[Libvirt-cim] [PATCH] (#2) Add check to catch duplicated VirtualDevice parameter in DiskRASDs

Kaitlin Rupert kaitlin at linux.vnet.ibm.com
Wed Aug 5 16:22:31 UTC 2009


Richard Maciel wrote:
> # HG changeset patch
> # User Richard Maciel <rmaciel at linux.vnet.ibm.com>
> # Date 1249448787 10800
> # Node ID 3eebf7d2c4ebb1f4fdc17173c0b12cb34496c32e
> # Parent  23c0707da946c185f4387a13276b0c9fbf084da2
> (#2) Add check to catch duplicated VirtualDevice parameter in DiskRASDs
> 
> At the moment of creation of a guest, it is necessary to check if its DiskRASDs all have unique (among themselves) VirtualDevice parameters
> 
> #2:
>   Fixed patch submission date
> 
> Signed-off-by: Richard Maciel <rmaciel at linux.vnet.ibm.com>
> 
> diff -r 23c0707da946 -r 3eebf7d2c4eb src/Virt_VirtualSystemManagementService.c
> --- a/src/Virt_VirtualSystemManagementService.c	Wed Aug 05 02:05:30 2009 -0300
> +++ b/src/Virt_VirtualSystemManagementService.c	Wed Aug 05 02:06:27 2009 -0300
> @@ -1011,6 +1011,11 @@
> 
>          for (i = 0; i < *index; i++) {
>                  struct virt_device *ptr = &list[i];
> +                
> +                if (STREQC(ptr->dev.disk.virtual_dev, dev->dev.disk.virtual_dev)) 

This line is over 80 characters.

You want to make sure that you're comparing these values for disk 
devices only.   If I attempt to define a guest with two network devices, 
then I see the error below and the guest fails to define properly.

I added some debug, and here's what I get:

device_parsing.c(325): No network source defined, leaving blank

Virt_VirtualSystemManagementService.c(1015): ----------ptr->id: 
00:16:3e:d2:92:9d, dev->id: 00:11:22:33:44:55
Virt_VirtualSystemManagementService.c(1016): ----------virt_dev: (null), 
virt_dev: (null)
Virt_VirtualSystemManagementService.c(1426): Failed to classify 
resources: VirtualDevice property must be unique for each 
DiskResourceAllocationSettingData in a single guest


> +                        return "VirtualDevice property must be unique for each "
> +                               "DiskResourceAllocationSettingData in a single "
> +                               "guest";
> 
>                  if (STREQC(ptr->id, dev->id)) {
>                          CU_DEBUG("Overriding device %s from refconf", ptr->id);
> 


-- 
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list