[Libvirt-cim] [PATCH] [TEST] Add branch to VSMS/14_define_sys_disk.py to fix Caption settings in DiskRASD

Deepti B Kalakeri deeptik at linux.vnet.ibm.com
Thu Mar 19 11:40:58 UTC 2009



yunguol at cn.ibm.com wrote:
> # HG changeset patch
> # User Guolian Yun <yunguol at cn.ibm.com>
> # Date 1237447329 25200
> # Node ID 9f70dfab7a1e354ec6cfdc14d4f80f1a79cfdb41
> # Parent  a06ef66126e2c8636f0b2ae0d978d38192471e9d
> [TEST] Add branch to VSMS/14_define_sys_disk.py to fix Caption settings in DiskRASD
>
>
> Tested for Xen, XenFV, KVM with current sources and rpm
> Signed-off-by: Guolian Yun<yunguol at cn.ibm.com>
>
> diff -r a06ef66126e2 -r 9f70dfab7a1e suites/libvirt-cim/cimtest/VirtualSystemManagementService/14_define_sys_disk.py
> --- a/suites/libvirt-cim/cimtest/VirtualSystemManagementService/14_define_sys_disk.py	Wed Mar 18 06:38:30 2009 -0700
> +++ b/suites/libvirt-cim/cimtest/VirtualSystemManagementService/14_define_sys_disk.py	Thu Mar 19 00:22:09 2009 -0700
> @@ -36,11 +36,13 @@
>  from XenKvmLib.classes import get_typed_class, inst_to_mof
>  from XenKvmLib.rasd import get_default_rasds
>  from XenKvmLib.const import do_main, _image_dir, f9_changeset, \
> -                            KVM_default_disk_dev, get_provider_version
> +Xen_default_disk_dev, XenFV_default_disk_dev, \
> +KVM_default_disk_dev, get_provider_version
>  from XenKvmLib.vxml import get_class
>  from XenKvmLib.common_util import parse_instance_id
>  from XenKvmLib.enumclass import EnumInstances
>
> +libvirt_cim_dasd_caption = 707
>  sup_types = ['Xen', 'XenFV', 'KVM', 'LXC']
>  test_dom = 'rstest_disk_domain'
>
> @@ -66,9 +68,12 @@
>
>      for rasd in rasds:
>          if rasd.classname == drasd_cn:
> -            if disk_type != "" and rasd['Caption'] != disk_type:
> +            curr_cim_rev, changeset = get_provider_version(virt, ip)
> +            if disk_type != "" and rasd['Caption'] != disk_type and \
> +               curr_cim_rev >= libvirt_cim_dasd_caption:
>                  continue
>              rasd['Address'] = addr
> +            rasd['VirtualDevice'] = virt + '_default_disk_dev'
>   
The virtual device should have the value of either hda, xvda and not 
KVM_default_disk_dev or Xen_default_disk_dev.
This test case passes since you only try to define the guest. We cannot 
start the guest with KVM_default_disk_dev or Xen_default_disk_dev 
information in rasd['VirtualDevice'], so it certainly wrong to have it.
You can verify with the following XML which is the output of the 
cimserver debug:

<domain type="kvm">
<name>rstest_disk_domain</name>
<on_poweroff>destroy</on_poweroff>
<on_crash>destroy</on_crash>
<uuid>45c60611-e962-4803-9394-60a6fd4e7ada</uuid>
<os>
<type>hvm</type>
<boot dev="hd"/>
</os>
<currentMemory>262144</currentMemory>
<memory>262144</memory>
<vcpu>1</vcpu>
<devices>
<disk type="file" device="cdrom">
<source file="/tmp/cimtest_large_image"/>
*<target dev="KVM_default_disk_dev"/>*
</disk>
<interface type="network">
<mac address="00:16:3e:04:73:0f"/>
<source network="cimtest-networkpool"/>
</interface>
<input type="mouse" bus="ps2"/>
<graphics type="vnc" port="-1" listen="127.0.0.1" keymap="en-us"/>
</devices>
</domain>

You will not be able to start the guest, the following error will be seen:

virsh start rstest_disk_domain
libvir: QEMU error : internal error unsupported disk type 
'KVM_default_disk_dev'
error: Failed to start domain rstest_disk_domain



>              curr_cim_rev, changeset = get_provider_version(virt, ip)
>              if changeset == f9_changeset and virt == 'KVM':
>                      rasd['VirtualDevice'] = KVM_default_disk_dev
>   
Also, can you get the above rasd['VirtualDevice'] before the if 
condition here, so that we dont have to initialise it twice in case of 
F9 revision is matched.

> _______________________________________________
> Libvirt-cim mailing list
> Libvirt-cim at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-cim
>   

-- 
Thanks and Regards,
Deepti B. Kalakeri
IBM Linux Technology Center
deeptik at linux.vnet.ibm.com




More information about the Libvirt-cim mailing list