qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 10/33] serial: add "instance-id" property


From: Marc-André Lureau
Subject: Re: [PATCH v3 10/33] serial: add "instance-id" property
Date: Tue, 19 Nov 2019 14:32:27 +0400

Hi

On Mon, Nov 18, 2019 at 6:30 PM Peter Maydell <address@hidden> wrote:
>
> On Wed, 23 Oct 2019 at 18:33, Marc-André Lureau
> <address@hidden> wrote:
> >
> > This property will be used to move common vmstate registration to
> > device realize in following patch.
> >
> > Signed-off-by: Marc-André Lureau <address@hidden>
> > ---
> >  hw/char/serial.c         | 3 +++
> >  include/hw/char/serial.h | 1 +
> >  2 files changed, 4 insertions(+)
> >
> > diff --git a/hw/char/serial.c b/hw/char/serial.c
> > index 069d8715d0..0b61a71e4e 100644
> > --- a/hw/char/serial.c
> > +++ b/hw/char/serial.c
> > @@ -990,6 +990,7 @@ SerialState *serial_init(int base, qemu_irq irq, int 
> > baudbase,
> >      s->irq = irq;
> >      qdev_prop_set_uint32(dev, "baudbase", baudbase);
> >      qdev_prop_set_chr(dev, "chardev", chr);
> > +    qdev_prop_set_int32(dev, "instance-id", base);
> >      serial_realize_core(s, &error_fatal);
> >      qdev_set_legacy_instance_id(dev, base, 2);
> >      qdev_init_nofail(dev);
> > @@ -1003,6 +1004,7 @@ SerialState *serial_init(int base, qemu_irq irq, int 
> > baudbase,
> >  static Property serial_properties[] = {
> >      DEFINE_PROP_CHR("chardev", SerialState, chr),
> >      DEFINE_PROP_UINT32("baudbase", SerialState, baudbase, 115200),
> > +    DEFINE_PROP_INT32("instance-id", SerialState, instance_id, 0),
>
> This could use an explanatory comment, because I have no
> idea what it does or when a user of the device would want
> or need to set it... (I am guessing that part of the answer
> may be "needed only by legacy users of this device that don't
> want to break migration compatibility" ?)

That's right, I'll add that comment.

>
> >      DEFINE_PROP_END_OF_LIST(),
> >  };
>
> thanks
> -- PMM
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]