[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 46/61] virtio-serial : show structures.
From: |
fred . konrad |
Subject: |
[Qemu-devel] [PATCH 46/61] virtio-serial : show structures. |
Date: |
Mon, 7 Jan 2013 19:40:59 +0100 |
From: KONRAD Frederic <address@hidden>
As we discuss with anthony and andreas, this structure must be showed to avoid
two memory allocations for virtio-serial-x.
Signed-off-by: KONRAD Frederic <address@hidden>
---
hw/virtio-serial-bus.c | 41 -----------------------------------------
hw/virtio-serial.h | 41 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index 7272bfd..b7cce7a 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -25,47 +25,6 @@
#include "trace.h"
#include "virtio-serial.h"
-/* The virtio-serial bus on top of which the ports will ride as devices */
-struct VirtIOSerialBus {
- BusState qbus;
-
- /* This is the parent device that provides the bus for ports. */
- VirtIOSerial *vser;
-
- /* The maximum number of ports that can ride on top of this bus */
- uint32_t max_nr_ports;
-};
-
-typedef struct VirtIOSerialPostLoad {
- QEMUTimer *timer;
- uint32_t nr_active_ports;
- struct {
- VirtIOSerialPort *port;
- uint8_t host_connected;
- } *connected;
-} VirtIOSerialPostLoad;
-
-struct VirtIOSerial {
- VirtIODevice vdev;
-
- VirtQueue *c_ivq, *c_ovq;
- /* Arrays of ivqs and ovqs: one per port */
- VirtQueue **ivqs, **ovqs;
-
- VirtIOSerialBus bus;
-
- DeviceState *qdev;
-
- QTAILQ_HEAD(, VirtIOSerialPort) ports;
-
- /* bitmap for identifying active ports */
- uint32_t *ports_map;
-
- struct virtio_console_config config;
-
- struct VirtIOSerialPostLoad *post_load;
-};
-
static VirtIOSerialPort *find_port_by_id(VirtIOSerial *vser, uint32_t id)
{
VirtIOSerialPort *port;
diff --git a/hw/virtio-serial.h b/hw/virtio-serial.h
index 16e3982..722d01b 100644
--- a/hw/virtio-serial.h
+++ b/hw/virtio-serial.h
@@ -173,6 +173,47 @@ struct VirtIOSerialPort {
bool throttled;
};
+/* The virtio-serial bus on top of which the ports will ride as devices */
+struct VirtIOSerialBus {
+ BusState qbus;
+
+ /* This is the parent device that provides the bus for ports. */
+ VirtIOSerial *vser;
+
+ /* The maximum number of ports that can ride on top of this bus */
+ uint32_t max_nr_ports;
+};
+
+typedef struct VirtIOSerialPostLoad {
+ QEMUTimer *timer;
+ uint32_t nr_active_ports;
+ struct {
+ VirtIOSerialPort *port;
+ uint8_t host_connected;
+ } *connected;
+} VirtIOSerialPostLoad;
+
+struct VirtIOSerial {
+ VirtIODevice vdev;
+
+ VirtQueue *c_ivq, *c_ovq;
+ /* Arrays of ivqs and ovqs: one per port */
+ VirtQueue **ivqs, **ovqs;
+
+ VirtIOSerialBus bus;
+
+ DeviceState *qdev;
+
+ QTAILQ_HEAD(, VirtIOSerialPort) ports;
+
+ /* bitmap for identifying active ports */
+ uint32_t *ports_map;
+
+ struct virtio_console_config config;
+
+ struct VirtIOSerialPostLoad *post_load;
+};
+
/* Interface to the virtio-serial bus */
/*
--
1.7.11.7
- [Qemu-devel] [PATCH 26/61] virtio-scsi : add the virtio-scsi device., (continued)
- [Qemu-devel] [PATCH 26/61] virtio-scsi : add the virtio-scsi device., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 24/61] virtio-scsi : allocate cmd_vqs array separately., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 45/61] virtio-rng.c : cleanup : use QOM casts., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 39/61] virtio-rng : don't use pointer for configuration., fred . konrad, 2013/01/07
- Re: [Qemu-devel] [PATCH 00/61] Virtio refactoring., Michael S. Tsirkin, 2013/01/07
- [Qemu-devel] [PATCH 52/61] virtio-serial : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 28/61] virtio-scsi-s390 : switch to the new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 38/61] virtio-rng : show the VirtIORNG structure., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 31/61] virtio-scsi : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 46/61] virtio-serial : show structures.,
fred . konrad <=
- [Qemu-devel] [PATCH 37/61] virtio-balloon : cleanup : remove qdev field., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 27/61] virtio-scsi-pci : switch to new API., fred . konrad, 2013/01/07
- [Qemu-devel] [PATCH 29/61] virtio-scsi : cleanup : use QOM casts., fred . konrad, 2013/01/07
- Re: [Qemu-devel] [PATCH 00/61] Virtio refactoring., Peter Maydell, 2013/01/08