Bug 2024419
| Summary: | virsh update-device guest --live --config: Operation not supported: cannot modify field 'address' of the disk | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Yiding Liu (Fujitsu) <yidliu> |
| Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
| Status: | CLOSED ERRATA | QA Contact: | Han Han <hhan> |
| Severity: | medium | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 8.6 | CC: | drjones, jdenemar, jtomko, lcapitulino, lmen, virt-maint, xuzhang |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-7.10.0-1.module+el8.6.0+13502+4f24a11d | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-05-10 13:24:11 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | 7.10.0 |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1929792, 1885765 | ||
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 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
*** Bug 2025789 has been marked as a duplicate of this bug. *** Since this issue happens on x86_64 as well, let me remove [aarch64] from the summary. 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 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
Covered by automation cases like virsh.change_media_matrix.pre_vm_state_running.cdrom_test.default.action_twice.live_config.eject_update 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 |
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>