* [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack
@ 2013-08-02 21:16 Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 1/6] ipack: Convert to QOM realize Andreas Färber
` (6 more replies)
0 siblings, 7 replies; 16+ messages in thread
From: Andreas Färber @ 2013-08-02 21:16 UTC (permalink / raw)
To: qemu-devel
Cc: Hu Tao, Peter Crosthwaite, Alberto Garcia, Andreas Färber,
Anthony Liguori
Hello,
This series converts IndustryPack devices to QOM realize/unrealize.
It goes on to clean up file placement, promoting IndustryPack to use its own
subdirectory like PCI, ISA, virtio, etc.
Available from:
https://github.com/afaerber/qemu-cpu/commits/realize-ipack.v1
git://github.com/afaerber/qemu-cpu.git realize-ipack.v1
Regards,
Andreas
Cc: Anthony Liguori <anthony@codemonkey.ws>
Cc: Alberto Garcia <agarcia@igalia.com>
Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: Hu Tao <hutao@cn.fujitsu.com>
Andreas Färber (6):
ipack: Convert to QOM realize
ipack: QOM parent field cleanup for IPackBus
ipack: QOM parent field cleanup for IPackDevice
ipack: Simplify VMSTATE_IPACK_DEVICE() macro
ipoctal232: QOM parent field cleanup
ipack: Move IndustryPack out of hw/char/
hw/Makefile.objs | 1 +
hw/char/Makefile.objs | 2 +-
hw/char/ipoctal232.c | 30 ++++++++++++++++--------
hw/ipack/Makefile.objs | 2 ++
hw/{char => ipack}/ipack.c | 44 ++++++++++++++---------------------
hw/{char => ipack}/tpci200.c | 2 +-
{hw/char => include/hw/ipack}/ipack.h | 24 +++++++++++++------
7 files changed, 60 insertions(+), 45 deletions(-)
create mode 100644 hw/ipack/Makefile.objs
rename hw/{char => ipack}/ipack.c (70%)
rename hw/{char => ipack}/tpci200.c (99%)
rename {hw/char => include/hw/ipack}/ipack.h (75%)
--
1.8.1.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH qom-next for-next 1/6] ipack: Convert to QOM realize
2013-08-02 21:16 [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Andreas Färber
@ 2013-08-02 21:16 ` Andreas Färber
2013-08-05 15:16 ` Alberto Garcia
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 2/6] ipack: QOM parent field cleanup for IPackBus Andreas Färber
` (5 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Andreas Färber @ 2013-08-02 21:16 UTC (permalink / raw)
To: qemu-devel; +Cc: Alberto Garcia, Andreas Färber
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/char/ipack.c | 40 ++++++++++++++++------------------------
hw/char/ipack.h | 5 ++---
hw/char/ipoctal232.c | 18 +++++++++++++-----
3 files changed, 31 insertions(+), 32 deletions(-)
diff --git a/hw/char/ipack.c b/hw/char/ipack.c
index f890471..a902fe4 100644
--- a/hw/char/ipack.c
+++ b/hw/char/ipack.c
@@ -33,37 +33,28 @@ void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent,
bus->set_irq = handler;
}
-static int ipack_device_dev_init(DeviceState *qdev)
+static void ipack_device_realize(DeviceState *dev, Error **errp)
{
- IPackBus *bus = IPACK_BUS(qdev_get_parent_bus(qdev));
- IPackDevice *dev = IPACK_DEVICE(qdev);
- IPackDeviceClass *k = IPACK_DEVICE_GET_CLASS(dev);
+ IPackDevice *idev = IPACK_DEVICE(dev);
+ IPackBus *bus = IPACK_BUS(qdev_get_parent_bus(dev));
- if (dev->slot < 0) {
- dev->slot = bus->free_slot;
+ if (idev->slot < 0) {
+ idev->slot = bus->free_slot;
}
- if (dev->slot >= bus->n_slots) {
- return -1;
+ if (idev->slot >= bus->n_slots) {
+ error_setg(errp, "Only %" PRIu8 " slots available.", bus->n_slots);
+ return;
}
- bus->free_slot = dev->slot + 1;
+ bus->free_slot = idev->slot + 1;
- dev->irq = qemu_allocate_irqs(bus->set_irq, dev, 2);
-
- return k->init(dev);
+ idev->irq = qemu_allocate_irqs(bus->set_irq, idev, 2);
}
-static int ipack_device_dev_exit(DeviceState *qdev)
+static void ipack_device_unrealize(DeviceState *dev, Error **errp)
{
- IPackDevice *dev = IPACK_DEVICE(qdev);
- IPackDeviceClass *k = IPACK_DEVICE_GET_CLASS(dev);
-
- if (k->exit) {
- k->exit(dev);
- }
+ IPackDevice *idev = IPACK_DEVICE(dev);
- qemu_free_irqs(dev->irq);
-
- return 0;
+ qemu_free_irqs(idev->irq);
}
static Property ipack_device_props[] = {
@@ -74,10 +65,11 @@ static Property ipack_device_props[] = {
static void ipack_device_class_init(ObjectClass *klass, void *data)
{
DeviceClass *k = DEVICE_CLASS(klass);
+
set_bit(DEVICE_CATEGORY_INPUT, k->categories);
k->bus_type = TYPE_IPACK_BUS;
- k->init = ipack_device_dev_init;
- k->exit = ipack_device_dev_exit;
+ k->realize = ipack_device_realize;
+ k->unrealize = ipack_device_unrealize;
k->props = ipack_device_props;
}
diff --git a/hw/char/ipack.h b/hw/char/ipack.h
index f2b7a12..4286fc0 100644
--- a/hw/char/ipack.h
+++ b/hw/char/ipack.h
@@ -38,10 +38,9 @@ typedef struct IPackDeviceClass IPackDeviceClass;
OBJECT_GET_CLASS(IPackDeviceClass, (obj), TYPE_IPACK_DEVICE)
struct IPackDeviceClass {
+ /*< private >*/
DeviceClass parent_class;
-
- int (*init)(IPackDevice *dev);
- int (*exit)(IPackDevice *dev);
+ /*< public >*/
uint16_t (*io_read)(IPackDevice *dev, uint8_t addr);
void (*io_write)(IPackDevice *dev, uint8_t addr, uint16_t val);
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index 88e2cca..80ebe7b 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -118,6 +118,8 @@ struct IPOctalState {
#define IPOCTAL(obj) \
OBJECT_CHECK(IPOctalState, (obj), TYPE_IPOCTAL)
+#define IPOCTAL_GET_PARENT_CLASS(obj) \
+ OBJECT_GET_PARENT_CLASS(obj, TYPE_IPOCTAL)
static const VMStateDescription vmstate_scc2698_channel = {
.name = "scc2698_channel",
@@ -534,11 +536,19 @@ static void hostdev_event(void *opaque, int event)
}
}
-static int ipoctal_init(IPackDevice *ip)
+static void ipoctal_realize(DeviceState *dev, Error **errp)
{
- IPOctalState *s = IPOCTAL(ip);
+ IPOctalState *s = IPOCTAL(dev);
+ DeviceClass *parent_dc = DEVICE_CLASS(IPOCTAL_GET_PARENT_CLASS(dev));
+ Error *err = NULL;
unsigned i;
+ parent_dc->realize(dev, &err);
+ if (err != NULL) {
+ error_propagate(errp, err);
+ return;
+ }
+
for (i = 0; i < N_CHANNELS; i++) {
SCC2698Channel *ch = &s->ch[i];
ch->ipoctal = s;
@@ -552,8 +562,6 @@ static int ipoctal_init(IPackDevice *ip)
DPRINTF("Could not redirect channel %u, no chardev set\n", i);
}
}
-
- return 0;
}
static Property ipoctal_properties[] = {
@@ -573,7 +581,6 @@ static void ipoctal_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
IPackDeviceClass *ic = IPACK_DEVICE_CLASS(klass);
- ic->init = ipoctal_init;
ic->io_read = io_read;
ic->io_write = io_write;
ic->id_read = id_read;
@@ -585,6 +592,7 @@ static void ipoctal_class_init(ObjectClass *klass, void *data)
ic->mem_read8 = mem_read8;
ic->mem_write8 = mem_write8;
+ dc->realize = ipoctal_realize;
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
dc->desc = "GE IP-Octal 232 8-channel RS-232 IndustryPack";
dc->props = ipoctal_properties;
--
1.8.1.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH qom-next for-next 2/6] ipack: QOM parent field cleanup for IPackBus
2013-08-02 21:16 [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 1/6] ipack: Convert to QOM realize Andreas Färber
@ 2013-08-02 21:16 ` Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 3/6] ipack: QOM parent field cleanup for IPackDevice Andreas Färber
` (4 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2013-08-02 21:16 UTC (permalink / raw)
To: qemu-devel; +Cc: Alberto Garcia, Andreas Färber
Clean up the only user of IPackBus::qbus field and rename it.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/char/ipack.c | 2 +-
hw/char/ipack.h | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/char/ipack.c b/hw/char/ipack.c
index a902fe4..0758fdd 100644
--- a/hw/char/ipack.c
+++ b/hw/char/ipack.c
@@ -28,7 +28,7 @@ void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent,
const char *name, uint8_t n_slots,
qemu_irq_handler handler)
{
- qbus_create_inplace(&bus->qbus, TYPE_IPACK_BUS, parent, name);
+ qbus_create_inplace(bus, TYPE_IPACK_BUS, parent, name);
bus->n_slots = n_slots;
bus->set_irq = handler;
}
diff --git a/hw/char/ipack.h b/hw/char/ipack.h
index 4286fc0..03b07f0 100644
--- a/hw/char/ipack.h
+++ b/hw/char/ipack.h
@@ -19,7 +19,9 @@ typedef struct IPackBus IPackBus;
#define IPACK_BUS(obj) OBJECT_CHECK(IPackBus, (obj), TYPE_IPACK_BUS)
struct IPackBus {
- BusState qbus;
+ /*< private >*/
+ BusState parent_obj;
+
/* All fields are private */
uint8_t n_slots;
uint8_t free_slot;
--
1.8.1.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH qom-next for-next 3/6] ipack: QOM parent field cleanup for IPackDevice
2013-08-02 21:16 [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 1/6] ipack: Convert to QOM realize Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 2/6] ipack: QOM parent field cleanup for IPackBus Andreas Färber
@ 2013-08-02 21:16 ` Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 4/6] ipack: Simplify VMSTATE_IPACK_DEVICE() macro Andreas Färber
` (3 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2013-08-02 21:16 UTC (permalink / raw)
To: qemu-devel; +Cc: Alberto Garcia, Andreas Färber
Rename the IPackDevice::qdev field to avoid accidental use.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/char/ipack.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/char/ipack.h b/hw/char/ipack.h
index 03b07f0..080767f 100644
--- a/hw/char/ipack.h
+++ b/hw/char/ipack.h
@@ -61,7 +61,10 @@ struct IPackDeviceClass {
};
struct IPackDevice {
- DeviceState qdev;
+ /*< private >*/
+ DeviceState parent_obj;
+ /*< public >*/
+
int32_t slot;
/* IRQ objects for the IndustryPack INT0# and INT1# */
qemu_irq *irq;
--
1.8.1.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH qom-next for-next 4/6] ipack: Simplify VMSTATE_IPACK_DEVICE() macro
2013-08-02 21:16 [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Andreas Färber
` (2 preceding siblings ...)
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 3/6] ipack: QOM parent field cleanup for IPackDevice Andreas Färber
@ 2013-08-02 21:16 ` Andreas Färber
2013-08-02 21:17 ` [Qemu-devel] [PATCH qom-next for-next 5/6] ipoctal232: QOM parent field cleanup Andreas Färber
` (2 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2013-08-02 21:16 UTC (permalink / raw)
To: qemu-devel; +Cc: Alberto Garcia, Andreas Färber
Hardcode name and offset to avoid having to pass parent_obj to it.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/char/ipack.h | 10 ++++++++--
hw/char/ipoctal232.c | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/char/ipack.h b/hw/char/ipack.h
index 080767f..c183383 100644
--- a/hw/char/ipack.h
+++ b/hw/char/ipack.h
@@ -72,8 +72,14 @@ struct IPackDevice {
extern const VMStateDescription vmstate_ipack_device;
-#define VMSTATE_IPACK_DEVICE(_field, _state) \
- VMSTATE_STRUCT(_field, _state, 1, vmstate_ipack_device, IPackDevice)
+#define VMSTATE_IPACK_DEVICE() { \
+ .name = "parent_obj", \
+ .size = sizeof(IPackDevice), \
+ .version_id = 1, \
+ .vmsd = &vmstate_ipack_device, \
+ .flags = VMS_STRUCT, \
+ .offset = 0, \
+}
IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot);
void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent,
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index 80ebe7b..08093da 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -156,7 +156,7 @@ static const VMStateDescription vmstate_ipoctal = {
.minimum_version_id = 1,
.minimum_version_id_old = 1,
.fields = (VMStateField[]) {
- VMSTATE_IPACK_DEVICE(dev, IPOctalState),
+ VMSTATE_IPACK_DEVICE(),
VMSTATE_STRUCT_ARRAY(ch, IPOctalState, N_CHANNELS, 1,
vmstate_scc2698_channel, SCC2698Channel),
VMSTATE_STRUCT_ARRAY(blk, IPOctalState, N_BLOCKS, 1,
--
1.8.1.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH qom-next for-next 5/6] ipoctal232: QOM parent field cleanup
2013-08-02 21:16 [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Andreas Färber
` (3 preceding siblings ...)
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 4/6] ipack: Simplify VMSTATE_IPACK_DEVICE() macro Andreas Färber
@ 2013-08-02 21:17 ` Andreas Färber
2013-08-02 21:17 ` [Qemu-devel] [PATCH qom-next for-next 6/6] ipack: Move IndustryPack out of hw/char/ Andreas Färber
2013-08-06 8:48 ` [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Alberto Garcia
6 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2013-08-02 21:17 UTC (permalink / raw)
To: qemu-devel; +Cc: Alberto Garcia, Andreas Färber
Clean up accesses to IPOctalState::dev field and rename it.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/char/ipoctal232.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index 08093da..4af9678 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -108,7 +108,8 @@ struct SCC2698Block {
};
struct IPOctalState {
- IPackDevice dev;
+ IPackDevice parent_obj;
+
SCC2698Channel ch[N_CHANNELS];
SCC2698Block blk[N_BLOCKS];
uint8_t irq_vector;
@@ -174,6 +175,7 @@ static const uint8_t id_prom_data[] = {
static void update_irq(IPOctalState *dev, unsigned block)
{
+ IPackDevice *idev = IPACK_DEVICE(dev);
/* Blocks A and B interrupt on INT0#, C and D on INT1#.
Thus, to get the status we have to check two blocks. */
SCC2698Block *blk0 = &dev->blk[block];
@@ -181,9 +183,9 @@ static void update_irq(IPOctalState *dev, unsigned block)
unsigned intno = block / 2;
if ((blk0->isr & blk0->imr) || (blk1->isr & blk1->imr)) {
- qemu_irq_raise(dev->dev.irq[intno]);
+ qemu_irq_raise(idev->irq[intno]);
} else {
- qemu_irq_lower(dev->dev.irq[intno]);
+ qemu_irq_lower(idev->irq[intno]);
}
}
--
1.8.1.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [Qemu-devel] [PATCH qom-next for-next 6/6] ipack: Move IndustryPack out of hw/char/
2013-08-02 21:16 [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Andreas Färber
` (4 preceding siblings ...)
2013-08-02 21:17 ` [Qemu-devel] [PATCH qom-next for-next 5/6] ipoctal232: QOM parent field cleanup Andreas Färber
@ 2013-08-02 21:17 ` Andreas Färber
2013-08-06 8:48 ` [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Alberto Garcia
6 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2013-08-02 21:17 UTC (permalink / raw)
To: qemu-devel; +Cc: Alberto Garcia, Andreas Färber
Move the header defining an IPackBus and IPackDevice base class into
a new include/ directory and move their implementation and a
PCI-IndustryPack bridge out of hw/char/ directory into a new hw/ipack/.
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/Makefile.objs | 1 +
hw/char/Makefile.objs | 2 +-
hw/char/ipoctal232.c | 2 +-
hw/ipack/Makefile.objs | 2 ++
hw/{char => ipack}/ipack.c | 2 +-
hw/{char => ipack}/tpci200.c | 2 +-
{hw/char => include/hw/ipack}/ipack.h | 0
7 files changed, 7 insertions(+), 4 deletions(-)
create mode 100644 hw/ipack/Makefile.objs
rename hw/{char => ipack}/ipack.c (98%)
rename hw/{char => ipack}/tpci200.c (99%)
rename {hw/char => include/hw/ipack}/ipack.h (100%)
diff --git a/hw/Makefile.objs b/hw/Makefile.objs
index 0243d6a..d2c8469 100644
--- a/hw/Makefile.objs
+++ b/hw/Makefile.objs
@@ -12,6 +12,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += i2c/
devices-dirs-$(CONFIG_SOFTMMU) += ide/
devices-dirs-$(CONFIG_SOFTMMU) += input/
devices-dirs-$(CONFIG_SOFTMMU) += intc/
+devices-dirs-$(CONFIG_IPACK) += ipack/
devices-dirs-$(CONFIG_SOFTMMU) += isa/
devices-dirs-$(CONFIG_SOFTMMU) += misc/
devices-dirs-$(CONFIG_SOFTMMU) += net/
diff --git a/hw/char/Makefile.objs b/hw/char/Makefile.objs
index f8f3dbc..494f45e 100644
--- a/hw/char/Makefile.objs
+++ b/hw/char/Makefile.objs
@@ -1,4 +1,4 @@
-common-obj-$(CONFIG_IPACK) += tpci200.o ipoctal232.o ipack.o
+common-obj-$(CONFIG_IPACK) += ipoctal232.o
common-obj-$(CONFIG_ESCC) += escc.o
common-obj-$(CONFIG_PARALLEL) += parallel.o
common-obj-$(CONFIG_PL011) += pl011.o
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index 4af9678..1ff3624 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -8,7 +8,7 @@
* later version.
*/
-#include "ipack.h"
+#include "hw/ipack/ipack.h"
#include "qemu/bitops.h"
#include "sysemu/char.h"
diff --git a/hw/ipack/Makefile.objs b/hw/ipack/Makefile.objs
new file mode 100644
index 0000000..8b9bdcb
--- /dev/null
+++ b/hw/ipack/Makefile.objs
@@ -0,0 +1,2 @@
+common-obj-$(CONFIG_IPACK) += ipack.o
+common-obj-$(CONFIG_IPACK) += tpci200.o
diff --git a/hw/char/ipack.c b/hw/ipack/ipack.c
similarity index 98%
rename from hw/char/ipack.c
rename to hw/ipack/ipack.c
index 0758fdd..66175fa 100644
--- a/hw/char/ipack.c
+++ b/hw/ipack/ipack.c
@@ -8,7 +8,7 @@
* later version.
*/
-#include "ipack.h"
+#include "hw/ipack/ipack.h"
IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot)
{
diff --git a/hw/char/tpci200.c b/hw/ipack/tpci200.c
similarity index 99%
rename from hw/char/tpci200.c
rename to hw/ipack/tpci200.c
index d9e17b2..b521721 100644
--- a/hw/char/tpci200.c
+++ b/hw/ipack/tpci200.c
@@ -8,7 +8,7 @@
* later version.
*/
-#include "ipack.h"
+#include "hw/ipack/ipack.h"
#include "hw/pci/pci.h"
#include "qemu/bitops.h"
#include <stdio.h>
diff --git a/hw/char/ipack.h b/include/hw/ipack/ipack.h
similarity index 100%
rename from hw/char/ipack.h
rename to include/hw/ipack/ipack.h
--
1.8.1.4
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next for-next 1/6] ipack: Convert to QOM realize
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 1/6] ipack: Convert to QOM realize Andreas Färber
@ 2013-08-05 15:16 ` Alberto Garcia
2013-08-05 17:46 ` Andreas Färber
0 siblings, 1 reply; 16+ messages in thread
From: Alberto Garcia @ 2013-08-05 15:16 UTC (permalink / raw)
To: Andreas Färber; +Cc: qemu-devel
On Fri, Aug 02, 2013 at 11:16:56PM +0200, Andreas Färber wrote:
> +#define IPOCTAL_GET_PARENT_CLASS(obj) \
> + OBJECT_GET_PARENT_CLASS(obj, TYPE_IPOCTAL)
Hey, I cannot make it compile with the latest master:
hw/char/ipoctal232.c: In function ‘ipoctal_realize’:
hw/char/ipoctal232.c:544:5: error: implicit declaration of function ‘OBJECT_GET_PARENT_CLASS’ [-Werror=implicit-function-declaration]
hw/char/ipoctal232.c:544:5: error: nested extern declaration of ‘OBJECT_GET_PARENT_CLASS’ [-Werror=nested-externs]
Berto
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next for-next 1/6] ipack: Convert to QOM realize
2013-08-05 15:16 ` Alberto Garcia
@ 2013-08-05 17:46 ` Andreas Färber
0 siblings, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2013-08-05 17:46 UTC (permalink / raw)
To: Alberto Garcia; +Cc: qemu-devel
Am 05.08.2013 17:16, schrieb Alberto Garcia:
> On Fri, Aug 02, 2013 at 11:16:56PM +0200, Andreas Färber wrote:
>
>> +#define IPOCTAL_GET_PARENT_CLASS(obj) \
>> + OBJECT_GET_PARENT_CLASS(obj, TYPE_IPOCTAL)
>
> Hey, I cannot make it compile with the latest master:
>
> hw/char/ipoctal232.c: In function ‘ipoctal_realize’:
> hw/char/ipoctal232.c:544:5: error: implicit declaration of function ‘OBJECT_GET_PARENT_CLASS’ [-Werror=implicit-function-declaration]
> hw/char/ipoctal232.c:544:5: error: nested extern declaration of ‘OBJECT_GET_PARENT_CLASS’ [-Werror=nested-externs]
Sorry, forgot to mention that in the cover letter: The branch linked to
has one patch before this series introducing that macro. It's on the
list as part of the virtio conversion series:
http://patchwork.ozlabs.org/patch/263863/
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] 16+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack
2013-08-02 21:16 [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Andreas Färber
` (5 preceding siblings ...)
2013-08-02 21:17 ` [Qemu-devel] [PATCH qom-next for-next 6/6] ipack: Move IndustryPack out of hw/char/ Andreas Färber
@ 2013-08-06 8:48 ` Alberto Garcia
2014-02-08 19:58 ` Andreas Färber
6 siblings, 1 reply; 16+ messages in thread
From: Alberto Garcia @ 2013-08-06 8:48 UTC (permalink / raw)
To: Andreas Färber; +Cc: qemu-devel
On Fri, Aug 02, 2013 at 11:16:55PM +0200, Andreas Färber wrote:
> This series converts IndustryPack devices to QOM realize/unrealize.
>
> It goes on to clean up file placement, promoting IndustryPack to use
> its own subdirectory like PCI, ISA, virtio, etc.
> Andreas Färber (6):
> ipack: Convert to QOM realize
> ipack: QOM parent field cleanup for IPackBus
> ipack: QOM parent field cleanup for IPackDevice
> ipack: Simplify VMSTATE_IPACK_DEVICE() macro
> ipoctal232: QOM parent field cleanup
> ipack: Move IndustryPack out of hw/char/
Acked-by: Alberto Garcia <agarcia@igalia.com>
Berto
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack
2013-08-06 8:48 ` [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Alberto Garcia
@ 2014-02-08 19:58 ` Andreas Färber
2014-02-08 23:31 ` Paolo Bonzini
2014-02-09 18:17 ` Alberto Garcia
0 siblings, 2 replies; 16+ messages in thread
From: Andreas Färber @ 2014-02-08 19:58 UTC (permalink / raw)
To: Alberto Garcia, Paolo Bonzini
Cc: Peter Maydell, Juan Quintela, qemu-devel, Michael S. Tsirkin
Am 06.08.2013 10:48, schrieb Alberto Garcia:
> On Fri, Aug 02, 2013 at 11:16:55PM +0200, Andreas Färber wrote:
>
>> This series converts IndustryPack devices to QOM realize/unrealize.
>>
>> It goes on to clean up file placement, promoting IndustryPack to use
>> its own subdirectory like PCI, ISA, virtio, etc.
>
>> Andreas Färber (6):
>> ipack: Convert to QOM realize
>> ipack: QOM parent field cleanup for IPackBus
>> ipack: QOM parent field cleanup for IPackDevice
I've now applied these three to qom-next.
>> ipack: Simplify VMSTATE_IPACK_DEVICE() macro
mst disliked the according change for a PCI VMState macro, so I've not
applied this; but my RFC VMState series has not received a lot of review
either since then, in particular not from Juan, and I've just uncovered
an issue with armv7m_nvic requiring a v2. I'll extend v2 to drop this
macro completely.
>> ipoctal232: QOM parent field cleanup
Rebased on lack of preceding patch as follows:
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index 6fe79da..99bab4d 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -155,7 +155,7 @@ static const VMStateDescription vmstate_ipoctal = {
.minimum_version_id = 1,
.minimum_version_id_old = 1,
.fields = (VMStateField[]) {
- VMSTATE_IPACK_DEVICE(dev, IPOctalState),
+ VMSTATE_IPACK_DEVICE(parent_obj, IPOctalState),
VMSTATE_STRUCT_ARRAY(ch, IPOctalState, N_CHANNELS, 1,
vmstate_scc2698_channel, SCC2698Channel),
VMSTATE_STRUCT_ARRAY(blk, IPOctalState, N_BLOCKS, 1,
>> ipack: Move IndustryPack out of hw/char/
There were unresolved IRC discussions with Paolo where exactly to place
which IndustryPack files, so that this series has been lying around.
Patch 03/06 makes it obvious that the header should live somewhere in
include/ for documenting the base QOM type though.
A minimally invasive alternative would be to move it from hw/char/ to
include/hw/char/ - would that be acceptable for everyone as first step?
The other issue was that while the ipoctal232 device is right in
hw/char/, tpci200.c and ipack.[hc] have nothing to do with char devices
- therefore this patch proposed hw/ipack/, matching drivers/ipack/ in Linux.
> Acked-by: Alberto Garcia <agarcia@igalia.com>
https://github.com/afaerber/qemu-cpu/commits/qom-next
Thanks,
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 related [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack
2014-02-08 19:58 ` Andreas Färber
@ 2014-02-08 23:31 ` Paolo Bonzini
2014-02-09 21:31 ` Paolo Bonzini
2014-02-09 18:17 ` Alberto Garcia
1 sibling, 1 reply; 16+ messages in thread
From: Paolo Bonzini @ 2014-02-08 23:31 UTC (permalink / raw)
To: Andreas Färber, Alberto Garcia
Cc: Peter Maydell, Michael S. Tsirkin, qemu-devel, Juan Quintela
Il 08/02/2014 20:58, Andreas Färber ha scritto:
> Patch 03/06 makes it obvious that the header should live somewhere in
> include/ for documenting the base QOM type though.
>
> A minimally invasive alternative would be to move it from hw/char/ to
> include/hw/char/ - would that be acceptable for everyone as first step?
Ok.
> The other issue was that while the ipoctal232 device is right in
> hw/char/, tpci200.c and ipack.[hc] have nothing to do with char devices
> - therefore this patch proposed hw/ipack/, matching drivers/ipack/ in Linux.
It's okay, but I think I asked what other IPack modules exist and I had
no answer.
Paolo
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack
2014-02-08 19:58 ` Andreas Färber
2014-02-08 23:31 ` Paolo Bonzini
@ 2014-02-09 18:17 ` Alberto Garcia
1 sibling, 0 replies; 16+ messages in thread
From: Alberto Garcia @ 2014-02-09 18:17 UTC (permalink / raw)
To: Andreas Färber
Cc: Peter Maydell, Paolo Bonzini, Juan Quintela, qemu-devel,
Michael S. Tsirkin
On Sat, Feb 08, 2014 at 08:58:35PM +0100, Andreas Färber wrote:
> >> ipack: Move IndustryPack out of hw/char/
>
> There were unresolved IRC discussions with Paolo where exactly to
> place which IndustryPack files, so that this series has been lying
> around.
As I had explained some time ago I was only interested in the
combination of the TPCI200 and IPOctal boards, but I decided to
emulate them as separate devices because it seemed like a better
design to me. But I'm fine with whatever solution, even merging those
source files if it makes sense.
Berto
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack
2014-02-08 23:31 ` Paolo Bonzini
@ 2014-02-09 21:31 ` Paolo Bonzini
2014-02-09 21:46 ` Alberto Garcia
2014-02-09 22:12 ` Andreas Färber
0 siblings, 2 replies; 16+ messages in thread
From: Paolo Bonzini @ 2014-02-09 21:31 UTC (permalink / raw)
To: Andreas Färber, Alberto Garcia
Cc: Peter Maydell, Juan Quintela, qemu-devel, Michael S. Tsirkin
Il 09/02/2014 00:31, Paolo Bonzini ha scritto:
>
>> The other issue was that while the ipoctal232 device is right in
>> hw/char/, tpci200.c and ipack.[hc] have nothing to do with char devices
>> - therefore this patch proposed hw/ipack/, matching drivers/ipack/ in
>> Linux.
>
> It's okay, but I think I asked what other IPack modules exist and I had
> no answer.
I found more IPack here:
http://www.acromag.com/catalog/84/Embedded_I_O_Boards/Industry_Pack_I_O_Modules
so hw/ipack is fine.
Paolo
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack
2014-02-09 21:31 ` Paolo Bonzini
@ 2014-02-09 21:46 ` Alberto Garcia
2014-02-09 22:12 ` Andreas Färber
1 sibling, 0 replies; 16+ messages in thread
From: Alberto Garcia @ 2014-02-09 21:46 UTC (permalink / raw)
To: Paolo Bonzini
Cc: qemu-devel, Peter Maydell, Juan Quintela, Andreas Färber,
Michael S. Tsirkin
On Sun, Feb 09, 2014 at 10:31:33PM +0100, Paolo Bonzini wrote:
> >It's okay, but I think I asked what other IPack modules exist and I
> >had no answer.
>
> I found more IPack here: http://www.acromag.com/catalog/84/Embedded_I_O_Boards/Industry_Pack_I_O_Modules
>
> so hw/ipack is fine.
Also:
http://defense.ge-ip.com/products/industrypack-modules/c36
including the IPOctal-232.
Berto
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack
2014-02-09 21:31 ` Paolo Bonzini
2014-02-09 21:46 ` Alberto Garcia
@ 2014-02-09 22:12 ` Andreas Färber
1 sibling, 0 replies; 16+ messages in thread
From: Andreas Färber @ 2014-02-09 22:12 UTC (permalink / raw)
To: Paolo Bonzini, Alberto Garcia
Cc: Peter Maydell, Juan Quintela, qemu-devel, Michael S. Tsirkin
Am 09.02.2014 22:31, schrieb Paolo Bonzini:
> Il 09/02/2014 00:31, Paolo Bonzini ha scritto:
>>
>>> The other issue was that while the ipoctal232 device is right in
>>> hw/char/, tpci200.c and ipack.[hc] have nothing to do with char devices
>>> - therefore this patch proposed hw/ipack/, matching drivers/ipack/ in
>>> Linux.
>>
>> It's okay, but I think I asked what other IPack modules exist and I had
>> no answer.
>
> I found more IPack here:
> http://www.acromag.com/catalog/84/Embedded_I_O_Boards/Industry_Pack_I_O_Modules
>
>
> so hw/ipack is fine.
Okay, so applying the original patch after all:
https://github.com/afaerber/qemu-cpu/commits/qom-next
Another old branch gone. :)
Cheers,
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] 16+ messages in thread
end of thread, other threads:[~2014-02-09 22:12 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-02 21:16 [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 1/6] ipack: Convert to QOM realize Andreas Färber
2013-08-05 15:16 ` Alberto Garcia
2013-08-05 17:46 ` Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 2/6] ipack: QOM parent field cleanup for IPackBus Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 3/6] ipack: QOM parent field cleanup for IPackDevice Andreas Färber
2013-08-02 21:16 ` [Qemu-devel] [PATCH qom-next for-next 4/6] ipack: Simplify VMSTATE_IPACK_DEVICE() macro Andreas Färber
2013-08-02 21:17 ` [Qemu-devel] [PATCH qom-next for-next 5/6] ipoctal232: QOM parent field cleanup Andreas Färber
2013-08-02 21:17 ` [Qemu-devel] [PATCH qom-next for-next 6/6] ipack: Move IndustryPack out of hw/char/ Andreas Färber
2013-08-06 8:48 ` [Qemu-devel] [PATCH qom-next for-next 0/6] QOM realize for IndustryPack Alberto Garcia
2014-02-08 19:58 ` Andreas Färber
2014-02-08 23:31 ` Paolo Bonzini
2014-02-09 21:31 ` Paolo Bonzini
2014-02-09 21:46 ` Alberto Garcia
2014-02-09 22:12 ` Andreas Färber
2014-02-09 18:17 ` Alberto Garcia
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.