All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laine Stump <laine@redhat.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] race condition when exec'ing "qemu -incoming" followed by monitor "cont"
Date: Fri, 09 Apr 2010 12:47:56 -0400	[thread overview]
Message-ID: <4BBF5A3C.10005@redhat.com> (raw)
In-Reply-To: <4BBF4FEA.1070306@redhat.com>

On 04/09/2010 12:03 PM, Laine Stump wrote:
> (Please forgive (and correct!) any inaccuracies in my description of 
> qemu's workings - I've only recently started looking at it directly, 
> rather than through the lens of libvirt)
>
> libvirt implements a "domain restore" operation by:
>
> 0) start with a previously saved domain image in a file
>
> 1) open the domain image, and connect it to a pipe
>
> 2) fork, connect the pipe to stdin, and exec qemu with "-incoming 
> exec:cat"
>
> 3) execute "cont" in that qemu's monitor.

I realized after sending that I was too hasty in my reading of the code, 
and interpreted it incorrectly. The file containing the domain image is 
not sent into a pipe, but merely dup2'ed to be stdin in the child 
process. So the correct sequence of events is:

0) start with a previously saved domain image in a file

1) open the domain image

2) fork, dup2 the domain image's fd as stdin,  and exec qemu with 
"-incoming exec:cat"

3) execute "cont" in that qemu's monitor.


On 04/09/2010 12:29 PM, Paolo Bonzini wrote:
> On 04/09/2010 06:03 PM, Laine Stump wrote:
>>
>> Can someone provide any insight on why it is possible to start the CPUs
>> in the domain before the incoming migration is complete, and what we can
>> do (other than blindly sleeping) to prevent this?
>
> I would say it's a bug in QEMU, and it has to be fixed there.

My assumption would have been that, if -incoming is specified on the 
commandline, the monitor should not even be started up until the 
incoming migration is complete. Being new to qemu, though, I'm hoping 
there's something I'm missing.

      parent reply	other threads:[~2010-04-09 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 16:03 [Qemu-devel] race condition when exec'ing "qemu -incoming" followed by monitor "cont" Laine Stump
2010-04-09 16:29 ` [Qemu-devel] " Paolo Bonzini
2010-04-09 16:45 ` [Qemu-devel] " Daniel P. Berrange
2010-04-09 16:47 ` Laine Stump [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=4BBF5A3C.10005@redhat.com \
    --to=laine@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.