# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1225319502 25200
# Node ID 70a6139bbe36c56ebec2a301468ff652c444520d
# Parent 02650ebca65b14e9f243f11308d795371a8e740e
Handle add/remove/modify support for graphics devices
There's not dynamic update support for graphics devices. If a user
add/removes/updates a graphics device while the guest is running, the changes
aren't picked up until the guest is restarted.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r 02650ebca65b -r 70a6139bbe36 src/Virt_VirtualSystemManagementService.c
--- a/src/Virt_VirtualSystemManagementService.c Wed Oct 29 15:31:42 2008 -0700
+++ b/src/Virt_VirtualSystemManagementService.c Wed Oct 29 15:31:42 2008 -0700
@@ -1448,11 +1448,16 @@
struct virt_device *dev = &list[i];
if (STREQ(dev->id, devid)) {
- s = _resource_dynamic(dominfo,
- dev,
- RESOURCE_DEL,
- CLASSNAME(op));
dev->type = CIM_RES_TYPE_UNKNOWN;
+
+ if (type == CIM_RES_TYPE_GRAPHICS)
+ cu_statusf(_BROKER, &s, CMPI_RC_OK, "");
+ else {
+ s = _resource_dynamic(dominfo,
+ dev,
+ RESOURCE_DEL,
+ CLASSNAME(op));
+ }
break;
}
}
@@ -1497,6 +1502,13 @@
goto out;
}
+ if ((type == CIM_RES_TYPE_GRAPHICS) && (*count > 0)) {
+ cu_statusf(_BROKER, &s,
+ CMPI_RC_ERR_FAILED,
+ "A resource already exiss for type %" PRIu16,
type);
+ goto out;
+ }
+
list = realloc(*_list, ((*count)+1)*sizeof(struct virt_device));
if (list == NULL) {
/* No memory */
@@ -1513,6 +1525,12 @@
dev->type = type;
rasd_to_vdev(rasd, dominfo, dev, ns);
+
+ if (type == CIM_RES_TYPE_GRAPHICS) {
+ (*count)++;
+ cu_statusf(_BROKER, &s, CMPI_RC_OK, "");
+ goto out;
+ }
s = _resource_dynamic(dominfo, dev, RESOURCE_ADD, CLASSNAME(op));
if (s.rc != CMPI_RC_OK)
@@ -1570,10 +1588,15 @@
if (STREQ(dev->id, devid)) {
rasd_to_vdev(rasd, dominfo, dev, ns);
- s = _resource_dynamic(dominfo,
- dev,
- RESOURCE_MOD,
- CLASSNAME(op));
+
+ if (type == CIM_RES_TYPE_GRAPHICS)
+ cu_statusf(_BROKER, &s, CMPI_RC_OK, "");
+ else {
+ s = _resource_dynamic(dominfo,
+ dev,
+ RESOURCE_MOD,
+ CLASSNAME(op));
+ }
break;
}
}