]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Fix error detection in device change
authorPhilipp Hahn <hahn@univention.de>
Tue, 30 Aug 2011 14:59:24 +0000 (16:59 +0200)
committerEric Blake <eblake@redhat.com>
Tue, 30 Aug 2011 16:32:13 +0000 (10:32 -0600)
commit4521ffabebde75c0c3c7cc88d1b6eaeedbe50e0f
tree8a186ed70b666cef2aa77686a81744fccaae6f2a
parent27c85260532f879be5674a4eed0811c21fd34f94
Fix error detection in device change

According to qemu-kvm/qerror.c all messages start with a capital
"Device ", but the current code only scans for the lower case "device ".
This results in "virDomainUpdateDeviceFlags()" to not detect locked
CD-ROMs and reporting success even in the case of a failure:
# virsh qemu-monitor-command "$VM" change\ drive-ide0-0-0\ \"/var/lib/libvirt/images/ucs_2.4-0-sec4-20110714145916-dvd-amd64.iso\"
Device 'drive-ide0-0-0' is locked
# virsh update-device "$VM" /dev/stdin <<<"<disk type='file' device='cdrom'><driver name='qemu' type='raw'/><source file='/var/lib/libvirt/images/ucs_2.4-0-sec4-20110714145916-dvd-amd64.iso'/><target dev='hda' bus='ide'/><readonly/><alias name='ide0-0-0'/><address type='drive' controller='0' bus='0' unit='0'/></disk>"
Device updated successfully

Signed-off-by: Philipp Hahn <hahn@univention.de>
src/qemu/qemu_monitor_text.c