[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/4] char: add a post_load callback
From: |
Anthony Liguori |
Subject: |
Re: [Qemu-devel] [PATCH 1/4] char: add a post_load callback |
Date: |
Wed, 20 Mar 2013 13:59:10 -0500 |
User-agent: |
Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) |
Alon Levy <address@hidden> writes:
>> Alon Levy <address@hidden> writes:
>>
>> > Signed-off-by: Alon Levy <address@hidden>
>> > ---
>> > include/char/char.h | 12 ++++++++++++
>> > qemu-char.c | 7 +++++++
>> > 2 files changed, 19 insertions(+)
>> >
>> > diff --git a/include/char/char.h b/include/char/char.h
>> > index 0326b2a..0fdcaf9 100644
>> > --- a/include/char/char.h
>> > +++ b/include/char/char.h
>> > @@ -70,6 +70,7 @@ struct CharDriverState {
>> > void (*chr_set_echo)(struct CharDriverState *chr, bool echo);
>> > void (*chr_guest_open)(struct CharDriverState *chr);
>> > void (*chr_guest_close)(struct CharDriverState *chr);
>> > + void (*chr_post_load)(struct CharDriverState *chr, int
>> > connected);
>>
>> The character device layer should *not* be messing around with
>> notifying
>> migration state.
>>
>> I thought we previously discussed this? Just implement a migration
>> hook
>> in the spice code.
>
> The thing Gerd objected to when I sent a patch doing just that was the
> way I used the vmstate, one possible way to not have to use vmstate at
> all is adding api for querying the current front end connected status,
> like qemu_fe_is_connected. Is that acceptable?
To determine if the backend is connected? If so, it's fine, but I'd
suggest being more explicit and calling it qemu_fe_is_be_connected().
Regards,
Anthony Liguori
>
>>
>> Regards,
>>
>> Anthony Liguori
>>
>> > void *opaque;
>> > int idle_tag;
>> > char *label;
>> > @@ -144,6 +145,17 @@ void qemu_chr_fe_open(struct CharDriverState
>> > *chr);
>> > void qemu_chr_fe_close(struct CharDriverState *chr);
>> >
>> > /**
>> > + * @qemu_chr_fe_post_load:
>> > + *
>> > + * Indicate to backend that a migration has just completed. Must
>> > be called when
>> > + * the vm is in the running state.
>> > + *
>> > + * @connected true if frontend is still connected after migration,
>> > false
>> > + * otherwise.
>> > + */
>> > +void qemu_chr_fe_post_load(struct CharDriverState *chr, int
>> > connected);
>> > +
>> > +/**
>> > * @qemu_chr_fe_printf:
>> > *
>> > * Write to a character backend using a printf style interface.
>> > diff --git a/qemu-char.c b/qemu-char.c
>> > index 4e011df..42c911f 100644
>> > --- a/qemu-char.c
>> > +++ b/qemu-char.c
>> > @@ -3390,6 +3390,13 @@ void qemu_chr_fe_open(struct CharDriverState
>> > *chr)
>> > }
>> > }
>> >
>> > +void qemu_chr_fe_post_load(struct CharDriverState *chr, int
>> > connected)
>> > +{
>> > + if (chr->chr_post_load) {
>> > + chr->chr_post_load(chr, connected);
>> > + }
>> > +}
>> > +
>> > void qemu_chr_fe_close(struct CharDriverState *chr)
>> > {
>> > if (chr->chr_guest_close) {
>> > --
>> > 1.8.1.4
>>
>>
>>
- [Qemu-devel] [PATCH v2 0/4] for spice post load char device hook, Alon Levy, 2013/03/20
- [Qemu-devel] [PATCH 2/4] virtio-serial: add a post_load callback implemented by port, Alon Levy, 2013/03/20
- [Qemu-devel] [PATCH 1/4] char: add a post_load callback, Alon Levy, 2013/03/20
- Re: [Qemu-devel] [PATCH 1/4] char: add a post_load callback, Alon Levy, 2013/03/20
- Re: [Qemu-devel] [PATCH 1/4] char: add a post_load callback,
Anthony Liguori <=
- Re: [Qemu-devel] [PATCH 1/4] char: add a post_load callback, Hans de Goede, 2013/03/21
- Re: [Qemu-devel] [PATCH 1/4] char: add a post_load callback, Hans de Goede, 2013/03/21
- [Qemu-devel] [PATCH v3 0/2] spice-qemu-char fix agent mouse after migration, Alon Levy, 2013/03/21
- [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected, Alon Levy, 2013/03/21
- Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected, Anthony Liguori, 2013/03/21
- Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected, Alon Levy, 2013/03/21
- Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected, Anthony Liguori, 2013/03/21
- Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected, Alon Levy, 2013/03/21
- Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected, Alon Levy, 2013/03/21
- Re: [Qemu-devel] [PATCH 1/2] char: add qemu_chr_be_is_fe_connected, Hans de Goede, 2013/03/22