* [Qemu-devel] [PATCH v2 0/2] Drop support for qdev taddr properties
@ 2013-04-09 11:27 Peter Maydell
2013-04-09 11:27 ` [Qemu-devel] [PATCH v2 1/2] hw/sm501: Use correct setter for sysbus-ohci dma-address property Peter Maydell
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Peter Maydell @ 2013-04-09 11:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori, David Gibson, patches
There is currently only one user of the qdev taddr (target addr,
now hwaddr) property code, and that user is wrong anyway, since the
property it's trying to set isn't actually a taddr property.
Fix the erroneous use in sm501 and drop all the taddr property code.
The justification for dropping the support is that a device should
generally not be exposing properties whose width (conceptually)
depends on the target CPU type. (This is the same rationale for
not supporting hwaddr fields in migration state.) Instead the
device should expose either a 32 bit or 64 bit property, depending
on what the actual hardware does.
Changes v1->v2:
* no functional changes, just rebased since Paolo's moved
everything around and the old patches won't apply
Peter Maydell (2):
hw/sm501: Use correct setter for sysbus-ohci dma-address property
qdev: Drop taddr properties
hw/block/fdc.c | 1 -
hw/core/Makefile.objs | 1 -
hw/core/qdev-addr.c | 78 -------------------------------------------
hw/display/sm501.c | 3 +-
hw/display/tcx.c | 1 -
hw/dma/xilinx_axidma.c | 1 -
hw/lm32/milkymist-hw.h | 1 -
hw/net/milkymist-minimac2.c | 1 -
hw/sparc/sun4m.c | 1 -
include/hw/qdev-addr.h | 10 ------
10 files changed, 1 insertion(+), 97 deletions(-)
delete mode 100644 hw/core/qdev-addr.c
delete mode 100644 include/hw/qdev-addr.h
--
1.7.9.5
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH v2 1/2] hw/sm501: Use correct setter for sysbus-ohci dma-address property
2013-04-09 11:27 [Qemu-devel] [PATCH v2 0/2] Drop support for qdev taddr properties Peter Maydell
@ 2013-04-09 11:27 ` Peter Maydell
2013-04-16 14:47 ` Andreas Färber
2013-04-16 15:10 ` Aurelien Jarno
2013-04-09 11:27 ` [Qemu-devel] [PATCH v2 2/2] qdev: Drop taddr properties Peter Maydell
2013-04-16 13:39 ` [Qemu-devel] [PATCH v2 0/2] Drop support for qdev " Peter Maydell
2 siblings, 2 replies; 8+ messages in thread
From: Peter Maydell @ 2013-04-09 11:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori, David Gibson, patches
The sysbus-ohci dma-address property is declared as a HEX64
property, not a TADDR, so use the correct setter for it.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/display/sm501.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 6b660ac..3840bce 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -1430,7 +1430,7 @@ void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
/* bridge to usb host emulation module */
dev = qdev_create(NULL, "sysbus-ohci");
qdev_prop_set_uint32(dev, "num-ports", 2);
- qdev_prop_set_taddr(dev, "dma-offset", base);
+ qdev_prop_set_uint64(dev, "dma-offset", base);
qdev_init_nofail(dev);
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0,
base + MMIO_BASE_OFFSET + SM501_USB_HOST);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH v2 2/2] qdev: Drop taddr properties
2013-04-09 11:27 [Qemu-devel] [PATCH v2 0/2] Drop support for qdev taddr properties Peter Maydell
2013-04-09 11:27 ` [Qemu-devel] [PATCH v2 1/2] hw/sm501: Use correct setter for sysbus-ohci dma-address property Peter Maydell
@ 2013-04-09 11:27 ` Peter Maydell
2013-04-20 12:44 ` Blue Swirl
2013-04-16 13:39 ` [Qemu-devel] [PATCH v2 0/2] Drop support for qdev " Peter Maydell
2 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2013-04-09 11:27 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori, David Gibson, patches
Drop all the infrastructure for taddr properties (ie ones which
are 'hwaddr' sized). These are now unused, and any further desired
use would be rather questionable since device properties shouldn't
generally depend on a type that is conceptually variable based on
the target CPU. 32 or 64 bit integer properties should be used instead
as appropriate for the specific device.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/block/fdc.c | 1 -
hw/core/Makefile.objs | 1 -
hw/core/qdev-addr.c | 78 -------------------------------------------
hw/display/sm501.c | 1 -
hw/display/tcx.c | 1 -
hw/dma/xilinx_axidma.c | 1 -
hw/lm32/milkymist-hw.h | 1 -
hw/net/milkymist-minimac2.c | 1 -
hw/sparc/sun4m.c | 1 -
include/hw/qdev-addr.h | 10 ------
10 files changed, 96 deletions(-)
delete mode 100644 hw/core/qdev-addr.c
delete mode 100644 include/hw/qdev-addr.h
diff --git a/hw/block/fdc.c b/hw/block/fdc.c
index 1ed874f..f1f1fd7 100644
--- a/hw/block/fdc.c
+++ b/hw/block/fdc.c
@@ -33,7 +33,6 @@
#include "qemu/timer.h"
#include "hw/isa/isa.h"
#include "hw/sysbus.h"
-#include "hw/qdev-addr.h"
#include "sysemu/blockdev.h"
#include "sysemu/sysemu.h"
#include "qemu/log.h"
diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs
index 94109f3..950146c 100644
--- a/hw/core/Makefile.objs
+++ b/hw/core/Makefile.objs
@@ -9,6 +9,5 @@ common-obj-$(CONFIG_PTIMER) += ptimer.o
common-obj-$(CONFIG_SOFTMMU) += sysbus.o
common-obj-$(CONFIG_SOFTMMU) += null-machine.o
common-obj-$(CONFIG_SOFTMMU) += loader.o
-common-obj-$(CONFIG_SOFTMMU) += qdev-addr.o
common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.o
diff --git a/hw/core/qdev-addr.c b/hw/core/qdev-addr.c
deleted file mode 100644
index 80a38bb..0000000
--- a/hw/core/qdev-addr.c
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "hw/qdev.h"
-#include "hw/qdev-addr.h"
-#include "exec/hwaddr.h"
-#include "qapi/qmp/qerror.h"
-#include "qapi/visitor.h"
-
-/* --- target physical address --- */
-
-static int parse_taddr(DeviceState *dev, Property *prop, const char *str)
-{
- hwaddr *ptr = qdev_get_prop_ptr(dev, prop);
-
- *ptr = strtoull(str, NULL, 16);
- return 0;
-}
-
-static int print_taddr(DeviceState *dev, Property *prop, char *dest, size_t len)
-{
- hwaddr *ptr = qdev_get_prop_ptr(dev, prop);
- return snprintf(dest, len, "0x" TARGET_FMT_plx, *ptr);
-}
-
-static void get_taddr(Object *obj, Visitor *v, void *opaque,
- const char *name, Error **errp)
-{
- DeviceState *dev = DEVICE(obj);
- Property *prop = opaque;
- hwaddr *ptr = qdev_get_prop_ptr(dev, prop);
- int64_t value;
-
- value = *ptr;
- visit_type_int64(v, &value, name, errp);
-}
-
-static void set_taddr(Object *obj, Visitor *v, void *opaque,
- const char *name, Error **errp)
-{
- DeviceState *dev = DEVICE(obj);
- Property *prop = opaque;
- hwaddr *ptr = qdev_get_prop_ptr(dev, prop);
- Error *local_err = NULL;
- int64_t value;
-
- if (dev->realized) {
- qdev_prop_set_after_realize(dev, name, errp);
- return;
- }
-
- visit_type_int64(v, &value, name, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- return;
- }
- if ((uint64_t)value <= (uint64_t) ~(hwaddr)0) {
- *ptr = value;
- } else {
- error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE,
- dev->id?:"", name, value, (uint64_t) 0,
- (uint64_t) ~(hwaddr)0);
- }
-}
-
-
-PropertyInfo qdev_prop_taddr = {
- .name = "taddr",
- .parse = parse_taddr,
- .print = print_taddr,
- .get = get_taddr,
- .set = set_taddr,
-};
-
-void qdev_prop_set_taddr(DeviceState *dev, const char *name, hwaddr value)
-{
- Error *errp = NULL;
- object_property_set_int(OBJECT(dev), value, name, &errp);
- assert(!errp);
-
-}
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 3840bce..09a819e 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -28,7 +28,6 @@
#include "ui/console.h"
#include "hw/arm/devices.h"
#include "hw/sysbus.h"
-#include "hw/qdev-addr.h"
#include "qemu/range.h"
#include "ui/pixel_ops.h"
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index c44068e..55abaee 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -26,7 +26,6 @@
#include "ui/console.h"
#include "ui/pixel_ops.h"
#include "hw/sysbus.h"
-#include "hw/qdev-addr.h"
#define MAXX 1024
#define MAXY 768
diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c
index 8db1a74..997b06e 100644
--- a/hw/dma/xilinx_axidma.c
+++ b/hw/dma/xilinx_axidma.c
@@ -26,7 +26,6 @@
#include "qemu/timer.h"
#include "hw/ptimer.h"
#include "qemu/log.h"
-#include "hw/qdev-addr.h"
#include "hw/stream.h"
diff --git a/hw/lm32/milkymist-hw.h b/hw/lm32/milkymist-hw.h
index 4e86c4e..5317ce6 100644
--- a/hw/lm32/milkymist-hw.h
+++ b/hw/lm32/milkymist-hw.h
@@ -2,7 +2,6 @@
#define QEMU_HW_MILKYMIST_H
#include "hw/qdev.h"
-#include "hw/qdev-addr.h"
#include "net/net.h"
static inline DeviceState *milkymist_uart_create(hwaddr base,
diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c
index 29618e8..4ef6318 100644
--- a/hw/net/milkymist-minimac2.c
+++ b/hw/net/milkymist-minimac2.c
@@ -27,7 +27,6 @@
#include "trace.h"
#include "net/net.h"
#include "qemu/error-report.h"
-#include "hw/qdev-addr.h"
#include <zlib.h>
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 31beb32..635115f 100644
--- a/hw/sparc/sun4m.c
+++ b/hw/sparc/sun4m.c
@@ -37,7 +37,6 @@
#include "hw/nvram/fw_cfg.h"
#include "hw/char/escc.h"
#include "hw/empty_slot.h"
-#include "hw/qdev-addr.h"
#include "hw/loader.h"
#include "elf.h"
#include "sysemu/blockdev.h"
diff --git a/include/hw/qdev-addr.h b/include/hw/qdev-addr.h
deleted file mode 100644
index 79708e6..0000000
--- a/include/hw/qdev-addr.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef HW_QDEV_ADDR_H
-#define HW_QDEV_ADDR_H 1
-
-#define DEFINE_PROP_TADDR(_n, _s, _f, _d) \
- DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_taddr, hwaddr)
-
-extern PropertyInfo qdev_prop_taddr;
-void qdev_prop_set_taddr(DeviceState *dev, const char *name, hwaddr value);
-
-#endif
--
1.7.9.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH v2 0/2] Drop support for qdev taddr properties
2013-04-09 11:27 [Qemu-devel] [PATCH v2 0/2] Drop support for qdev taddr properties Peter Maydell
2013-04-09 11:27 ` [Qemu-devel] [PATCH v2 1/2] hw/sm501: Use correct setter for sysbus-ohci dma-address property Peter Maydell
2013-04-09 11:27 ` [Qemu-devel] [PATCH v2 2/2] qdev: Drop taddr properties Peter Maydell
@ 2013-04-16 13:39 ` Peter Maydell
2 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2013-04-16 13:39 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Anthony Liguori, patches, David Gibson
Ping!
-- PMM
On 9 April 2013 12:27, Peter Maydell <peter.maydell@linaro.org> wrote:
> There is currently only one user of the qdev taddr (target addr,
> now hwaddr) property code, and that user is wrong anyway, since the
> property it's trying to set isn't actually a taddr property.
> Fix the erroneous use in sm501 and drop all the taddr property code.
>
> The justification for dropping the support is that a device should
> generally not be exposing properties whose width (conceptually)
> depends on the target CPU type. (This is the same rationale for
> not supporting hwaddr fields in migration state.) Instead the
> device should expose either a 32 bit or 64 bit property, depending
> on what the actual hardware does.
>
> Changes v1->v2:
> * no functional changes, just rebased since Paolo's moved
> everything around and the old patches won't apply
>
> Peter Maydell (2):
> hw/sm501: Use correct setter for sysbus-ohci dma-address property
> qdev: Drop taddr properties
>
> hw/block/fdc.c | 1 -
> hw/core/Makefile.objs | 1 -
> hw/core/qdev-addr.c | 78 -------------------------------------------
> hw/display/sm501.c | 3 +-
> hw/display/tcx.c | 1 -
> hw/dma/xilinx_axidma.c | 1 -
> hw/lm32/milkymist-hw.h | 1 -
> hw/net/milkymist-minimac2.c | 1 -
> hw/sparc/sun4m.c | 1 -
> include/hw/qdev-addr.h | 10 ------
> 10 files changed, 1 insertion(+), 97 deletions(-)
> delete mode 100644 hw/core/qdev-addr.c
> delete mode 100644 include/hw/qdev-addr.h
>
> --
> 1.7.9.5
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH v2 1/2] hw/sm501: Use correct setter for sysbus-ohci dma-address property
2013-04-09 11:27 ` [Qemu-devel] [PATCH v2 1/2] hw/sm501: Use correct setter for sysbus-ohci dma-address property Peter Maydell
@ 2013-04-16 14:47 ` Andreas Färber
2013-04-16 14:49 ` Peter Maydell
2013-04-16 15:10 ` Aurelien Jarno
1 sibling, 1 reply; 8+ messages in thread
From: Andreas Färber @ 2013-04-16 14:47 UTC (permalink / raw)
To: Peter Maydell
Cc: Anthony Liguori, patches, qemu-devel, Gerd Hoffmann,
Paolo Bonzini, David Gibson
Am 09.04.2013 13:27, schrieb Peter Maydell:
> The sysbus-ohci dma-address property is declared as a HEX64
> property, not a TADDR, so use the correct setter for it.
Actually, it's declared as
DEFINE_PROP_DMAADDR("dma-offset", OHCISysBusState, dma_offset, 3),
which is in turn defined as DEFINE_PROP_HEX64 in include/hw/qdev-dma.h.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> hw/display/sm501.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> index 6b660ac..3840bce 100644
> --- a/hw/display/sm501.c
> +++ b/hw/display/sm501.c
> @@ -1430,7 +1430,7 @@ void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
> /* bridge to usb host emulation module */
> dev = qdev_create(NULL, "sysbus-ohci");
> qdev_prop_set_uint32(dev, "num-ports", 2);
> - qdev_prop_set_taddr(dev, "dma-offset", base);
> + qdev_prop_set_uint64(dev, "dma-offset", base);
> qdev_init_nofail(dev);
> sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0,
> base + MMIO_BASE_OFFSET + SM501_USB_HOST);
You could also remove the include now, right?
Either way,
Acked-by: Andreas Färber <afaerber@suse.de>
CC'ing Gerd.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH v2 1/2] hw/sm501: Use correct setter for sysbus-ohci dma-address property
2013-04-16 14:47 ` Andreas Färber
@ 2013-04-16 14:49 ` Peter Maydell
0 siblings, 0 replies; 8+ messages in thread
From: Peter Maydell @ 2013-04-16 14:49 UTC (permalink / raw)
To: Andreas Färber
Cc: Anthony Liguori, patches, qemu-devel, Gerd Hoffmann,
Paolo Bonzini, David Gibson
On 16 April 2013 15:47, Andreas Färber <afaerber@suse.de> wrote:
> Am 09.04.2013 13:27, schrieb Peter Maydell:
>> The sysbus-ohci dma-address property is declared as a HEX64
>> property, not a TADDR, so use the correct setter for it.
>
> Actually, it's declared as
> DEFINE_PROP_DMAADDR("dma-offset", OHCISysBusState, dma_offset, 3),
> which is in turn defined as DEFINE_PROP_HEX64 in include/hw/qdev-dma.h.
Yes, I abbreviated a bit.
> You could also remove the include now, right?
In theory, but given patch 2 it's a bit moot :-)
> Either way,
>
> Acked-by: Andreas Färber <afaerber@suse.de>
Thanks.
-- PMM
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH v2 1/2] hw/sm501: Use correct setter for sysbus-ohci dma-address property
2013-04-09 11:27 ` [Qemu-devel] [PATCH v2 1/2] hw/sm501: Use correct setter for sysbus-ohci dma-address property Peter Maydell
2013-04-16 14:47 ` Andreas Färber
@ 2013-04-16 15:10 ` Aurelien Jarno
1 sibling, 0 replies; 8+ messages in thread
From: Aurelien Jarno @ 2013-04-16 15:10 UTC (permalink / raw)
To: Peter Maydell
Cc: Paolo Bonzini, Anthony Liguori, patches, qemu-devel, David Gibson
On Tue, Apr 09, 2013 at 12:27:52PM +0100, Peter Maydell wrote:
> The sysbus-ohci dma-address property is declared as a HEX64
> property, not a TADDR, so use the correct setter for it.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> hw/display/sm501.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> index 6b660ac..3840bce 100644
> --- a/hw/display/sm501.c
> +++ b/hw/display/sm501.c
> @@ -1430,7 +1430,7 @@ void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
> /* bridge to usb host emulation module */
> dev = qdev_create(NULL, "sysbus-ohci");
> qdev_prop_set_uint32(dev, "num-ports", 2);
> - qdev_prop_set_taddr(dev, "dma-offset", base);
> + qdev_prop_set_uint64(dev, "dma-offset", base);
> qdev_init_nofail(dev);
> sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0,
> base + MMIO_BASE_OFFSET + SM501_USB_HOST);
Tested-by: Aurelien Jarno <aurelien@aurel32.net>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] [PATCH v2 2/2] qdev: Drop taddr properties
2013-04-09 11:27 ` [Qemu-devel] [PATCH v2 2/2] qdev: Drop taddr properties Peter Maydell
@ 2013-04-20 12:44 ` Blue Swirl
0 siblings, 0 replies; 8+ messages in thread
From: Blue Swirl @ 2013-04-20 12:44 UTC (permalink / raw)
To: Peter Maydell
Cc: Paolo Bonzini, Anthony Liguori, patches@linaro.org, qemu-devel,
David Gibson
Patch does not apply, please rebase:
Applying: qdev: Drop taddr properties
error: patch failed: hw/display/sm501.c:28
error: hw/display/sm501.c: patch does not apply
error: patch failed: hw/dma/xilinx_axidma.c:26
error: hw/dma/xilinx_axidma.c: patch does not apply
Patch failed at 0002 qdev: Drop taddr properties
On Tue, Apr 9, 2013 at 11:27 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> Drop all the infrastructure for taddr properties (ie ones which
> are 'hwaddr' sized). These are now unused, and any further desired
> use would be rather questionable since device properties shouldn't
> generally depend on a type that is conceptually variable based on
> the target CPU. 32 or 64 bit integer properties should be used instead
> as appropriate for the specific device.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> hw/block/fdc.c | 1 -
> hw/core/Makefile.objs | 1 -
> hw/core/qdev-addr.c | 78 -------------------------------------------
> hw/display/sm501.c | 1 -
> hw/display/tcx.c | 1 -
> hw/dma/xilinx_axidma.c | 1 -
> hw/lm32/milkymist-hw.h | 1 -
> hw/net/milkymist-minimac2.c | 1 -
> hw/sparc/sun4m.c | 1 -
> include/hw/qdev-addr.h | 10 ------
> 10 files changed, 96 deletions(-)
> delete mode 100644 hw/core/qdev-addr.c
> delete mode 100644 include/hw/qdev-addr.h
>
> diff --git a/hw/block/fdc.c b/hw/block/fdc.c
> index 1ed874f..f1f1fd7 100644
> --- a/hw/block/fdc.c
> +++ b/hw/block/fdc.c
> @@ -33,7 +33,6 @@
> #include "qemu/timer.h"
> #include "hw/isa/isa.h"
> #include "hw/sysbus.h"
> -#include "hw/qdev-addr.h"
> #include "sysemu/blockdev.h"
> #include "sysemu/sysemu.h"
> #include "qemu/log.h"
> diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs
> index 94109f3..950146c 100644
> --- a/hw/core/Makefile.objs
> +++ b/hw/core/Makefile.objs
> @@ -9,6 +9,5 @@ common-obj-$(CONFIG_PTIMER) += ptimer.o
> common-obj-$(CONFIG_SOFTMMU) += sysbus.o
> common-obj-$(CONFIG_SOFTMMU) += null-machine.o
> common-obj-$(CONFIG_SOFTMMU) += loader.o
> -common-obj-$(CONFIG_SOFTMMU) += qdev-addr.o
> common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.o
>
> diff --git a/hw/core/qdev-addr.c b/hw/core/qdev-addr.c
> deleted file mode 100644
> index 80a38bb..0000000
> --- a/hw/core/qdev-addr.c
> +++ /dev/null
> @@ -1,78 +0,0 @@
> -#include "hw/qdev.h"
> -#include "hw/qdev-addr.h"
> -#include "exec/hwaddr.h"
> -#include "qapi/qmp/qerror.h"
> -#include "qapi/visitor.h"
> -
> -/* --- target physical address --- */
> -
> -static int parse_taddr(DeviceState *dev, Property *prop, const char *str)
> -{
> - hwaddr *ptr = qdev_get_prop_ptr(dev, prop);
> -
> - *ptr = strtoull(str, NULL, 16);
> - return 0;
> -}
> -
> -static int print_taddr(DeviceState *dev, Property *prop, char *dest, size_t len)
> -{
> - hwaddr *ptr = qdev_get_prop_ptr(dev, prop);
> - return snprintf(dest, len, "0x" TARGET_FMT_plx, *ptr);
> -}
> -
> -static void get_taddr(Object *obj, Visitor *v, void *opaque,
> - const char *name, Error **errp)
> -{
> - DeviceState *dev = DEVICE(obj);
> - Property *prop = opaque;
> - hwaddr *ptr = qdev_get_prop_ptr(dev, prop);
> - int64_t value;
> -
> - value = *ptr;
> - visit_type_int64(v, &value, name, errp);
> -}
> -
> -static void set_taddr(Object *obj, Visitor *v, void *opaque,
> - const char *name, Error **errp)
> -{
> - DeviceState *dev = DEVICE(obj);
> - Property *prop = opaque;
> - hwaddr *ptr = qdev_get_prop_ptr(dev, prop);
> - Error *local_err = NULL;
> - int64_t value;
> -
> - if (dev->realized) {
> - qdev_prop_set_after_realize(dev, name, errp);
> - return;
> - }
> -
> - visit_type_int64(v, &value, name, &local_err);
> - if (local_err) {
> - error_propagate(errp, local_err);
> - return;
> - }
> - if ((uint64_t)value <= (uint64_t) ~(hwaddr)0) {
> - *ptr = value;
> - } else {
> - error_set(errp, QERR_PROPERTY_VALUE_OUT_OF_RANGE,
> - dev->id?:"", name, value, (uint64_t) 0,
> - (uint64_t) ~(hwaddr)0);
> - }
> -}
> -
> -
> -PropertyInfo qdev_prop_taddr = {
> - .name = "taddr",
> - .parse = parse_taddr,
> - .print = print_taddr,
> - .get = get_taddr,
> - .set = set_taddr,
> -};
> -
> -void qdev_prop_set_taddr(DeviceState *dev, const char *name, hwaddr value)
> -{
> - Error *errp = NULL;
> - object_property_set_int(OBJECT(dev), value, name, &errp);
> - assert(!errp);
> -
> -}
> diff --git a/hw/display/sm501.c b/hw/display/sm501.c
> index 3840bce..09a819e 100644
> --- a/hw/display/sm501.c
> +++ b/hw/display/sm501.c
> @@ -28,7 +28,6 @@
> #include "ui/console.h"
> #include "hw/arm/devices.h"
> #include "hw/sysbus.h"
> -#include "hw/qdev-addr.h"
> #include "qemu/range.h"
> #include "ui/pixel_ops.h"
>
> diff --git a/hw/display/tcx.c b/hw/display/tcx.c
> index c44068e..55abaee 100644
> --- a/hw/display/tcx.c
> +++ b/hw/display/tcx.c
> @@ -26,7 +26,6 @@
> #include "ui/console.h"
> #include "ui/pixel_ops.h"
> #include "hw/sysbus.h"
> -#include "hw/qdev-addr.h"
>
> #define MAXX 1024
> #define MAXY 768
> diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c
> index 8db1a74..997b06e 100644
> --- a/hw/dma/xilinx_axidma.c
> +++ b/hw/dma/xilinx_axidma.c
> @@ -26,7 +26,6 @@
> #include "qemu/timer.h"
> #include "hw/ptimer.h"
> #include "qemu/log.h"
> -#include "hw/qdev-addr.h"
>
> #include "hw/stream.h"
>
> diff --git a/hw/lm32/milkymist-hw.h b/hw/lm32/milkymist-hw.h
> index 4e86c4e..5317ce6 100644
> --- a/hw/lm32/milkymist-hw.h
> +++ b/hw/lm32/milkymist-hw.h
> @@ -2,7 +2,6 @@
> #define QEMU_HW_MILKYMIST_H
>
> #include "hw/qdev.h"
> -#include "hw/qdev-addr.h"
> #include "net/net.h"
>
> static inline DeviceState *milkymist_uart_create(hwaddr base,
> diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c
> index 29618e8..4ef6318 100644
> --- a/hw/net/milkymist-minimac2.c
> +++ b/hw/net/milkymist-minimac2.c
> @@ -27,7 +27,6 @@
> #include "trace.h"
> #include "net/net.h"
> #include "qemu/error-report.h"
> -#include "hw/qdev-addr.h"
>
> #include <zlib.h>
>
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index 31beb32..635115f 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -37,7 +37,6 @@
> #include "hw/nvram/fw_cfg.h"
> #include "hw/char/escc.h"
> #include "hw/empty_slot.h"
> -#include "hw/qdev-addr.h"
> #include "hw/loader.h"
> #include "elf.h"
> #include "sysemu/blockdev.h"
> diff --git a/include/hw/qdev-addr.h b/include/hw/qdev-addr.h
> deleted file mode 100644
> index 79708e6..0000000
> --- a/include/hw/qdev-addr.h
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -#ifndef HW_QDEV_ADDR_H
> -#define HW_QDEV_ADDR_H 1
> -
> -#define DEFINE_PROP_TADDR(_n, _s, _f, _d) \
> - DEFINE_PROP_DEFAULT(_n, _s, _f, _d, qdev_prop_taddr, hwaddr)
> -
> -extern PropertyInfo qdev_prop_taddr;
> -void qdev_prop_set_taddr(DeviceState *dev, const char *name, hwaddr value);
> -
> -#endif
> --
> 1.7.9.5
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-04-20 12:45 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-09 11:27 [Qemu-devel] [PATCH v2 0/2] Drop support for qdev taddr properties Peter Maydell
2013-04-09 11:27 ` [Qemu-devel] [PATCH v2 1/2] hw/sm501: Use correct setter for sysbus-ohci dma-address property Peter Maydell
2013-04-16 14:47 ` Andreas Färber
2013-04-16 14:49 ` Peter Maydell
2013-04-16 15:10 ` Aurelien Jarno
2013-04-09 11:27 ` [Qemu-devel] [PATCH v2 2/2] qdev: Drop taddr properties Peter Maydell
2013-04-20 12:44 ` Blue Swirl
2013-04-16 13:39 ` [Qemu-devel] [PATCH v2 0/2] Drop support for qdev " Peter Maydell
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).