Friday, 16 January
2009
Fri, 16 Jan
'09
2:15 a.m.
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1232061344 28800
# Node ID a0d97b02af71c0cd5b13a88ab0ba089ea3c35d2a
# Parent 8c56ab06aeb9b89f419f1befe6182c92ad5edbb8
[TEST] Add support for EmulatedType 1 to SDC.
Also fix a bug with the if statement in set_disk_props() and a spacing bug.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 8c56ab06aeb9 -r a0d97b02af71 src/Virt_SettingsDefineCapabilities.c
--- a/src/Virt_SettingsDefineCapabilities.c Wed Jan 14 08:41:52 2009 -0800
+++ b/src/Virt_SettingsDefineCapabilities.c Thu Jan 15 15:15:44 2009 -0800
@@ -611,13 +611,13 @@
const CMPIObjectPath *ref,
const char *id,
uint64_t disk_size,
+ uint16_t emu_type,
struct inst_list *list)
{
const char *addr;
const char *dev;
CMPIInstance *inst;
CMPIStatus s = {CMPI_RC_OK, NULL};
- uint16_t emu_type = 0;
if (type == DOMAIN_LXC) {
addr = "/tmp";
@@ -646,7 +646,7 @@
dev = "xvda";
CMSetProperty(inst, "Caption",
(CMPIValue *)"PV disk", CMPI_chars);
- } else if (type, DOMAIN_XENFV) {
+ } else if (type == DOMAIN_XENFV) {
CMSetProperty(inst, "Caption",
(CMPIValue *)"FV disk", CMPI_chars);
}
@@ -671,6 +671,7 @@
char *pfx;
const char *id;
uint64_t disk_size;
+ uint16_t emu_type = 0;
CMPIStatus s = {CMPI_RC_OK, NULL};
switch(template_type) {
@@ -702,16 +703,54 @@
pfx = class_prefix_name(CLASSNAME(ref));
if (STREQ(pfx, "Xen")) {
- s = set_disk_props(DOMAIN_XENPV, ref, id, disk_size, list);
-
+ int xen_type[2] = {DOMAIN_XENFV, DOMAIN_XENPV};
+ int i = 0;
+
+ for (; i < 2; i++) {
+ emu_type = 0;
+ s = set_disk_props(xen_type[i],
+ ref,
+ id,
+ disk_size,
+ emu_type,
+ list);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+
+ emu_type = 1;
+ s = set_disk_props(xen_type[i],
+ ref,
+ id,
+ disk_size,
+ emu_type,
+ list);
+ if (s.rc != CMPI_RC_OK)
+ goto out;
+ }
+ } else if (STREQ(pfx, "KVM")) {
+ s = set_disk_props(DOMAIN_KVM,
+ ref,
+ id,
+ disk_size,
+ emu_type,
+ list);
if (s.rc != CMPI_RC_OK)
- goto out;
+ goto out;
- s = set_disk_props(DOMAIN_XENFV, ref, id, disk_size, list);
- } else if (STREQ(pfx, "KVM")) {
- s = set_disk_props(DOMAIN_KVM, ref, id, disk_size, list);
+ emu_type = 1;
+ s = set_disk_props(DOMAIN_KVM,
+ ref,
+ id,
+ disk_size,
+ emu_type,
+ list);
} else if (STREQ(pfx, "LXC")) {
- s = set_disk_props(DOMAIN_LXC, ref, id, disk_size, list);
+ s = set_disk_props(DOMAIN_LXC,
+ ref,
+ id,
+ disk_size,
+ emu_type,
+ list);
} else {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_FAILED,