summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2018-06-05 08:56:26 +0200
committerDavid Gibson <david@gibson.dropbear.id.au>2018-06-12 10:44:35 +1000
commitefe2add7cb7f870ebd90ac4f9637161a4821200a (patch)
treecf7ab44bd0c2a7e91c0f56b55a83ca1f3269f92b /hw
parent6b37554458a1e8cfe8f91ef0beac82e8de8f85bb (diff)
downloadqemu-efe2add7cb7f870ebd90ac4f9637161a4821200a.zip
spapr/vio: deprecate the "irq" property
VIO devices have an "irq" property that can be used by the sPAPR IRQ allocator as an IRQ number hint. But it is not set in QEMU nor in libvirt. It brings unnecessary complexity to the underlying layers managing the IRQ number space and it is in full opposition with the new static IRQ allocator we want to introduce in sPAPR. Let's deprecate it to simplify the spapr_irq_alloc routine in the future. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> [dwg: Check qtest_enabled() to suppress bogus warnings from make check] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw')
-rw-r--r--hw/ppc/spapr_vio.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c
index 472dd6f33a..4555c648a8 100644
--- a/hw/ppc/spapr_vio.c
+++ b/hw/ppc/spapr_vio.c
@@ -22,6 +22,7 @@
#include "qemu/osdep.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
+#include "qapi/visitor.h"
#include "hw/hw.h"
#include "qemu/log.h"
#include "sysemu/sysemu.h"
@@ -32,6 +33,7 @@
#include "sysemu/kvm.h"
#include "sysemu/device_tree.h"
#include "kvm_ppc.h"
+#include "sysemu/qtest.h"
#include "hw/ppc/spapr.h"
#include "hw/ppc/spapr_vio.h"
@@ -41,8 +43,26 @@
#include <libfdt.h>
+static void spapr_vio_getset_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_getset_irq,
+ .set = spapr_vio_getset_irq,
+};
+
static Property spapr_vio_props[] = {
- DEFINE_PROP_UINT32("irq", VIOsPAPRDevice, irq, 0), \
+ DEFINE_PROP("irq", VIOsPAPRDevice, irq, spapr_vio_irq_propinfo, uint32_t),
DEFINE_PROP_END_OF_LIST(),
};