Bug 716826 - [libvirt] Cannot insert CD (update device) to VM when LIVE constant is not used in updateDeviceFlags command
[libvirt] Cannot insert CD (update device) to VM when LIVE constant is not us...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
x86_64 Linux
unspecified Severity high
: rc
: ---
Assigned To: Jiri Denemark
Virtualization Bugs
: Regression, TestBlocker
: 720183 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2011-06-27 04:27 EDT by Jakub Libosvar
Modified: 2011-12-06 06:15 EST (History)
8 users (show)

See Also:
Fixed In Version: libvirt-0.9.3-1.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-12-06 06:15:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jakub Libosvar 2011-06-27 04:27:04 EDT
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"/>

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):

How reproducible:

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:
Comment 2 Jiri Denemark 2011-06-27 05:28:36 EDT
Patch sent upstream: https://www.redhat.com/archives/libvir-list/2011-June/msg01332.html
Comment 3 Jiri Denemark 2011-06-27 06:14:39 EDT
The regression was introduced in 0.9.1 by

commit da1eba6bc8f58bfce34136710d1979a3a44adb17
Author: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.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.
          discard copied definition.
Comment 4 Jiri Denemark 2011-06-28 09:34:39 EDT
Fixed upstream by v0.9.3-rc1-9-gad7b327:

commit ad7b327690a85d9cf802d53f2c9f4f61db0171ee
Author: Jiri Denemark <jdenemar@redhat.com>
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
Comment 7 Jiri Denemark 2011-07-11 04:58:05 EDT
*** Bug 720183 has been marked as a duplicate of this bug. ***
Comment 8 errata-xmlrpc 2011-12-06 06:15:51 EST
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.


Note You need to log in before you can comment on or make changes to this bug.