[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/47] qdev: gpio: Don't allow name share between I a
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PULL 01/47] qdev: gpio: Don't allow name share between I and O |
Date: |
Wed, 15 Oct 2014 05:08:35 +0200 |
From: Peter Crosthwaite <address@hidden>
Only allow a GPIO name to be one or the other. Inputs and outputs are
functionally different and should be in different namespaces. Prepares
support for the QOMification of IRQs as Links or Child objects.
The alternative is to munge names .e.g. with "-in" or "-out" suffixes
when giving QOM names. But that reduces clarity and if there are cases
out there where users want I and O with same name they can manually add
their own suffixes.
Reviewed-by: Alexander Graf <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
hw/core/qdev.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index fcb1638..976e208 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -339,6 +339,7 @@ void qdev_init_gpio_in_named(DeviceState *dev,
qemu_irq_handler handler,
{
NamedGPIOList *gpio_list = qdev_get_named_gpio_list(dev, name);
+ assert(gpio_list->num_out == 0 || !name);
gpio_list->in = qemu_extend_irqs(gpio_list->in, gpio_list->num_in, handler,
dev, n);
gpio_list->num_in += n;
@@ -354,6 +355,7 @@ void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq
*pins,
{
NamedGPIOList *gpio_list = qdev_get_named_gpio_list(dev, name);
+ assert(gpio_list->num_in == 0 || !name);
assert(gpio_list->num_out == 0);
gpio_list->num_out = n;
gpio_list->out = pins;
--
1.8.4.5
- [Qemu-devel] [PULL 00/47] QOM devices patch queue 2014-10-15, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 01/47] qdev: gpio: Don't allow name share between I and O,
Andreas Färber <=
- [Qemu-devel] [PULL 02/47] qdev: gpio: Register GPIO inputs as child objects, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 03/47] qdev: gpio: Register GPIO outputs as QOM links, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 07/47] tests: virtio-serial: Check if hot-plug/unplug works, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 06/47] tests: virtio-scsi: Check if hot-plug/unplug works, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 04/47] qom: Add error handler for object_property_print(), Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 08/47] libqos: Add qpci_plug_device_test() and qpci_unplug_acpi_device_test(), Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 09/47] tests: virtio-rng: Check if hot-plug/unplug works, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 05/47] qom: Add error handler for object alias property, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 11/47] tests: virtio-blk: Check if hot-plug/unplug works, Andreas Färber, 2014/10/14
- [Qemu-devel] [PULL 10/47] tests: virtio-net: Check if hot-plug/unplug works, Andreas Färber, 2014/10/14