Hide Forgot
Description of problem: When attempting to change CD and updateDeviceFlags command is called without libvirt.VIR_DOMAIN_DEVICE_MODIFY_LIVE flag, device is not updated but finishes successfully. Example script: import libvirt xml = '''<disk device="cdrom" type="file"> <source file=""/> <target dev="hdc"/> </disk> ''' conn = libvirt.open('qemu:///system') dom = conn.lookupByName('win7-32') dom.updateDeviceFlags(xml, libvirt.VIR_DOMAIN_DEVICE_MODIFY_FORCE | libvirt.VIR_DOMAIN_DEVICE_MODIFY_LIVE) # Only this one succeeds dom.updateDeviceFlags(xml, libvirt.VIR_DOMAIN_DEVICE_MODIFY_FORCE | libvirt.VIR_DOMAIN_DEVICE_MODIFY_CURRENT) # This one fails dom.updateDeviceFlags(xml, libvirt.VIR_DOMAIN_DEVICE_MODIFY_FORCE) # This one fails too Version-Release number of selected component (if applicable): libvirt-0.9.2-1.el6.x86_64 qemu-kvm-0.12.1.2-2.165.el6.x86_64 How reproducible: Always Steps to Reproduce: 1. Attempt to change CD in VM using libvirt.VIR_DOMAIN_DEVICE_MODIFY_CURRENT flag (script above) Actual results: device is not updated Expected results: device is updated Additional info:
Patch sent upstream: https://www.redhat.com/archives/libvir-list/2011-June/msg01332.html
The regression was introduced in 0.9.1 by commit da1eba6bc8f58bfce34136710d1979a3a44adb17 Author: KAMEZAWA Hiroyuki <kamezawa.hiroyu.com> Date: Fri Apr 22 12:07:56 2011 +0900 libvirt/qemu - support persistent modification of devices This patch adds functions for modify domain's persistent definition. To do error recovery in easy way, we use a copy of vmdef and update it. The whole sequence will be: make a copy of domain definition. if (flags & MODIFY_CONFIG) update copied domain definition if (flags & MODIF_LIVE) do hotplug. if (no error) save copied one to the file and update cached definition. else discard copied definition.
Fixed upstream by v0.9.3-rc1-9-gad7b327: commit ad7b327690a85d9cf802d53f2c9f4f61db0171ee Author: Jiri Denemark <jdenemar> Date: Mon Jun 27 11:25:19 2011 +0200 qemu: Fix update device for CURRENT + FORCE flags When CURRENT and FORCE flags were used together, UpdateDeviceFlags did nothing because it failed to transform CURRENT into either LIVE or CONFIG.
*** Bug 720183 has been marked as a duplicate of this bug. ***
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1513.html