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 2024419 - virsh update-device guest --live --config: Operation not supported: cannot modify field 'address' of the disk
Summary: virsh update-device guest --live --config: Operation not supported: cannot mo...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: libvirt
Version: 8.6
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Han Han
URL:
Whiteboard:
: 2025789 (view as bug list)
Depends On:
Blocks: 1929792 1885765
TreeView+ depends on / blocked
 
Reported: 2021-11-18 03:37 UTC by Yiding Liu (Fujitsu)
Modified: 2022-05-10 13:39 UTC (History)
7 users (show)

Fixed In Version: libvirt-7.10.0-1.module+el8.6.0+13502+4f24a11d
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 13:24:11 UTC
Type: Bug
Target Upstream Version: 7.10.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 2023605 1 unspecified CLOSED Live update device with --persistent fail unexpectedly 2023-06-18 06:45:30 UTC
Red Hat Issue Tracker RHELPLAN-103106 0 None None None 2021-11-18 03:38:14 UTC
Red Hat Product Errata RHSA-2022:1759 0 None None None 2022-05-10 13:25:02 UTC

Description Yiding Liu (Fujitsu) 2021-11-18 03:37:25 UTC
Description of problem:
when we use update-device --live --config together, cmd failed.
It failed since libvirt-7.9.0-1

# virsh update-device avocado-vt-vm1 disk.xml --live --config
error: Failed to update device from disk.xml
error: Operation not supported: cannot modify field 'address' of the disk

Version-Release number of selected component (if applicable):
libvirt-7.9.0-1.module+el8.6.0+13150+28339563.aarch64

How reproducible: 100%

Steps to Reproduce:
1. Prepare a guest xml with test disk && Start guest
<disk type='file' device='cdrom'>
  <driver name='qemu' type='raw'/>
  <source file='/tmp/debug/test.iso'/>
  <target dev='sdc' bus='scsi'/>
  <readonly/>
  <address type='drive' controller='0' bus='0' target='0' unit='2'/>
</disk>


2. Prepare a test disk xml
<?xml version='1.0' encoding='UTF-8'?>
<disk device="cdrom" type="file"><target bus="scsi" dev="sdc" /><alias name="scsi0-0-0-2" /></disk>


3. update guest test device by disk xml
# virsh update-device avocado-vt-vm1 disk.xml --live --config
error: Failed to update device from disk.xml
error: Operation not supported: cannot modify field 'address' of the disk


Actual results:
# virsh update-device avocado-vt-vm1 disk.xml --live --config
error: Failed to update device from disk.xml
error: Operation not supported: cannot modify field 'address' of the disk


Expected results:
virsh update-device avocado-vt-vm1 disk.xml --live --config successfully

Additional info:
Just use single option, that works.

# virsh update-device avocado-vt-vm1 disk.xml --live
Device updated successfully

# virsh update-device avocado-vt-vm1 disk.xml --config
Device updated successfully

# virsh dumpxml avocado-vt-vm1
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source index='3'/>
      <target dev='sdc' bus='scsi'/>
      <readonly/>
      <alias name='scsi0-0-0-2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>

Comment 1 Yiding Liu (Fujitsu) 2021-11-18 05:52:02 UTC
libvirtd info

log_filters="1:qemu 1:libvirt 1:object 3:json 3:event"
log_outputs="3:file:/var/log/libvirt/libvirtd.log"

# cat libvirtd.log 
2021-11-18 05:45:46.547+0000: 357431: info : libvirt version: 7.9.0, package: 1.module+el8.6.0+13150+28339563 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2021-11-03-10:06:27, )
2021-11-18 05:45:46.547+0000: 357431: info : hostname: hpe-apollo80-01-n00.khw4.lab.eng.bos.redhat.com
2021-11-18 05:45:46.547+0000: 357431: error : virNetworkObjAssignDefLocked:596 : operation failed: network 'default' already exists with uuid 1b4f73cf-3252-457c-9d3d-142c129a650e
2021-11-18 05:47:14.317+0000: 357417: error : qemuDomainDiskChangeSupported:8081 : Operation not supported: cannot modify field 'address' of the disk

Comment 2 Ján Tomko 2021-11-18 08:26:16 UTC
This was caused by:
commit 03ed14d2d4a4e51568b1ee5a6e6c9c3371bb4d34
CommitDate: 2021-10-12 10:26:04 +0200

    qemu: validate: Move disk address validation code

git describe: v7.8.0-146-g03ed14d2d4 contains: v7.9.0-rc1~161

Fixed by:
commit 03f9dfbb5183b3ade354a63dc16e8afb5f6d8652
Author:     Ján Tomko <jtomko>
CommitDate: 2021-11-16 16:40:33 +0100

    conf: device: compare drive address fields separately
    
    Commit 3210c8b04 introduced a separate field 'diskbus' for
    internal use by the commandline formatter.
    
    Adjust the check for address equality to compare the relevant
    fields separately instead of the whole struct.
    
    This means that the changes of the 'diskbus' field added
    in commit 03ed14d2d4 no longer affect the outcome of the address
    equality check.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=2023605
    
    Fixes: 3210c8b047534f7e1d3ccde7ea3bcf11e7c92ad9
    Fixes: 03ed14d2d4a4e51568b1ee5a6e6c9c3371bb4d34
    Signed-off-by: Ján Tomko <jtomko>
    Reviewed-by: Peter Krempa <pkrempa>

git describe: v7.9.0-140-g03f9dfbb51

Comment 3 Ján Tomko 2021-11-23 11:51:34 UTC
*** Bug 2025789 has been marked as a duplicate of this bug. ***

Comment 4 Masayoshi Mizuma (Fujitsu) 2021-11-23 13:28:15 UTC
Since this issue happens on x86_64 as well, let me remove [aarch64] from the summary.

Comment 5 Yiding Liu (Fujitsu) 2021-12-06 09:41:26 UTC
Use the steps of comment 1 to verify the bug, the fix works.

# cat disk.xml 
<?xml version='1.0' encoding='UTF-8'?>
<disk device="cdrom" type="file"><target bus="scsi" dev="sdc" /><alias name="scsi0-0-0-4" /></disk>
# virsh update-device avocado-vt-vm1 disk.xml --live --config
Device updated successfully

Comment 8 Han Han 2021-12-20 03:34:35 UTC
Tested on libvirt-7.10.0-1.module+el8.6.0+13502+4f24a11d.x86_64 qemu-kvm-6.1.0-5.module+el8.6.0+13430+8fdd5f85.x86_64.
Worked for me:
1. Start an VM with the following cdrom xml:
virsh dumpxml rhel|xmllint --xpath //disk -
...
    </disk><disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source index="4"/>
      <target dev="sdb" bus="scsi"/>
      <readonly/>
      <alias name="scsi0-0-0-1"/>
      <address type="drive" controller="0" bus="0" target="0" unit="1"/>
    </disk>


2. Update the cdrom xml with --live --config
➜  ~ cat /tmp/cdrom-full.xml 
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/boot.iso'/>
      <target dev='sdb' bus='scsi'/>
      <readonly/>
    </disk>

➜  ~ virsh update-device rhel /tmp/cdrom-full.xml --live --config                                                                                                                            
Device updated successfully

➜  ~ virsh dumpxml rhel|xmllint --xpath //disk -
<disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/var/lib/libvirt/images/rhel.sp1" index="2"/>
      <backingStore type="file" index="3">
        <format type="qcow2"/>
        <source file="/var/lib/libvirt/images/rhel.qcow2"/>
        <backingStore/>
      </backingStore>
      <target dev="sda" bus="sata"/>
      <alias name="sata0-0-0"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk><disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/var/lib/libvirt/images/boot.iso" index="5"/>
      <backingStore/>
      <target dev="sdb" bus="scsi"/>
      <readonly/>
      <alias name="scsi0-0-0-1"/>
      <address type="drive" controller="0" bus="0" target="0" unit="1"/>
    </disk>

No error at update-device here

Comment 9 Han Han 2021-12-20 03:57:56 UTC
Covered by automation cases like virsh.change_media_matrix.pre_vm_state_running.cdrom_test.default.action_twice.live_config.eject_update

Comment 12 errata-xmlrpc 2022-05-10 13:24:11 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 (Moderate: virt:rhel and virt-devel:rhel security, bug fix, and enhancement update), 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/RHSA-2022:1759


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