Description of problem: If I update block cdrom device with unmatched source dev, for example <disk type='block' device='cdrom'> <driver name='qemu' type='raw'/> <source dev='/var/lib/libvirt/images/tt.img'/> <target dev='sdc' bus='scsi'/> <readonly/> <shareable/> </disk> then restart libvirtd may cause the running guest be destroyed Version-Release number of selected component (if applicable): libvirt-0.10.2-18.el6_4.2.x86_64 qemu-kvm-rhev-0.12.1.2-2.355.el6_4.2.x86_64 kernel-2.6.32-358.2.1.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1. start a guest with empty block cdrom device <disk type='block' device='cdrom'> <driver name='qemu' type='raw'/> <target dev='sdc' bus='scsi'/> <readonly/> <shareable/> </disk> # virsh start guest 2. Update cdrom device with unmatched source dev # cat cdrom.xml <disk type='block' device='cdrom'> <driver name='qemu' type='raw'/> <source dev='/var/lib/libvirt/images/tt.img'/> <target dev='sdc' bus='scsi'/> <readonly/> <shareable/> </disk> # virsh update-device guest cdrom.xml Device updated successfully 3. Restart libvirt 4. Check the guest status Actual results: guest is destroyed, with error in libvirtd.log 2013-03-19 08:23:27.144+0000: 18490: error : qemuGetSharedDiskKey:765 : Unable to get minor number of device '/var/lib/libvirt/images/tt.img': Invalid argument 2013-03-19 08:23:27.433+0000: 18490: error : qemuGetSharedDiskKey:765 : Unable to get minor number of device '/var/lib/libvirt/images/tt.img': Invalid argument Expected results: update-device should be prohibited or after restart libvirtd guest still running Additional info:
Patch in upstream: https://www.redhat.com/archives/libvir-list/2013-March/msg01021.html
(In reply to comment #0) > Description of problem: > If I update block cdrom device with unmatched source dev, for example > <disk type='block' device='cdrom'> > <driver name='qemu' type='raw'/> > <source dev='/var/lib/libvirt/images/tt.img'/> > <target dev='sdc' bus='scsi'/> > <readonly/> > <shareable/> > </disk> > then restart libvirtd may cause the running guest be destroyed > > Version-Release number of selected component (if applicable): > libvirt-0.10.2-18.el6_4.2.x86_64 > qemu-kvm-rhev-0.12.1.2-2.355.el6_4.2.x86_64 > kernel-2.6.32-358.2.1.el6.x86_64 > > How reproducible: > 100% > > Steps to Reproduce: > 1. start a guest with empty block cdrom device > <disk type='block' device='cdrom'> > <driver name='qemu' type='raw'/> > <target dev='sdc' bus='scsi'/> > <readonly/> > <shareable/> > </disk> > # virsh start guest > > 2. Update cdrom device with unmatched source dev > # cat cdrom.xml > <disk type='block' device='cdrom'> > <driver name='qemu' type='raw'/> > <source dev='/var/lib/libvirt/images/tt.img'/> > <target dev='sdc' bus='scsi'/> > <readonly/> > <shareable/> > </disk> Personally I think this is just wrong use, which is existed long ago, but only exposed by the new sgio feature. But this indeed exposes a problem we have (the new disk src is not added into the shared disk table, which is resolved by the patch I pasted in comment 1).
(In reply to comment #2) > (In reply to comment #0) > > Description of problem: > > If I update block cdrom device with unmatched source dev, for example > > <disk type='block' device='cdrom'> > > <driver name='qemu' type='raw'/> > > <source dev='/var/lib/libvirt/images/tt.img'/> > > <target dev='sdc' bus='scsi'/> > > <readonly/> > > <shareable/> > > </disk> > > then restart libvirtd may cause the running guest be destroyed > > > > Version-Release number of selected component (if applicable): > > libvirt-0.10.2-18.el6_4.2.x86_64 > > qemu-kvm-rhev-0.12.1.2-2.355.el6_4.2.x86_64 > > kernel-2.6.32-358.2.1.el6.x86_64 > > > > How reproducible: > > 100% > > > > Steps to Reproduce: > > 1. start a guest with empty block cdrom device > > <disk type='block' device='cdrom'> > > <driver name='qemu' type='raw'/> > > <target dev='sdc' bus='scsi'/> > > <readonly/> > > <shareable/> > > </disk> > > # virsh start guest > > > > 2. Update cdrom device with unmatched source dev > > # cat cdrom.xml > > <disk type='block' device='cdrom'> > > <driver name='qemu' type='raw'/> > > <source dev='/var/lib/libvirt/images/tt.img'/> > > <target dev='sdc' bus='scsi'/> > > <readonly/> > > <shareable/> > > </disk> > > Personally I think this is just wrong use, which is existed long ago, but > only exposed by the new sgio feature. > I moved this to "Virtualization Tools" component, since it's a wrong use, just means we need a better error, most of the users will not mix type='block' with non-block files. https://www.redhat.com/archives/libvir-list/2013-March/msg01176.html
update-device fails in that case for a running VM for me $ sudo virsh update-device f23 xml error: Failed to update device from xml error: Unable to get minor number of device '/tmp/foo.img': Invalid argument