From: Anthony Liguori <aliguori@us.ibm.com>
To: Avi Kivity <avi@redhat.com>
Cc: owasserm@redhat.com, quintela@redhat.com, qemu-devel@nongnu.org,
Michael Roth <mdroth@linux.vnet.ibm.com>,
yamahata@valinux.co.jp, pbonzini@redhat.com, akong@redhat.com,
afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH 01/17] qidl: add QEMU IDL processor
Date: Wed, 06 Jun 2012 16:27:58 +0800 [thread overview]
Message-ID: <4FCF148E.8000104@us.ibm.com> (raw)
In-Reply-To: <4FCF0AA0.5090105@redhat.com>
On 06/06/2012 03:45 PM, Avi Kivity wrote:
> On 06/06/2012 02:51 AM, Anthony Liguori wrote:
>>>> +during device construction and never changes. This means we can add an
>>>> +**_immutable** marker to it:
>>>
>>> Even if it does change (suppose we add a monitor command to retarget a
>>> the serial device's chardev), it need not be migrated since it doesn't
>>> describe guest state, only host state. Maybe we should mark *chr _host
>>> instead of _immutable.
>>
>> No, this is just another example of C's type system sucking and being
>> ambiguous.
>>
>> Consider the following example:
>>
>> struct PS2Keyboard {
>> DeviceState parent;
>>
>> PCKBDState _immutable *controller; // link
>> ...
>> };
>>
>> This is definitely '_immutable' even though *something* has to marshal
>> that PCKBDState. That's because this is a reference to an externally
>> managed object. As long as references don't change due to guest
>> initiated actions, they're immutable.
>
> In fact C allows you to express this:
>
> const T *foo; // *foo may not change, but foo may
> T * const foo; // foo may not change, but *foo may
>
> Although every time I see this, I have to stop and think, which activity
> I usually try to avoid. So your example would be written
>
> PCKBDState * _immutable controller; // link
>
> if we adopt the same system.
I think you meant to add a const in there, but yeah, I know.
> But I wasn't referring to that at all.
> Instead, some state is simply not relevant to the guest view, even
> though it is state. We don't have a lot of that since most host state
> is behind nice interfaces, but think of a vga device that keeps track of
> the host window size and alt-ctrl status. Those are not guest state and
> need not be migrated.
Both the host window size and alt-ctrl status are not device state. They are
host backend state and they ought to be stored in a different data structure.
This is exactly how we do it (both things are stored in sdl.c or vnc.c).
If we're storing mutable host state in a device structure, that's a bug IMHO.
That's sort of the premise of the QIDL annotations at least.
>> In the case of a CharDriverState, the reference is always immutable. If
>> we supported changing char backends dynamically, it would not happen by
>> changing the reference, but almost certainly by having the ability to
>> reopen the char driver in place. IOW, while the referenced object
>> changes, the reference doesn't change.
>
> In either case, state changes. The reason we don't send it over is
> because it's not guest state, not because we reopen in place or not (and
> migration shouldn't depend on how we choose to implement changing
> chardev backends -- reopen or delete/new).
Well the goal is here not to support any possible way of separating guest state
and host state. The goal is here is to be very opinionated about how we
separate guest and host state such that we can take a rigorous approach to
migrating guest state.
I think we're actually pretty good today about separating host and guest state.
I can't think of an example within devices where we don't cleanly separate
things outside of block devices.
Regards,
Anthony Liguori
>
>
next prev parent reply other threads:[~2012-06-06 8:28 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-05 1:00 [Qemu-devel] [RFC] Use QEMU IDL for device serialization/vmstate Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 01/17] qidl: add QEMU IDL processor Michael Roth
2012-06-05 1:57 ` Anthony Liguori
2012-06-05 9:25 ` Kevin Wolf
2012-06-05 9:47 ` Anthony Liguori
2012-06-05 10:11 ` Kevin Wolf
2012-06-05 16:21 ` Michael Roth
2012-06-05 19:56 ` Paolo Bonzini
2012-06-05 23:40 ` Anthony Liguori
2012-06-06 5:12 ` Paolo Bonzini
2012-06-06 5:43 ` Anthony Liguori
2012-06-06 7:30 ` Kevin Wolf
2012-06-05 10:00 ` Peter Maydell
2012-06-05 10:10 ` Anthony Liguori
2012-06-11 7:13 ` Andreas Färber
2012-06-11 7:20 ` Paolo Bonzini
2012-06-11 7:56 ` Andreas Färber
2012-06-11 7:59 ` Paolo Bonzini
2012-06-11 9:02 ` Andreas Färber
2012-06-11 8:04 ` Andreas Färber
2012-06-11 13:12 ` Anthony Liguori
2012-06-11 13:37 ` Peter Maydell
2012-06-11 13:09 ` Peter Maydell
2012-06-05 10:06 ` Avi Kivity
2012-06-05 12:19 ` Gerd Hoffmann
2012-06-05 23:41 ` Anthony Liguori
2012-06-06 7:19 ` Avi Kivity
2012-06-05 21:11 ` Michael Roth
2012-06-06 7:31 ` Avi Kivity
2012-06-06 21:36 ` Michael Roth
2012-06-07 7:08 ` Avi Kivity
2012-06-05 23:51 ` Anthony Liguori
2012-06-06 1:25 ` Peter Maydell
2012-06-06 7:45 ` Avi Kivity
2012-06-06 8:27 ` Anthony Liguori [this message]
2012-06-06 8:37 ` Avi Kivity
2012-06-06 8:45 ` Anthony Liguori
2012-06-06 8:59 ` Avi Kivity
2012-06-06 9:17 ` Anthony Liguori
2012-06-06 9:58 ` Avi Kivity
2012-06-06 11:12 ` Anthony Liguori
2012-06-06 11:25 ` Avi Kivity
2012-06-06 23:20 ` Anthony Liguori
2012-06-05 1:00 ` [Qemu-devel] [PATCH 02/17] qidl: add qc definitions Michael Roth
2012-06-05 9:25 ` Kevin Wolf
2012-06-05 10:35 ` Jan Kiszka
2012-06-05 11:12 ` Anthony Liguori
2012-06-05 11:26 ` Jan Kiszka
2012-06-05 11:42 ` Kevin Wolf
2012-06-05 14:08 ` Paolo Bonzini
2012-06-05 21:44 ` Michael Roth
2012-06-05 23:35 ` Anthony Liguori
2012-06-05 1:00 ` [Qemu-devel] [PATCH 03/17] qapi: add visitor interfaces for arrays Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 04/17] qapi: QmpOutputVisitor, implement array handling Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 05/17] qapi: qapi-visit.py, support arrays and complex qapi definitions Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 06/17] qapi: qapi-visit.py, add gen support for existing types Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 07/17] qapi: add open-coded visitors for QEMUTimer/struct tm types Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 08/17] rtc: move RTCState declaration to header Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 09/17] rtc: add qc annotations Michael Roth
2012-06-05 10:25 ` Avi Kivity
2012-06-05 10:40 ` Jan Kiszka
2012-06-05 12:42 ` Avi Kivity
2012-06-05 22:07 ` Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 10/17] Makefile: add infrastructure to incorporate qidl-generated files Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 11/17] qapi: add qidl-generated qapi schema for rtc Michael Roth
2012-06-05 9:29 ` Kevin Wolf
2012-06-05 16:03 ` Michael Roth
2012-06-06 7:38 ` Kevin Wolf
2012-06-06 22:40 ` Michael Roth
2012-06-05 10:11 ` Avi Kivity
2012-06-05 1:00 ` [Qemu-devel] [PATCH 12/17] rtc: add a QOM property for accessing device state Michael Roth
2012-06-05 14:14 ` Paolo Bonzini
2012-06-05 17:54 ` Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 13/17] rtc: add _version() qidl annotations Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 14/17] qidl: add qidl-based generation of vmstate field bindings Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 15/17] Makefile: add qidl-generation of vmstate field descriptions Michael Roth
2012-06-05 1:00 ` [Qemu-devel] [PATCH 16/17] qidl: add qidl-generated vmstate fields for rtc Michael Roth
2012-06-05 10:26 ` Avi Kivity
2012-06-05 23:38 ` Anthony Liguori
2012-06-06 7:47 ` Avi Kivity
2012-06-05 1:00 ` [Qemu-devel] [PATCH 17/17] rtc: use qidl-generated vmstate bindings Michael Roth
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=4FCF148E.8000104@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=afaerber@suse.de \
--cc=akong@redhat.com \
--cc=avi@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=owasserm@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=yamahata@valinux.co.jp \
/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).