[libvirt] [RFC PATCH] Prevent defining a domain has disk used by other domain

Daniel P. Berrange berrange at redhat.com
Fri Sep 23 08:13:01 UTC 2011


On Fri, Sep 23, 2011 at 03:59:04PM +0800, Osier Yang wrote:
> $subject + "If the disk is shared and readonly."
> 
> If the disk is not shared or readonly, the later started domain
> will relabel the disk, thus the first domain will lose the permission
> to write to the disk and be corrupt.
> 
> --
> I'm not sure if it's the design to allow multiple domains use
> same disk not shared and readonly. So this patch just gives a
> demo of the implementation (it skips the checking of nbd disk,
> and only changes qemu driver), to see whether if the pricinple
> is right or not.
> ---
>  src/conf/domain_conf.c   |   34 ++++++++++++++++++++++++++++++++++
>  src/conf/domain_conf.h   |    2 ++
>  src/libvirt_private.syms |    1 +
>  src/qemu/qemu_driver.c   |   24 ++++++++++++++++++++++++
>  4 files changed, 61 insertions(+), 0 deletions(-)

NACK, defining two guests with the same disk is not a bug.
Only *starting* two guests with the same disk is a problem,
and that is what the lock manager code is protecting against.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list