Bug 740482 - [sVirt] sVirt should not force relabel the running guest's img and give it to a new defined guest
Summary: [sVirt] sVirt should not force relabel the running guest's img and give it to...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.2
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-22 08:15 UTC by Wayne Sun
Modified: 2011-09-23 09:35 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-23 09:35:10 UTC


Attachments (Terms of Use)

Description Wayne Sun 2011-09-22 08:15:18 UTC
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.

Comment 1 Dave Allan 2011-09-22 15:02:29 UTC
There is no relevant change between 0.9.4-7 and 0.9.4-7.2, so something else is different in your environment.

Comment 2 Wayne Sun 2011-09-23 03:36:10 UTC
(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.

Comment 3 Osier Yang 2011-09-23 07:35:02 UTC
@Wayne, can you test if it works well when the disk is shared or readonly?

Comment 4 Osier Yang 2011-09-23 08:24:21 UTC
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


Note You need to log in before you can comment on or make changes to this bug.