diff options
-rw-r--r-- | hw/display/ati_2d.c | 1 | ||||
-rw-r--r-- | hw/display/cirrus_vga.c | 1 | ||||
-rw-r--r-- | hw/display/cirrus_vga_isa.c | 1 | ||||
-rw-r--r-- | hw/display/vga-isa.c | 1 | ||||
-rw-r--r-- | hw/display/vga-mmio.c | 1 | ||||
-rw-r--r-- | hw/display/vga-pci.c | 1 | ||||
-rw-r--r-- | hw/display/vga.c | 1 | ||||
-rw-r--r-- | hw/display/vga_int.h | 1 | ||||
-rw-r--r-- | hw/display/vmware_vga.c | 1 | ||||
-rw-r--r-- | hw/net/virtio-net.c | 18 | ||||
-rw-r--r-- | include/hw/virtio/virtio.h | 2 | ||||
-rw-r--r-- | include/qemu/typedefs.h | 2 | ||||
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
13 files changed, 29 insertions, 4 deletions
diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c index 692bec91de..7d786653e8 100644 --- a/hw/display/ati_2d.c +++ b/hw/display/ati_2d.c @@ -12,6 +12,7 @@ #include "ati_regs.h" #include "qemu/log.h" #include "ui/pixel_ops.h" +#include "ui/console.h" /* * NOTE: diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index c1e719a405..6e8c747c46 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -45,6 +45,7 @@ #include "ui/pixel_ops.h" #include "cirrus_vga_internal.h" #include "qom/object.h" +#include "ui/console.h" /* * TODO: diff --git a/hw/display/cirrus_vga_isa.c b/hw/display/cirrus_vga_isa.c index 96144bd690..84be51670e 100644 --- a/hw/display/cirrus_vga_isa.c +++ b/hw/display/cirrus_vga_isa.c @@ -31,6 +31,7 @@ #include "hw/isa/isa.h" #include "cirrus_vga_internal.h" #include "qom/object.h" +#include "ui/console.h" #define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga" OBJECT_DECLARE_SIMPLE_TYPE(ISACirrusVGAState, ISA_CIRRUS_VGA) diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c index 46abbc5653..2a5437d803 100644 --- a/hw/display/vga-isa.c +++ b/hw/display/vga-isa.c @@ -32,6 +32,7 @@ #include "qemu/timer.h" #include "hw/loader.h" #include "hw/qdev-properties.h" +#include "ui/console.h" #include "qom/object.h" #define TYPE_ISA_VGA "isa-vga" diff --git a/hw/display/vga-mmio.c b/hw/display/vga-mmio.c index 75dfcedea5..cd2c46776d 100644 --- a/hw/display/vga-mmio.c +++ b/hw/display/vga-mmio.c @@ -27,6 +27,7 @@ #include "hw/sysbus.h" #include "hw/display/vga.h" #include "hw/qdev-properties.h" +#include "ui/console.h" #include "vga_int.h" /* diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index 9a91de7ed1..df23dbf3a0 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -30,6 +30,7 @@ #include "migration/vmstate.h" #include "vga_int.h" #include "ui/pixel_ops.h" +#include "ui/console.h" #include "qemu/module.h" #include "qemu/timer.h" #include "hw/loader.h" diff --git a/hw/display/vga.c b/hw/display/vga.c index 50ecb1ad02..0cb26a791b 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -31,6 +31,7 @@ #include "vga_int.h" #include "vga_regs.h" #include "ui/pixel_ops.h" +#include "ui/console.h" #include "qemu/timer.h" #include "hw/xen/xen.h" #include "migration/vmstate.h" diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h index 330406ad9c..7cf0d11201 100644 --- a/hw/display/vga_int.h +++ b/hw/display/vga_int.h @@ -27,7 +27,6 @@ #include "exec/ioport.h" #include "exec/memory.h" -#include "ui/console.h" #include "hw/display/bochs-vbe.h" #include "hw/acpi/acpi_aml_interface.h" diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index cedbbde522..53949d2539 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -33,6 +33,7 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qom/object.h" +#include "ui/console.h" #undef VERBOSE #define HW_RECT_ACCEL diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 8b32339b76..aba12759d5 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -549,7 +549,14 @@ static RxFilterInfo *virtio_net_query_rxfilter(NetClientState *nc) static void virtio_net_queue_reset(VirtIODevice *vdev, uint32_t queue_index) { VirtIONet *n = VIRTIO_NET(vdev); - NetClientState *nc = qemu_get_subqueue(n->nic, vq2q(queue_index)); + NetClientState *nc; + + /* validate queue_index and skip for cvq */ + if (queue_index >= n->max_queue_pairs * 2) { + return; + } + + nc = qemu_get_subqueue(n->nic, vq2q(queue_index)); if (!nc->peer) { return; @@ -566,9 +573,16 @@ static void virtio_net_queue_reset(VirtIODevice *vdev, uint32_t queue_index) static void virtio_net_queue_enable(VirtIODevice *vdev, uint32_t queue_index) { VirtIONet *n = VIRTIO_NET(vdev); - NetClientState *nc = qemu_get_subqueue(n->nic, vq2q(queue_index)); + NetClientState *nc; int r; + /* validate queue_index and skip for cvq */ + if (queue_index >= n->max_queue_pairs * 2) { + return; + } + + nc = qemu_get_subqueue(n->nic, vq2q(queue_index)); + if (!nc->peer || !vdev->vhost_started) { return; } diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 141a253a2c..a973811cbf 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -148,7 +148,9 @@ struct VirtioDeviceClass { void (*set_config)(VirtIODevice *vdev, const uint8_t *config); void (*reset)(VirtIODevice *vdev); void (*set_status)(VirtIODevice *vdev, uint8_t val); + /* Device must validate queue_index. */ void (*queue_reset)(VirtIODevice *vdev, uint32_t queue_index); + /* Device must validate queue_index. */ void (*queue_enable)(VirtIODevice *vdev, uint32_t queue_index); /* For transitional devices, this is a bitmap of features * that are only exposed on the legacy interface but not diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 6d4e6d9708..688408e048 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -132,6 +132,8 @@ typedef struct Visitor Visitor; typedef struct VMChangeStateEntry VMChangeStateEntry; typedef struct VMStateDescription VMStateDescription; typedef struct DumpState DumpState; +typedef struct GraphicHwOps GraphicHwOps; +typedef struct QEMUCursor QEMUCursor; /* * Pointer types diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index bc7d4780ec..6ecabfb2b5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1682,7 +1682,7 @@ sub process { # Block comments use /* on a line of its own my $commentline = $rawline; - while ($commentline =~ s@^(\+.*)/\*.*\*/@$1@o) { # remove inline #inline /*...*/ + while ($commentline =~ s@^(\+.*)/\*.*\*/@$1@o) { # remove inline /*...*/ } if ($commentline =~ m@^\+.*/\*\*?+[ \t]*[^ \t]@) { # /* or /** non-blank WARN("Block comments use a leading /* on a separate line\n" . $herecurr); |