[libvirt] [PATCH/RFC] qemu/kvm: allow to hot remove scsi/virtio disks

Daniel P. Berrange berrange at redhat.com
Tue Oct 21 13:42:40 UTC 2008


On Fri, Oct 17, 2008 at 04:24:52PM +0200, Guido G?nther wrote:
> On Fri, Oct 17, 2008 at 02:37:17PM +0200, Daniel Veillard wrote:
> [..snip..] 
> >   Looks fine, i just removed a couple of extra spaces at end of line
> > before commiting :-)
> Thanks a lot for applying this so quickly! Attached is a patch that
> allows for unplugging of disks. To do that I added a token to
> virDomainDiskDef that holds the PCI bus/slot number [1] so we can
> indentify the device on unplug. It's a union since other
> busses/hypervisors might have other requirements. The token is meant as
> an internal handle and will never show up in an XML and should probably
> move up into virDomainDeviceDef. Comments are welcome.

The thing I'm not happy about with this scheme, is that it only works
if you previously hot-attached the disk during the lifetime of this
particular execution of the VM.   If you had a disk specified on the
command line with -driver, then it is not able to unplug it. Having
a detach command that may work or may fail depending on how the disk
was previously configured is not very nice.

Is there not some 'info pci' or 'info disk' command we cna use to find
out the PCI slot number at the time we want to detach the device. This
would make it work for all disks, and avoid the need to track the 
state in that virDomainDiskDef union

Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list