* [Qemu-devel] [PATCH 0/2] pcspk migration compatibility
@ 2016-11-28 13:31 Dr. David Alan Gilbert (git)
2016-11-28 13:32 ` [Qemu-devel] [PATCH 1/2] migration/pcspk: Add a property to state if pcspk is migrated Dr. David Alan Gilbert (git)
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2016-11-28 13:31 UTC (permalink / raw)
To: qemu-devel, kraxel, quintela, amit.shah, pavel.dovgaluk
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Hi,
39c88f56 added VMState for pcspk but turned it on for
all machine types, this breaks backwards compatibility
to older machine types.
If this is too late for 2.8 then I suggest we take the 1st
of these two patches, which just makes it a property to flip
for those of us who need it. Adding the 2nd patch after 2.8
might cause problems for people using 2.8 with 2.7 machine
type.
Dave
Dr. David Alan Gilbert (2):
migration/pcspk: Add a property to state if pcspk is migrated
migration/pcspk: Turn migration of pcspk off for 2.7 and older
hw/audio/pcspk.c | 10 ++++++++++
include/hw/i386/pc.h | 5 +++++
2 files changed, 15 insertions(+)
--
2.9.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH 1/2] migration/pcspk: Add a property to state if pcspk is migrated
2016-11-28 13:31 [Qemu-devel] [PATCH 0/2] pcspk migration compatibility Dr. David Alan Gilbert (git)
@ 2016-11-28 13:32 ` Dr. David Alan Gilbert (git)
2016-11-28 13:32 ` [Qemu-devel] [PATCH 2/2] migration/pcspk: Turn migration of pcspk off for 2.7 and older Dr. David Alan Gilbert (git)
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2016-11-28 13:32 UTC (permalink / raw)
To: qemu-devel, kraxel, quintela, amit.shah, pavel.dovgaluk
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Allow us to turn migration of pcspk off for compatibility.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
hw/audio/pcspk.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index 984534b..7980022 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -54,6 +54,7 @@ typedef struct {
unsigned int play_pos;
uint8_t data_on;
uint8_t dummy_refresh_clock;
+ bool migrate;
} PCSpkState;
static const char *s_spk = "pcspk";
@@ -187,11 +188,19 @@ static void pcspk_realizefn(DeviceState *dev, Error **errp)
pcspk_state = s;
}
+static bool migrate_needed(void *opaque)
+{
+ PCSpkState *s = opaque;
+
+ return s->migrate;
+}
+
static const VMStateDescription vmstate_spk = {
.name = "pcspk",
.version_id = 1,
.minimum_version_id = 1,
.minimum_version_id_old = 1,
+ .needed = migrate_needed,
.fields = (VMStateField[]) {
VMSTATE_UINT8(data_on, PCSpkState),
VMSTATE_UINT8(dummy_refresh_clock, PCSpkState),
@@ -201,6 +210,7 @@ static const VMStateDescription vmstate_spk = {
static Property pcspk_properties[] = {
DEFINE_PROP_UINT32("iobase", PCSpkState, iobase, -1),
+ DEFINE_PROP_BOOL("migrate", PCSpkState, migrate, true),
DEFINE_PROP_END_OF_LIST(),
};
--
2.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH 2/2] migration/pcspk: Turn migration of pcspk off for 2.7 and older
2016-11-28 13:31 [Qemu-devel] [PATCH 0/2] pcspk migration compatibility Dr. David Alan Gilbert (git)
2016-11-28 13:32 ` [Qemu-devel] [PATCH 1/2] migration/pcspk: Add a property to state if pcspk is migrated Dr. David Alan Gilbert (git)
@ 2016-11-28 13:32 ` Dr. David Alan Gilbert (git)
2016-11-28 15:09 ` [Qemu-devel] [PATCH 0/2] pcspk migration compatibility Paolo Bonzini
2016-11-29 5:54 ` Amit Shah
3 siblings, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2016-11-28 13:32 UTC (permalink / raw)
To: qemu-devel, kraxel, quintela, amit.shah, pavel.dovgaluk
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To keep backwards migration compatibility allow us to turn pcspk
migration off.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
include/hw/i386/pc.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 67a1a9e..4b74130 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -395,6 +395,11 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
.driver = "Opteron_G3" "-" TYPE_X86_CPU,\
.property = "stepping",\
.value = "1",\
+ },\
+ {\
+ .driver = "isa-pcspk",\
+ .property = "migrate",\
+ .value = "off",\
},
#define PC_COMPAT_2_6 \
--
2.9.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 0/2] pcspk migration compatibility
2016-11-28 13:31 [Qemu-devel] [PATCH 0/2] pcspk migration compatibility Dr. David Alan Gilbert (git)
2016-11-28 13:32 ` [Qemu-devel] [PATCH 1/2] migration/pcspk: Add a property to state if pcspk is migrated Dr. David Alan Gilbert (git)
2016-11-28 13:32 ` [Qemu-devel] [PATCH 2/2] migration/pcspk: Turn migration of pcspk off for 2.7 and older Dr. David Alan Gilbert (git)
@ 2016-11-28 15:09 ` Paolo Bonzini
2016-11-28 15:12 ` Dr. David Alan Gilbert
2016-11-29 5:54 ` Amit Shah
3 siblings, 1 reply; 6+ messages in thread
From: Paolo Bonzini @ 2016-11-28 15:09 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git), qemu-devel, kraxel, quintela,
amit.shah, pavel.dovgaluk
On 28/11/2016 14:31, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Hi,
> 39c88f56 added VMState for pcspk but turned it on for
> all machine types, this breaks backwards compatibility
> to older machine types.
>
> If this is too late for 2.8 then I suggest we take the 1st
> of these two patches, which just makes it a property to flip
> for those of us who need it. Adding the 2nd patch after 2.8
> might cause problems for people using 2.8 with 2.7 machine
> type.
>
> Dave
>
> Dr. David Alan Gilbert (2):
> migration/pcspk: Add a property to state if pcspk is migrated
> migration/pcspk: Turn migration of pcspk off for 2.7 and older
>
> hw/audio/pcspk.c | 10 ++++++++++
> include/hw/i386/pc.h | 5 +++++
> 2 files changed, 15 insertions(+)
>
Wow, I didn't know optional sections existed. We could have used it for
hw/char/parallel.c, but that was added only a couple months before
optional sections.
Queued for 2.8.
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 0/2] pcspk migration compatibility
2016-11-28 15:09 ` [Qemu-devel] [PATCH 0/2] pcspk migration compatibility Paolo Bonzini
@ 2016-11-28 15:12 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 6+ messages in thread
From: Dr. David Alan Gilbert @ 2016-11-28 15:12 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, kraxel, quintela, amit.shah, pavel.dovgaluk
* Paolo Bonzini (pbonzini@redhat.com) wrote:
>
>
> On 28/11/2016 14:31, Dr. David Alan Gilbert (git) wrote:
> > From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> > Hi,
> > 39c88f56 added VMState for pcspk but turned it on for
> > all machine types, this breaks backwards compatibility
> > to older machine types.
> >
> > If this is too late for 2.8 then I suggest we take the 1st
> > of these two patches, which just makes it a property to flip
> > for those of us who need it. Adding the 2nd patch after 2.8
> > might cause problems for people using 2.8 with 2.7 machine
> > type.
> >
> > Dave
> >
> > Dr. David Alan Gilbert (2):
> > migration/pcspk: Add a property to state if pcspk is migrated
> > migration/pcspk: Turn migration of pcspk off for 2.7 and older
> >
> > hw/audio/pcspk.c | 10 ++++++++++
> > include/hw/i386/pc.h | 5 +++++
> > 2 files changed, 15 insertions(+)
> >
>
> Wow, I didn't know optional sections existed. We could have used it for
> hw/char/parallel.c, but that was added only a couple months before
> optional sections.
I'd forgotten that they existed and was about to write them to
solve this problem, and then found the code I apparently reviewed
a year or so ago :-)
> Queued for 2.8.
Thanks.
Dave
> Paolo
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 0/2] pcspk migration compatibility
2016-11-28 13:31 [Qemu-devel] [PATCH 0/2] pcspk migration compatibility Dr. David Alan Gilbert (git)
` (2 preceding siblings ...)
2016-11-28 15:09 ` [Qemu-devel] [PATCH 0/2] pcspk migration compatibility Paolo Bonzini
@ 2016-11-29 5:54 ` Amit Shah
3 siblings, 0 replies; 6+ messages in thread
From: Amit Shah @ 2016-11-29 5:54 UTC (permalink / raw)
To: Dr. David Alan Gilbert (git); +Cc: qemu-devel, kraxel, quintela, pavel.dovgaluk
On (Mon) 28 Nov 2016 [13:31:59], Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
>
> Hi,
> 39c88f56 added VMState for pcspk but turned it on for
> all machine types, this breaks backwards compatibility
> to older machine types.
>
> If this is too late for 2.8 then I suggest we take the 1st
> of these two patches, which just makes it a property to flip
> for those of us who need it. Adding the 2nd patch after 2.8
> might cause problems for people using 2.8 with 2.7 machine
> type.
Reviewed-by: Amit Shah <amit.shah@redhat.com>
We should take both for 2.8, thanks!
Amit
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-11-29 5:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-28 13:31 [Qemu-devel] [PATCH 0/2] pcspk migration compatibility Dr. David Alan Gilbert (git)
2016-11-28 13:32 ` [Qemu-devel] [PATCH 1/2] migration/pcspk: Add a property to state if pcspk is migrated Dr. David Alan Gilbert (git)
2016-11-28 13:32 ` [Qemu-devel] [PATCH 2/2] migration/pcspk: Turn migration of pcspk off for 2.7 and older Dr. David Alan Gilbert (git)
2016-11-28 15:09 ` [Qemu-devel] [PATCH 0/2] pcspk migration compatibility Paolo Bonzini
2016-11-28 15:12 ` Dr. David Alan Gilbert
2016-11-29 5:54 ` Amit Shah
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).