# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1240250416 25200
# Node ID 7456dabe495895b047b9308c38506cbba1fc0507
# Parent bca16d22da253f390a74fb08d4f61f7419308dba
Add support for specifying the NIC model type
libvirt only supports this for KVM guests currently.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r bca16d22da25 -r 7456dabe4958 src/Virt_RASD.c
--- a/src/Virt_RASD.c Mon Apr 20 11:00:16 2009 -0700
+++ b/src/Virt_RASD.c Mon Apr 20 11:00:16 2009 -0700
@@ -398,6 +398,12 @@
"Address",
(CMPIValue *)dev->dev.net.mac,
CMPI_chars);
+
+ if (dev->dev.net.model != NULL)
+ CMSetProperty(inst,
+ "ResourceSubType",
+ (CMPIValue *)dev->dev.net.model,
+ CMPI_chars);
} else if (dev->type == CIM_RES_TYPE_MEM) {
const char *units = "KiloBytes";
diff -r bca16d22da25 -r 7456dabe4958 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Mon Apr 20 11:00:16 2009 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Mon Apr 20 11:00:16 2009 -0700
@@ -495,6 +495,12 @@
free(dev->dev.net.source);
dev->dev.net.source = name_from_pool_id(val);
+ free(dev->dev.net.model);
+ if (cu_get_str_prop(inst, "ResourceSubType", &val) != CMPI_RC_OK)
+ dev->dev.net.model = NULL;
+ else
+ dev->dev.net.model = strdup(val);
+
out:
return msg;
}