[PATCH 0 of 4] [RFC] Add support for disk bus type for KVM

# HG changeset patch # User Richard Maciel <rmaciel@linux.vnet.ibm.com> # Date 1244170693 10800 # Node ID 8f9488b1665f045bcdd4c96769053c6f76379b34 # Parent 6e913ff6791f527b50583360fddadbef76a92e01 Signed-off-by: Richard Maciel <rmaciel@linux.vnet.ibm.com> diff -r 6e913ff6791f -r 8f9488b1665f libxkutil/device_parsing.h --- a/libxkutil/device_parsing.h Mon Jun 01 18:19:42 2009 -0300 +++ b/libxkutil/device_parsing.h Thu Jun 04 23:58:13 2009 -0300 @@ -39,6 +39,7 @@ enum {DISK_UNKNOWN, DISK_PHY, DISK_FILE, DISK_FS} disk_type; bool readonly; bool shareable; + char *bus_type; }; struct net_device { diff -r 6e913ff6791f -r 8f9488b1665f schema/ResourceAllocationSettingData.mof --- a/schema/ResourceAllocationSettingData.mof Mon Jun 01 18:19:42 2009 -0300 +++ b/schema/ResourceAllocationSettingData.mof Thu Jun 04 23:58:13 2009 -0300 @@ -28,6 +28,9 @@ ValueMap {"0", "1"}, Values {"Disk", "CDROM"}] uint16 EmulatedType; + + [Description ("Bus type of the device")] + string BusType; }; [Description ("LXC virtual disk configuration"),

# HG changeset patch # User Richard Maciel <rmaciel@linux.vnet.ibm.com> # Date 1244173955 10800 # Node ID 5037ddc96cee2ed47f6f91eeb7fc634a3c01d212 # Parent 8f9488b1665f045bcdd4c96769053c6f76379b34 Signed-off-by: Richard Maciel <rmaciel@linux.vnet.ibm.com> diff -r 8f9488b1665f -r 5037ddc96cee libxkutil/device_parsing.c --- a/libxkutil/device_parsing.c Thu Jun 04 23:58:13 2009 -0300 +++ b/libxkutil/device_parsing.c Fri Jun 05 00:52:35 2009 -0300 @@ -59,6 +59,7 @@ free(dev->driver); free(dev->source); free(dev->virtual_dev); + free(dev->bus_type); } static void cleanup_net_device(struct net_device *dev) @@ -246,6 +247,7 @@ ddev->virtual_dev = get_attr_value(child, "dev"); if (ddev->virtual_dev == NULL) goto err; + ddev->bus_type = get_attr_value(child, "bus"); } else if (XSTREQ(child->name, "readonly")) { ddev->readonly = true; } else if (XSTREQ(child->name, "shareable")) { @@ -666,6 +668,7 @@ DUP_FIELD(dev, _dev, dev.disk.driver); DUP_FIELD(dev, _dev, dev.disk.source); DUP_FIELD(dev, _dev, dev.disk.virtual_dev); + DUP_FIELD(dev, _dev, dev.disk.bus_type); dev->dev.disk.disk_type = _dev->dev.disk.disk_type; dev->dev.disk.readonly = _dev->dev.disk.readonly; dev->dev.disk.shareable = _dev->dev.disk.shareable;

# HG changeset patch # User Richard Maciel <rmaciel@linux.vnet.ibm.com> # Date 1244174547 10800 # Node ID e4eedf59bb5883b8814ed0569fabb27f71516494 # Parent 5037ddc96cee2ed47f6f91eeb7fc634a3c01d212 Signed-off-by: Richard Maciel <rmaciel@linux.vnet.ibm.com> diff -r 5037ddc96cee -r e4eedf59bb58 libxkutil/xmlgen.c --- a/libxkutil/xmlgen.c Fri Jun 05 00:52:35 2009 -0300 +++ b/libxkutil/xmlgen.c Fri Jun 05 01:02:27 2009 -0300 @@ -60,6 +60,8 @@ if (tmp == NULL) return XML_ERROR; xmlNewProp(tmp, BAD_CAST "dev", BAD_CAST dev->virtual_dev); + if (dev->bus_type) + xmlNewProp(tmp, BAD_CAST "bus", BAD_CAST dev->bus_type); if (dev->readonly) xmlNewChild(disk, NULL, BAD_CAST "readonly", NULL);

# HG changeset patch # User Richard Maciel <rmaciel@linux.vnet.ibm.com> # Date 1244176094 10800 # Node ID 9ca5749d068acb566f7df0956ffb3ea1976493e4 # Parent e4eedf59bb5883b8814ed0569fabb27f71516494 Signed-off-by: Richard Maciel <rmaciel@linux.vnet.ibm.com> diff -r e4eedf59bb58 -r 9ca5749d068a src/Virt_RASD.c --- a/src/Virt_RASD.c Fri Jun 05 01:02:27 2009 -0300 +++ b/src/Virt_RASD.c Fri Jun 05 01:28:14 2009 -0300 @@ -253,6 +253,11 @@ (CMPIValue *)dev->dev.disk.source, CMPI_chars); + CMSetProperty(inst, + "BusType", + (CMPIValue *)dev->dev.disk.bus_type, + CMPI_chars); + /* There's not much we can do here if we don't recognize the type, * so it seems that assuming 'disk' is a reasonable default */
participants (1)
-
Richard Maciel