Hide Forgot
Description of problem: Define a domain using a image already used by a running guest, then start the new defined domain. The img will be relabelled and taken over by the new defined domain, at the same time the running guest get broken for fail to read/write from the img. Version-Release number of selected component (if applicable): # rpm -q libvirt qemu-kvm kernel libvirt-0.9.4-12.el6.x86_64 qemu-kvm-0.12.1.2-2.192.el6.x86_64 kernel-2.6.32-197.el6.x86_64 How reproducible: always Steps to Reproduce: 1. prepare a running guest 2. define a new guest which using the img file of the runnning guest # virsh define domain.xml In domain.xml: <source file='/img/of/already/running/domain'/> and no <seclabel> in the xml 3. start the new defined guest # virsh start $new_defined_guest 4. check both guest by virt-viewer Actual results: image label was forced change to owned by new domain, and the running domain is broken. Expected results: the new defined and started guest can not take over the running domain's img, sVirt should denied it Additional info: Test this also on libvirt-0.9.4-11 and libvirt-0.9.4-7.2, the result is the same as on -12. But on libvirt-0.9.4-7 and -6, both guests can running well.
There is no relevant change between 0.9.4-7 and 0.9.4-7.2, so something else is different in your environment.
(In reply to comment #1) > There is no relevant change between 0.9.4-7 and 0.9.4-7.2, so something else is > different in your environment. There is something different, I use fresh install machine but with different qemu-kvm and kernel For 7: # rpm -q libvirt qemu-kvm kernel libvirt-0.9.4-7.el6.x86_64 qemu-kvm-0.12.1.2-2.184.el6.x86_64 kernel-2.6.32-192.el6.x86_64 For 7.2: # rpm -q libvirt qemu-kvm kernel libvirt-0.9.4-7.2.el6.x86_64 qemu-kvm-0.12.1.2-2.190.el6.x86_64 kernel-2.6.32-193.el6.x86_64 For another try of direct downgrade libvirt from 11 to 7 and 6, the result is same with 11 and 12. The qemu-kvm is 0.12.1.2-2.185 in this try.
@Wayne, can you test if it works well when the disk is shared or readonly?
Confirmed with Wayne, just as expected, there is no problem for disk which is specified as *shareable* or *readonly*. But IMHO we need to prevent defining a domain which has disk used by other domains. Posted RFC patch to upstream for further discussion. https://www.redhat.com/archives/libvir-list/2011-September/msg00935.html