All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices
@ 2016-03-29  7:47 xiaoqiang zhao
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 1/6] hw/char: QOM'ify escc.c xiaoqiang zhao
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: xiaoqiang zhao @ 2016-03-29  7:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: cornelia.huck, pbonzini, michael, agraf, edgar.iglesias

This patch set trys to QOM'ify hw/char files, see commit messages 
for more details

Changes in v2:
* rename TYPE_SCLP_LM_CONSOLE to TYPE_SCLPLM_CONSOLE which is suggested by 
  Cornelia Huck <cornelia.huck@de.ibm.com>
* rebase on the current master

xiaoqiang zhao (6):
  hw/char: QOM'ify escc.c
  hw/char: QOM'ify etraxfs_ser.c
  hw/char: QOM'ify lm32_juart.c
  hw/char: QOM'ify lm32_uart.c
  hw/char: QOM'ify sclpconsole-lm.c
  hw/char: QOM'ify sclpconsole.c

 hw/char/escc.c           | 12 +++++-------
 hw/char/etraxfs_ser.c    | 11 +++++------
 hw/char/lm32_juart.c     |  9 +++------
 hw/char/lm32_uart.c      | 12 +++++-------
 hw/char/sclpconsole-lm.c | 14 +++++++++-----
 hw/char/sclpconsole.c    | 12 ++++++++----
 6 files changed, 35 insertions(+), 35 deletions(-)

-- 
2.1.4

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

* [Qemu-devel] [PATCH v2 1/6] hw/char: QOM'ify escc.c
  2016-03-29  7:47 [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices xiaoqiang zhao
@ 2016-03-29  7:47 ` xiaoqiang zhao
  2016-05-09 10:41   ` Paolo Bonzini
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 2/6] hw/char: QOM'ify etraxfs_ser.c xiaoqiang zhao
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: xiaoqiang zhao @ 2016-03-29  7:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: cornelia.huck, pbonzini, michael, agraf, edgar.iglesias

Drop the old SysBus init function and use instance_init

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
---
 hw/char/escc.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/hw/char/escc.c b/hw/char/escc.c
index 7bf09a0..b802c3e 100644
--- a/hw/char/escc.c
+++ b/hw/char/escc.c
@@ -983,9 +983,10 @@ void slavio_serial_ms_kbd_init(hwaddr base, qemu_irq irq,
     sysbus_mmio_map(s, 0, base);
 }
 
-static int escc_init1(SysBusDevice *dev)
+static void escc_init1(Object *obj)
 {
-    ESCCState *s = ESCC(dev);
+    ESCCState *s = ESCC(obj);
+    SysBusDevice *dev = SYS_BUS_DEVICE(obj);
     unsigned int i;
 
     s->chn[0].disabled = s->disabled;
@@ -1002,7 +1003,7 @@ static int escc_init1(SysBusDevice *dev)
     s->chn[0].otherchn = &s->chn[1];
     s->chn[1].otherchn = &s->chn[0];
 
-    memory_region_init_io(&s->mmio, OBJECT(s), &escc_mem_ops, s, "escc",
+    memory_region_init_io(&s->mmio, obj, &escc_mem_ops, s, "escc",
                           ESCC_SIZE << s->it_shift);
     sysbus_init_mmio(dev, &s->mmio);
 
@@ -1014,8 +1015,6 @@ static int escc_init1(SysBusDevice *dev)
         s->chn[1].hs = qemu_input_handler_register((DeviceState *)(&s->chn[1]),
                                                    &sunkbd_handler);
     }
-
-    return 0;
 }
 
 static Property escc_properties[] = {
@@ -1032,9 +1031,7 @@ static Property escc_properties[] = {
 static void escc_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
 
-    k->init = escc_init1;
     dc->reset = escc_reset;
     dc->vmsd = &vmstate_escc;
     dc->props = escc_properties;
@@ -1045,6 +1042,7 @@ static const TypeInfo escc_info = {
     .name          = TYPE_ESCC,
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(ESCCState),
+    .instance_init = escc_init1,
     .class_init    = escc_class_init,
 };
 
-- 
2.1.4

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

* [Qemu-devel] [PATCH v2 2/6] hw/char: QOM'ify etraxfs_ser.c
  2016-03-29  7:47 [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices xiaoqiang zhao
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 1/6] hw/char: QOM'ify escc.c xiaoqiang zhao
@ 2016-03-29  7:47 ` xiaoqiang zhao
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 3/6] hw/char: QOM'ify lm32_juart.c xiaoqiang zhao
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: xiaoqiang zhao @ 2016-03-29  7:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: cornelia.huck, pbonzini, michael, agraf, edgar.iglesias

Drop the old SysBus init function and use instance_init

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
---
 hw/char/etraxfs_ser.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c
index 146b387..ede7024 100644
--- a/hw/char/etraxfs_ser.c
+++ b/hw/char/etraxfs_ser.c
@@ -209,12 +209,13 @@ static void etraxfs_ser_reset(DeviceState *d)
 
 }
 
-static int etraxfs_ser_init(SysBusDevice *dev)
+static void etraxfs_ser_init(Object *obj)
 {
-    ETRAXSerial *s = ETRAX_SERIAL(dev);
+    ETRAXSerial *s = ETRAX_SERIAL(obj);
+    SysBusDevice *dev = SYS_BUS_DEVICE(obj);
 
     sysbus_init_irq(dev, &s->irq);
-    memory_region_init_io(&s->mmio, OBJECT(s), &ser_ops, s,
+    memory_region_init_io(&s->mmio, obj, &ser_ops, s,
                           "etraxfs-serial", R_MAX * 4);
     sysbus_init_mmio(dev, &s->mmio);
 
@@ -225,15 +226,12 @@ static int etraxfs_ser_init(SysBusDevice *dev)
                               serial_can_receive, serial_receive,
                               serial_event, s);
     }
-    return 0;
 }
 
 static void etraxfs_ser_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
 
-    k->init = etraxfs_ser_init;
     dc->reset = etraxfs_ser_reset;
     /* Reason: init() method uses qemu_char_get_next_serial() */
     dc->cannot_instantiate_with_device_add_yet = true;
@@ -243,6 +241,7 @@ static const TypeInfo etraxfs_ser_info = {
     .name          = TYPE_ETRAX_FS_SERIAL,
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(ETRAXSerial),
+    .instance_init = etraxfs_ser_init,
     .class_init    = etraxfs_ser_class_init,
 };
 
-- 
2.1.4

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

* [Qemu-devel] [PATCH v2 3/6] hw/char: QOM'ify lm32_juart.c
  2016-03-29  7:47 [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices xiaoqiang zhao
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 1/6] hw/char: QOM'ify escc.c xiaoqiang zhao
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 2/6] hw/char: QOM'ify etraxfs_ser.c xiaoqiang zhao
@ 2016-03-29  7:47 ` xiaoqiang zhao
  2016-05-09  9:08   ` michael
  2016-05-09 10:43   ` Paolo Bonzini
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 4/6] hw/char: QOM'ify lm32_uart.c xiaoqiang zhao
                   ` (3 subsequent siblings)
  6 siblings, 2 replies; 18+ messages in thread
From: xiaoqiang zhao @ 2016-03-29  7:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: cornelia.huck, pbonzini, michael, agraf, edgar.iglesias

Drop the old SysBus init function and use instance_init

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
---
 hw/char/lm32_juart.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/hw/char/lm32_juart.c b/hw/char/lm32_juart.c
index 5bf8acf..cd8d0ee 100644
--- a/hw/char/lm32_juart.c
+++ b/hw/char/lm32_juart.c
@@ -114,17 +114,15 @@ static void juart_reset(DeviceState *d)
     s->jrx = 0;
 }
 
-static int lm32_juart_init(SysBusDevice *dev)
+static void lm32_juart_init(Object *obj)
 {
-    LM32JuartState *s = LM32_JUART(dev);
+    LM32JuartState *s = LM32_JUART(obj);
 
     /* FIXME use a qdev chardev prop instead of qemu_char_get_next_serial() */
     s->chr = qemu_char_get_next_serial();
     if (s->chr) {
         qemu_chr_add_handlers(s->chr, juart_can_rx, juart_rx, juart_event, s);
     }
-
-    return 0;
 }
 
 static const VMStateDescription vmstate_lm32_juart = {
@@ -141,9 +139,7 @@ static const VMStateDescription vmstate_lm32_juart = {
 static void lm32_juart_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
 
-    k->init = lm32_juart_init;
     dc->reset = juart_reset;
     dc->vmsd = &vmstate_lm32_juart;
     /* Reason: init() method uses qemu_char_get_next_serial() */
@@ -154,6 +150,7 @@ static const TypeInfo lm32_juart_info = {
     .name          = TYPE_LM32_JUART,
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(LM32JuartState),
+    .instance_init = lm32_juart_init,
     .class_init    = lm32_juart_class_init,
 };
 
-- 
2.1.4

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

* [Qemu-devel] [PATCH v2 4/6] hw/char: QOM'ify lm32_uart.c
  2016-03-29  7:47 [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices xiaoqiang zhao
                   ` (2 preceding siblings ...)
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 3/6] hw/char: QOM'ify lm32_juart.c xiaoqiang zhao
@ 2016-03-29  7:47 ` xiaoqiang zhao
  2016-05-09  9:08   ` michael
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 5/6] hw/char: QOM'ify sclpconsole-lm.c xiaoqiang zhao
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: xiaoqiang zhao @ 2016-03-29  7:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: cornelia.huck, pbonzini, michael, agraf, edgar.iglesias

Drop the old SysBus init function and use instance_init

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
---
 hw/char/lm32_uart.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/hw/char/lm32_uart.c b/hw/char/lm32_uart.c
index 036813d..f29054b 100644
--- a/hw/char/lm32_uart.c
+++ b/hw/char/lm32_uart.c
@@ -249,13 +249,14 @@ static void uart_reset(DeviceState *d)
     s->regs[R_LSR] = LSR_THRE | LSR_TEMT;
 }
 
-static int lm32_uart_init(SysBusDevice *dev)
+static void lm32_uart_init(Object *obj)
 {
-    LM32UartState *s = LM32_UART(dev);
+    LM32UartState *s = LM32_UART(obj);
+    SysBusDevice *dev = SYS_BUS_DEVICE(obj);
 
     sysbus_init_irq(dev, &s->irq);
 
-    memory_region_init_io(&s->iomem, OBJECT(s), &uart_ops, s,
+    memory_region_init_io(&s->iomem, obj, &uart_ops, s,
                           "uart", R_MAX * 4);
     sysbus_init_mmio(dev, &s->iomem);
 
@@ -264,8 +265,6 @@ static int lm32_uart_init(SysBusDevice *dev)
     if (s->chr) {
         qemu_chr_add_handlers(s->chr, uart_can_rx, uart_rx, uart_event, s);
     }
-
-    return 0;
 }
 
 static const VMStateDescription vmstate_lm32_uart = {
@@ -281,9 +280,7 @@ static const VMStateDescription vmstate_lm32_uart = {
 static void lm32_uart_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
-    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
 
-    k->init = lm32_uart_init;
     dc->reset = uart_reset;
     dc->vmsd = &vmstate_lm32_uart;
     /* Reason: init() method uses qemu_char_get_next_serial() */
@@ -294,6 +291,7 @@ static const TypeInfo lm32_uart_info = {
     .name          = TYPE_LM32_UART,
     .parent        = TYPE_SYS_BUS_DEVICE,
     .instance_size = sizeof(LM32UartState),
+    .instance_init = lm32_uart_init,
     .class_init    = lm32_uart_class_init,
 };
 
-- 
2.1.4

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

* [Qemu-devel] [PATCH v2 5/6] hw/char: QOM'ify sclpconsole-lm.c
  2016-03-29  7:47 [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices xiaoqiang zhao
                   ` (3 preceding siblings ...)
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 4/6] hw/char: QOM'ify lm32_uart.c xiaoqiang zhao
@ 2016-03-29  7:47 ` xiaoqiang zhao
  2016-05-09  9:05   ` Cornelia Huck
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 6/6] hw/char: QOM'ify sclpconsole.c xiaoqiang zhao
  2016-05-05 10:38 ` [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices 赵小强
  6 siblings, 1 reply; 18+ messages in thread
From: xiaoqiang zhao @ 2016-03-29  7:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: cornelia.huck, pbonzini, michael, agraf, edgar.iglesias

Drop the DO_UPCAST macro

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
---
 hw/char/sclpconsole-lm.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/hw/char/sclpconsole-lm.c b/hw/char/sclpconsole-lm.c
index 7d4ff81..a22ad8d 100644
--- a/hw/char/sclpconsole-lm.c
+++ b/hw/char/sclpconsole-lm.c
@@ -44,6 +44,10 @@ typedef struct SCLPConsoleLM {
     uint8_t buf[SIZE_CONSOLE_BUFFER];
 } SCLPConsoleLM;
 
+#define TYPE_SCLPLM_CONSOLE "sclplmconsole"
+#define SCLPLM_CONSOLE(obj) \
+    OBJECT_CHECK(SCLPConsoleLM, (obj), TYPE_SCLPLM_CONSOLE)
+
 /*
 *  Character layer call-back functions
  *
@@ -116,7 +120,7 @@ static int get_console_data(SCLPEvent *event, uint8_t *buf, size_t *size,
 {
     int len;
 
-    SCLPConsoleLM *cons = DO_UPCAST(SCLPConsoleLM, event, event);
+    SCLPConsoleLM *cons = SCLPLM_CONSOLE(event);
 
     len = cons->length;
     /* data need to fit into provided SCLP buffer */
@@ -190,7 +194,7 @@ static int write_console_data(SCLPEvent *event, const uint8_t *buf, int len)
     int ret = 0;
     const uint8_t *buf_offset;
 
-    SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+    SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
 
     if (!scon->chr) {
         /* If there's no backend, we can just say we consumed all data. */
@@ -244,7 +248,7 @@ static int write_event_data(SCLPEvent *event, EventBufferHeader *ebh)
     int errors = 0;
     MDBO *mdbo;
     SclpMsg *data = (SclpMsg *) ebh;
-    SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+    SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
 
     len = be16_to_cpu(data->mdb.header.length);
     if (len < sizeof(data->mdb.header)) {
@@ -313,7 +317,7 @@ static int console_init(SCLPEvent *event)
 {
     static bool console_available;
 
-    SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+    SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
 
     if (console_available) {
         error_report("Multiple line-mode operator consoles are not supported");
@@ -336,7 +340,7 @@ static int console_exit(SCLPEvent *event)
 static void console_reset(DeviceState *dev)
 {
    SCLPEvent *event = SCLP_EVENT(dev);
-   SCLPConsoleLM *scon = DO_UPCAST(SCLPConsoleLM, event, event);
+   SCLPConsoleLM *scon = SCLPLM_CONSOLE(event);
 
    event->event_pending = false;
    scon->length = 0;
-- 
2.1.4

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

* [Qemu-devel] [PATCH v2 6/6] hw/char: QOM'ify sclpconsole.c
  2016-03-29  7:47 [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices xiaoqiang zhao
                   ` (4 preceding siblings ...)
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 5/6] hw/char: QOM'ify sclpconsole-lm.c xiaoqiang zhao
@ 2016-03-29  7:47 ` xiaoqiang zhao
  2016-05-09  9:05   ` Cornelia Huck
  2016-05-05 10:38 ` [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices 赵小强
  6 siblings, 1 reply; 18+ messages in thread
From: xiaoqiang zhao @ 2016-03-29  7:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: cornelia.huck, pbonzini, michael, agraf, edgar.iglesias

Drop the DO_UPCAST macro

Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
---
 hw/char/sclpconsole.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/char/sclpconsole.c b/hw/char/sclpconsole.c
index 45997ff..15a5b2b 100644
--- a/hw/char/sclpconsole.c
+++ b/hw/char/sclpconsole.c
@@ -40,6 +40,10 @@ typedef struct SCLPConsole {
     bool notify;            /* qemu_notify_event() req'd if true           */
 } SCLPConsole;
 
+#define TYPE_SCLP_CONSOLE "sclpconsole"
+#define SCLP_CONSOLE(obj) \
+    OBJECT_CHECK(SCLPConsole, (obj), TYPE_SCLP_CONSOLE)
+
 /* character layer call-back functions */
 
 /* Return number of bytes that fit into iov buffer */
@@ -95,7 +99,7 @@ static unsigned int receive_mask(void)
 static void get_console_data(SCLPEvent *event, uint8_t *buf, size_t *size,
                              int avail)
 {
-    SCLPConsole *cons = DO_UPCAST(SCLPConsole, event, event);
+    SCLPConsole *cons = SCLP_CONSOLE(event);
 
     /* first byte is hex 0 saying an ascii string follows */
     *buf++ = '\0';
@@ -157,7 +161,7 @@ static int read_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr,
 static ssize_t write_console_data(SCLPEvent *event, const uint8_t *buf,
                                   size_t len)
 {
-    SCLPConsole *scon = DO_UPCAST(SCLPConsole, event, event);
+    SCLPConsole *scon = SCLP_CONSOLE(event);
 
     if (!scon->chr) {
         /* If there's no backend, we can just say we consumed all data. */
@@ -214,7 +218,7 @@ static int console_init(SCLPEvent *event)
 {
     static bool console_available;
 
-    SCLPConsole *scon = DO_UPCAST(SCLPConsole, event, event);
+    SCLPConsole *scon = SCLP_CONSOLE(event);
 
     if (console_available) {
         error_report("Multiple VT220 operator consoles are not supported");
@@ -232,7 +236,7 @@ static int console_init(SCLPEvent *event)
 static void console_reset(DeviceState *dev)
 {
    SCLPEvent *event = SCLP_EVENT(dev);
-   SCLPConsole *scon = DO_UPCAST(SCLPConsole, event, event);
+   SCLPConsole *scon = SCLP_CONSOLE(event);
 
    event->event_pending = false;
    scon->iov_sclp = 0;
-- 
2.1.4

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

* Re: [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices
  2016-03-29  7:47 [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices xiaoqiang zhao
                   ` (5 preceding siblings ...)
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 6/6] hw/char: QOM'ify sclpconsole.c xiaoqiang zhao
@ 2016-05-05 10:38 ` 赵小强
  2016-05-05 12:51   ` Peter Maydell
  6 siblings, 1 reply; 18+ messages in thread
From: 赵小强 @ 2016-05-05 10:38 UTC (permalink / raw)
  To: xiaoqiang zhao
  Cc: qemu-devel, pbonzini, cornelia.huck, michael, agraf, edgar.iglesias











At 2016-03-29 15:47:19, "xiaoqiang zhao" <zxq_yx_007@163.com> wrote:
>This patch set trys to QOM'ify hw/char files, see commit messages 
>for more details
>
>Changes in v2:
>* rename TYPE_SCLP_LM_CONSOLE to TYPE_SCLPLM_CONSOLE which is suggested by 
>  Cornelia Huck <cornelia.huck@de.ibm.com>
>* rebase on the current master
>
>xiaoqiang zhao (6):
>  hw/char: QOM'ify escc.c
>  hw/char: QOM'ify etraxfs_ser.c
>  hw/char: QOM'ify lm32_juart.c
>  hw/char: QOM'ify lm32_uart.c
>  hw/char: QOM'ify sclpconsole-lm.c
>  hw/char: QOM'ify sclpconsole.c
>
> hw/char/escc.c           | 12 +++++-------
> hw/char/etraxfs_ser.c    | 11 +++++------
> hw/char/lm32_juart.c     |  9 +++------
> hw/char/lm32_uart.c      | 12 +++++-------
> hw/char/sclpconsole-lm.c | 14 +++++++++-----
> hw/char/sclpconsole.c    | 12 ++++++++----
> 6 files changed, 35 insertions(+), 35 deletions(-)
>
>-- 
>2.1.4
>

ping ???

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

* Re: [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices
  2016-05-05 10:38 ` [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices 赵小强
@ 2016-05-05 12:51   ` Peter Maydell
  2016-05-05 14:04     ` xiaoqiang zhao
                       ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Peter Maydell @ 2016-05-05 12:51 UTC (permalink / raw)
  To: 赵小强
  Cc: QEMU Developers, Alexander Graf, Michael Walle,
	Edgar E. Iglesias, Cornelia Huck, Paolo Bonzini

On 5 May 2016 at 11:38, 赵小强 <zxq_yx_007@163.com> wrote:
> At 2016-03-29 15:47:19, "xiaoqiang zhao" <zxq_yx_007@163.com> wrote:
>>This patch set trys to QOM'ify hw/char files, see commit messages
>>for more details
>>
>>Changes in v2:
>>* rename TYPE_SCLP_LM_CONSOLE to TYPE_SCLPLM_CONSOLE which is suggested by
>>  Cornelia Huck <cornelia.huck@de.ibm.com>
>>* rebase on the current master
>>
>>xiaoqiang zhao (6):
>>  hw/char: QOM'ify escc.c
>>  hw/char: QOM'ify etraxfs_ser.c
>>  hw/char: QOM'ify lm32_juart.c
>>  hw/char: QOM'ify lm32_uart.c
>>  hw/char: QOM'ify sclpconsole-lm.c
>>  hw/char: QOM'ify sclpconsole.c
>>
>> hw/char/escc.c           | 12 +++++-------
>> hw/char/etraxfs_ser.c    | 11 +++++------
>> hw/char/lm32_juart.c     |  9 +++------
>> hw/char/lm32_uart.c      | 12 +++++-------
>> hw/char/sclpconsole-lm.c | 14 +++++++++-----
>> hw/char/sclpconsole.c    | 12 ++++++++----
>> 6 files changed, 35 insertions(+), 35 deletions(-)
>>
>>--
>>2.1.4
>>
>
> ping ???

I think you will have better luck if you rearrange all these
QOM patches so that you provide them as one series per board
or per target architecture, not one per type of device.
There is no single person with responsibility for "all of
hw/char" so structuring your cleanup patchsets like this will
tend to result in the people who might care about the devices
not looking at them. (Also you can concentrate on the devices
which are actively maintained, like ARM ones, x86 ones, MIPS
and SPARC ones, rather than the oddballs semi-orphaned ones
like lm32, CRIS, etc.)

thanks
-- PMM

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

* Re: [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices
  2016-05-05 12:51   ` Peter Maydell
@ 2016-05-05 14:04     ` xiaoqiang zhao
  2016-05-06  7:37     ` Markus Armbruster
  2016-05-09 10:44     ` Paolo Bonzini
  2 siblings, 0 replies; 18+ messages in thread
From: xiaoqiang zhao @ 2016-05-05 14:04 UTC (permalink / raw)
  To: Peter Maydell
  Cc: QEMU Developers, Alexander Graf, Michael Walle,
	Edgar E. Iglesias, Cornelia Huck, Paolo Bonzini


> 在 2016年5月5日,20:51,Peter Maydell <peter.maydell@linaro.org> 写道:
> 
>> On 5 May 2016 at 11:38, 赵小强 <zxq_yx_007@163.com> wrote:
>> At 2016-03-29 15:47:19, "xiaoqiang zhao" <zxq_yx_007@163.com> wrote:
>>> This patch set trys to QOM'ify hw/char files, see commit messages
>>> for more details
>>> 
>>> Changes in v2:
>>> * rename TYPE_SCLP_LM_CONSOLE to TYPE_SCLPLM_CONSOLE which is suggested by
>>> Cornelia Huck <cornelia.huck@de.ibm.com>
>>> * rebase on the current master
>>> 
>>> xiaoqiang zhao (6):
>>> hw/char: QOM'ify escc.c
>>> hw/char: QOM'ify etraxfs_ser.c
>>> hw/char: QOM'ify lm32_juart.c
>>> hw/char: QOM'ify lm32_uart.c
>>> hw/char: QOM'ify sclpconsole-lm.c
>>> hw/char: QOM'ify sclpconsole.c
>>> 
>>> hw/char/escc.c           | 12 +++++-------
>>> hw/char/etraxfs_ser.c    | 11 +++++------
>>> hw/char/lm32_juart.c     |  9 +++------
>>> hw/char/lm32_uart.c      | 12 +++++-------
>>> hw/char/sclpconsole-lm.c | 14 +++++++++-----
>>> hw/char/sclpconsole.c    | 12 ++++++++----
>>> 6 files changed, 35 insertions(+), 35 deletions(-)
>>> 
>>> --
>>> 2.1.4
>> 
>> ping ???
> 
> I think you will have better luck if you rearrange all these
> QOM patches so that you provide them as one series per board
> or per target architecture, not one per type of device.
> There is no single person with responsibility for "all of
> hw/char" so structuring your cleanup patchsets like this will
> tend to result in the people who might care about the devices
> not looking at them. (Also you can concentrate on the devices
> which are actively maintained, like ARM ones, x86 ones, MIPS
> and SPARC ones, rather than the oddballs semi-orphaned ones
> like lm32, CRIS, etc.)
> 
> thanks
> -- PMM

Thanks peter, Sounds reasonable!

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

* Re: [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices
  2016-05-05 12:51   ` Peter Maydell
  2016-05-05 14:04     ` xiaoqiang zhao
@ 2016-05-06  7:37     ` Markus Armbruster
  2016-05-09 10:44     ` Paolo Bonzini
  2 siblings, 0 replies; 18+ messages in thread
From: Markus Armbruster @ 2016-05-06  7:37 UTC (permalink / raw)
  To: Peter Maydell
  Cc: 赵小强,
	QEMU Developers, Alexander Graf, Michael Walle, Paolo Bonzini,
	Cornelia Huck, Edgar E. Iglesias

Peter Maydell <peter.maydell@linaro.org> writes:

> On 5 May 2016 at 11:38, 赵小强 <zxq_yx_007@163.com> wrote:
>> At 2016-03-29 15:47:19, "xiaoqiang zhao" <zxq_yx_007@163.com> wrote:
>>>This patch set trys to QOM'ify hw/char files, see commit messages
>>>for more details
>>>
>>>Changes in v2:
>>>* rename TYPE_SCLP_LM_CONSOLE to TYPE_SCLPLM_CONSOLE which is suggested by
>>>  Cornelia Huck <cornelia.huck@de.ibm.com>
>>>* rebase on the current master
>>>
>>>xiaoqiang zhao (6):
>>>  hw/char: QOM'ify escc.c
>>>  hw/char: QOM'ify etraxfs_ser.c
>>>  hw/char: QOM'ify lm32_juart.c
>>>  hw/char: QOM'ify lm32_uart.c
>>>  hw/char: QOM'ify sclpconsole-lm.c
>>>  hw/char: QOM'ify sclpconsole.c
>>>
>>> hw/char/escc.c           | 12 +++++-------
>>> hw/char/etraxfs_ser.c    | 11 +++++------
>>> hw/char/lm32_juart.c     |  9 +++------
>>> hw/char/lm32_uart.c      | 12 +++++-------
>>> hw/char/sclpconsole-lm.c | 14 +++++++++-----
>>> hw/char/sclpconsole.c    | 12 ++++++++----
>>> 6 files changed, 35 insertions(+), 35 deletions(-)
>>>
>>>--
>>>2.1.4
>>>
>>
>> ping ???
>
> I think you will have better luck if you rearrange all these
> QOM patches so that you provide them as one series per board
> or per target architecture, not one per type of device.
> There is no single person with responsibility for "all of
> hw/char" so structuring your cleanup patchsets like this will
> tend to result in the people who might care about the devices
> not looking at them. (Also you can concentrate on the devices
> which are actively maintained, like ARM ones, x86 ones, MIPS
> and SPARC ones, rather than the oddballs semi-orphaned ones
> like lm32, CRIS, etc.)

But please don't throw away your cleanups for the oddballs just yet.
Unloved code keeping obsolete internal interfaces alive is a problem
worth reducing.

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

* Re: [Qemu-devel] [PATCH v2 5/6] hw/char: QOM'ify sclpconsole-lm.c
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 5/6] hw/char: QOM'ify sclpconsole-lm.c xiaoqiang zhao
@ 2016-05-09  9:05   ` Cornelia Huck
  0 siblings, 0 replies; 18+ messages in thread
From: Cornelia Huck @ 2016-05-09  9:05 UTC (permalink / raw)
  To: xiaoqiang zhao; +Cc: qemu-devel, pbonzini, michael, agraf, edgar.iglesias

On Tue, 29 Mar 2016 15:47:24 +0800
xiaoqiang zhao <zxq_yx_007@163.com> wrote:

> Drop the DO_UPCAST macro
> 
> Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
> ---
>  hw/char/sclpconsole-lm.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)

Thanks, applied to my s390-next branch.

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

* Re: [Qemu-devel] [PATCH v2 6/6] hw/char: QOM'ify sclpconsole.c
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 6/6] hw/char: QOM'ify sclpconsole.c xiaoqiang zhao
@ 2016-05-09  9:05   ` Cornelia Huck
  0 siblings, 0 replies; 18+ messages in thread
From: Cornelia Huck @ 2016-05-09  9:05 UTC (permalink / raw)
  To: xiaoqiang zhao; +Cc: qemu-devel, pbonzini, michael, agraf, edgar.iglesias

On Tue, 29 Mar 2016 15:47:25 +0800
xiaoqiang zhao <zxq_yx_007@163.com> wrote:

> Drop the DO_UPCAST macro
> 
> Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
> ---
>  hw/char/sclpconsole.c | 12 ++++++++----
>  1 file changed, 8 insertions(+), 4 deletions(-)

Thanks, applied to my s390-next branch.

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

* Re: [Qemu-devel] [PATCH v2 4/6] hw/char: QOM'ify lm32_uart.c
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 4/6] hw/char: QOM'ify lm32_uart.c xiaoqiang zhao
@ 2016-05-09  9:08   ` michael
  0 siblings, 0 replies; 18+ messages in thread
From: michael @ 2016-05-09  9:08 UTC (permalink / raw)
  To: xiaoqiang zhao; +Cc: qemu-devel, pbonzini, cornelia.huck, agraf, edgar.iglesias

Am 2016-03-29 09:47, schrieb xiaoqiang zhao:
> Drop the old SysBus init function and use instance_init
> 
> Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>

Acked-by: Michael Walle <michael@walle.cc>
Tested-by: Michael Walle <michael@walle.cc>

-michael

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

* Re: [Qemu-devel] [PATCH v2 3/6] hw/char: QOM'ify lm32_juart.c
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 3/6] hw/char: QOM'ify lm32_juart.c xiaoqiang zhao
@ 2016-05-09  9:08   ` michael
  2016-05-09 10:43   ` Paolo Bonzini
  1 sibling, 0 replies; 18+ messages in thread
From: michael @ 2016-05-09  9:08 UTC (permalink / raw)
  To: xiaoqiang zhao; +Cc: qemu-devel, pbonzini, cornelia.huck, agraf, edgar.iglesias

Am 2016-03-29 09:47, schrieb xiaoqiang zhao:
> Drop the old SysBus init function and use instance_init
> 
> Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>

Acked-by: Michael Walle <michael@walle.cc>
Tested-by: Michael Walle <michael@walle.cc>

-michael

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

* Re: [Qemu-devel] [PATCH v2 1/6] hw/char: QOM'ify escc.c
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 1/6] hw/char: QOM'ify escc.c xiaoqiang zhao
@ 2016-05-09 10:41   ` Paolo Bonzini
  0 siblings, 0 replies; 18+ messages in thread
From: Paolo Bonzini @ 2016-05-09 10:41 UTC (permalink / raw)
  To: xiaoqiang zhao, qemu-devel; +Cc: cornelia.huck, michael, agraf, edgar.iglesias



On 29/03/2016 09:47, xiaoqiang zhao wrote:
> Drop the old SysBus init function and use instance_init
> 
> Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
> ---
>  hw/char/escc.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/hw/char/escc.c b/hw/char/escc.c
> index 7bf09a0..b802c3e 100644
> --- a/hw/char/escc.c
> +++ b/hw/char/escc.c
> @@ -983,9 +983,10 @@ void slavio_serial_ms_kbd_init(hwaddr base, qemu_irq irq,
>      sysbus_mmio_map(s, 0, base);
>  }
>  
> -static int escc_init1(SysBusDevice *dev)
> +static void escc_init1(Object *obj)
>  {
> -    ESCCState *s = ESCC(dev);
> +    ESCCState *s = ESCC(obj);
> +    SysBusDevice *dev = SYS_BUS_DEVICE(obj);
>      unsigned int i;
>  
>      s->chn[0].disabled = s->disabled;
> @@ -1002,7 +1003,7 @@ static int escc_init1(SysBusDevice *dev)
>      s->chn[0].otherchn = &s->chn[1];
>      s->chn[1].otherchn = &s->chn[0];
>  
> -    memory_region_init_io(&s->mmio, OBJECT(s), &escc_mem_ops, s, "escc",
> +    memory_region_init_io(&s->mmio, obj, &escc_mem_ops, s, "escc",
>                            ESCC_SIZE << s->it_shift);
>      sysbus_init_mmio(dev, &s->mmio);
>  
> @@ -1014,8 +1015,6 @@ static int escc_init1(SysBusDevice *dev)
>          s->chn[1].hs = qemu_input_handler_register((DeviceState *)(&s->chn[1]),
>                                                     &sunkbd_handler);
>      }

No, instance_init cannot touch globals (qemu_add_mouse_event_handler,
qemu_input_handler_register).

Paolo

> -
> -    return 0;
>  }
>  
>  static Property escc_properties[] = {
> @@ -1032,9 +1031,7 @@ static Property escc_properties[] = {
>  static void escc_class_init(ObjectClass *klass, void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
> -    SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
>  
> -    k->init = escc_init1;
>      dc->reset = escc_reset;
>      dc->vmsd = &vmstate_escc;
>      dc->props = escc_properties;
> @@ -1045,6 +1042,7 @@ static const TypeInfo escc_info = {
>      .name          = TYPE_ESCC,
>      .parent        = TYPE_SYS_BUS_DEVICE,
>      .instance_size = sizeof(ESCCState),
> +    .instance_init = escc_init1,
>      .class_init    = escc_class_init,
>  };
>  
> 

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

* Re: [Qemu-devel] [PATCH v2 3/6] hw/char: QOM'ify lm32_juart.c
  2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 3/6] hw/char: QOM'ify lm32_juart.c xiaoqiang zhao
  2016-05-09  9:08   ` michael
@ 2016-05-09 10:43   ` Paolo Bonzini
  1 sibling, 0 replies; 18+ messages in thread
From: Paolo Bonzini @ 2016-05-09 10:43 UTC (permalink / raw)
  To: xiaoqiang zhao, qemu-devel; +Cc: cornelia.huck, michael, agraf, edgar.iglesias



On 29/03/2016 09:47, xiaoqiang zhao wrote:
>  
>      /* FIXME use a qdev chardev prop instead of qemu_char_get_next_serial() */
>      s->chr = qemu_char_get_next_serial();
>      if (s->chr) {
>          qemu_chr_add_handlers(s->chr, juart_can_rx, juart_rx, juart_event, s);
>      }

This is wrong, for the usual reason that instance_init cannot touch
globals.  The right thing to do here would be to add a chardev property
to the device as in the FIXME; at this point, it is obvious that the
rest must be in a init or realize callback, because the properties are
not available in init.

Same for patch 4.

Paolo

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

* Re: [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices
  2016-05-05 12:51   ` Peter Maydell
  2016-05-05 14:04     ` xiaoqiang zhao
  2016-05-06  7:37     ` Markus Armbruster
@ 2016-05-09 10:44     ` Paolo Bonzini
  2 siblings, 0 replies; 18+ messages in thread
From: Paolo Bonzini @ 2016-05-09 10:44 UTC (permalink / raw)
  To: Peter Maydell, 赵小强
  Cc: QEMU Developers, Alexander Graf, Michael Walle,
	Edgar E. Iglesias, Cornelia Huck



On 05/05/2016 14:51, Peter Maydell wrote:
> I think you will have better luck if you rearrange all these
> QOM patches so that you provide them as one series per board
> or per target architecture, not one per type of device.
> There is no single person with responsibility for "all of
> hw/char"

Actually there is. :) I've reviewed the patches, and the only acceptable
once are those Cornelia has queued already.

Paolo

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

end of thread, other threads:[~2016-05-09 10:44 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-29  7:47 [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices xiaoqiang zhao
2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 1/6] hw/char: QOM'ify escc.c xiaoqiang zhao
2016-05-09 10:41   ` Paolo Bonzini
2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 2/6] hw/char: QOM'ify etraxfs_ser.c xiaoqiang zhao
2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 3/6] hw/char: QOM'ify lm32_juart.c xiaoqiang zhao
2016-05-09  9:08   ` michael
2016-05-09 10:43   ` Paolo Bonzini
2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 4/6] hw/char: QOM'ify lm32_uart.c xiaoqiang zhao
2016-05-09  9:08   ` michael
2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 5/6] hw/char: QOM'ify sclpconsole-lm.c xiaoqiang zhao
2016-05-09  9:05   ` Cornelia Huck
2016-03-29  7:47 ` [Qemu-devel] [PATCH v2 6/6] hw/char: QOM'ify sclpconsole.c xiaoqiang zhao
2016-05-09  9:05   ` Cornelia Huck
2016-05-05 10:38 ` [Qemu-devel] [PATCH v2 0/6] QOM'ify hw/char devices 赵小强
2016-05-05 12:51   ` Peter Maydell
2016-05-05 14:04     ` xiaoqiang zhao
2016-05-06  7:37     ` Markus Armbruster
2016-05-09 10:44     ` Paolo Bonzini

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.