On Tue, May 21, 2013 at 06:40:34PM +0800, Guannan Ren wrote: > --- > src/qemu/qemu_conf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c > index 41fe0b9..7266d3b 100644 > --- a/src/qemu/qemu_conf.c > +++ b/src/qemu/qemu_conf.c > @@ -1184,7 +1184,7 @@ qemuAddSharedDevice(virQEMUDriverPtr driver, > if (dev->type == VIR_DOMAIN_DEVICE_DISK) { > disk = dev->data.disk; > > - if (disk->shared || > + if (!disk->shared || > !disk->src || > (disk->type != VIR_DOMAIN_DISK_TYPE_BLOCK && > !(disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME && This code is a good candidate for creation of unit tests to validate the qemuAddSharedDevice / qemuRemoveSharedDevice operation with various different configs. 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 :| -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list