qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 01/37] qdev: remove unused qdev_prop_int64


From: Marc-André Lureau
Subject: Re: [PATCH v4 01/37] qdev: remove unused qdev_prop_int64
Date: Mon, 2 Dec 2019 14:29:34 +0400

Hi

On Mon, Dec 2, 2019 at 9:23 AM Markus Armbruster <address@hidden> wrote:
>
> Marc-André Lureau <address@hidden> writes:
>
> > Signed-off-by: Marc-André Lureau <address@hidden>
> > ---
> >  hw/core/qdev-properties.c    | 32 --------------------------------
> >  include/hw/qdev-properties.h |  3 ---
> >  2 files changed, 35 deletions(-)
> >
> > diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> > index ac28890e5a..be4cb01f0b 100644
> > --- a/hw/core/qdev-properties.c
> > +++ b/hw/core/qdev-properties.c
> > @@ -409,31 +409,6 @@ static void set_uint64(Object *obj, Visitor *v, const 
> > char *name,
> >      visit_type_uint64(v, name, ptr, errp);
> >  }
> >
> > -static void get_int64(Object *obj, Visitor *v, const char *name,
> > -                      void *opaque, Error **errp)
> > -{
> > -    DeviceState *dev = DEVICE(obj);
> > -    Property *prop = opaque;
> > -    int64_t *ptr = qdev_get_prop_ptr(dev, prop);
> > -
> > -    visit_type_int64(v, name, ptr, errp);
> > -}
> > -
> > -static void set_int64(Object *obj, Visitor *v, const char *name,
> > -                      void *opaque, Error **errp)
> > -{
> > -    DeviceState *dev = DEVICE(obj);
> > -    Property *prop = opaque;
> > -    int64_t *ptr = qdev_get_prop_ptr(dev, prop);
> > -
> > -    if (dev->realized) {
> > -        qdev_prop_set_after_realize(dev, name, errp);
> > -        return;
> > -    }
> > -
> > -    visit_type_int64(v, name, ptr, errp);
> > -}
> > -
> >  const PropertyInfo qdev_prop_uint64 = {
> >      .name  = "uint64",
> >      .get   = get_uint64,
> > @@ -441,13 +416,6 @@ const PropertyInfo qdev_prop_uint64 = {
> >      .set_default_value = set_default_value_uint,
> >  };
> >
> > -const PropertyInfo qdev_prop_int64 = {
> > -    .name  = "int64",
> > -    .get   = get_int64,
> > -    .set   = set_int64,
> > -    .set_default_value = set_default_value_int,
> > -};
> > -
> >  /* --- string --- */
> >
> >  static void release_string(Object *obj, const char *name, void *opaque)
> > diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
> > index c6a8cb5516..690ff07ae2 100644
> > --- a/include/hw/qdev-properties.h
> > +++ b/include/hw/qdev-properties.h
> > @@ -13,7 +13,6 @@ extern const PropertyInfo qdev_prop_uint16;
> >  extern const PropertyInfo qdev_prop_uint32;
> >  extern const PropertyInfo qdev_prop_int32;
> >  extern const PropertyInfo qdev_prop_uint64;
> > -extern const PropertyInfo qdev_prop_int64;
> >  extern const PropertyInfo qdev_prop_size;
> >  extern const PropertyInfo qdev_prop_string;
> >  extern const PropertyInfo qdev_prop_chr;
> > @@ -164,8 +163,6 @@ extern const PropertyInfo qdev_prop_pcie_link_width;
> >      DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_int32, int32_t)
> >  #define DEFINE_PROP_UINT64(_n, _s, _f, _d)                      \
> >      DEFINE_PROP_UNSIGNED(_n, _s, _f, _d, qdev_prop_uint64, uint64_t)
> > -#define DEFINE_PROP_INT64(_n, _s, _f, _d)                      \
> > -    DEFINE_PROP_SIGNED(_n, _s, _f, _d, qdev_prop_int64, int64_t)
> >  #define DEFINE_PROP_SIZE(_n, _s, _f, _d)                       \
> >      DEFINE_PROP_UNSIGNED(_n, _s, _f, _d, qdev_prop_size, uint64_t)
> >  #define DEFINE_PROP_PCI_DEVFN(_n, _s, _f, _d)                   \
>
> History of its use:
>
>     Author: Peter Xu <address@hidden>
>     Date:   Tue Jul 18 11:39:01 2017 +0800
>
>         qdev: provide DEFINE_PROP_INT64()
>
>         We have nearly all the stuff, but this one is missing. Add it in.
>
>         Am going to use this new helper for MigrationParameters fields, since
>         most of them are int64_t.
>
>         CC: Markus Armbruster <address@hidden>
>         CC: Eduardo Habkost <address@hidden>
>         CC: Marc-André Lureau <address@hidden>
>         CC: Peter Xu <address@hidden>
>         CC: Juan Quintela <address@hidden>
>         CC: Marcel Apfelbaum <address@hidden>
>         CC: Eric Blake <address@hidden>
>         Reviewed-by: Marc-André Lureau <address@hidden>
>         Reviewed-by: Marcel Apfelbaum <address@hidden>
>         Reviewed-by: Juan Quintela <address@hidden>
>         Reviewed-by: Eduardo Habkost <address@hidden>
>         Signed-off-by: Peter Xu <address@hidden>
>         Message-Id: <address@hidden>
>         Signed-off-by: Juan Quintela <address@hidden>
>
>     commit 89632fafdc64927647b6f45416307cd3d4c746db
>     Author: Peter Xu <address@hidden>
>     Date:   Tue Jul 18 11:39:02 2017 +0800
>
>         migration: export parameters to props
>
>         Export migration parameters to qdev properties. Then we can use, for
>         example:
>
>           -global migration.x-cpu-throttle-initial=xxx
>
>         To specify migration parameters during init.
>
>         Prefix "x-" is appended for each parameter exported to show that this 
> is
>         not a stable interface, and only for debugging/testing purpose.
>
>         Reviewed-by: Juan Quintela <address@hidden>
>         Signed-off-by: Peter Xu <address@hidden>
>         Message-Id: <address@hidden>
>         Signed-off-by: Juan Quintela <address@hidden>
>
>     [More commits adding uses...]
>
>     commit 741d4086c856320807a2575389d7c0505578270b
>     Author: Juan Quintela <address@hidden>
>     Date:   Fri Dec 1 13:08:38 2017 +0100
>
>         migration: Use proper types in json
>
>         We use int for everything (int64_t), and then we check that value is
>         between 0 and 255.  Change it to the valid types.
>
>         This change only happens for HMP.  QMP always use bytes and similar.
>
>         Signed-off-by: Juan Quintela <address@hidden>
>         Reviewed-by: Eric Blake <address@hidden>
>
>     [All uses gone again]
>
> We can remove it now, and revert the removal when new uses pop up.
> Churn.  I'd say remove if we think new uses are unlikely.  I doubt they
> are.
>

Oh, somehow I missed those users. I thought the code had never been
exercised. Ok, let's keep it for now.




reply via email to

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