KVM test: Make physical_resources_check cope with qemu change on 'info block'
commit022518f2f4720efd2cc4c06bae1d24139f49d23e
authorlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>
Fri, 20 May 2011 19:08:08 +0000 (20 19:08 +0000)
committerlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>
Fri, 20 May 2011 19:08:08 +0000 (20 19:08 +0000)
tree4eef56ea5b03d550dbe4e80da77e83e967a6ad7e
parentdebabeffa27e9f1d97981b486007c1e9be14a209
KVM test: Make physical_resources_check cope with qemu change on 'info block'

New qemu upstream versions report block info like this:

(monitor humanmonitor1) Sending command 'info block'
(monitor humanmonitor1) Response to 'info block'
(monitor humanmonitor1)    virtio0: removable=0 file=/tmp/kvm_autotest_root/images/rhel6-64.qcow2 ro=0 drv=qcow2 encrypted=0
(monitor humanmonitor1)    ide1-cd0: removable=1 locked=0 [not inserted]
(monitor humanmonitor1)    floppy0: removable=1 locked=0 [not inserted]
(monitor humanmonitor1)    sd0: removable=1 locked=0 [not inserted]

While older versions report like this:

(monitor humanmonitor1) Sending command 'info block'
(monitor humanmonitor1) Response to 'info block'
(monitor humanmonitor1)    virtio0: type=hd removable=0 file=/tmp/kvm_autotest_root/images/rhel6-64.qcow2 ro=0 drv=qcow2 encrypted=0
(monitor humanmonitor1)    ide1-cd0: type=cdrom removable=1 locked=0 [not inserted]
(monitor humanmonitor1)    floppy0: type=floppy removable=1 locked=0 [not inserted]
(monitor humanmonitor1)    sd0: type=floppy removable=1 locked=0 [not inserted]

The type field was removed, as it wasn't reliable. So for searching for
hard drives, look for the disk image name rather than the type tags.

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@5366 592f7852-d20e-0410-864c-8624ca9c26a4
client/tests/kvm/tests/physical_resources_check.py