* [Qemu-devel] [PATCH] spapr/vio: remove the "irq" property"
@ 2019-01-09 10:30 Cédric Le Goater
2019-01-09 10:32 ` Thomas Huth
2019-01-09 14:23 ` Greg Kurz
0 siblings, 2 replies; 3+ messages in thread
From: Cédric Le Goater @ 2019-01-09 10:30 UTC (permalink / raw)
To: David Gibson
Cc: Thomas Huth, Greg Kurz, qemu-ppc, qemu-devel,
Cédric Le Goater
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, 2 version later.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
The machine uselessly allocates an IRQ number for the sPAPR NVRAM.
This is harmless but still a little ugly.
hw/ppc/spapr_vio.c | 47 ++++++----------------------------------------
1 file changed, 6 insertions(+), 41 deletions(-)
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] spapr/vio: remove the "irq" property"
2019-01-09 10:30 [Qemu-devel] [PATCH] spapr/vio: remove the "irq" property" Cédric Le Goater
@ 2019-01-09 10:32 ` Thomas Huth
2019-01-09 14:23 ` Greg Kurz
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2019-01-09 10:32 UTC (permalink / raw)
To: Cédric Le Goater, David Gibson; +Cc: Greg Kurz, qemu-ppc, qemu-devel
On 2019-01-09 11:30, 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, 2 version later.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>
> The machine uselessly allocates an IRQ number for the sPAPR NVRAM.
> This is harmless but still a little ugly.
>
> hw/ppc/spapr_vio.c | 47 ++++++----------------------------------------
> 1 file changed, 6 insertions(+), 41 deletions(-)
>
> 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 = {
>
Looks good to me.
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] spapr/vio: remove the "irq" property"
2019-01-09 10:30 [Qemu-devel] [PATCH] spapr/vio: remove the "irq" property" Cédric Le Goater
2019-01-09 10:32 ` Thomas Huth
@ 2019-01-09 14:23 ` Greg Kurz
1 sibling, 0 replies; 3+ messages in thread
From: Greg Kurz @ 2019-01-09 14:23 UTC (permalink / raw)
To: Cédric Le Goater; +Cc: David Gibson, Thomas Huth, qemu-ppc, qemu-devel
On Wed, 9 Jan 2019 11:30:28 +0100
Cédric Le Goater <clg@kaod.org> 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, 2 version later.
>
> Signed-off-by: Cédric Le Goater <clg@kaod.org>
> ---
>
The change in the code looks good but...
> The machine uselessly allocates an IRQ number for the sPAPR NVRAM.
> This is harmless but still a little ugly.
>
> hw/ppc/spapr_vio.c | 47 ++++++----------------------------------------
... but qemu-deprecated.texi still contains this subsection:
@subsection vio-spapr-device device options
@subsubsection "irq": "" (since 3.0.0)
The ``irq'' property is obsoleted.
It should be removed in this patch as well.
Another file that usually needs patching is qemu-options.hx, but we don't
need it as it doesn't contain any sPAPR related documentation.
With the subsection removed from qemu-deprecated.texi,
Reviewed-by: Greg Kurz <groug@kaod.org>
> 1 file changed, 6 insertions(+), 41 deletions(-)
>
> 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 = {
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-09 14:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-09 10:30 [Qemu-devel] [PATCH] spapr/vio: remove the "irq" property" Cédric Le Goater
2019-01-09 10:32 ` Thomas Huth
2019-01-09 14:23 ` Greg Kurz
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).