qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] attaching disk to paused guest
       [not found] <1135585455.7248392.1363509145859.JavaMail.root@redhat.com>
@ 2013-04-03 11:05 ` Liron Aravot
  2013-04-04 15:49   ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Liron Aravot @ 2013-04-03 11:05 UTC (permalink / raw)
  To: qemu-devel

Hi,
does qemu support attaching disk to a paused guest? Does it makes sense to allow this operation?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] attaching disk to paused guest
  2013-04-03 11:05 ` [Qemu-devel] attaching disk to paused guest Liron Aravot
@ 2013-04-04 15:49   ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2013-04-04 15:49 UTC (permalink / raw)
  To: Liron Aravot; +Cc: libvir-list@redhat.com, qemu-devel

On Wed, Apr 3, 2013 at 1:05 PM, Liron Aravot <laravot@redhat.com> wrote:
> does qemu support attaching disk to a paused guest? Does it makes sense to allow this operation?

Yes, it works.  I tested it via libvirt:

$ virsh start vm
$ cat >/tmp/disk.xml
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='path/to/new_disk.img'/>
      <target dev='vdb' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08'
function='0x0'/>
    </disk>
^D
$ virsh suspend vm
$ virsh list
 Id    Name                           State
----------------------------------------------------
 1     vm                               paused
$ virsh attach-device vm /tmp/disk.xml
Device attached successfully
$ virsh resume vm

The issue with hotplug is that it may involve guest cooperation.  This
is not possible when the guest is paused, but attaching a new
virtio-blk adapter is okay because we'll just have pending PCI hotplug
notifications when the guest is resumed.

Hot unplug is the nasty case because the guest OS isn't running and
cannot terminate its guest driver for the device.  Because of this,
both network adapters and disks in QEMU try to clean up after
themselves and libvirt does not need to wait for the guest to
acknowledge hot unplug.

I think both hotplug and hot unplug should work fine while the guest is paused.

Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-04 15:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1135585455.7248392.1363509145859.JavaMail.root@redhat.com>
2013-04-03 11:05 ` [Qemu-devel] attaching disk to paused guest Liron Aravot
2013-04-04 15:49   ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).