virtio: make virtio device's structures public.

These structures must be made public to avoid two memory allocations for
refactored virtio devices.

Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 1363624648-16906-2-git-send-email-fred.konrad@greensocs.com

Changes V4 <- V3:
   * Rebased on current git.

Changes V3 <- V2:
    * Style correction spotted by Andreas (virtio-scsi.h).
    * Style correction for virtio-net.h.

Changes V2 <- V1:
    * Move the dataplane include into the header (virtio-blk).
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
KONRAD Frederic 2013-03-18 17:37:18 +01:00 committed by Anthony Liguori
parent e531761d63
commit f1b24e840f
12 changed files with 159 additions and 160 deletions

View file

@ -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 */
/*