[Qemu-devel] [PATCH v2] spapr/vio: remove the "irq" property"

Cédric Le Goater posted 1 patch 5 years, 2 months ago
Test asan passed
Test checkpatch passed
Test docker-clang@ubuntu passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190109143119.9972-1-clg@kaod.org
Maintainers: David Gibson <david@gibson.dropbear.id.au>
qemu-deprecated.texi |  6 ------
hw/ppc/spapr_vio.c   | 47 ++++++--------------------------------------
2 files changed, 6 insertions(+), 47 deletions(-)
[Qemu-devel] [PATCH v2] spapr/vio: remove the "irq" property"
Posted by Cédric Le Goater 5 years, 2 months ago
commit efe2add7cb7f ("spapr/vio: deprecate the "irq" property") was
merged in QEMU version 3.0. The "irq" property" can be removed for
QEMU version 4.0.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
---
 qemu-deprecated.texi |  6 ------
 hw/ppc/spapr_vio.c   | 47 ++++++--------------------------------------
 2 files changed, 6 insertions(+), 47 deletions(-)

diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index c3735b698ee4..eb5cd2a72d41 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -168,9 +168,3 @@ Example of legacy encoding:
 The above, converted to the current supported format:
 
 @code{json:@{"file.driver":"rbd", "file.pool":"rbd", "file.image":"name"@}}
-
-@subsection vio-spapr-device device options
-
-@subsubsection "irq": "" (since 3.0.0)
-
-The ``irq'' property is obsoleted.
diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
index 7e8a9ad09337..414673d31341 100644
--- a/hw/ppc/spapr_vio.c
+++ b/hw/ppc/spapr_vio.c
@@ -44,38 +44,6 @@
 
 #define SPAPR_VIO_REG_BASE 0x71000000
 
-static void spapr_vio_get_irq(Object *obj, Visitor *v, const char *name,
-                              void *opaque, Error **errp)
-{
-    Property *prop = opaque;
-    uint32_t *ptr = qdev_get_prop_ptr(DEVICE(obj), prop);
-
-    visit_type_uint32(v, name, ptr, errp);
-}
-
-static void spapr_vio_set_irq(Object *obj, Visitor *v, const char *name,
-                              void *opaque, Error **errp)
-{
-    Property *prop = opaque;
-    uint32_t *ptr = qdev_get_prop_ptr(DEVICE(obj), prop);
-
-    if (!qtest_enabled()) {
-        warn_report(TYPE_VIO_SPAPR_DEVICE " '%s' property is deprecated", name);
-    }
-    visit_type_uint32(v, name, ptr, errp);
-}
-
-static const PropertyInfo spapr_vio_irq_propinfo = {
-    .name = "irq",
-    .get = spapr_vio_get_irq,
-    .set = spapr_vio_set_irq,
-};
-
-static Property spapr_vio_props[] = {
-    DEFINE_PROP("irq", VIOsPAPRDevice, irq, spapr_vio_irq_propinfo, uint32_t),
-    DEFINE_PROP_END_OF_LIST(),
-};
-
 static char *spapr_vio_get_dev_name(DeviceState *qdev)
 {
     VIOsPAPRDevice *dev = VIO_SPAPR_DEVICE(qdev);
@@ -534,15 +502,13 @@ static void spapr_vio_busdev_realize(DeviceState *qdev, Error **errp)
         dev->qdev.id = id;
     }
 
-    if (!dev->irq) {
-        dev->irq = spapr_vio_reg_to_irq(dev->reg);
+    dev->irq = spapr_vio_reg_to_irq(dev->reg);
 
-        if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
-            dev->irq = spapr_irq_findone(spapr, &local_err);
-            if (local_err) {
-                error_propagate(errp, local_err);
-                return;
-            }
+    if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
+        dev->irq = spapr_irq_findone(spapr, &local_err);
+        if (local_err) {
+            error_propagate(errp, local_err);
+            return;
         }
     }
 
@@ -668,7 +634,6 @@ static void vio_spapr_device_class_init(ObjectClass *klass, void *data)
     k->realize = spapr_vio_busdev_realize;
     k->reset = spapr_vio_busdev_reset;
     k->bus_type = TYPE_SPAPR_VIO_BUS;
-    k->props = spapr_vio_props;
 }
 
 static const TypeInfo spapr_vio_type_info = {
-- 
2.20.1


Re: [Qemu-devel] [PATCH v2] spapr/vio: remove the "irq" property"
Posted by David Gibson 5 years, 2 months ago
On Wed, Jan 09, 2019 at 03:31:19PM +0100, Cédric Le Goater wrote:
> commit efe2add7cb7f ("spapr/vio: deprecate the "irq" property") was
> merged in QEMU version 3.0. The "irq" property" can be removed for
> QEMU version 4.0.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Greg Kurz <groug@kaod.org>

Applied, thanks.

> ---
>  qemu-deprecated.texi |  6 ------
>  hw/ppc/spapr_vio.c   | 47 ++++++--------------------------------------
>  2 files changed, 6 insertions(+), 47 deletions(-)
> 
> diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
> index c3735b698ee4..eb5cd2a72d41 100644
> --- a/qemu-deprecated.texi
> +++ b/qemu-deprecated.texi
> @@ -168,9 +168,3 @@ Example of legacy encoding:
>  The above, converted to the current supported format:
>  
>  @code{json:@{"file.driver":"rbd", "file.pool":"rbd", "file.image":"name"@}}
> -
> -@subsection vio-spapr-device device options
> -
> -@subsubsection "irq": "" (since 3.0.0)
> -
> -The ``irq'' property is obsoleted.
> diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
> index 7e8a9ad09337..414673d31341 100644
> --- a/hw/ppc/spapr_vio.c
> +++ b/hw/ppc/spapr_vio.c
> @@ -44,38 +44,6 @@
>  
>  #define SPAPR_VIO_REG_BASE 0x71000000
>  
> -static void spapr_vio_get_irq(Object *obj, Visitor *v, const char *name,
> -                              void *opaque, Error **errp)
> -{
> -    Property *prop = opaque;
> -    uint32_t *ptr = qdev_get_prop_ptr(DEVICE(obj), prop);
> -
> -    visit_type_uint32(v, name, ptr, errp);
> -}
> -
> -static void spapr_vio_set_irq(Object *obj, Visitor *v, const char *name,
> -                              void *opaque, Error **errp)
> -{
> -    Property *prop = opaque;
> -    uint32_t *ptr = qdev_get_prop_ptr(DEVICE(obj), prop);
> -
> -    if (!qtest_enabled()) {
> -        warn_report(TYPE_VIO_SPAPR_DEVICE " '%s' property is deprecated", name);
> -    }
> -    visit_type_uint32(v, name, ptr, errp);
> -}
> -
> -static const PropertyInfo spapr_vio_irq_propinfo = {
> -    .name = "irq",
> -    .get = spapr_vio_get_irq,
> -    .set = spapr_vio_set_irq,
> -};
> -
> -static Property spapr_vio_props[] = {
> -    DEFINE_PROP("irq", VIOsPAPRDevice, irq, spapr_vio_irq_propinfo, uint32_t),
> -    DEFINE_PROP_END_OF_LIST(),
> -};
> -
>  static char *spapr_vio_get_dev_name(DeviceState *qdev)
>  {
>      VIOsPAPRDevice *dev = VIO_SPAPR_DEVICE(qdev);
> @@ -534,15 +502,13 @@ static void spapr_vio_busdev_realize(DeviceState *qdev, Error **errp)
>          dev->qdev.id = id;
>      }
>  
> -    if (!dev->irq) {
> -        dev->irq = spapr_vio_reg_to_irq(dev->reg);
> +    dev->irq = spapr_vio_reg_to_irq(dev->reg);
>  
> -        if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
> -            dev->irq = spapr_irq_findone(spapr, &local_err);
> -            if (local_err) {
> -                error_propagate(errp, local_err);
> -                return;
> -            }
> +    if (SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
> +        dev->irq = spapr_irq_findone(spapr, &local_err);
> +        if (local_err) {
> +            error_propagate(errp, local_err);
> +            return;
>          }
>      }
>  
> @@ -668,7 +634,6 @@ static void vio_spapr_device_class_init(ObjectClass *klass, void *data)
>      k->realize = spapr_vio_busdev_realize;
>      k->reset = spapr_vio_busdev_reset;
>      k->bus_type = TYPE_SPAPR_VIO_BUS;
> -    k->props = spapr_vio_props;
>  }
>  
>  static const TypeInfo spapr_vio_type_info = {

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson