RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1368417 - update-device fail to update startupPolicy for hard disks with --persistent but successful with --live
Summary: update-device fail to update startupPolicy for hard disks with --persistent b...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.3
Hardware: x86_64
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: lijuan men
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-19 10:32 UTC by Pei Zhang
Modified: 2017-08-01 23:53 UTC (History)
5 users (show)

Fixed In Version: libvirt-3.0.0-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:11:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:1846 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2017-08-01 18:02:50 UTC

Description Pei Zhang 2016-08-19 10:32:31 UTC
Description of problem:
update-device fail to update startupPolicy for hard disks with --persistent but successful with --live

Version-Release number of selected component (if applicable):
libvirt-2.0.0-5.el7.x86_64
qemu-kvm-rhev-2.6.0-20.el7.x86_64

How reproducible:
100%

Steps to Reproduce:

1. start a guest as following, a disk with startupPolocy.
 
# virsh dumpxml r73 | grep disk -A 9
  ......
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/at-dt/disk/a.qcow2' startupPolicy='mandatory'/>
      <target dev='vde' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </disk>
......

2. Prepare a disk xml as following, keep the disk source file bug change the value
of startupPolicy.

# cat disk.xml
<disk type='file' device='disk'>
        <driver name='qemu' type='qcow2'/>
        <source file='/mnt/at-dt/disk/a.qcow2' startupPolicy='optional'>
        </source>
        <backingStore/>
        <target dev='vde' bus='virtio'/>
</disk>

3. update-device to live update startupPolicy successfully.
# virsh update-device r73 disk.xml --live
Device updated successfully

4. check domain xml
# virsh dumpxml r73 | grep disk -A 9
  ......
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/mnt/at-dt/disk/a.qcow2' startupPolicy='optional'>
        <seclabel model='selinux' labelskip='yes'/>
      </source>
      <backingStore/>
      <target dev='vde' bus='virtio'/>
      <alias name='virtio-disk4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </disk>
......

5. fail to use update-device update startupPolicy with --config or --persistent


# virsh update-device r73 disk.xml --config
error: Failed to update device from disk.xml
error: invalid argument: this disk doesn't support update

# virsh update-device r73 disk.xml --persistent
error: Failed to update device from disk.xml
error: invalid argument: this disk doesn't support update


Actual results:
As step 3, update-device update startupPolicy with --live,
but fail with --config or --persistent as step 5.

Expected results:
The result should be consistent for updating startupPolicy in hard disks.

Additional info:

Comment 2 Michal Privoznik 2016-08-31 08:00:20 UTC
For historical reasons, startupPolicy (and while update-device) aimed at live update so config update never got that much attention. Therefore just cdroms and floppies can be updated. I agree that it is a stupid limitation. Will work on the patches.

Comment 4 Michal Privoznik 2016-09-02 11:42:21 UTC
Patch proposed upstream:

https://www.redhat.com/archives/libvir-list/2016-September/msg00033.html

Comment 5 Michal Privoznik 2016-09-27 15:43:51 UTC
I've just pushed patch upstream:

commit 3193a594475f1565e03ddec22fd72af08e95adb2
Author:     Michal Privoznik <mprivozn>
AuthorDate: Wed Aug 31 11:09:58 2016 +0200
Commit:     Michal Privoznik <mprivozn>
CommitDate: Tue Sep 27 17:27:53 2016 +0200

    qemuDomainUpdateDeviceConfig: Allow full disk update
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1368417
    
    So far, when it comes to 'virsh update-device --config' of disks
    we are limiting ourselves for just the disk source update and
    just for CDROMs and floppies. This makes no sense. Especially if
    you look around and see that we already allow full update to
    graphics and net devices. So let's just take whatever XML user
    wants to have there and replace our internal definition with it.
    
    Signed-off-by: Michal Privoznik <mprivozn>

v2.2.0-241-g3193a59

Comment 6 Michal Privoznik 2017-03-03 09:59:11 UTC
This should have been in POST per comment 5.

Comment 8 lijuan men 2017-05-26 10:23:04 UTC
verify the bug

version:
libvirt-3.2.0-6.el7
qemu-kvm-rhev-2.9.0-6.el7.x86_64

scenario1:

[root@lmen1 ~]# virsh dumpxml uefi 
 <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/uefi.qcow2' startupPolicy='optional'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

[root@lmen1 ~]# cat disk.xml 
<disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/uefi.qcow2' startupPolicy='mandatory'/>
      <target dev='sda' bus='sata'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

[root@lmen1 ~]# virsh update-device uefi disk.xml --live
Device updated successfully

[root@lmen1 ~]# virsh dumpxml uefi | grep disk -A 12
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/uefi.qcow2' startupPolicy='mandatory'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

#virsh edit uefi -->startupPolicy='optional'   

scenario2:

[root@lmen1 ~]# virsh dumpxml uefi | grep disk -A 12
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/uefi.qcow2' startupPolicy='optional'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

[root@lmen1 ~]# cat disk.xml 
<disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/uefi.qcow2' startupPolicy='mandatory'/>
      <target dev='sda' bus='sata'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

[root@lmen1 ~]# virsh update-device uefi disk.xml --config
Device updated successfully

[root@lmen1 ~]# virsh dumpxml uefi | grep disk -A 12
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/uefi.qcow2' startupPolicy='optional'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

[root@lmen1 ~]# virsh edit uefi
<disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/uefi.qcow2' startupPolicy='mandatory'/>
      <target dev='sda' bus='sata'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

scenario3:

[root@lmen1 ~]# virsh dumpxml uefi | grep disk -A 12
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/uefi.qcow2' startupPolicy='optional'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

[root@lmen1 ~]# cat disk.xml 
<disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/uefi.qcow2' startupPolicy='mandatory'/>
      <target dev='sda' bus='sata'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

[root@lmen1 ~]# virsh update-device uefi disk.xml --persistent
Device updated successfully


[root@lmen1 ~]# virsh dumpxml uefi | grep disk -A 12
...
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/uefi.qcow2' startupPolicy='mandatory'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

#virsh edit uefi
 <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/uefi.qcow2' startupPolicy='mandatory'/>
      <target dev='sda' bus='sata'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

Comment 9 errata-xmlrpc 2017-08-01 17:11:42 UTC
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.

https://access.redhat.com/errata/RHEA-2017:1846

Comment 10 errata-xmlrpc 2017-08-01 23:53:19 UTC
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.

https://access.redhat.com/errata/RHEA-2017:1846


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