Revision 6b331efb hw/virtio-pci.c

b/hw/virtio-pci.c
18 18
#include "virtio.h"
19 19
#include "virtio-blk.h"
20 20
#include "virtio-net.h"
21
#include "virtio-serial.h"
21 22
#include "pci.h"
22 23
#include "qemu-error.h"
23 24
#include "msix.h"
......
109 110
#ifdef CONFIG_LINUX
110 111
    V9fsConf fsconf;
111 112
#endif
112
    /* Max. number of ports we can have for a the virtio-serial device */
113
    uint32_t max_virtserial_ports;
113
    virtio_serial_conf serial;
114 114
    virtio_net_conf net;
115 115
    bool ioeventfd_disabled;
116 116
    bool ioeventfd_started;
......
770 770
        proxy->class_code != PCI_CLASS_OTHERS)          /* qemu-kvm  */
771 771
        proxy->class_code = PCI_CLASS_COMMUNICATION_OTHER;
772 772

  
773
    vdev = virtio_serial_init(&pci_dev->qdev, proxy->max_virtserial_ports);
773
    vdev = virtio_serial_init(&pci_dev->qdev, &proxy->serial);
774 774
    if (!vdev) {
775 775
        return -1;
776 776
    }
777 777
    vdev->nvectors = proxy->nvectors == DEV_NVECTORS_UNSPECIFIED
778
                                        ? proxy->max_virtserial_ports + 1
778
                                        ? proxy->serial.max_virtserial_ports + 1
779 779
                                        : proxy->nvectors;
780 780
    virtio_init_pci(proxy, vdev,
781 781
                    PCI_VENDOR_ID_REDHAT_QUMRANET,
......
902 902
                               DEV_NVECTORS_UNSPECIFIED),
903 903
            DEFINE_PROP_HEX32("class", VirtIOPCIProxy, class_code, 0),
904 904
            DEFINE_VIRTIO_COMMON_FEATURES(VirtIOPCIProxy, host_features),
905
            DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy, max_virtserial_ports,
906
                               31),
905
            DEFINE_PROP_UINT32("max_ports", VirtIOPCIProxy,
906
                               serial.max_virtserial_ports, 31),
907 907
            DEFINE_PROP_END_OF_LIST(),
908 908
        },
909 909
        .qdev.reset = virtio_pci_reset,

Also available in: Unified diff