qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Liron Aravot <laravot@redhat.com>
Cc: "libvir-list@redhat.com" <libvir-list@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] attaching disk to paused guest
Date: Thu, 4 Apr 2013 17:49:43 +0200	[thread overview]
Message-ID: <CAJSP0QWo-B8NP3nBk8t5ic+GiDS6Aya-oFoUBuwY3QGZ40e0gQ@mail.gmail.com> (raw)
In-Reply-To: <1679096577.677966.1364987132067.JavaMail.root@redhat.com>

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

      reply	other threads:[~2013-04-04 15:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJSP0QWo-B8NP3nBk8t5ic+GiDS6Aya-oFoUBuwY3QGZ40e0gQ@mail.gmail.com \
    --to=stefanha@gmail.com \
    --cc=laravot@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).