Bug 1586027
Summary: | virsh detach-device-alias --config does not work | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Peter Krempa <pkrempa> |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
Status: | CLOSED ERRATA | QA Contact: | jiyan <jiyan> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.5 | CC: | dyuan, jdenemar, lmen, mprivozn, xuzhang, yalzhang |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-4.5.0-1.el7 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2018-10-30 09:55:54 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: | |
Embargoed: |
Description
Peter Krempa
2018-06-05 10:55:19 UTC
Fixed upstream: commit d7ca39e0fb7f795d6431a76c73e7828ffded4f2a Author: Peter Krempa <pkrempa> Date: Tue Jun 5 09:35:12 2018 +0200 qemu: Fix detaching from persistent def in qemuDomainDetachDeviceAliasLiveAndConfig The code that detaches the device from persistent definition copies the persistent definition first so that it can easily be rolled back. The actual detaching is then made in the copy which is assigned back on success (if the live operation succeeded as well). This is not the case in qemuDomainDetachDeviceAliasLiveAndConfig where the definition was copied and put back, but the detaching happened from the other object which was overwritten. Version: kernel-3.10.0-918.el7.x86_64 qemu-kvm-rhev-2.12.0-6.el7.x86_64 libvirt-4.5.0-1.el7.x86_64 1. Detach all the devices in <device></device> by 'detach-device-alias', As for alias generated by libvirtd can not be identified in inactive XML, so Only tested 'ua-' alias. 2. live / persistent detach is not supported for 'memballoon', 'panic', 'hub', 'sound', 'video' and 'smartcard'. Besides, can not configure 'ua-' alias for 'graphic'. So Do not test these devices. 3. Test the following scenairo both when VM is running and shutoff, and also tested '--live'. (As for 'shutoff' and '--live' not pated here.) Steps: S1. Test 'rng', 'shmem', 'watchdog', 'scsi controller', 'mem' devices S1-1. 'detach-device-alias' rng device # virsh domstate b1 running # virsh dumpxml b1 |grep "<rng" -A5 <rng model='virtio'> <rate bytes='1234' period='2000'/> <backend model='random'>/dev/random</backend> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f39'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0c' function='0x0'/> </rng> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f39 --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<rng" -A5 No output S1-2. 'detach-device-alias' shmem device # virsh domstate b1 running # virsh dumpxml b1 <shmem name='my_shmem0'> <model type='ivshmem-plain'/> <size unit='M'>4</size> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f41'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/> </shmem> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f41 --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<shmem" -A10 No output S1-3. 'detach-device-alias' watchdog device # virsh domstate b1 running # virsh dumpxml b1 <watchdog model='i6300esb' action='poweroff'> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f37'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0e' function='0x0'/> </watchdog> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f37 --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<watchdog" -A3 No output S1-4. 'detach-device-alias' scsi controller device # virsh domstate b1 running # virsh dumpxml b1 <controller type='scsi' index='0' model='virtio-scsi'> <driver iothread='1'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f25'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/> </controller> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f25 --config Device detach request sent successfully # virsh dumpxml b1 |grep “ <controller type='scsi'” No output S1-5. 'detach-device-alias' memory device Note: Detaching memory always failed in dumpxml while succeeded in cmd. https://bugzilla.redhat.com/show_bug.cgi?id=1598087 S2. Test 'spicevmc-redir', 'tcp-redir' devices # virsh domstate b1 running # virsh dumpxml b1 |grep "<redir" -A5 <redirdev bus='usb' type='spicevmc'> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f36'/> <address type='usb' bus='0' port='1'/> </redirdev> <redirdev bus='usb' type='tcp'> <source mode='connect' host='10.66.4.201' service='4000' tls='no'/> <protocol type='raw'/> <alias name='ua-redir046b7e883-8517-4e49-b2db-3b3a8d96ccab'/> <address type='usb' bus='0' port='2'/> </redirdev> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f36 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-redir046b7e883-8517-4e49-b2db-3b3a8d96ccab --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<redir" -A5 No output S3. Test 'hostdev-usb', 'hostdev-scsi', 'hostdev-pci' devices S3-1. 'detach-device-alias' hostdev-usb device # virsh domstate test1 running # virsh dumpxml test1 |grep "<hostdev" -A8 <hostdev mode='subsystem' type='usb' managed='no'> <source> <vendor id='0x0951'/> <product id='0x1666'/> <address bus='1' device='3'/> </source> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f35'/> <address type='usb' bus='0' port='4'/> </hostdev> # virsh detach-device-alias test1 ua-9874229d-d867-4932-ad28-279e9a777f35 --config Device detach request sent successfully # virsh dumpxml test1 --inactive|grep "<hostdev" -A8 No output S3-2. 'detach-device-alias' hostdev-scsi device # virsh domstate b1 running # virsh dumpxml b1 |grep "<hostdev" -A9 <hostdev mode='subsystem' type='scsi' managed='no' sgio='filtered' rawio='yes'> <source> <adapter name='scsi_host3'/> <address bus='0' target='0' unit='0'/> </source> <shareable/> <boot order='10'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f35'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </hostdev> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f35 --config Device detach request sent successfully # virsh dumpxml b1 --inactive |grep "<hostdev" -A9 No output S3-3. 'detach-device-alias' hostdev-pci device # virsh domstate test1 running # virsh dumpxml test1 |grep "<hostdev" -A7 <hostdev mode='subsystem' type='pci' managed='yes'> <driver name='vfio'/> <source> <address domain='0x0000' bus='0x03' slot='0x10' function='0x3'/> </source> <alias name='ua-46b7e883-8517-4e49-b2db-3b3a8d96ccac'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </hostdev> # virsh detach-device-alias test1 ua-46b7e883-8517-4e49-b2db-3b3a8d96ccac --config Device detach request sent successfully # virsh dumpxml test1 --inactive|grep "<hostdev" -A7 No output S4. Test 'Input-PS2', 'Input-usb', 'Input-virtio', 'Input-virtio-through' devices # virsh domstate b1 running # virsh dumpxml b1 <input type='keyboard' bus='ps2'> (**Does not support hot-unplugging**) <alias name='ua-9874229d-d867-4932-ad28-279e9a777f60'/> </input> <input type='keyboard' bus='usb'> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f31'/> <address type='usb' bus='0' port='6'/> </input> <input type='mouse' bus='virtio'> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f32'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> </input> <input type='passthrough' bus='virtio'> <source evdev='/dev/input/event3'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f30'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </input> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f60 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f32 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f31 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f30 --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<input" -A10 No output for the devices detached above S5. Test 'isa-serial pty serial/console', 'pci-serial pty serial', 'isa-serial file serial/console', 'pci-serial file serial' devices S5-1. 'detach-device-alias' isa-serial pty serial/console device # virsh domstate b1 running # virsh dumpxml b1 |grep "<serial" -A6 (Bus 'isa.0' does not support hotplugging) <serial type='pty'> <source path='/dev/pts/1'/> <target type='isa-serial' port='0'> <model name='isa-serial'/> </target> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f29'/> </serial> # virsh dumpxml b1 |grep "<console" -A4 <console type='pty' tty='/dev/pts/1'> <source path='/dev/pts/1'/> <target type='serial' port='0'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f29'/> </console> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f29 --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<console" -A4 No output # virsh dumpxml b1 --inactive|grep "<serial" -A4 No output S5-2. 'detach-device-alias' pci-serial pty serial device # virsh domstate b1 running # virsh dumpxml b1 |grep "<serial" -A7 <serial type='pty'> <source path='/dev/pts/1'/> <target type='pci-serial' port='0'> <model name='pci-serial'/> </target> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f29'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> </serial> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f29 --config Device detach request sent successfully # virsh dumpxml b1 |grep "<serial" -A7 No output S5-3. 'detach-device-alias' isa-serial file serial/console device # virsh domstate b1 running # virsh dumpxml b1 |grep "<serial" -A15 <serial type='file'> <source path='/tmp/file' append='on'> <seclabel model='dac' relabel='no'/> </source> <target type='isa-serial' port='0'> <model name='isa-serial'/> </target> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f29'/> </serial> <console type='file'> <source path='/tmp/file' append='on'> <seclabel model='dac' relabel='no'/> </source> <target type='serial' port='0'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f29'/> </console> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f29 --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<serial" -A15 No output S5-2. 'detach-device-alias' pci-serial file serial device # virsh domstate b1 running # virsh dumpxml b1 --inactive|grep "<serial" -A9 <serial type='file'> <source path='/tmp/file' append='on'> <seclabel model='dac' relabel='no'/> </source> <target type='pci-serial' port='0'> <model name='pci-serial'/> </target> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f29'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> </serial> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f29 --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<serial" -A9 No output S6. Test 'Channel-spicevmc', 'Channel-pty', 'Channel-Unix-virtio' devices S6-1. 'detach-device-alias' channel-spicevmc device # virsh domstate b1 running # virsh dumpxml b1 |grep "<channel" -A4 <channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0' state='disconnected'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777123'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777123 --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<channel" -A4 No output S6-2. 'detach-device-alias' Channel-pty device # virsh domstate b1 running # virsh dumpxml b1 |grep "<channel" -A5 <channel type='pty'> <source path='/dev/pts/1'/> <target type='virtio' name='arbitrary.virtio.serial.port.name' state='disconnected'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777123'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777123 --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<channel" -A5 No output S6-3. 'detach-device-alias' Channel-unix-virtio device # virsh domstate b1 running # virsh dumpxml b1 |grep "<channel" -A5 <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/> <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777123'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777123 --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<channel" -A5 No output S7. Detach Network/ Bridge/ Direct/ UDP interface device # virsh domstate b1 running # virsh dumpxml b1 |grep "<interface" -A10 <interface type='network'> <mac address='52:54:00:a2:31:7c'/> <source network='default' bridge='virbr0'/> <target dev='vnet0'/> <model type='virtio'/> <driver name='vhost' txmode='iothread' ioeventfd='on' event_idx='off' queues='5' rx_queue_size='256' tx_queue_size='256'> <host csum='off' gso='off' tso4='off' tso6='off' ecn='off' ufo='off' mrg_rxbuf='off'/> <guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/> </driver> <alias name='ua-9874229d-d867-4932-ad28-279e9a777101'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <interface type='udp'> <mac address='52:54:00:22:c9:42'/> <source address='127.0.0.1' port='11115'> <local address='127.0.0.1' port='11116'/> </source> <model type='rtl8139'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777102'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0f' function='0x0'/> </interface> <interface type='bridge'> <mac address='52:54:00:86:e9:41'/> <source bridge='virbr0'/> <target dev='vnet1'/> <model type='rtl8139'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777103'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> </interface> <interface type='direct'> <mac address='52:54:00:a0:8c:f6'/> <source dev='eno3' mode='bridge'/> <target dev='macvtap0'/> <model type='rtl8139'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777104'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x10' function='0x0'/> </interface> <interface type='hostdev' managed='yes'> <mac address='52:54:00:c6:b7:84'/> <driver name='vfio'/> <source> <address type='pci' domain='0x0000' bus='0x03' slot='0x10' function='0x1'/> </source> <alias name='ua-46b7e883-8517-4e49-b2db-3b3a8d96ccab'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </interface> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777101 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777102 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777103 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777104 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-46b7e883-8517-4e49-b2db-3b3a8d96ccab --config Device detach request sent successfully # virsh dumpxml b1 --inactive|grep "<interface" -A12 No output S8. Detach file / network / volume / block-disk / block-lun disk device # virsh domstate b1 running # virsh dumpxml b1 |grep "<disk" -A12 <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/b1.qcow2'/> <backingStore/> <target dev='hda' bus='ide'/> <boot order='1'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f10'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='qcow2' iothread='1'/> <source file='/var/lib/libvirt/images/RHEL-7.6-x86_64-latest.qcow2'/> <backingStore/> <target dev='vdb' bus='virtio'/> <boot order='2'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f11'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/> </disk> <disk type='network' device='disk'> <driver name='qemu' type='raw'/> <source protocol='iscsi' name='iqn.2003-01.org.linux-iscsi.hp-dl385g10-01.x8664:sn.9e857156e171/2'> <host name='hp-dl385g10-01.lab.eng.pek2.redhat.com' port='3260'/> </source> <target dev='sdc' bus='usb'/> <boot order='3'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f12'/> <address type='usb' bus='0' port='3.1'/> </disk> <disk type='block' device='disk'> <driver name='qemu' type='raw'/> <source dev='/dev/sdd'/> <backingStore/> <target dev='sdd' bus='usb'/> <boot order='4'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f13'/> <address type='usb' bus='0' port='4'/> </disk> <disk type='volume' device='disk'> <driver name='qemu' type='qcow2'/> <source pool='dirpool' volume='volume.qcow2'/> <backingStore/> <target dev='sde' bus='scsi'/> <boot order='5'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f14'/> <address type='drive' controller='0' bus='0' target='0' unit='4'/> </disk> <disk type='block' device='lun'> <driver name='qemu' type='raw'/> <source dev='/dev/sde'/> <backingStore/> <target dev='sdf' bus='scsi'/> <boot order='6'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f15'/> <address type='drive' controller='0' bus='0' target='0' unit='5'/> </disk> # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f11 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f12 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f13 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f14 --config Device detach request sent successfully # virsh detach-device-alias b1 ua-9874229d-d867-4932-ad28-279e9a777f15 --config Device detach request sent successfully # virsh dumpxml b1 --inactive |grep "<disk" -A12 <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/var/lib/libvirt/images/b1.qcow2'/> <target dev='hda' bus='ide'/> <boot order='1'/> <alias name='ua-9874229d-d867-4932-ad28-279e9a777f10'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> Hi, during verifying this bug, I found that 'guestfwd' channel can not accept 'ua-' alias, while other three channel can (can be seen in the last comment). So I did not test this device and BTW will you implement this function for this device? # virsh dumpxml b1 <channel type='unix'> <source mode='bind' path='/tmp/guestfwd'/> <target type='guestfwd' address='10.0.2.1' port='4600'/> </channel> (In reply to jiyan from comment #5) > There is a separate bug for that. See bug 1591636. Thanks, Michal. As all the results are expected, move this bug to be verified. 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/RHSA-2018:3113 |