|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [RFCv2 02/38] x86/hyperlaunch: correct the naming of domain ramdisk field
The ramdisk field was incorrectly renamed to module without providing a sound
justification. Doing so creates an unnecessary indirection that can cause more
confusion than utility. The only way the field is populated is via a match of a
boot module of type BOOTMOD_RAMDISK. All usages of the field are cast into a
variables named initrd. The attempt to generalize the field name under the
guise that it could be multiplexed for other module types did so without a
valid usage. The result is there is no consideration of how that multiplexing
would even work or be deconflict with the simultaneous presence of a ramdisk.
Moving the field name back to ramdisk to make the current code flow logical. At
a later time should there be a use case that arises where additional modules
need to be passed to a domain, a more appropriate framework will be crafted
that will like be more complicated than just renaming the field to something
other than ramdisk.
Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
xen/arch/x86/hvm/dom0_build.c | 2 +-
xen/arch/x86/include/asm/boot-domain.h | 2 +-
xen/arch/x86/pv/dom0_build.c | 2 +-
xen/arch/x86/setup.c | 2 +-
xen/common/domain-builder/fdt.c | 8 ++++----
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index a038e58c118b..0664f0543fd6 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -648,7 +648,7 @@ static int __init pvh_load_kernel(
{
struct domain *d = bd->d;
struct boot_module *image = bd->kernel;
- struct boot_module *initrd = bd->module;
+ struct boot_module *initrd = bd->ramdisk;
void *image_base = bootstrap_map_bm(image);
void *image_start = image_base + image->headroom;
unsigned long image_len = image->size;
diff --git a/xen/arch/x86/include/asm/boot-domain.h
b/xen/arch/x86/include/asm/boot-domain.h
index cb5351241a62..740bfb74121c 100644
--- a/xen/arch/x86/include/asm/boot-domain.h
+++ b/xen/arch/x86/include/asm/boot-domain.h
@@ -28,7 +28,7 @@ struct boot_domain {
unsigned int max_vcpus;
struct boot_module *kernel;
- struct boot_module *module;
+ struct boot_module *ramdisk;
const char *cmdline;
struct domain *d;
diff --git a/xen/arch/x86/pv/dom0_build.c b/xen/arch/x86/pv/dom0_build.c
index e1b78d47c218..3b2baf057b75 100644
--- a/xen/arch/x86/pv/dom0_build.c
+++ b/xen/arch/x86/pv/dom0_build.c
@@ -375,7 +375,7 @@ static int __init dom0_construct(const struct boot_domain
*bd)
struct vcpu *v = d->vcpu[0];
struct boot_module *image = bd->kernel;
- struct boot_module *initrd = bd->module;
+ struct boot_module *initrd = bd->ramdisk;
void *image_base;
unsigned long image_len;
void *image_start;
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 6a1e874b2ecf..afc133b4d562 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -2187,7 +2187,7 @@ void asmlinkage __init noreturn __start_xen(void)
if ( !bi->hyperlaunch_enabled && initrdidx < MAX_NR_BOOTMODS )
{
bi->mods[initrdidx].type = BOOTMOD_RAMDISK;
- bi->domains[0].module = &bi->mods[initrdidx];
+ bi->domains[0].ramdisk = &bi->mods[initrdidx];
if ( first_boot_module_index(bi, BOOTMOD_UNKNOWN) < MAX_NR_BOOTMODS )
printk(XENLOG_WARNING
"Multiple initrd candidates, picking module #%u\n",
diff --git a/xen/common/domain-builder/fdt.c b/xen/common/domain-builder/fdt.c
index 232621ae46f9..1b3492571b15 100644
--- a/xen/common/domain-builder/fdt.c
+++ b/xen/common/domain-builder/fdt.c
@@ -374,10 +374,10 @@ static int __init fdt_process_domain_node(
{
int idx;
- if ( bd->module )
+ if ( bd->ramdisk )
{
printk(XENLOG_WARNING
- "Duplicate module for domain %s\n", name);
+ "Duplicate multiboot,ramdisk for domain %s\n", name);
continue;
}
@@ -390,9 +390,9 @@ static int __init fdt_process_domain_node(
return idx;
}
- printk(XENLOG_INFO " module: multiboot-index=%d\n", idx);
+ printk(XENLOG_INFO " ramdisk: multiboot-index=%d\n", idx);
bi->mods[idx].type = BOOTMOD_RAMDISK;
- bd->module = &bi->mods[idx];
+ bd->ramdisk = &bi->mods[idx];
}
}
--
2.30.2
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |