qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-3.0] spapr/vio: quiet down the "irq" property accessors
@ 2018-07-03 15:23 Cédric Le Goater
  2018-07-04  1:29 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Cédric Le Goater @ 2018-07-03 15:23 UTC (permalink / raw)
  To: David Gibson; +Cc: qemu-ppc, qemu-devel, Cédric Le Goater

commit efe2add7cb7f ("spapr/vio: deprecate the "irq" property")
introduced get/set accessors for the "irq" property to warn of its
usage, but the warning in the get pollutes the monitor 'info qtree'.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
 hw/ppc/spapr_vio.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
index daf85130b5ef..be9af71437cc 100644
--- a/hw/ppc/spapr_vio.c
+++ b/hw/ppc/spapr_vio.c
@@ -43,7 +43,16 @@
 
 #include <libfdt.h>
 
-static void spapr_vio_getset_irq(Object *obj, Visitor *v, const char *name,
+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;
@@ -57,8 +66,8 @@ static void spapr_vio_getset_irq(Object *obj, Visitor *v, const char *name,
 
 static const PropertyInfo spapr_vio_irq_propinfo = {
     .name = "irq",
-    .get = spapr_vio_getset_irq,
-    .set = spapr_vio_getset_irq,
+    .get = spapr_vio_get_irq,
+    .set = spapr_vio_set_irq,
 };
 
 static Property spapr_vio_props[] = {
-- 
2.13.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH for-3.0] spapr/vio: quiet down the "irq" property accessors
  2018-07-03 15:23 [Qemu-devel] [PATCH for-3.0] spapr/vio: quiet down the "irq" property accessors Cédric Le Goater
@ 2018-07-04  1:29 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2018-07-04  1:29 UTC (permalink / raw)
  To: Cédric Le Goater; +Cc: qemu-ppc, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1813 bytes --]

On Tue, Jul 03, 2018 at 05:23:59PM +0200, Cédric Le Goater wrote:
> commit efe2add7cb7f ("spapr/vio: deprecate the "irq" property")
> introduced get/set accessors for the "irq" property to warn of its
> usage, but the warning in the get pollutes the monitor 'info qtree'.
> 
> Signed-off-by: Cédric Le Goater <clg@kaod.org>

Applied to ppc-for-3.0.

> ---
>  hw/ppc/spapr_vio.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
> index daf85130b5ef..be9af71437cc 100644
> --- a/hw/ppc/spapr_vio.c
> +++ b/hw/ppc/spapr_vio.c
> @@ -43,7 +43,16 @@
>  
>  #include <libfdt.h>
>  
> -static void spapr_vio_getset_irq(Object *obj, Visitor *v, const char *name,
> +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;
> @@ -57,8 +66,8 @@ static void spapr_vio_getset_irq(Object *obj, Visitor *v, const char *name,
>  
>  static const PropertyInfo spapr_vio_irq_propinfo = {
>      .name = "irq",
> -    .get = spapr_vio_getset_irq,
> -    .set = spapr_vio_getset_irq,
> +    .get = spapr_vio_get_irq,
> +    .set = spapr_vio_set_irq,
>  };
>  
>  static Property spapr_vio_props[] = {

-- 
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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-04  1:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-03 15:23 [Qemu-devel] [PATCH for-3.0] spapr/vio: quiet down the "irq" property accessors Cédric Le Goater
2018-07-04  1:29 ` David Gibson

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).