# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1206117651 25200
# Node ID ff7434bc724db507c23a8c4f9628d82dcae44ec7
# Parent 6c2d68b9722a23a94075172270acffad1bbbad6f
Add kernel/initrd support to Xen_VSSD
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 6c2d68b9722a -r ff7434bc724d schema/VSSD.mof
--- a/schema/VSSD.mof Fri Mar 21 08:29:49 2008 -0700
+++ b/schema/VSSD.mof Fri Mar 21 09:40:51 2008 -0700
@@ -15,6 +15,12 @@ class Xen_VirtualSystemSettingData : CIM
"para-virtualized mode")]
string Bootloader;
string BootloaderArgs;
+
+ [Description ("The direct-boot kernel for PV guests not using a
bootloader")]
+ string Kernel;
+
+ [Description ("The direct-boot ramdisk for PV guests not using a
bootloader")]
+ string Ramdisk;
[Description ("The device to boot from when in fully-virtualized mode."
"One of hd,fd,cdrom.")]
diff -r 6c2d68b9722a -r ff7434bc724d src/Virt_VSSD.c
--- a/src/Virt_VSSD.c Fri Mar 21 08:29:49 2008 -0700
+++ b/src/Virt_VSSD.c Fri Mar 21 09:40:51 2008 -0700
@@ -70,6 +70,16 @@ static void _set_pv_prop(struct domain *
if (dominfo->bootloader_args != NULL)
CMSetProperty(inst, "BootloaderArgs",
(CMPIValue *)dominfo->bootloader_args,
+ CMPI_chars);
+
+ if (dominfo->os_info.pv.kernel != NULL)
+ CMSetProperty(inst, "Kernel",
+ (CMPIValue *)dominfo->os_info.pv.kernel,
+ CMPI_chars);
+
+ if (dominfo->os_info.pv.initrd != NULL)
+ CMSetProperty(inst, "Ramdisk",
+ (CMPIValue *)dominfo->os_info.pv.initrd,
CMPI_chars);
}
diff -r 6c2d68b9722a -r ff7434bc724d src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Fri Mar 21 08:29:49 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Fri Mar 21 09:40:51 2008 -0700
@@ -90,19 +90,33 @@ static int xenpv_vssd_to_domain(CMPIInst
domain->type = DOMAIN_XENPV;
+ free(domain->bootloader);
ret = cu_get_str_prop(inst, "Bootloader", &val);
- if (ret != CMPI_RC_OK)
- val = "";
-
- free(domain->bootloader);
- domain->bootloader = strdup(val);
-
+ if (ret == CMPI_RC_OK)
+ domain->bootloader = strdup(val);
+ else
+ domain->bootloader = NULL;
+
+ free(domain->bootloader_args);
ret = cu_get_str_prop(inst, "BootloaderArgs", &val);
- if (ret != CMPI_RC_OK)
- val = "";
-
- free(domain->bootloader_args);
- domain->bootloader_args = strdup(val);
+ if (ret == CMPI_RC_OK)
+ domain->bootloader_args = strdup(val);
+ else
+ domain->bootloader_args = NULL;
+
+ free(domain->os_info.pv.kernel);
+ ret = cu_get_str_prop(inst, "Kernel", &val);
+ if (ret == CMPI_RC_OK)
+ domain->os_info.pv.kernel = strdup(val);
+ else
+ domain->os_info.pv.kernel = NULL;
+
+ free(domain->os_info.pv.initrd);
+ ret = cu_get_str_prop(inst, "Ramdisk", &val);
+ if (ret == CMPI_RC_OK)
+ domain->os_info.pv.initrd = strdup(val);
+ else
+ domain->os_info.pv.initrd = NULL;
return 1;
}