All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Avi Kivity <avi@redhat.com>
Cc: libvir-list@redhat.com, Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, Hollis Blanchard <hollisb@us.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 2/6] Introduce monitor 'wait' command (v2)
Date: Thu, 09 Apr 2009 16:19:55 +0200	[thread overview]
Message-ID: <49DE040B.5060107@siemens.com> (raw)
In-Reply-To: <49DDFEEC.6050704@redhat.com>

Avi Kivity wrote:
> Anthony Liguori wrote:
>> Avi Kivity wrote:
>>> Anthony Liguori wrote:
>>>> The wait command will pause the monitor the command was issued in
>>>> until a new
>>>> event becomes available.  Events are queued if there isn't a waiter
>>>> present.
>>>> The wait command completes after a single event is available.
>>>>   
>>>
>>> How do you stop a wait if there are no pending events?
>>
>> You mean, cancel a wait?  You cannot.  I thought about whether it was
>> a problem or not.  I'm not sure.
> 
> A management agent might want to detach from guests, upgrade, restart,
> and reattach.
> 
>>
>> You could introduce a wait-cancel command, but then you need a way to
>> identify which wait you want to cancel.  I can't think of a simple way
>> to do that today.
> 
> This, as well as the queueing that's necessary with this model,
> indicates (to me) that it is too complicated.

It should be feasible to handle some key sequence like ^C while the
monitor is suspended (ie. blocked on things like event-wait or migrate).
I thought about such a feature while reworking the involved parts but
postponed it as I saw no urgent need for it.

> 
>>
>>>> Today, we queue events indefinitely but in the future, I suspect
>>>> we'll drop
>>>> events that are older than a certain amount of time to avoid infinitely
>>>> allocating memory for long running VMs.
>>>>   
>>>
>>> This queueing plug the race where an event happens immediately after
>>> a wait completes.  But it could be avoided completely by having
>>> asynchronous notifications on a single monitor.
>>
>> There are multiple things I think are being confused: asynchronous
>> completion of monitor commands, events, monitor multiplexing, and
>> non-human mode.
>>
>> There can only be one command active at any given time on a Monitor
>> context.  We can have many Monitor contexts.  There is currently only
>> one Monitor context connected to a character device at a given time.
> 
> Don't think of 'migrate -d' as a command to perform migration, instead
> it's a command to start migration.
> 
> I also object to exposing internal qemu implementation details like
> monitor contexts to the user (by forcing them to have multiple
> connections).  If we can't have more than one monitor command, we need
> to fix that.
> 
>>
>> I think what you want to see is something like this:
>>
>> <input> tag=4: info cpus
>> <input> tag=5: info kvm
>> <output> tag=5,rc=0: kvm enabled
>> <output> tag=4,rc=0: eip = 0x0000000444
>> <ouput> rc=0,class=vm-state,name=start: vm started
>>
>> To me, this is a combination of events, which is introduced by this
>> patch, a non-human monitor mode, and finally multiplexing multiple
>> monitors into a single session.
>>
>> Right now, you can have the same functional thing by having three
>> monitors.  In the first monitor you'd see:
>>
>> (qemu) info cpus
>> eip = 0x000000444
>> (qemu)
>>
>> In the second you'd see:
>>
>> (qemu) info kvm
>> kvm enabled
>> (qemu)
>>
>> In the third you'd see:
>>
>> (qemu) wait
>> 23423423.23423: vm-state: start: vm started
>> (qemu)
>>
>> Even those the two info commands today are synchronous, there's
>> nothing requiring them to be (see migrate as an example).  So I think
>> we're in agreement but you just want to jump ahead 6 months ;-)
>>
> 
> Commands which are inherently synchronous should remain so.  Commands
> which are inherently async should be coded like that.  It was a mistake
> IMO to have 'migrate' be a synchronous command, it should have always
> behaved as if -d is given.
> 
> Having tagged replies is a good idea, but IMO, introducing multiple
> monitors will create a lot of subtle problems, several of which we've
> already identified.

We do have multiple monitors already, try '-monitor X -serial mon:Y', or
also attach via gdb and issue 'monitor whatever'. And we should continue
to design the monitor interface for this (which means here: event
notification should be configured per monitor session).

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux

  reply	other threads:[~2009-04-09 14:20 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08 18:34 [Qemu-devel] [PATCH 1/6] Allow multiple monitor devices (v2) Anthony Liguori
2009-04-08 18:34 ` [Qemu-devel] [PATCH 2/6] Introduce monitor 'wait' command (v2) Anthony Liguori
2009-04-08 18:34   ` [Qemu-devel] [PATCH 3/6] Introduce wait filtering (v2) Anthony Liguori
2009-04-08 18:35     ` [Qemu-devel] [PATCH 4/6] Document new events (v2) Anthony Liguori
2009-04-08 18:35       ` [Qemu-devel] [PATCH 5/6] Implement vm-state notifications (v2) Anthony Liguori
2009-04-08 18:35         ` [Qemu-devel] [PATCH 6/6] Implement vnc-event " Anthony Liguori
2009-04-08 18:43   ` [Qemu-devel] Re: [PATCH 2/6] Introduce monitor 'wait' command (v2) Anthony Liguori
2009-04-08 19:01   ` [Qemu-devel] " Blue Swirl
2009-04-08 19:02     ` Anthony Liguori
2009-04-09 11:01   ` Avi Kivity
2009-04-09 13:40     ` Anthony Liguori
2009-04-09 13:58       ` Avi Kivity
2009-04-09 14:19         ` Jan Kiszka [this message]
2009-04-09  8:19 ` [Qemu-devel] [PATCH 1/6] Allow multiple monitor devices (v2) Avi Kivity
2009-04-09 13:28   ` Anthony Liguori
2009-04-09 13:40     ` Avi Kivity
2009-04-09 13:47       ` Anthony Liguori
2009-04-09 14:03         ` Avi Kivity
2009-04-09 14:13           ` Anthony Liguori
2009-04-09 14:28             ` Avi Kivity
2009-04-09 14:30               ` Anthony Liguori
2009-04-09 14:37                 ` Avi Kivity
2009-04-09 14:57                   ` Anthony Liguori
2009-04-09 15:11                     ` Avi Kivity
2009-04-09 15:40                       ` Anthony Liguori
2009-04-09 15:57                         ` Avi Kivity
2009-04-09 16:09                           ` Anthony Liguori
2009-04-09 16:30                             ` Avi Kivity
2009-04-09 16:42                               ` Anthony Liguori
2009-04-09 17:00                                 ` Avi Kivity
2009-04-09 17:40                                   ` Anthony Liguori
2009-04-11 16:25                                     ` Avi Kivity
2009-04-11 20:18                                       ` Anthony Liguori
2009-04-11 21:14                                         ` Avi Kivity
2009-04-12 18:42                                           ` Jamie Lokier
2009-04-14  8:30                                             ` [libvirt] " Daniel P. Berrange
2009-04-14  9:15                                               ` Avi Kivity
2009-04-14  9:17                                                 ` Daniel P. Berrange
2009-04-14  9:29                                                   ` Jan Kiszka
2009-04-14  9:36                                                     ` Avi Kivity
2009-04-14  9:38                                                   ` Avi Kivity
2009-04-14 18:21                                                     ` Jamie Lokier
2009-04-14 18:19                                                 ` Jamie Lokier
2009-04-16  9:03                                                   ` Avi Kivity
2009-04-11 23:16                                       ` Zachary Amsden
2009-04-12  8:23                                         ` Zachary Amsden
2009-04-14  8:28                                           ` Gerd Hoffmann
2009-04-14 18:20                                             ` Jamie Lokier
2009-04-11 19:11                                 ` Avi Kivity
2009-04-11 21:47                                   ` Andreas Färber
2009-04-12 18:44                                     ` Jamie Lokier
2009-04-09 16:01                       ` Jamie Lokier
2009-04-09 14:15           ` [libvirt] " Gerd Hoffmann
2009-04-09 14:19             ` Avi Kivity
2009-04-09 14:56               ` Jan Kiszka
2009-04-09 15:15                 ` François Revol
2009-04-09 15:15                 ` Avi Kivity
2009-04-09 15:49                   ` Jan Kiszka
2009-04-09 16:01                     ` Avi Kivity
2009-04-09 16:07                   ` Jamie Lokier
2009-05-11 20:54 ` Hollis Blanchard
2009-05-11 21:51   ` Anthony Liguori
2009-05-12  8:48     ` Avi Kivity

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=49DE040B.5060107@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=hollisb@us.ibm.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 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.