All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-ppc <qemu-ppc@nongnu.org>,
	"Magnus Damm" <magnus.damm@gmail.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	"Fabien Chouteau" <chouteau@adacore.com>,
	"KONRAD Frederic" <frederic.konrad@adacore.com>,
	qemu-arm <qemu-arm@nongnu.org>,
	"Corey Minyard" <cminyard@mvista.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Aleksandar Markovic" <amarkovic@wavecomp.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Richard Henderson" <rth@twiddle.net>,
	"Paul Burton" <pburton@wavecomp.com>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>
Subject: Re: [PATCH v3 07/33] serial: register vmsd with DeviceClass
Date: Thu, 21 Nov 2019 10:49:50 +0400	[thread overview]
Message-ID: <CAJ+F1CLW1+w3WsUS8ySdU2qLqGy7+0sRhwsTqki1qY+-ij7U2g@mail.gmail.com> (raw)
In-Reply-To: <20191120185420.GF2858@work-vm>

Hi

On Wed, Nov 20, 2019 at 10:54 PM Dr. David Alan Gilbert
<dgilbert@redhat.com> wrote:
>
> * Marc-André Lureau (marcandre.lureau@gmail.com) wrote:
> > On Tue, Nov 19, 2019 at 2:35 PM Peter Maydell <peter.maydell@linaro.org> wrote:
> > >
> > > On Tue, 19 Nov 2019 at 10:23, Marc-André Lureau
> > > <marcandre.lureau@redhat.com> wrote:
> > > > On Mon, Nov 18, 2019 at 6:22 PM Peter Maydell <peter.maydell@linaro.org> wrote:
> > > > > Did you test whether migration still works from a QEMU
> > > > > version without this patch to one with it? (The migration
> > > >
> > > > Yes, I thought I did test correctly, but I realized testing with x86
> > > > isn't correct.
> > > >
> > > > So with arm/musicpal for ex, I can migrate from before->after, however
> > > > after->before won't work. Is that ok?
> > >
> > > Broadly speaking, the only case where we care about not
> > > breaking cross-version migration is where we have a versioned
> > > machine type. So musicpal doesn't matter too much. Beyond
> > > that, yes, generally before->after is more important than
> > > after->before. I have a feeling Red Hat downstream cares about
> > > after->before migration at least for x86 but you or your colleagues
> > > would know that better than me :-)
> > >
> > > > > vmstate code is too complicated for me to be able to figure
> > > > > out whether passing the 'dev' pointer makes a difference
> > > > > to whot it names the state sections and whether the
> > > > > 'qdev_set_legacy_instance_id' suffices to avoid problems.)
> > > >
> > > > I don't see a way to fix after->before, because the instance id is
> > > > initially 0 with the new code, and the old code expect a different
> > > > value.
> > >
> > > Can you explain how the instance ID stuff works? I was
> > > expecting that the result of setting the legacy instance ID
> > > would just be that the new version would always have
> > > the older setting, so if it works for old->new it would also
> > > work for new->old. But as I say I don't understand this bit
> > > of the migration code.
> >
> > From what I understand, the alias_id is only used in
> > savevm.c:find_se(), and thus can only be used to match against
> > "legacy" instance id values. On new code, instance_id is generated
> > incrementally from 0 with calculate_new_instance_id(), based on
> > "qdev-path/vmsd-name".
>
> I think there are cases here there's no qdev path that's viable;
> e.g. for ISA devices, the ID is set to the ISA IO base:
>
> hw/char/serial-isa.c
> 79:    qdev_set_legacy_instance_id(dev, isa->iobase, 3);
>
> (In serial_isa_realizefn )
>
> but to be honest I'd have to trace this out and see what values the
> devices are actually using to be sure.

There is no qdev path, because ISA bus doesn't have get_dev_path()
implemented for some reason.

However, vmstate_register_with_alias_id() will use
calculate_new_instance_id(se->idstr) in this case.

>
> (And yes, please don't break backwards migration; otherwise I'll
> end up having to figure out a fix).

My understanding is that qdev_set_legacy_instance_id() always broke
backward migration.

To keep backward migration to work, we would need a mechanism to
"force" to use legacy instance id.

Would it be acceptable to have a patch that does that when the
original VM state uses legacy instance id?
If you start the VM with the new code path, and try to migrate to the
old / legacy it would fail. But migrating existing old VM back and
forth between old/new would work.





-- 
Marc-André Lureau


  reply	other threads:[~2019-11-21  6:51 UTC|newest]

Thread overview: 99+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 17:31 [PATCH v3 00/33] Clean-ups: qom-ify serial and remove QDEV_PROP_PTR Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 01/33] qdev: remove unused qdev_prop_int64 Marc-André Lureau
2019-11-18 14:01   ` Peter Maydell
2019-11-20  3:36     ` Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 02/33] sysbus: remove unused sysbus_try_create* Marc-André Lureau
2019-10-23 22:35   ` Philippe Mathieu-Daudé
2019-11-18 14:02   ` Peter Maydell
2019-10-23 17:31 ` [PATCH v3 03/33] sysbus: remove outdated comment Marc-André Lureau
2019-10-23 22:36   ` Philippe Mathieu-Daudé
2019-10-23 17:31 ` [PATCH v3 04/33] chardev: generate an internal id when none given Marc-André Lureau
2019-11-18 14:12   ` Peter Maydell
2019-11-18 18:54     ` Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 05/33] serial-pci-multi: factor out multi_serial_get_nr_ports Marc-André Lureau
2019-10-23 22:41   ` Philippe Mathieu-Daudé
2019-10-24  9:59     ` Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 06/33] serial: initial qom-ification Marc-André Lureau
2019-10-24  8:48   ` Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 07/33] serial: register vmsd with DeviceClass Marc-André Lureau
2019-11-18 14:21   ` Peter Maydell
2019-11-19 10:22     ` Marc-André Lureau
2019-11-19 10:33       ` Peter Maydell
2019-11-19 11:57         ` Marc-André Lureau
2019-11-20 18:54           ` Dr. David Alan Gilbert
2019-11-21  6:49             ` Marc-André Lureau [this message]
2019-10-23 17:31 ` [PATCH v3 08/33] serial: add "chardev" property Marc-André Lureau
2019-10-23 22:39   ` Philippe Mathieu-Daudé
2019-11-18 14:23   ` Peter Maydell
2019-10-23 17:31 ` [PATCH v3 09/33] serial: add "baudbase" property Marc-André Lureau
2019-10-23 22:40   ` Philippe Mathieu-Daudé
2019-11-18 14:26   ` Peter Maydell
2019-10-23 17:31 ` [PATCH v3 10/33] serial: add "instance-id" property Marc-André Lureau
2019-11-18 14:29   ` Peter Maydell
2019-11-19 10:32     ` Marc-André Lureau
2019-11-20  9:06   ` Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 11/33] serial: realize the serial device Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 12/33] serial: replace serial_exit_core() with unrealize Marc-André Lureau
2019-11-18 14:32   ` Peter Maydell
2019-11-20 12:32   ` Philippe Mathieu-Daudé
2019-10-23 17:31 ` [PATCH v3 13/33] serial: start making SerialMM a sysbus device Marc-André Lureau
2019-11-18 14:43   ` Peter Maydell
2019-11-20  7:34     ` Marc-André Lureau
2019-11-20 10:36       ` Peter Maydell
2019-11-20 10:40         ` Marc-André Lureau
2019-11-20 10:58           ` Peter Maydell
2019-11-20 11:03             ` Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 14/33] serial-mm: add "regshift" property Marc-André Lureau
2019-11-18 14:54   ` Peter Maydell
2019-11-20  7:53     ` Marc-André Lureau
2019-11-20 10:43       ` Peter Maydell
2019-10-23 17:31 ` [PATCH v3 15/33] serial-mm: add endianness property Marc-André Lureau
2019-11-18 15:02   ` Peter Maydell
2019-11-18 15:07   ` Peter Maydell
2019-11-20  7:59     ` Marc-André Lureau
2019-11-20 12:57   ` Philippe Mathieu-Daudé
2019-10-23 17:31 ` [PATCH v3 16/33] serial-mm: use sysbus facilities Marc-André Lureau
2019-11-18 15:09   ` Peter Maydell
2019-11-20  8:30     ` Marc-André Lureau
2019-11-20 10:46       ` Peter Maydell
2019-10-23 17:31 ` [PATCH v3 17/33] serial: make SerialIO a sysbus device Marc-André Lureau
2019-11-18 15:16   ` Peter Maydell
2019-11-20  8:41     ` Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 18/33] mips: inline serial_init Marc-André Lureau
2019-11-18 15:24   ` Peter Maydell
2019-11-20 11:14     ` Marc-André Lureau
2019-11-20  0:07   ` Aleksandar Markovic
2019-10-23 17:31 ` [PATCH v3 19/33] sm501: make SerialMM a child, export chardev property Marc-André Lureau
2019-10-23 22:57   ` Philippe Mathieu-Daudé
2019-10-24 10:28     ` Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 20/33] vmmouse: replace PROP_PTR with PROP_LINK Marc-André Lureau
2019-10-23 22:59   ` Philippe Mathieu-Daudé
2019-10-23 17:31 ` [PATCH v3 21/33] lance: " Marc-André Lureau
2019-10-23 23:00   ` Philippe Mathieu-Daudé
2019-10-24 11:09     ` Marc-André Lureau
2019-10-24 11:47       ` Philippe Mathieu-Daudé
2019-10-24 11:52         ` Peter Maydell
2019-10-24 18:07           ` Eduardo Habkost
2019-10-25  7:31             ` Peter Maydell
2019-10-24 12:25         ` Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 22/33] etraxfs: remove PROP_PTR usage Marc-André Lureau
2019-11-18 15:28   ` Peter Maydell
2019-10-23 17:31 ` [PATCH v3 23/33] dp8393x: replace PROP_PTR with PROP_LINK Marc-André Lureau
2019-10-23 23:02   ` Philippe Mathieu-Daudé
2019-10-24 11:12     ` Marc-André Lureau
2019-10-24 11:48       ` Philippe Mathieu-Daudé
2019-10-23 17:31 ` [PATCH v3 24/33] leon3: use qemu_irq framework instead of callback as property Marc-André Lureau
2019-11-18 14:15   ` KONRAD Frederic
2019-11-18 15:34   ` Peter Maydell
2019-10-23 17:31 ` [PATCH v3 25/33] sparc: move PIL irq handling to cpu.c Marc-André Lureau
2019-11-18 15:38   ` Peter Maydell
2019-10-23 17:31 ` [PATCH v3 26/33] RFC: mips/cps: fix setting saar property Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 27/33] cris: improve passing PIC interrupt vector to the CPU Marc-André Lureau
2019-11-18 15:40   ` Peter Maydell
2019-10-23 17:31 ` [PATCH v3 28/33] smbus-eeprom: remove PROP_PTR Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 29/33] omap-intc: " Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 30/33] omap-i2c: " Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 31/33] omap-gpio: " Marc-André Lureau
2019-10-23 17:31 ` [PATCH v3 32/33] qdev: remove PROP_MEMORY_REGION Marc-André Lureau
2019-10-23 23:07   ` Philippe Mathieu-Daudé
2019-10-23 17:31 ` [PATCH v3 33/33] qdev: remove QDEV_PROP_PTR Marc-André Lureau

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=CAJ+F1CLW1+w3WsUS8ySdU2qLqGy7+0sRhwsTqki1qY+-ij7U2g@mail.gmail.com \
    --to=marcandre.lureau@gmail.com \
    --cc=amarkovic@wavecomp.com \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=berrange@redhat.com \
    --cc=chouteau@adacore.com \
    --cc=cminyard@mvista.com \
    --cc=dgilbert@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=frederic.konrad@adacore.com \
    --cc=hpoussin@reactos.org \
    --cc=jasowang@redhat.com \
    --cc=magnus.damm@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=pburton@wavecomp.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    /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.