Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Descriptionyalzhang@redhat.com
2021-11-16 06:53:03 UTC
Description of problem:
Update disk with --persistent fail with "cannot modify field 'address' of the disk"
Version-Release number of selected component (if applicable):
libvirt-7.9.0-1.el9.x86_64
qemu-kvm-6.1.0-6.el9.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Start a vm with disk device as below:
# virsh dumpxml rhel |grep /disk -B9
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/test.img' startupPolicy='mandatory' index='1'/>
<backingStore/>
<target dev='sdb' bus='sata'/>
<alias name='sata0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
2. Update the 'startupPolicy' of the device with "--live --config" or "--persistent"(--persistent is equal to "--live --config" for running vm):
# cat disk.xml
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/test.img' startupPolicy='optional' index='1'/>
<backingStore/>
<target dev='sdb' bus='sata'/>
<alias name='sata0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
# virsh update-device rhel disk.xml --live --config
error: Failed to update device from disk.xml
error: Operation not supported: cannot modify field 'address' of the disk
compare the live and inactive xml, the address is the same
active:
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/test.img' startupPolicy='mandatory' index='1'/>
<backingStore/>
<target dev='sdb' bus='sata'/>
<alias name='sata0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
inactive:
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/test.img' startupPolicy='mandatory'/>
<target dev='sdb' bus='sata'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
3. when update it "--live" or "--config" separately, it succeed:
# virsh update-device rhel disk.xml --live
Device updated successfully
# virsh dumpxml rhel | grep /disk -B9
...
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/tmp/test.img' startupPolicy='optional' index='1'/>
<backingStore/>
<target dev='sdb' bus='sata'/>
<alias name='sata0-0-1'/>
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
</disk>
Actual results:
Update disk with --persistent fail with "cannot modify field 'address' of the disk"
Expected results:
Should succeed
Additional info:
1. No such issue with libvirt-7.8.0-1.el9.x86_64;
2. Same issue with interface device:
# virsh update-device rhel inter.xml --live
Device updated successfully
# virsh update-device rhel inter.xml --config
Device updated successfully
# virsh update-device rhel inter.xml --persistent
error: Failed to update device from inter.xml
error: device not found: no device found at address '0000:01:00.0' matching MAC address '52:54:00:b1:e4:49' and alias 'net0'
# virsh dumpxml rhel | grep /interface -B12
<interface type='network'>
<mac address='52:54:00:b1:e4:49'/>
<source network='default' portid='ecd00f19-65d3-4952-82b6-8d38196cd625' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='e1000e'/>
<link state='up'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</interface>
# cat inter.xml
<interface type='network'>
<mac address='52:54:00:b1:e4:49'/>
<source network='default' portid='ecd00f19-65d3-4952-82b6-8d38196cd625' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='e1000e'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
</interface>
It should succeed, as all the info like address '0000:01:00.0' and MAC address and alias 'net0' in the xml are correct, and link state support live update.
Comment 1yalzhang@redhat.com
2021-11-16 09:38:59 UTC
Add the log info when the error happens:
# grep -i error /var/log/libvirt/libvirtd.log
2021-11-16 09:35:08.379+0000: 2747: error : virDomainNetFindIdx:15776 : device not found: no device found at address '0000:01:00.0' matching MAC address '52:54:00:b1:e4:49' and alias 'net0'
2021-11-16 09:36:59.263+0000: 2748: error : qemuDomainDiskChangeSupported:8079 : Operation not supported: cannot modify field 'address' of the disk
I have bisected the disk issue to:
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
The interface issue looks like a separate bug and
I could reproduce it on v7.8.0.
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 5yalzhang@redhat.com
2021-11-17 10:16:52 UTC
Test on V7.9.0-140-g03f9dfbb51, the bug is fixed for disk, mark the bug as Verified:tested.
And file another bug for interface bug 2024098
Comment 8yalzhang@redhat.com
2021-12-15 02:41:10 UTC
Test on libvirt-7.10.0-1.el9.x86_64 with the scenarios in comment 0, the bug is fixed.
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 (new packages: libvirt), 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/RHBA-2022:2390
Description of problem: Update disk with --persistent fail with "cannot modify field 'address' of the disk" Version-Release number of selected component (if applicable): libvirt-7.9.0-1.el9.x86_64 qemu-kvm-6.1.0-6.el9.x86_64 How reproducible: 100% Steps to Reproduce: 1. Start a vm with disk device as below: # virsh dumpxml rhel |grep /disk -B9 <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/tmp/test.img' startupPolicy='mandatory' index='1'/> <backingStore/> <target dev='sdb' bus='sata'/> <alias name='sata0-0-1'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> 2. Update the 'startupPolicy' of the device with "--live --config" or "--persistent"(--persistent is equal to "--live --config" for running vm): # cat disk.xml <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/tmp/test.img' startupPolicy='optional' index='1'/> <backingStore/> <target dev='sdb' bus='sata'/> <alias name='sata0-0-1'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> # virsh update-device rhel disk.xml --live --config error: Failed to update device from disk.xml error: Operation not supported: cannot modify field 'address' of the disk compare the live and inactive xml, the address is the same active: <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/tmp/test.img' startupPolicy='mandatory' index='1'/> <backingStore/> <target dev='sdb' bus='sata'/> <alias name='sata0-0-1'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> inactive: <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/tmp/test.img' startupPolicy='mandatory'/> <target dev='sdb' bus='sata'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> 3. when update it "--live" or "--config" separately, it succeed: # virsh update-device rhel disk.xml --live Device updated successfully # virsh dumpxml rhel | grep /disk -B9 ... <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/tmp/test.img' startupPolicy='optional' index='1'/> <backingStore/> <target dev='sdb' bus='sata'/> <alias name='sata0-0-1'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> Actual results: Update disk with --persistent fail with "cannot modify field 'address' of the disk" Expected results: Should succeed Additional info: 1. No such issue with libvirt-7.8.0-1.el9.x86_64; 2. Same issue with interface device: # virsh update-device rhel inter.xml --live Device updated successfully # virsh update-device rhel inter.xml --config Device updated successfully # virsh update-device rhel inter.xml --persistent error: Failed to update device from inter.xml error: device not found: no device found at address '0000:01:00.0' matching MAC address '52:54:00:b1:e4:49' and alias 'net0' # virsh dumpxml rhel | grep /interface -B12 <interface type='network'> <mac address='52:54:00:b1:e4:49'/> <source network='default' portid='ecd00f19-65d3-4952-82b6-8d38196cd625' bridge='virbr0'/> <target dev='vnet0'/> <model type='e1000e'/> <link state='up'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </interface> # cat inter.xml <interface type='network'> <mac address='52:54:00:b1:e4:49'/> <source network='default' portid='ecd00f19-65d3-4952-82b6-8d38196cd625' bridge='virbr0'/> <target dev='vnet0'/> <model type='e1000e'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/> </interface> It should succeed, as all the info like address '0000:01:00.0' and MAC address and alias 'net0' in the xml are correct, and link state support live update.