Compare commits

...

6 Commits
master ... f17

Author SHA1 Message Date
Cole Robinson 5dd4694a12 Add forgotton patch 2013-04-20 21:11:18 -04:00
Cole Robinson ef897053c4 CVE-2013-1922: qemu-nbd block format auto-detection vulnerability (bz #952574, bz #923219) 2013-04-20 20:47:13 -04:00
Cole Robinson 1ffd2723e8 Fix -vga vmware crashes (bz #836260)
Fix vhost crash (bz #918272)
Fix kvm module permissions after first install (bz #907215)
2013-04-02 12:35:23 -04:00
Kyle McMartin dbbc37dd0a pci: fix unaligned writes to pci config index register (rhbz#830261)
(resulted in NetBSD being unable to boot in a VM.)
2013-01-30 09:39:12 -05:00
Cole Robinson 9d29b15e79 CVE-2012-6075: Buffer overflow in e1000 nic (bz #889301, bz #889304) 2013-01-16 10:44:47 -05:00
Cole Robinson dee28d805f Remove comma from 1.0.1 version number
CVE-2012-3515 VT100 emulation vulnerability (bz #854600, bz 851252)
Fix slirp crash (bz #845793)
Fix KVM module permissions after install (bz #863374)
2012-10-07 16:24:18 -04:00
110 changed files with 1896 additions and 1347 deletions

View File

@ -1,8 +1,7 @@
From 01936dfd5b9fa8117fc1d63ce92198dd28422773 Mon Sep 17 00:00:00 2001
From 8187027c26b65cac0e35edf81f0ca42672e793cb Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 19 Dec 2011 14:59:45 +0100
Subject: [PATCH 101/118] usb-redir: Clear iso / irq error when stopping the
stream
Subject: [PATCH] usb-redir: Clear iso / irq error when stopping the stream
And ignore status messages from the client which arrive after stream
stop (the stream stop send to the client and an error status reported by
@ -10,8 +9,8 @@ the client my cross each other due to network latency).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
usb-redir.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index fb91c92..7678f1a 100644
@ -24,7 +23,7 @@ index fb91c92..7678f1a 100644
+ dev->endpoint[EP2I(ep)].iso_error = 0;
usbredir_free_bufpq(dev, ep);
}
@@ -522,6 +523,7 @@ static void usbredir_stop_interrupt_receiving(USBRedirDevice *dev,
DPRINTF("interrupt recv stopped ep %02X\n", ep);
dev->endpoint[EP2I(ep)].interrupt_started = 0;
@ -32,25 +31,22 @@ index fb91c92..7678f1a 100644
+ dev->endpoint[EP2I(ep)].interrupt_error = 0;
usbredir_free_bufpq(dev, ep);
}
@@ -1029,7 +1031,7 @@ static void usbredir_iso_stream_status(void *priv, uint32_t id,
DPRINTF("iso status %d ep %02X id %u\n", iso_stream_status->status,
ep, id);
- if (!dev->dev.attached) {
+ if (!dev->dev.attached || !dev->endpoint[EP2I(ep)].iso_started) {
return;
}
@@ -1050,7 +1052,7 @@ static void usbredir_interrupt_receiving_status(void *priv, uint32_t id,
DPRINTF("interrupt recv status %d ep %02X id %u\n",
interrupt_receiving_status->status, ep, id);
- if (!dev->dev.attached) {
+ if (!dev->dev.attached || !dev->endpoint[EP2I(ep)].interrupt_started) {
return;
}
--
1.7.7.5

View File

@ -1,8 +1,8 @@
From cc5740ae8aa68dbbdc690f694b0e55d70f9c49ee Mon Sep 17 00:00:00 2001
From fb594e813ed4560598dda8deeabff07fd7292d65 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 19 Dec 2011 13:42:40 +0100
Subject: [PATCH 102/118] usb-redir: Dynamically adjust iso buffering size
based on ep interval
Subject: [PATCH] usb-redir: Dynamically adjust iso buffering size based on ep
interval
Note the bufpq_target_size id stored in the endpoint info struct,
even though it only used once. This is done because it will be
@ -10,8 +10,8 @@ referenced from other code in a follow up patch.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 47 insertions(+), 5 deletions(-)
usb-redir.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 47 insertions(+), 5 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index 7678f1a..ab2c8fa 100644
@ -23,7 +23,7 @@ index 7678f1a..ab2c8fa 100644
QTAILQ_HEAD(, buf_packet) bufpq;
+ int bufpq_target_size;
};
struct USBRedirDevice {
@@ -332,15 +333,41 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
uint8_t ep)
@ -97,6 +97,3 @@ index 7678f1a..ab2c8fa 100644
}
}
}
--
1.7.7.5

View File

@ -1,16 +1,16 @@
From 577aff1f1df0a41fd5e21f5ff2b470c36565211b Mon Sep 17 00:00:00 2001
From c9b88c4b22dca99ffc2fde191da5a2f3f50eb2dd Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 19 Dec 2011 14:55:15 +0100
Subject: [PATCH 103/118] usb-redir: Pre-fill our isoc input buffer before
sending pkts to the host
Subject: [PATCH] usb-redir: Pre-fill our isoc input buffer before sending pkts
to the host
This is something which should have been done from the first version of
usb-redir, but wasn't.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
usb-redir.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/usb-redir.c b/usb-redir.c
index ab2c8fa..17ea7a7 100644
@ -25,7 +25,7 @@ index ab2c8fa..17ea7a7 100644
+ int bufpq_size;
int bufpq_target_size;
};
@@ -296,6 +298,7 @@ static struct buf_packet *bufp_alloc(USBRedirDevice *dev,
bufp->len = len;
bufp->status = status;
@ -33,7 +33,7 @@ index ab2c8fa..17ea7a7 100644
+ dev->endpoint[EP2I(ep)].bufpq_size++;
return bufp;
}
@@ -303,6 +306,7 @@ static void bufp_free(USBRedirDevice *dev, struct buf_packet *bufp,
uint8_t ep)
{
@ -48,10 +48,10 @@ index ab2c8fa..17ea7a7 100644
dev->endpoint[EP2I(ep)].iso_started = 1;
+ dev->endpoint[EP2I(ep)].bufpq_prefilled = 0;
}
if (ep & USB_DIR_IN) {
struct buf_packet *isop;
+ if (dev->endpoint[EP2I(ep)].iso_started &&
+ !dev->endpoint[EP2I(ep)].bufpq_prefilled) {
+ if (dev->endpoint[EP2I(ep)].bufpq_size <
@ -69,6 +69,3 @@ index ab2c8fa..17ea7a7 100644
/* Check iso_error for stream errors, otherwise its an underrun */
status = dev->endpoint[EP2I(ep)].iso_error;
dev->endpoint[EP2I(ep)].iso_error = 0;
--
1.7.7.5

View File

@ -1,8 +1,7 @@
From b8e632d175063770655e75507de85ae873fa6c2d Mon Sep 17 00:00:00 2001
From 1910610b534d00f5687d9a566dc2a3f3ea93348b Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 20 Dec 2011 16:54:25 +0100
Subject: [PATCH 104/118] usb-redir: Try to keep our buffer size near the
target size
Subject: [PATCH] usb-redir: Try to keep our buffer size near the target size
Before this patch we would allow the (iso) buffer to grow unlimited
(and it would under certain circumstances) leading to way too high
@ -10,8 +9,8 @@ latencies for iso data streams.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
usb-redir.c | 30 +++++++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index 17ea7a7..88d941a 100644
@ -28,7 +27,7 @@ index 17ea7a7..88d941a 100644
@@ -290,16 +291,34 @@ static void usbredir_cancel_packet(USBDevice *udev, USBPacket *p)
}
}
-static struct buf_packet *bufp_alloc(USBRedirDevice *dev,
+static void bufp_alloc(USBRedirDevice *dev,
uint8_t *data, int len, int status, uint8_t ep)
@ -61,7 +60,7 @@ index 17ea7a7..88d941a 100644
dev->endpoint[EP2I(ep)].bufpq_size++;
- return bufp;
}
static void bufp_free(USBRedirDevice *dev, struct buf_packet *bufp,
@@ -378,6 +397,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
DPRINTF("iso stream started ep %02X\n", ep);
@ -69,7 +68,7 @@ index 17ea7a7..88d941a 100644
dev->endpoint[EP2I(ep)].bufpq_prefilled = 0;
+ dev->endpoint[EP2I(ep)].bufpq_dropping_packets = 0;
}
if (ep & USB_DIR_IN) {
@@ -504,6 +524,10 @@ static int usbredir_handle_interrupt_data(USBRedirDevice *dev,
usbredirparser_do_write(dev->parser);
@ -80,8 +79,5 @@ index 17ea7a7..88d941a 100644
+ dev->endpoint[EP2I(ep)].bufpq_target_size = 1000;
+ dev->endpoint[EP2I(ep)].bufpq_dropping_packets = 0;
}
intp = QTAILQ_FIRST(&dev->endpoint[EP2I(ep)].bufpq);
--
1.7.7.5

View File

@ -1,12 +1,12 @@
From ba411ef969f3dcd8e82929e5577c0e06a60a5707 Mon Sep 17 00:00:00 2001
From e5a3a3c10613f3d4055b68232aba221b142c0c8b Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 20 Dec 2011 16:21:34 +0100
Subject: [PATCH 105/118] usb-redir: Improve some debugging messages
Subject: [PATCH] usb-redir: Improve some debugging messages
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
usb-redir.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index 88d941a..86bccf8 100644
@ -23,7 +23,7 @@ index 88d941a..86bccf8 100644
dev->endpoint[EP2I(ep)].bufpq_prefilled = 0;
dev->endpoint[EP2I(ep)].bufpq_dropping_packets = 0;
@@ -414,7 +415,8 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
isop = QTAILQ_FIRST(&dev->endpoint[EP2I(ep)].bufpq);
if (isop == NULL) {
- DPRINTF2("iso-token-in ep %02X, no isop\n", ep);
@ -40,11 +40,11 @@ index 88d941a..86bccf8 100644
- isop->len);
+ DPRINTF2("iso-token-in ep %02X status %d len %d queue-size: %d\n", ep,
+ isop->status, isop->len, dev->endpoint[EP2I(ep)].bufpq_size);
status = isop->status;
if (status != usb_redir_success) {
@@ -433,7 +435,8 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
len = isop->len;
if (len > p->iov.size) {
- ERROR("received iso data is larger then packet ep %02X\n", ep);
@ -53,6 +53,3 @@ index 88d941a..86bccf8 100644
bufp_free(dev, isop, ep);
return USB_RET_NAK;
}
--
1.7.7.5

View File

@ -1,22 +1,21 @@
From 34736b9b6690054152ae2b9b37f75f7ed720590a Mon Sep 17 00:00:00 2001
From 7aff5c50d0d24c97220616fd96ec4d1974432ab6 Mon Sep 17 00:00:00 2001
From: Amit Shah <amit.shah@redhat.com>
Date: Mon, 21 Mar 2011 21:57:47 +0100
Subject: [PATCH 106/118] char: Split out tcp socket close code in a separate
function
Subject: [PATCH] char: Split out tcp socket close code in a separate function
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
qemu-char.c | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
qemu-char.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index 27abcb9..a5ca611 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2163,6 +2163,21 @@ typedef struct {
static void tcp_chr_accept(void *opaque);
+static void tcp_closed(void *opaque)
+{
+ CharDriverState *chr = opaque;
@ -52,6 +51,3 @@ index 27abcb9..a5ca611 100644
} else if (size > 0) {
if (s->do_telnetopt)
tcp_chr_process_IAC_bytes(chr, s, buf, &size);
--
1.7.7.5

View File

@ -1,41 +1,41 @@
From 61efa48e1973eaac16615c85198d9d74e36a3124 Mon Sep 17 00:00:00 2001
From 99cc4ac45b73d64e0b96250b8091fc95cf29bf63 Mon Sep 17 00:00:00 2001
From: Amit Shah <amit.shah@redhat.com>
Date: Mon, 21 Mar 2011 20:31:45 +0100
Subject: [PATCH 107/118] char: Add a QemuChrHandlers struct to initialise
chardev handlers
Subject: [PATCH] char: Add a QemuChrHandlers struct to initialise chardev
handlers
Instead of passing each handler in the qemu_add_handlers() function,
create a struct of handlers that can be passed to the function instead.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
gdbstub.c | 9 +++++++--
hw/ccid-card-passthru.c | 11 +++++++----
hw/debugcon.c | 2 +-
hw/escc.c | 9 +++++++--
hw/etraxfs_ser.c | 13 +++++++++----
hw/grlib_apbuart.c | 12 +++++++-----
hw/ivshmem.c | 28 ++++++++++++++++++++++------
hw/lm32_juart.c | 8 +++++++-
hw/lm32_uart.c | 8 +++++++-
hw/mcf_uart.c | 9 +++++++--
hw/milkymist-uart.c | 8 +++++++-
hw/pl011.c | 9 +++++++--
hw/pxa2xx.c | 13 +++++++++----
hw/serial.c | 9 +++++++--
hw/sh_serial.c | 12 +++++++++---
hw/spapr_vty.c | 8 ++++++--
hw/strongarm.c | 12 +++++++-----
hw/syborg_serial.c | 9 +++++++--
hw/usb-serial.c | 9 +++++++--
hw/virtio-console.c | 11 ++++++++---
hw/xen_console.c | 16 +++++++++++-----
hw/xilinx_uartlite.c | 11 +++++++++--
monitor.c | 18 ++++++++++++++----
net/slirp.c | 8 ++++++--
qemu-char.c | 32 ++++++++++++++++++++++----------
qemu-char.h | 13 +++++++++----
usb-redir.c | 9 +++++++--
gdbstub.c | 9 +++++++--
hw/ccid-card-passthru.c | 11 +++++++----
hw/debugcon.c | 2 +-
hw/escc.c | 9 +++++++--
hw/etraxfs_ser.c | 13 +++++++++----
hw/grlib_apbuart.c | 12 +++++++-----
hw/ivshmem.c | 28 ++++++++++++++++++++++------
hw/lm32_juart.c | 8 +++++++-
hw/lm32_uart.c | 8 +++++++-
hw/mcf_uart.c | 9 +++++++--
hw/milkymist-uart.c | 8 +++++++-
hw/pl011.c | 9 +++++++--
hw/pxa2xx.c | 13 +++++++++----
hw/serial.c | 9 +++++++--
hw/sh_serial.c | 12 +++++++++---
hw/spapr_vty.c | 8 ++++++--
hw/strongarm.c | 12 +++++++-----
hw/syborg_serial.c | 9 +++++++--
hw/usb-serial.c | 9 +++++++--
hw/virtio-console.c | 11 ++++++++---
hw/xen_console.c | 16 +++++++++++-----
hw/xilinx_uartlite.c | 11 +++++++++--
monitor.c | 18 ++++++++++++++----
net/slirp.c | 8 ++++++--
qemu-char.c | 32 ++++++++++++++++++++++----------
qemu-char.h | 13 +++++++++----
usb-redir.c | 9 +++++++--
27 files changed, 233 insertions(+), 83 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
@ -45,7 +45,7 @@ index 640cf4e..b984e12 100644
@@ -2860,6 +2860,12 @@ static void gdb_sigterm_handler(int signal)
}
#endif
+static const QemuChrHandlers gdb_handlers = {
+ .fd_can_read = gdb_chr_can_receive,
+ .fd_read = gdb_chr_receive,
@ -58,12 +58,12 @@ index 640cf4e..b984e12 100644
@@ -2889,8 +2895,7 @@ int gdbserver_start(const char *device)
if (!chr)
return -1;
- qemu_chr_add_handlers(chr, gdb_chr_can_receive, gdb_chr_receive,
- gdb_chr_event, NULL);
+ qemu_chr_add_handlers(chr, &gdb_handlers, NULL);
}
s = gdbserver_state;
diff --git a/hw/ccid-card-passthru.c b/hw/ccid-card-passthru.c
index 9f51c6c..c5bff01 100644
@ -72,7 +72,7 @@ index 9f51c6c..c5bff01 100644
@@ -274,6 +274,12 @@ static const uint8_t *passthru_get_atr(CCIDCardState *base, uint32_t *len)
return card->atr;
}
+static const QemuChrHandlers passthru_handlers = {
+ .fd_can_read = ccid_card_vscard_can_read,
+ .fd_read = ccid_card_vscard_read,
@ -101,11 +101,11 @@ index c9ee6d9..1d3c3ca 100644
@@ -73,7 +73,7 @@ static void debugcon_init_core(DebugconState *s)
exit(1);
}
- qemu_chr_add_handlers(s->chr, NULL, NULL, NULL, s);
+ qemu_chr_add_handlers(s->chr, NULL, s);
}
static int debugcon_isa_initfn(ISADevice *dev)
diff --git a/hw/escc.c b/hw/escc.c
index 13c7e66..997377e 100644
@ -114,7 +114,7 @@ index 13c7e66..997377e 100644
@@ -867,6 +867,12 @@ void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq,
sysbus_mmio_map(s, 0, base);
}
+static const QemuChrHandlers serial_handlers = {
+ .fd_can_read = serial_can_receive,
+ .fd_read = serial_receive1,
@ -139,9 +139,9 @@ index 298b985..29d486e 100644
--- a/hw/etraxfs_ser.c
+++ b/hw/etraxfs_ser.c
@@ -208,6 +208,12 @@ static void etraxfs_ser_reset(DeviceState *d)
}
+static const QemuChrHandlers serial_handlers = {
+ .fd_can_read = serial_can_receive,
+ .fd_read = serial_receive,
@ -153,7 +153,7 @@ index 298b985..29d486e 100644
struct etrax_serial *s = FROM_SYSBUS(typeof (*s), dev);
@@ -217,10 +223,9 @@ static int etraxfs_ser_init(SysBusDevice *dev)
sysbus_init_mmio_region(dev, &s->mmio);
s->chr = qdev_init_chardev(&dev->qdev);
- if (s->chr)
- qemu_chr_add_handlers(s->chr,
@ -164,7 +164,7 @@ index 298b985..29d486e 100644
+ }
return 0;
}
diff --git a/hw/grlib_apbuart.c b/hw/grlib_apbuart.c
index c90b810..ac6c33b 100644
--- a/hw/grlib_apbuart.c
@ -172,7 +172,7 @@ index c90b810..ac6c33b 100644
@@ -144,16 +144,18 @@ static CPUWriteMemoryFunc * const grlib_apbuart_write[] = {
NULL, NULL, grlib_apbuart_writel,
};
+static const QemuChrHandlers grlib_handlers = {
+ .fd_can_read = grlib_apbuart_can_receive,
+ .fd_read = grlib_apbuart_receive,
@ -183,16 +183,16 @@ index c90b810..ac6c33b 100644
{
UART *uart = FROM_SYSBUS(typeof(*uart), dev);
int uart_regs = 0;
- qemu_chr_add_handlers(uart->chr,
- grlib_apbuart_can_receive,
- grlib_apbuart_receive,
- grlib_apbuart_event,
- uart);
+ qemu_chr_add_handlers(uart->chr, &grlib_handlers, uart);
sysbus_init_irq(dev, &uart->irq);
diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index 7b4dbf6..ee78576 100644
--- a/hw/ivshmem.c
@ -200,7 +200,7 @@ index 7b4dbf6..ee78576 100644
@@ -276,6 +276,18 @@ static void fake_irqfd(void *opaque, const uint8_t *buf, int size) {
msix_notify(pdev, entry->vector);
}
+static const QemuChrHandlers ivshmem_handlers = {
+ .fd_can_read = ivshmem_can_receive,
+ .fd_read = ivshmem_receive,
@ -219,7 +219,7 @@ index 7b4dbf6..ee78576 100644
@@ -295,11 +307,10 @@ static CharDriverState* create_eventfd_chr_device(void * opaque, int eventfd,
s->eventfd_table[vector].pdev = &s->dev;
s->eventfd_table[vector].vector = vector;
- qemu_chr_add_handlers(chr, ivshmem_can_receive, fake_irqfd,
- ivshmem_event, &s->eventfd_table[vector]);
+ qemu_chr_add_handlers(chr, &ivshmem_msi_handlers,
@ -229,12 +229,12 @@ index 7b4dbf6..ee78576 100644
- ivshmem_event, s);
+ qemu_chr_add_handlers(chr, &ivshmem_handlers, s);
}
return chr;
@@ -614,6 +625,12 @@ static int ivshmem_load(QEMUFile* f, void *opaque, int version_id)
return 0;
}
+static const QemuChrHandlers ivshmem_server_handlers = {
+ .fd_can_read = ivshmem_can_receive,
+ .fd_read = ivshmem_read,
@ -245,9 +245,9 @@ index 7b4dbf6..ee78576 100644
{
IVShmemState *s = DO_UPCAST(IVShmemState, dev, dev);
@@ -703,8 +720,7 @@ static int pci_ivshmem_init(PCIDevice *dev)
s->eventfd_chr = g_malloc0(s->vectors * sizeof(CharDriverState *));
- qemu_chr_add_handlers(s->server_chr, ivshmem_can_receive, ivshmem_read,
- ivshmem_event, s);
+ qemu_chr_add_handlers(s->server_chr, &ivshmem_server_handlers, s);
@ -261,7 +261,7 @@ index 5454aa4..1b9fa07 100644
@@ -110,13 +110,19 @@ static void juart_reset(DeviceState *d)
s->jrx = 0;
}
+static const QemuChrHandlers juart_handlers = {
+ .fd_can_read = juart_can_rx,
+ .fd_read = juart_rx,
@ -271,13 +271,13 @@ index 5454aa4..1b9fa07 100644
static int lm32_juart_init(SysBusDevice *dev)
{
LM32JuartState *s = FROM_SYSBUS(typeof(*s), dev);
s->chr = qdev_init_chardev(&dev->qdev);
if (s->chr) {
- qemu_chr_add_handlers(s->chr, juart_can_rx, juart_rx, juart_event, s);
+ qemu_chr_add_handlers(s->chr, juart_handlers, s);
}
return 0;
diff --git a/hw/lm32_uart.c b/hw/lm32_uart.c
index 3678545..ccaf88c 100644
@ -286,7 +286,7 @@ index 3678545..ccaf88c 100644
@@ -242,6 +242,12 @@ static void uart_reset(DeviceState *d)
s->regs[R_LSR] = LSR_THRE | LSR_TEMT;
}
+static const QemuChrHandlers uart_handlers = {
+ .fd_can_read = uart_can_rx,
+ .fd_read = uart_rx,
@ -297,13 +297,13 @@ index 3678545..ccaf88c 100644
{
LM32UartState *s = FROM_SYSBUS(typeof(*s), dev);
@@ -255,7 +261,7 @@ static int lm32_uart_init(SysBusDevice *dev)
s->chr = qdev_init_chardev(&dev->qdev);
if (s->chr) {
- qemu_chr_add_handlers(s->chr, uart_can_rx, uart_rx, uart_event, s);
+ qemu_chr_add_handlers(s->chr, uart_handlers, s);
}
return 0;
diff --git a/hw/mcf_uart.c b/hw/mcf_uart.c
index e6b2ab0..2870683 100644
@ -312,7 +312,7 @@ index e6b2ab0..2870683 100644
@@ -268,6 +268,12 @@ static void mcf_uart_receive(void *opaque, const uint8_t *buf, int size)
mcf_uart_push_byte(s, buf[0]);
}
+static const QemuChrHandlers mcf_uart_handlers = {
+ .fd_can_read = mcf_uart_can_receive,
+ .fd_read = mcf_uart_receive,
@ -339,7 +339,7 @@ index 5404ca9..fd10e12 100644
@@ -189,6 +189,12 @@ static void milkymist_uart_reset(DeviceState *d)
s->regs[R_STAT] = STAT_THRE;
}
+static const QemuChrHandlers uart_handlers = {
+ .fd_can_read = uart_can_rx,
+ .fd_read = uart_rx,
@ -350,13 +350,13 @@ index 5404ca9..fd10e12 100644
{
MilkymistUartState *s = FROM_SYSBUS(typeof(*s), dev);
@@ -201,7 +207,7 @@ static int milkymist_uart_init(SysBusDevice *dev)
s->chr = qdev_init_chardev(&dev->qdev);
if (s->chr) {
- qemu_chr_add_handlers(s->chr, uart_can_rx, uart_rx, uart_event, s);
+ qemu_chr_add_handlers(s->chr, uart_handlers, s);
}
return 0;
diff --git a/hw/pl011.c b/hw/pl011.c
index 707a161..7482246 100644
@ -365,7 +365,7 @@ index 707a161..7482246 100644
@@ -260,6 +260,12 @@ static const VMStateDescription vmstate_pl011 = {
}
};
+static const QemuChrHandlers pl011_handlers = {
+ .fd_can_read = pl011_can_receive,
+ .fd_read = pl011_receive,
@ -392,7 +392,7 @@ index e9a507e..24925b6 100644
@@ -1984,6 +1984,12 @@ static int pxa2xx_fir_load(QEMUFile *f, void *opaque, int version_id)
return 0;
}
+static const QemuChrHandlers pxa2xx_handlers = {
+ .fd_can_read = pxa2xx_fir_is_empty,
+ .fd_read = pxa2xx_fir_rx,
@ -405,7 +405,7 @@ index e9a507e..24925b6 100644
@@ -2002,10 +2008,9 @@ static PXA2xxFIrState *pxa2xx_fir_init(MemoryRegion *sysmem,
memory_region_init_io(&s->iomem, &pxa2xx_fir_ops, s, "pxa2xx-fir", 0x1000);
memory_region_add_subregion(sysmem, base, &s->iomem);
- if (chr)
- qemu_chr_add_handlers(chr, pxa2xx_fir_is_empty,
- pxa2xx_fir_rx, pxa2xx_fir_event, s);
@ -415,7 +415,7 @@ index e9a507e..24925b6 100644
+ }
register_savevm(NULL, "pxa2xx_fir", 0, 0, pxa2xx_fir_save,
pxa2xx_fir_load, s);
diff --git a/hw/serial.c b/hw/serial.c
index d35c7a9..6499d4a 100644
--- a/hw/serial.c
@ -423,7 +423,7 @@ index d35c7a9..6499d4a 100644
@@ -728,6 +728,12 @@ static void serial_reset(void *opaque)
qemu_irq_lower(s->irq);
}
+static const QemuChrHandlers serial_handlers = {
+ .fd_can_read = serial_can_receive1,
+ .fd_read = serial_receive1,
@ -434,14 +434,14 @@ index d35c7a9..6499d4a 100644
{
if (!s->chr) {
@@ -742,8 +748,7 @@ static void serial_init_core(SerialState *s)
qemu_register_reset(serial_reset, s);
- qemu_chr_add_handlers(s->chr, serial_can_receive1, serial_receive1,
- serial_event, s);
+ qemu_chr_add_handlers(s->chr, &serial_handlers, s);
}
/* Change the main reference oscillator frequency. */
diff --git a/hw/sh_serial.c b/hw/sh_serial.c
index a20c59e..470ce7a 100644
@ -450,7 +450,7 @@ index a20c59e..470ce7a 100644
@@ -350,6 +350,12 @@ static CPUWriteMemoryFunc * const sh_serial_writefn[] = {
&sh_serial_write,
};
+static const QemuChrHandlers sh_serial_handlers = {
+ .fd_can_read = sh_serial_can_receive1,
+ .fd_read = sh_serial_receive1,
@ -461,26 +461,26 @@ index a20c59e..470ce7a 100644
uint32_t freq, CharDriverState *chr,
qemu_irq eri_source,
@@ -389,9 +395,9 @@ void sh_serial_init (target_phys_addr_t base, int feat,
s->chr = chr;
- if (chr)
- qemu_chr_add_handlers(chr, sh_serial_can_receive1, sh_serial_receive1,
- sh_serial_event, s);
+ if (chr) {
+ qemu_chr_add_handlers(chr, &sh_serial_handlers, s);
+ }
s->eri = eri_source;
s->rxi = rxi_source;
diff --git a/hw/spapr_vty.c b/hw/spapr_vty.c
index f23cc36..0d9cd59 100644
index 386ccf7..8ad8226 100644
--- a/hw/spapr_vty.c
+++ b/hw/spapr_vty.c
@@ -54,6 +54,11 @@ void vty_putchars(VIOsPAPRDevice *sdev, uint8_t *buf, int len)
qemu_chr_fe_write(dev->chardev, buf, len);
}
+static const QemuChrHandlers vty_handlers = {
+ .fd_can_read = vty_can_receive,
+ .fd_read = vty_receive,
@ -492,11 +492,11 @@ index f23cc36..0d9cd59 100644
@@ -63,8 +68,7 @@ static int spapr_vty_init(VIOsPAPRDevice *sdev)
exit(1);
}
- qemu_chr_add_handlers(dev->chardev, vty_can_receive,
- vty_receive, NULL, dev);
+ qemu_chr_add_handlers(dev->chardev, vty_handlers, dev);
return 0;
}
diff --git a/hw/strongarm.c b/hw/strongarm.c
@ -506,7 +506,7 @@ index a3d9080..8a8a219 100644
@@ -1160,6 +1160,12 @@ static const MemoryRegionOps strongarm_uart_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
+static const QemuChrHandlers strongarm_uart_handlers = {
+ .fd_can_read = strongarm_uart_can_receive,
+ .fd_read = strongarm_uart_receive,
@ -518,7 +518,7 @@ index a3d9080..8a8a219 100644
StrongARMUARTState *s = FROM_SYSBUS(StrongARMUARTState, dev);
@@ -1172,11 +1178,7 @@ static int strongarm_uart_init(SysBusDevice *dev)
s->tx_timer = qemu_new_timer_ns(vm_clock, strongarm_uart_tx, s);
if (s->chr) {
- qemu_chr_add_handlers(s->chr,
- strongarm_uart_can_receive,
@ -527,7 +527,7 @@ index a3d9080..8a8a219 100644
- s);
+ qemu_chr_add_handlers(s->chr, &strongarm_uart_handlers, s);
}
return 0;
diff --git a/hw/syborg_serial.c b/hw/syborg_serial.c
index c83f82c..fff76da 100644
@ -536,7 +536,7 @@ index c83f82c..fff76da 100644
@@ -292,6 +292,12 @@ static const VMStateDescription vmstate_syborg_serial = {
}
};
+static const QemuChrHandlers syborg_serial_handlers = {
+ .fd_can_read = syborg_serial_can_receive,
+ .fd_read = syborg_serial_receive,
@ -563,7 +563,7 @@ index 7dbf6df..bcf6622 100644
@@ -482,6 +482,12 @@ static void usb_serial_event(void *opaque, int event)
}
}
+static const QemuChrHandlers usb_serial_handlers = {
+ .fd_can_read = usb_serial_can_read,
+ .fd_read = usb_serial_read,
@ -576,7 +576,7 @@ index 7dbf6df..bcf6622 100644
@@ -493,8 +499,7 @@ static int usb_serial_initfn(USBDevice *dev)
return -1;
}
- qemu_chr_add_handlers(s->cs, usb_serial_can_read, usb_serial_read,
- usb_serial_event, s);
+ qemu_chr_add_handlers(s->cs, &usb_serial_handlers, s);
@ -590,7 +590,7 @@ index d3351c8..6d6f3ef 100644
@@ -95,6 +95,12 @@ static void chr_event(void *opaque, int event)
}
}
+static const QemuChrHandlers chr_handlers = {
+ .fd_can_read = chr_can_read,
+ .fd_read = chr_read,
@ -602,7 +602,7 @@ index d3351c8..6d6f3ef 100644
VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port);
@@ -107,8 +113,7 @@ static int virtconsole_initfn(VirtIOSerialPort *port)
}
if (vcon->chr) {
- qemu_chr_add_handlers(vcon->chr, chr_can_read, chr_read, chr_event,
- vcon);
@ -617,7 +617,7 @@ index d3351c8..6d6f3ef 100644
- qemu_chr_add_handlers(vcon->chr, NULL, NULL, NULL, NULL);
+ qemu_chr_add_handlers(vcon->chr, NULL, NULL);
}
return 0;
diff --git a/hw/xen_console.c b/hw/xen_console.c
index edcb31c..2ba74f0 100644
@ -626,7 +626,7 @@ index edcb31c..2ba74f0 100644
@@ -212,6 +212,11 @@ out:
return ret;
}
+static const QemuChrHandlers xencons_handlers = {
+ .fd_can_read = xencons_can_receive,
+ .fd_read = xencons_receive,
@ -637,7 +637,7 @@ index edcb31c..2ba74f0 100644
struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
@@ -232,9 +237,9 @@ static int con_initialise(struct XenDevice *xendev)
return -1;
xen_be_bind_evtchn(&con->xendev);
- if (con->chr)
- qemu_chr_add_handlers(con->chr, xencons_can_receive, xencons_receive,
@ -645,29 +645,29 @@ index edcb31c..2ba74f0 100644
+ if (con->chr) {
+ qemu_chr_add_handlers(con->chr, &xencons_handlers, con);
+ }
xen_be_printf(xendev, 1, "ring mfn %d, remote port %d, local port %d, limit %zd\n",
con->ring_ref,
@@ -248,8 +253,9 @@ static void con_disconnect(struct XenDevice *xendev)
{
struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
- if (con->chr)
- qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL);
+ if (con->chr) {
+ qemu_chr_add_handlers(con->chr, NULL, NULL);
+ }
xen_be_unbind_evtchn(&con->xendev);
if (con->sring) {
diff --git a/hw/xilinx_uartlite.c b/hw/xilinx_uartlite.c
index ceb7b4d..69f7191 100644
--- a/hw/xilinx_uartlite.c
+++ b/hw/xilinx_uartlite.c
@@ -195,6 +195,12 @@ static void uart_event(void *opaque, int event)
}
+static const QemuChrHandlers uart_handlers = {
+ .fd_can_read = uart_can_rx,
+ .fd_read = uart_rx,
@ -679,7 +679,7 @@ index ceb7b4d..69f7191 100644
struct xlx_uartlite *s = FROM_SYSBUS(typeof (*s), dev);
@@ -206,8 +212,9 @@ static int xilinx_uartlite_init(SysBusDevice *dev)
sysbus_init_mmio_region(dev, &s->mmio);
s->chr = qdev_init_chardev(&dev->qdev);
- if (s->chr)
- qemu_chr_add_handlers(s->chr, uart_can_rx, uart_rx, uart_event, s);
@ -688,7 +688,7 @@ index ceb7b4d..69f7191 100644
+ }
return 0;
}
diff --git a/monitor.c b/monitor.c
index f956eb7..a82fda3 100644
--- a/monitor.c
@ -696,7 +696,7 @@ index f956eb7..a82fda3 100644
@@ -4882,6 +4882,18 @@ static void sortcmdlist(void)
* End:
*/
+static const QemuChrHandlers monitor_handlers = {
+ .fd_can_read = monitor_can_read,
+ .fd_read = monitor_read,
@ -725,7 +725,7 @@ index f956eb7..a82fda3 100644
- monitor_event, mon);
+ qemu_chr_add_handlers(chr, &monitor_handlers, mon);
}
QLIST_INSERT_HEAD(&mon_list, mon, entry);
diff --git a/net/slirp.c b/net/slirp.c
index 6646ecb..05405ff 100644
@ -734,7 +734,7 @@ index 6646ecb..05405ff 100644
@@ -576,6 +576,11 @@ static void guestfwd_read(void *opaque, const uint8_t *buf, int size)
slirp_socket_recv(fwd->slirp, fwd->server, fwd->port, buf, size);
}
+static const QemuChrHandlers guestfwd_handlers = {
+ .fd_can_read = guestfwd_can_read,
+ .fd_read = guestfwd_read,
@ -746,12 +746,12 @@ index 6646ecb..05405ff 100644
@@ -632,8 +637,7 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str,
fwd->port = port;
fwd->slirp = s->slirp;
- qemu_chr_add_handlers(fwd->hd, guestfwd_can_read, guestfwd_read,
- NULL, fwd);
+ qemu_chr_add_handlers(fwd->hd, &guestfwd_handlers, fwd);
return 0;
fail_syntax:
diff --git a/qemu-char.c b/qemu-char.c
index a5ca611..d2a99a6 100644
@ -760,7 +760,7 @@ index a5ca611..d2a99a6 100644
@@ -189,19 +189,26 @@ void qemu_chr_fe_printf(CharDriverState *s, const char *fmt, ...)
va_end(ap);
}
+static const QemuChrHandlers null_handlers = {
+ /* All handlers are initialised to NULL */
+};
@ -795,7 +795,7 @@ index a5ca611..d2a99a6 100644
@@ -441,6 +448,12 @@ static void mux_chr_event(void *opaque, int event)
mux_chr_send_event(d, i, event);
}
+static const QemuChrHandlers mux_chr_handlers = {
+ .fd_can_read = mux_chr_can_read,
+ .fd_read = mux_chr_read,
@ -822,7 +822,7 @@ index 8ca1e2d..564e688 100644
@@ -222,10 +222,15 @@ void qemu_chr_be_write(CharDriverState *s, uint8_t *buf, int len);
*/
void qemu_chr_be_event(CharDriverState *s, int event);
-void qemu_chr_add_handlers(CharDriverState *s,
- IOCanReadHandler *fd_can_read,
- IOReadHandler *fd_read,
@ -837,7 +837,7 @@ index 8ca1e2d..564e688 100644
+
+void qemu_chr_add_handlers(CharDriverState *s, const QemuChrHandlers *handlers,
void *opaque);
void qemu_chr_generic_open(CharDriverState *s);
diff --git a/usb-redir.c b/usb-redir.c
index 86bccf8..e421cff 100644
@ -846,7 +846,7 @@ index 86bccf8..e421cff 100644
@@ -865,6 +865,12 @@ static void usbredir_chardev_event(void *opaque, int event)
}
}
+static const QemuChrHandlers usbredir_chr_handlers = {
+ .fd_can_read = usbredir_chardev_can_read,
+ .fd_read = usbredir_chardev_read,
@ -857,15 +857,12 @@ index 86bccf8..e421cff 100644
* init + destroy
*/
@@ -892,8 +898,7 @@ static int usbredir_initfn(USBDevice *udev)
/* Let the backend know we are ready */
qemu_chr_fe_open(dev->cs);
- qemu_chr_add_handlers(dev->cs, usbredir_chardev_can_read,
- usbredir_chardev_read, usbredir_chardev_event, dev);
+ qemu_chr_add_handlers(dev->cs, &usbredir_chr_handlers, dev);
return 0;
}
--
1.7.7.5

View File

@ -1,16 +1,15 @@
From f896c023201863927853c5d97e62916e0753fede Mon Sep 17 00:00:00 2001
From 216176f588f4a4616bc129ccf5255734c8b1fe93 Mon Sep 17 00:00:00 2001
From: Amit Shah <amit.shah@redhat.com>
Date: Mon, 21 Mar 2011 20:32:58 +0100
Subject: [PATCH 108/118] iohandlers: Add enable/disable_write_fd_handler()
functions
Subject: [PATCH] iohandlers: Add enable/disable_write_fd_handler() functions
These will be used to provide a cleaner API for the nonblocking case.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
iohandler.c | 35 +++++++++++++++++++++++++++++++++++
main-loop.h | 3 +++
2 files changed, 38 insertions(+), 0 deletions(-)
iohandler.c | 35 +++++++++++++++++++++++++++++++++++
main-loop.h | 3 +++
2 files changed, 38 insertions(+)
diff --git a/iohandler.c b/iohandler.c
index 5640d49..a9a62cb 100644
@ -19,7 +18,7 @@ index 5640d49..a9a62cb 100644
@@ -45,6 +45,41 @@ typedef struct IOHandlerRecord {
static QLIST_HEAD(, IOHandlerRecord) io_handlers =
QLIST_HEAD_INITIALIZER(io_handlers);
+static IOHandlerRecord *find_iohandler(int fd)
+{
+ IOHandlerRecord *ioh;
@ -55,7 +54,7 @@ index 5640d49..a9a62cb 100644
+
+ ioh->fd_write = NULL;
+}
/* XXX: fd_read_poll should be suppressed, but an API change is
necessary in the character devices to suppress fd_can_read(). */
diff --git a/main-loop.h b/main-loop.h
@ -65,13 +64,10 @@ index 8a716b1..c5a96cd 100644
@@ -167,6 +167,9 @@ typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
typedef int IOCanReadHandler(void *opaque);
typedef void IOHandler(void *opaque);
+void enable_write_fd_handler(int fd, IOHandler *fd_write);
+void disable_write_fd_handler(int fd);
+
/**
* qemu_set_fd_handler2: Register a file descriptor with the main loop
*
--
1.7.7.5

View File

@ -1,7 +1,7 @@
From 6d5337e1dc8d926f9183e2f5eb5e97c438203527 Mon Sep 17 00:00:00 2001
From 17b20a10fec462c5906047b25d4eda83a1fa71dd Mon Sep 17 00:00:00 2001
From: Amit Shah <amit.shah@redhat.com>
Date: Mon, 21 Mar 2011 21:41:42 +0100
Subject: [PATCH 109/118] char: Add framework for a 'write unblocked' callback
Subject: [PATCH] char: Add framework for a 'write unblocked' callback
The char layer can let users know that the driver will block on further
input. For users interested in not blocking, they can assign a function
@ -11,9 +11,9 @@ future patches will enable the nonblocking and callback functionality.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
qemu-char.c | 3 +++
qemu-char.h | 4 ++++
2 files changed, 7 insertions(+), 0 deletions(-)
qemu-char.c | 3 +++
qemu-char.h | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/qemu-char.c b/qemu-char.c
index d2a99a6..66b5887 100644
@ -28,7 +28,7 @@ index d2a99a6..66b5887 100644
s->handler_opaque = opaque;
if (s->chr_update_read_handler)
s->chr_update_read_handler(s);
+ s->write_blocked = false;
+
/* We're connecting to an already opened device, so let's make sure we
@ -55,7 +55,4 @@ index 564e688..2628bee 100644
+ bool write_blocked; /* Are we in a blocked state? */
QTAILQ_ENTRY(CharDriverState) next;
};
--
1.7.7.5

View File

@ -1,8 +1,8 @@
From 9ca6b87b877fa46c81ce8e5b5a97dca4f522a727 Mon Sep 17 00:00:00 2001
From b9288d382e249663acf99e5d66b75685ec7cb123 Mon Sep 17 00:00:00 2001
From: Amit Shah <amit.shah@redhat.com>
Date: Mon, 21 Mar 2011 22:00:27 +0100
Subject: [PATCH 110/118] char: Update send_all() to handle nonblocking
chardev write requests
Subject: [PATCH] char: Update send_all() to handle nonblocking chardev write
requests
The send_all function is modified to return to the caller in case the
driver cannot handle any more data. It returns -EAGAIN or
@ -16,9 +16,9 @@ commits will add such capability.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
net/socket.c | 4 +-
qemu-char.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
qemu_socket.h | 2 +-
net/socket.c | 4 ++--
qemu-char.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
qemu_socket.h | 2 +-
3 files changed, 66 insertions(+), 9 deletions(-)
diff --git a/net/socket.c b/net/socket.c
@ -28,27 +28,27 @@ index e9ef128..0d53dce 100644
@@ -56,8 +56,8 @@ static ssize_t net_socket_receive(VLANClientState *nc, const uint8_t *buf, size_
uint32_t len;
len = htonl(size);
- send_all(s->fd, (const uint8_t *)&len, sizeof(len));
- return send_all(s->fd, buf, size);
+ send_all(NULL, s->fd, (const uint8_t *)&len, sizeof(len));
+ return send_all(NULL, s->fd, buf, size);
}
static ssize_t net_socket_receive_dgram(VLANClientState *nc, const uint8_t *buf, size_t size)
diff --git a/qemu-char.c b/qemu-char.c
index 66b5887..5e7f68e 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -507,7 +507,7 @@ static CharDriverState *qemu_chr_open_mux(CharDriverState *drv)
#ifdef _WIN32
-int send_all(int fd, const void *buf, int len1)
+static int do_send(int fd, const void *buf, int len1, bool nonblock)
{
int ret, len;
@@ -515,9 +515,14 @@ int send_all(int fd, const void *buf, int len1)
while (len > 0) {
ret = send(fd, buf, len, 0);
@ -65,9 +65,9 @@ index 66b5887..5e7f68e 100644
} else if (ret == 0) {
break;
@@ -531,7 +536,7 @@ int send_all(int fd, const void *buf, int len1)
#else
-int send_all(int fd, const void *_buf, int len1)
+static int do_send(int fd, const void *_buf, int len1, bool nonblock)
{
@ -93,7 +93,7 @@ index 66b5887..5e7f68e 100644
@@ -556,6 +568,44 @@ int send_all(int fd, const void *_buf, int len1)
#define STDIO_MAX_CLIENTS 1
static int stdio_nb_clients;
+int send_all(CharDriverState *chr, int fd, const void *_buf, int len1)
+{
+ int ret, eagain_errno;
@ -133,7 +133,7 @@ index 66b5887..5e7f68e 100644
+}
+
#ifndef _WIN32
typedef struct {
@@ -567,7 +617,7 @@ typedef struct {
static int fd_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
@ -142,7 +142,7 @@ index 66b5887..5e7f68e 100644
- return send_all(s->fd_out, buf, len);
+ return send_all(chr, s->fd_out, buf, len);
}
static int fd_chr_read_poll(void *opaque)
@@ -892,7 +942,7 @@ static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
pty_chr_update_read_handler(chr);
@ -151,7 +151,7 @@ index 66b5887..5e7f68e 100644
- return send_all(s->fd, buf, len);
+ return send_all(chr, s->fd, buf, len);
}
static int pty_chr_read_poll(void *opaque)
@@ -2196,8 +2246,15 @@ static void tcp_closed(void *opaque)
static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
@ -180,9 +180,6 @@ index 9e32fac..9ea33fe 100644
void socket_set_nonblock(int fd);
-int send_all(int fd, const void *buf, int len1);
+int send_all(CharDriverState *chr, int fd, const void *buf, int len1);
/* New, ipv6-ready socket helper functions, see qemu-sockets.c */
int inet_listen_opts(QemuOpts *opts, int port_offset);
--
1.7.7.5

View File

@ -1,8 +1,8 @@
From b235c039fbab104ab582922f0083625564e177b1 Mon Sep 17 00:00:00 2001
From 9add4194da962d50a7452d8097369c7e6f945961 Mon Sep 17 00:00:00 2001
From: Amit Shah <amit.shah@redhat.com>
Date: Mon, 21 Mar 2011 22:02:47 +0100
Subject: [PATCH 111/118] char: Equip the unix/tcp backend to handle
nonblocking writes#
Subject: [PATCH] char: Equip the unix/tcp backend to handle nonblocking
writes#
Now that the infrastructure is in place to return -EAGAIN to callers,
individual char drivers can set their update_fd_handlers() function to
@ -14,8 +14,8 @@ users of chardevs know that a driver became writable again.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
qemu-char.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
qemu-char.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/qemu-char.c b/qemu-char.c
index 5e7f68e..f98b240 100644
@ -24,7 +24,7 @@ index 5e7f68e..f98b240 100644
@@ -106,6 +106,19 @@
static QTAILQ_HEAD(CharDriverStateHead, CharDriverState) chardevs =
QTAILQ_HEAD_INITIALIZER(chardevs);
+/*
+ * Generic routine that gets called when chardev becomes writable.
+ * Lets chardev user know it's OK to send more data.
@ -44,7 +44,7 @@ index 5e7f68e..f98b240 100644
@@ -2515,6 +2528,25 @@ static void tcp_chr_close(CharDriverState *chr)
qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
}
+static void tcp_enable_write_fd_handler(CharDriverState *chr)
+{
+ TCPCharDriver *s = chr->opaque;
@ -73,9 +73,6 @@ index 5e7f68e..f98b240 100644
chr->chr_add_client = tcp_chr_add_client;
+ chr->chr_enable_write_fd_handler = tcp_enable_write_fd_handler;
+ chr->chr_disable_write_fd_handler = tcp_disable_write_fd_handler;
if (is_listen) {
s->listen_fd = fd;
--
1.7.7.5

View File

@ -1,7 +1,7 @@
From e5eb5b185d39942a2011b21114bb7f0b8e11427a Mon Sep 17 00:00:00 2001
From 7b5e576053c420ee067d754c8c5172928e699f05 Mon Sep 17 00:00:00 2001
From: Amit Shah <amit.shah@redhat.com>
Date: Mon, 21 Mar 2011 22:05:10 +0100
Subject: [PATCH 112/118] char: Throttle when host connection is down#
Subject: [PATCH] char: Throttle when host connection is down#
When the host-side connection goes down, throttle the virtio-serial bus
and later unthrottle when a connection gets established. This helps
@ -16,8 +16,8 @@ worst case (host d/c, guest write, host connect).
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
qemu-char.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
qemu-char.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/qemu-char.c b/qemu-char.c
index f98b240..5f67652 100644
@ -51,6 +51,3 @@ index f98b240..5f67652 100644
}
return ret;
} else {
--
1.7.7.5

View File

@ -1,8 +1,8 @@
From 71108acb189f5fda923013ed72270642199ab50d Mon Sep 17 00:00:00 2001
From e41d88487e07341ea2c1ff5f26bb8186dcaeb806 Mon Sep 17 00:00:00 2001
From: Amit Shah <amit.shah@redhat.com>
Date: Mon, 21 Mar 2011 22:06:41 +0100
Subject: [PATCH 113/118] virtio-console: Enable port throttling when chardev
is slow to consume data
Subject: [PATCH] virtio-console: Enable port throttling when chardev is slow
to consume data
When a chardev indicates it can't accept more data, we tell the
virtio-serial code to stop sending us any more data till we tell
@ -12,8 +12,8 @@ As soon as the chardev indicates it can accept more data, start pushing!
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
hw/virtio-console.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
hw/virtio-console.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index 6d6f3ef..da68211 100644
@ -22,7 +22,7 @@ index 6d6f3ef..da68211 100644
@@ -20,6 +20,16 @@ typedef struct VirtConsole {
CharDriverState *chr;
} VirtConsole;
+/*
+ * Callback function that's called from chardevs when backend becomes
+ * writable.
@ -33,7 +33,7 @@ index 6d6f3ef..da68211 100644
+
+ virtio_serial_throttle_port(&vcon->port, false);
+}
/* Callback function that's called when the guest sends us data */
static ssize_t flush_buf(VirtIOSerialPort *port, const uint8_t *buf, size_t len)
@@ -99,6 +109,7 @@ static const QemuChrHandlers chr_handlers = {
@ -42,8 +42,5 @@ index 6d6f3ef..da68211 100644
.fd_event = chr_event,
+ .fd_write_unblocked = chr_write_unblocked,
};
static int virtconsole_initfn(VirtIOSerialPort *port)
--
1.7.7.5

View File

@ -1,7 +1,7 @@
From d4066655fc866ac0e57420b32dec3b37277b374c Mon Sep 17 00:00:00 2001
From 9d324aabba1e20b6f3ed8a673d03f2c8bc0ad8d8 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Tue, 22 Mar 2011 12:27:59 +0200
Subject: [PATCH 114/118] spice-qemu-char.c: add throttling
Subject: [PATCH] spice-qemu-char.c: add throttling
BZ: 672191
@ -35,8 +35,8 @@ This patch relies on Amit's series to expose throttling to chardev's, which
was not accepted upstream, and will not be accepted upstream until the mainloop
is reworked to use glib.
---
spice-qemu-char.c | 39 +++++++++++++++++++++++++++++++++++----
1 files changed, 35 insertions(+), 4 deletions(-)
spice-qemu-char.c | 39 +++++++++++++++++++++++++++++++++++----
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index 7e8eaa9..eeeb32e 100644
@ -55,12 +55,12 @@ index 7e8eaa9..eeeb32e 100644
uint32_t debug;
+ QEMUTimer *unblock_timer;
} SpiceCharDriver;
static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len)
@@ -50,6 +53,17 @@ static int vmc_write(SpiceCharDeviceInstance *sin, const uint8_t *buf, int len)
return out;
}
+static void spice_chr_unblock(void *opaque)
+{
+ SpiceCharDriver *scd = opaque;
@ -100,7 +100,7 @@ index 7e8eaa9..eeeb32e 100644
{
SpiceCharDriver *s = chr->opaque;
+ int read_bytes;
dprintf(s, 2, "%s: %d\n", __func__, len);
vmc_register_interface(s);
@@ -147,7 +169,15 @@ static int spice_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
@ -118,16 +118,13 @@ index 7e8eaa9..eeeb32e 100644
+ }
+ return read_bytes;
}
static void spice_chr_close(struct CharDriverState *chr)
@@ -225,6 +255,7 @@ int qemu_chr_open_spice(QemuOpts *opts, CharDriverState **_chr)
chr->chr_close = spice_chr_close;
chr->chr_guest_open = spice_chr_guest_open;
chr->chr_guest_close = spice_chr_guest_close;
+ s->unblock_timer = qemu_new_timer_ms(vm_clock, spice_chr_unblock, s);
#if SPICE_SERVER_VERSION < 0x000901
/* See comment in vmc_state() */
--
1.7.7.5

View File

@ -1,7 +1,7 @@
From 9d965c99311c6f3d5c7ba9b66a72398814175865 Mon Sep 17 00:00:00 2001
From 3ffa1aa2d06a70c0db4a7cafd98948ee157bc68e Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Tue, 22 Mar 2011 12:28:00 +0200
Subject: [PATCH 115/118] spice-qemu-char.c: remove intermediate buffer
Subject: [PATCH] spice-qemu-char.c: remove intermediate buffer
BZ: 672191
upstream: not submitted (explained below)
@ -16,8 +16,8 @@ Also make datalen int and not ssize_t (to fit spice_chr_write signature).
This relied on the previous patch that introduces throttling, which
can't go upstream right now as explained in that patch.
---
spice-qemu-char.c | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
spice-qemu-char.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/spice-qemu-char.c b/spice-qemu-char.c
index eeeb32e..70a83bf 100644
@ -38,7 +38,7 @@ index eeeb32e..70a83bf 100644
@@ -69,7 +68,7 @@ static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin);
int bytes = MIN(len, scd->datalen);
- dprintf(scd, 2, "%s: %p %d/%d/%zd\n", __func__, scd->datapos, len, bytes, scd->datalen);
+ dprintf(scd, 2, "%s: %p %d/%d/%d\n", __func__, scd->datapos, len, bytes, scd->datalen);
if (bytes > 0) {
@ -66,6 +66,3 @@ index eeeb32e..70a83bf 100644
s->chr->write_blocked = true;
/* We'll get passed in the unconsumed data with the next call */
s->datalen = 0;
--
1.7.7.5

View File

@ -1,12 +1,12 @@
From 80aafc63c842ee902cc9e32d692efed8952a1e14 Mon Sep 17 00:00:00 2001
From eae4c4930ff644eee757888bbd43466f9b15d056 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 19 Jul 2011 10:56:19 +0200
Subject: [PATCH 116/118] usb-redir: Add flow control support
Subject: [PATCH] usb-redir: Add flow control support
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 26 ++++++++++++++++++++++++--
1 files changed, 24 insertions(+), 2 deletions(-)
usb-redir.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index e421cff..1289506 100644
@ -17,12 +17,12 @@ index e421cff..1289506 100644
{
USBRedirDevice *dev = priv;
+ int r;
- if (!dev->cs->opened) {
+ if (!dev->cs->opened || dev->cs->write_blocked) {
return 0;
}
- return qemu_chr_fe_write(dev->cs, data, count);
+ r = qemu_chr_fe_write(dev->cs, data, count);
+
@ -35,12 +35,12 @@ index e421cff..1289506 100644
+
+ return r;
}
/*
@@ -865,10 +875,22 @@ static void usbredir_chardev_event(void *opaque, int event)
}
}
+static void usbredir_chardev_write_unblocked(void *opaque)
+{
+ USBRedirDevice *dev = opaque;
@ -58,8 +58,5 @@ index e421cff..1289506 100644
.fd_event = usbredir_chardev_event,
+ .fd_write_unblocked = usbredir_chardev_write_unblocked,
};
/*
--
1.7.7.5

View File

@ -1,7 +1,7 @@
From 8e92fe9feebc319c019feb8c28941e322524932f Mon Sep 17 00:00:00 2001
From 16bd0559ba4870cf2f8c62654bcf1ee523e89afd Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Thu, 28 Jul 2011 15:08:48 +0300
Subject: [PATCH 117/118] virtio-serial-bus: replay guest_open on migration
Subject: [PATCH] virtio-serial-bus: replay guest_open on migration
When migrating a host with with a spice agent running the mouse becomes
non operational after the migration. This is rhbz #725965.
@ -18,8 +18,8 @@ chardev.
Signed-off-by: Alon Levy <alevy@redhat.com>
---
hw/virtio-serial-bus.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
hw/virtio-serial-bus.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index a4825b9..e5f343f 100644
@ -30,12 +30,12 @@ index a4825b9..e5f343f 100644
uint32_t id;
bool host_connected;
+ VirtIOSerialPortInfo *info;
id = qemu_get_be32(f);
port = find_port_by_id(s, id);
@@ -626,6 +627,11 @@ static int virtio_serial_load(QEMUFile *f, void *opaque, int version_id)
}
port->guest_connected = qemu_get_byte(f);
+ info = DO_UPCAST(VirtIOSerialPortInfo, qdev, port->dev.info);
+ if (port->guest_connected && info->guest_open) {
@ -45,6 +45,3 @@ index a4825b9..e5f343f 100644
host_connected = qemu_get_byte(f);
if (host_connected != port->host_connected) {
/*
--
1.7.7.5

View File

@ -1,8 +1,7 @@
From fad276489cbc04f228d52b7019bee9e7a88c8a86 Mon Sep 17 00:00:00 2001
From 774cd5d0718a65bed7032c9306128e79718bb72a Mon Sep 17 00:00:00 2001
From: Amit Shah <amit.shah@redhat.com>
Date: Fri, 2 Dec 2011 15:42:55 +0530
Subject: [PATCH 118/118] char: Disable write callback if throttled chardev is
detached
Subject: [PATCH] char: Disable write callback if throttled chardev is detached
If a throttled chardev is detached from the frontend device, all future
callbacks should be suppressed. Not doing this results in a segfault.
@ -12,8 +11,8 @@ Upstream: Not applicable, since throttling is a RHEL6-only feature.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
qemu-char.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
qemu-char.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/qemu-char.c b/qemu-char.c
index 5f67652..5a94919 100644
@ -31,6 +30,3 @@ index 5f67652..5a94919 100644
handlers = &null_handlers;
}
s->chr_can_read = handlers->fd_can_read;
--
1.7.7.5

View File

@ -1,7 +1,7 @@
From 959f57d34f11daf0da6f73541243934f39dfb2b2 Mon Sep 17 00:00:00 2001
From 18d2eb3e4dd3d3ecd3ce4dc9ad789403b9e2611a Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 13 Jan 2012 14:26:26 +0100
Subject: [PATCH 119/140] usb-ehci: Clear the portstatus powner bit on device
Subject: [PATCH] usb-ehci: Clear the portstatus powner bit on device
disconnect
According to the EHCI spec port ownerhsip should revert to the EHCI controller
@ -11,7 +11,7 @@ has been redirected.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 5 +++++
hw/usb-ehci.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -30,6 +30,3 @@ index a946e1d..69bcc4b 100644
return;
}
--
1.7.9.3

View File

@ -1,8 +1,8 @@
From bcc4748db3e991fbaa032fe9c0726288a8f1008d Mon Sep 17 00:00:00 2001
From 74f7edc6c72bf654fbb100895cee3f529706f1be Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 12 Jan 2012 16:54:04 +0100
Subject: [PATCH 120/140] usb-redir: Add the posibility to filter out certain
devices from redirecion
Subject: [PATCH] usb-redir: Add the posibility to filter out certain devices
from redirecion
This patch adds the posibility to filter out certain devices from redirecion.
To use this pass the filter property to -device usb-redir. The filter
@ -25,12 +25,12 @@ of the rules.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
configure | 2 +-
usb-redir.c | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
configure | 2 +-
usb-redir.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------
2 files changed, 106 insertions(+), 11 deletions(-)
diff --git a/configure b/configure
index 7ecf44e..c7e37df 100755
index 4b7faec..bae379c 100755
--- a/configure
+++ b/configure
@@ -2541,7 +2541,7 @@ fi
@ -43,7 +43,7 @@ index 7ecf44e..c7e37df 100755
usb_redir_cflags=$($pkg_config --cflags libusbredirparser 2>/dev/null)
usb_redir_libs=$($pkg_config --libs libusbredirparser 2>/dev/null)
diff --git a/usb-redir.c b/usb-redir.c
index 6e92f14..85f40d6 100644
index 1289506..b5f8081 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -34,6 +34,7 @@
@ -74,7 +74,7 @@ index 6e92f14..85f40d6 100644
};
struct AsyncURB {
@@ -790,6 +797,7 @@ static int usbredir_handle_control(USBDevice *udev, USBPacket *p,
@@ -789,6 +796,7 @@ static int usbredir_handle_control(USBDevice *udev, USBPacket *p,
static void usbredir_open_close_bh(void *opaque)
{
USBRedirDevice *dev = opaque;
@ -82,7 +82,7 @@ index 6e92f14..85f40d6 100644
usbredir_device_disconnect(dev);
@@ -820,7 +828,9 @@ static void usbredir_open_close_bh(void *opaque)
@@ -819,7 +827,9 @@ static void usbredir_open_close_bh(void *opaque)
dev->parser->interrupt_packet_func = usbredir_interrupt_packet;
dev->read_buf = NULL;
dev->read_buf_size = 0;
@ -93,7 +93,7 @@ index 6e92f14..85f40d6 100644
usbredirparser_do_write(dev->parser);
}
}
@@ -908,6 +918,17 @@ static int usbredir_initfn(USBDevice *udev)
@@ -907,6 +917,17 @@ static int usbredir_initfn(USBDevice *udev)
return -1;
}
@ -111,7 +111,7 @@ index 6e92f14..85f40d6 100644
dev->open_close_bh = qemu_bh_new(usbredir_open_close_bh, dev);
dev->attach_timer = qemu_new_timer_ms(vm_clock, usbredir_do_attach, dev);
@@ -956,6 +977,44 @@ static void usbredir_handle_destroy(USBDevice *udev)
@@ -955,6 +976,44 @@ static void usbredir_handle_destroy(USBDevice *udev)
if (dev->parser) {
usbredirparser_destroy(dev->parser);
}
@ -156,7 +156,7 @@ index 6e92f14..85f40d6 100644
}
/*
@@ -984,6 +1043,7 @@ static void usbredir_device_connect(void *priv,
@@ -983,6 +1042,7 @@ static void usbredir_device_connect(void *priv,
struct usb_redir_device_connect_header *device_connect)
{
USBRedirDevice *dev = priv;
@ -164,7 +164,7 @@ index 6e92f14..85f40d6 100644
if (qemu_timer_pending(dev->attach_timer) || dev->dev.attached) {
ERROR("Received device connect while already connected\n");
@@ -992,26 +1052,48 @@ static void usbredir_device_connect(void *priv,
@@ -991,26 +1051,48 @@ static void usbredir_device_connect(void *priv,
switch (device_connect->speed) {
case usb_redir_speed_low:
@ -218,7 +218,7 @@ index 6e92f14..85f40d6 100644
qemu_mod_timer(dev->attach_timer, dev->next_attach_time);
}
@@ -1038,15 +1120,27 @@ static void usbredir_device_disconnect(void *priv)
@@ -1037,15 +1119,27 @@ static void usbredir_device_disconnect(void *priv)
for (i = 0; i < MAX_ENDPOINTS; i++) {
QTAILQ_INIT(&dev->endpoint[i].bufpq);
}
@ -250,7 +250,7 @@ index 6e92f14..85f40d6 100644
}
static void usbredir_ep_info(void *priv,
@@ -1356,6 +1450,7 @@ static struct USBDeviceInfo usbredir_dev_info = {
@@ -1355,6 +1449,7 @@ static struct USBDeviceInfo usbredir_dev_info = {
.qdev.props = (Property[]) {
DEFINE_PROP_CHR("chardev", USBRedirDevice, cs),
DEFINE_PROP_UINT8("debug", USBRedirDevice, debug, 0),
@ -258,6 +258,3 @@ index 6e92f14..85f40d6 100644
DEFINE_PROP_END_OF_LIST(),
},
};
--
1.7.9.3

View File

@ -1,21 +1,21 @@
From 6c13e7b9448b10d966bb99c00c5120678ccd2a3f Mon Sep 17 00:00:00 2001
From 0bfba65fd1a9495f159d0a1824517d7b05999ca8 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sat, 18 Feb 2012 09:12:14 +0100
Subject: [PATCH 121/140] usb-redir: Fix printing of device version
Subject: [PATCH] usb-redir: Fix printing of device version
The device version is in bcd format, which requires some special handling to
print.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 6 ++++--
usb-redir.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index 85f40d6..9b804e9 100644
index b5f8081..d64182b 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -1076,8 +1076,10 @@ static void usbredir_device_connect(void *priv,
@@ -1075,8 +1075,10 @@ static void usbredir_device_connect(void *priv,
usb_redir_cap_connect_device_version)) {
INFO("attaching %s device %04x:%04x version %d.%d class %02x\n",
speed, device_connect->vendor_id, device_connect->product_id,
@ -28,6 +28,3 @@ index 85f40d6..9b804e9 100644
device_connect->device_class);
} else {
INFO("attaching %s device %04x:%04x class %02x\n", speed,
--
1.7.9.3

View File

@ -1,22 +1,21 @@
From 49a01afb24b925de97074d093fb072bb7de470f9 Mon Sep 17 00:00:00 2001
From dbd558869cab190a75e33a267d22a7fb7ef78a5f Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sat, 18 Feb 2012 09:18:57 +0100
Subject: [PATCH 122/140] usb-redir: Always clear device state on filter
reject
Subject: [PATCH] usb-redir: Always clear device state on filter reject
Always call usbredir_device_disconnect() when usbredir_check_filter() fails
to clean up all the device state (ie received endpoint info).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 11 +++++++----
usb-redir.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index 9b804e9..fe3b0a3 100644
index d64182b..eb174f0 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -985,7 +985,7 @@ static int usbredir_check_filter(USBRedirDevice *dev)
@@ -984,7 +984,7 @@ static int usbredir_check_filter(USBRedirDevice *dev)
{
if (dev->interface_info.interface_count == 0) {
ERROR("No interface info for device\n");
@ -25,7 +24,7 @@ index 9b804e9..fe3b0a3 100644
}
if (dev->filter_rules) {
@@ -993,7 +993,7 @@ static int usbredir_check_filter(USBRedirDevice *dev)
@@ -992,7 +992,7 @@ static int usbredir_check_filter(USBRedirDevice *dev)
usb_redir_cap_connect_device_version)) {
ERROR("Device filter specified and peer does not have the "
"connect_device_version capability\n");
@ -34,7 +33,7 @@ index 9b804e9..fe3b0a3 100644
}
if (usbredirfilter_check(
@@ -1010,11 +1010,15 @@ static int usbredir_check_filter(USBRedirDevice *dev)
@@ -1009,11 +1009,15 @@ static int usbredir_check_filter(USBRedirDevice *dev)
dev->device_info.product_id,
dev->device_info.device_version_bcd,
0) != 0) {
@ -51,7 +50,7 @@ index 9b804e9..fe3b0a3 100644
}
/*
@@ -1140,7 +1144,6 @@ static void usbredir_interface_info(void *priv,
@@ -1139,7 +1143,6 @@ static void usbredir_interface_info(void *priv,
if (usbredir_check_filter(dev)) {
ERROR("Device no longer matches filter after interface info "
"change, disconnecting!\n");
@ -59,6 +58,3 @@ index 9b804e9..fe3b0a3 100644
}
}
}
--
1.7.9.3

View File

@ -1,8 +1,7 @@
From f04315d9210f22e5d7317f1cfb3c076fb93b3c08 Mon Sep 17 00:00:00 2001
From 61d885a42da0c504c8455f24cc0b4cbe82ecfbaa Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sun, 19 Feb 2012 09:58:03 +0100
Subject: [PATCH 123/140] usb-redir: Let the usb-host know about our device
filtering
Subject: [PATCH] usb-redir: Let the usb-host know about our device filtering
libusbredirparser-0.3.4 adds 2 new packets which allows us to notify
the usb-host:
@ -12,12 +11,12 @@ the usb-host:
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
configure | 2 +-
usb-redir.c | 20 ++++++++++++++++++++
configure | 2 +-
usb-redir.c | 20 ++++++++++++++++++++
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index c7e37df..a4848a4 100755
index bae379c..59f91d0 100755
--- a/configure
+++ b/configure
@@ -2541,7 +2541,7 @@ fi
@ -30,7 +29,7 @@ index c7e37df..a4848a4 100755
usb_redir_cflags=$($pkg_config --cflags libusbredirparser 2>/dev/null)
usb_redir_libs=$($pkg_config --libs libusbredirparser 2>/dev/null)
diff --git a/usb-redir.c b/usb-redir.c
index fe3b0a3..d10d8de 100644
index eb174f0..3484479 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -106,6 +106,7 @@ struct AsyncURB {
@ -41,7 +40,7 @@ index fe3b0a3..d10d8de 100644
static void usbredir_device_connect(void *priv,
struct usb_redir_device_connect_header *device_connect);
static void usbredir_device_disconnect(void *priv);
@@ -812,6 +813,7 @@ static void usbredir_open_close_bh(void *opaque)
@@ -811,6 +812,7 @@ static void usbredir_open_close_bh(void *opaque)
dev->parser->log_func = usbredir_log;
dev->parser->read_func = usbredir_read;
dev->parser->write_func = usbredir_write;
@ -49,7 +48,7 @@ index fe3b0a3..d10d8de 100644
dev->parser->device_connect_func = usbredir_device_connect;
dev->parser->device_disconnect_func = usbredir_device_disconnect;
dev->parser->interface_info_func = usbredir_interface_info;
@@ -830,6 +832,7 @@ static void usbredir_open_close_bh(void *opaque)
@@ -829,6 +831,7 @@ static void usbredir_open_close_bh(void *opaque)
dev->read_buf_size = 0;
usbredirparser_caps_set_cap(caps, usb_redir_cap_connect_device_version);
@ -57,7 +56,7 @@ index fe3b0a3..d10d8de 100644
usbredirparser_init(dev->parser, VERSION, caps, USB_REDIR_CAPS_SIZE, 0);
usbredirparser_do_write(dev->parser);
}
@@ -1018,6 +1021,10 @@ static int usbredir_check_filter(USBRedirDevice *dev)
@@ -1017,6 +1020,10 @@ static int usbredir_check_filter(USBRedirDevice *dev)
error:
usbredir_device_disconnect(dev);
@ -68,7 +67,7 @@ index fe3b0a3..d10d8de 100644
return -1;
}
@@ -1043,6 +1050,19 @@ static int usbredir_handle_status(USBRedirDevice *dev,
@@ -1042,6 +1049,19 @@ static int usbredir_handle_status(USBRedirDevice *dev,
}
}
@ -88,6 +87,3 @@ index fe3b0a3..d10d8de 100644
static void usbredir_device_connect(void *priv,
struct usb_redir_device_connect_header *device_connect)
{
--
1.7.9.3

View File

@ -1,8 +1,7 @@
From 91338d1b4df14f7454d1b52200d2ae4eb957fa72 Mon Sep 17 00:00:00 2001
From 2740733386ffa8208f64a8e8e8988724f0ca1dde Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sun, 26 Feb 2012 15:28:51 +0100
Subject: [PATCH 124/140] usb-redir: Limit return values returned by iso
packets
Subject: [PATCH] usb-redir: Limit return values returned by iso packets
The usbredir protocol uses a status of usb_redir_stall to indicate that
an iso data stream has stopped (ie because the urbs failed on resubmit),
@ -12,14 +11,14 @@ iso stream errors.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 4 ++--
usb-redir.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index d10d8de..c76e55d 100644
index 3484479..c0ac7be 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -441,7 +441,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
@@ -440,7 +440,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
/* Check iso_error for stream errors, otherwise its an underrun */
status = dev->endpoint[EP2I(ep)].iso_error;
dev->endpoint[EP2I(ep)].iso_error = 0;
@ -28,7 +27,7 @@ index d10d8de..c76e55d 100644
}
DPRINTF2("iso-token-in ep %02X status %d len %d queue-size: %d\n", ep,
isop->status, isop->len, dev->endpoint[EP2I(ep)].bufpq_size);
@@ -449,7 +449,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
@@ -448,7 +448,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
status = isop->status;
if (status != usb_redir_success) {
bufp_free(dev, isop, ep);
@ -37,6 +36,3 @@ index d10d8de..c76e55d 100644
}
len = isop->len;
--
1.7.9.3

View File

@ -1,22 +1,22 @@
From ddb24b5063e3b4c90295bd4ddaab3bfc428ae79b Mon Sep 17 00:00:00 2001
From 3e69c5cc77c4e2e2b9c07d0d30e399705e3cbf09 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sun, 26 Feb 2012 15:51:50 +0100
Subject: [PATCH 125/140] usb-redir: Return USB_RET_NAK when we've no data for
an interrupt endpoint
Subject: [PATCH] usb-redir: Return USB_RET_NAK when we've no data for an
interrupt endpoint
We should return USB_RET_NAK, rather then a 0 sized packet, when we've no data
for an interrupt IN endpoint.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 5 ++++-
usb-redir.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/usb-redir.c b/usb-redir.c
index c76e55d..629c87d 100644
index c0ac7be..d10be6f 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -558,7 +558,10 @@ static int usbredir_handle_interrupt_data(USBRedirDevice *dev,
@@ -557,7 +557,10 @@ static int usbredir_handle_interrupt_data(USBRedirDevice *dev,
/* Check interrupt_error for stream errors */
status = dev->endpoint[EP2I(ep)].interrupt_error;
dev->endpoint[EP2I(ep)].interrupt_error = 0;
@ -28,6 +28,3 @@ index c76e55d..629c87d 100644
}
DPRINTF("interrupt-token-in ep %02X status %d len %d\n", ep,
intp->status, intp->len);
--
1.7.9.3

View File

@ -1,8 +1,8 @@
From 7a3acb928b617b33605c779e7df05c2c896844b1 Mon Sep 17 00:00:00 2001
From 7de8a8e7db3f75e5f8fc5edadfcc973e965ef2c3 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 20 Feb 2012 16:27:47 +0100
Subject: [PATCH 126/140] usb-ehci: Handle ISO packets failing with an error
other then NAK
Subject: [PATCH] usb-ehci: Handle ISO packets failing with an error other then
NAK
Before this patch the ehci code was not checking for any other errors other
then USB_RET_NAK. This causes 2 problems:
@ -21,7 +21,7 @@ fixes this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 22 +++++++++++++++++++---
hw/usb-ehci.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -59,6 +59,3 @@ index 69bcc4b..a6b6ae5 100644
itd->transact[i] &= ~ITD_XACT_ACTIVE;
}
}
--
1.7.9.3

View File

@ -1,8 +1,7 @@
From 82e500c24a026323e0b8b869e227cc68b179fb11 Mon Sep 17 00:00:00 2001
From 4d4fb021905e8d6bf382daa247a1a8da58fef8b7 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Mon, 27 Feb 2012 11:44:52 +0100
Subject: [PATCH 127/140] usb-ehci: Never follow table entries with the T-bit
set
Subject: [PATCH] usb-ehci: Never follow table entries with the T-bit set
Before this patch the T-bit was not checked in 2 places, while it should be.
@ -11,7 +10,7 @@ entry < 0x1000 and entry > 0x1000 checks, so this patch removes them.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 10 ++++------
hw/usb-ehci.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -56,6 +55,3 @@ index a6b6ae5..37076a9 100644
q->qtdaddr = q->qh.next_qtd;
ehci_set_state(q->ehci, async, EST_FETCHQTD);
--
1.7.9.3

View File

@ -1,8 +1,7 @@
From 0f1e5b8d4f36de8b6b1301740226c9858b5a0318 Mon Sep 17 00:00:00 2001
From 69ac2b074d687e0143da70c528515563b1c742c5 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 28 Feb 2012 16:34:38 +0100
Subject: [PATCH 128/140] usb-ehci: split our qh queue into async and periodic
queues
Subject: [PATCH] usb-ehci: split our qh queue into async and periodic queues
qhs can be part of both the async and the periodic schedule, as is shown
in later patches in this series it is useful to keep track of the qhs on
@ -10,7 +9,7 @@ a per schedule basis.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 62 ++++++++++++++++++++++++++++++++++-----------------------
hw/usb-ehci.c | 62 +++++++++++++++++++++++++++++++++++------------------------
1 file changed, 37 insertions(+), 25 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -214,6 +213,3 @@ index 37076a9..980cce3 100644
qemu_register_reset(ehci_reset, s);
--
1.7.9.3

View File

@ -1,8 +1,8 @@
From 320063f7165c5a5f9ddd5a09a4663bc1a81f5bd6 Mon Sep 17 00:00:00 2001
From 11fd62d6fd2bea9537fb7915b19043bbad88c410 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 2 Mar 2012 13:52:44 +0100
Subject: [PATCH 129/140] usb-ehci: always call ehci_queues_rip_unused for
period queues
Subject: [PATCH] usb-ehci: always call ehci_queues_rip_unused for period
queues
Before this patch USB 2 devices with interrupt endpoints were not working
properly. The problem is that to avoid loops we stop processing as soon
@ -22,7 +22,7 @@ their seen bit would still be 1 and they would be skipped.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 1 +
hw/usb-ehci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -37,6 +37,3 @@ index 980cce3..422afc8 100644
break;
default:
--
1.7.9.3

View File

@ -1,8 +1,7 @@
From 35562fb521547e081e732453a6395fc00d9ee9e4 Mon Sep 17 00:00:00 2001
From 27a9a7c516996ae28d635edaaec956be0e919d76 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 1 Mar 2012 15:20:17 +0100
Subject: [PATCH 130/140] usb-ehci: Drop cached qhs when the doorbell gets
rung
Subject: [PATCH] usb-ehci: Drop cached qhs when the doorbell gets rung
The purpose of the IAAD bit / the doorbell is to make the ehci controller
forget about cached qhs, this is mainly used when cancelling transactions,
@ -37,7 +36,7 @@ happen and the usb-ehci behavior from before this patch is not good.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 31 ++++++++++++++++---------------
hw/usb-ehci.c | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -110,6 +109,3 @@ index 422afc8..b8ba483 100644
break;
default:
--
1.7.9.3

View File

@ -1,12 +1,12 @@
From cbb6384d32c4926822ba9216992253deef9ef3b5 Mon Sep 17 00:00:00 2001
From ea210d9cf81169777f1bfd0f4cb6e9c86fb1fbe6 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 2 Mar 2012 11:02:04 +0100
Subject: [PATCH 131/140] usb-ehci: Rip the queues when the async or period
schedule is halted
Subject: [PATCH] usb-ehci: Rip the queues when the async or period schedule is
halted
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 5 ++++-
hw/usb-ehci.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -39,6 +39,3 @@ index b8ba483..11eded7 100644
ehci_clear_usbsts(ehci, USBSTS_PSS);
ehci_set_state(ehci, async, EST_INACTIVE);
break;
--
1.7.9.3

View File

@ -1,8 +1,8 @@
From 73a9969c47459ee208d6247999823f2a36ee51fe Mon Sep 17 00:00:00 2001
From 15e1636b0c32a0b4c0b85bc8b52ada681eb36a00 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 1 Mar 2012 16:34:56 +0100
Subject: [PATCH 132/140] usb-ehci: Any packet completion except for NAK
should set the interrupt
Subject: [PATCH] usb-ehci: Any packet completion except for NAK should set the
interrupt
As clearly stated in the 2.3.2 of the EHCI spec, any time USBERRINT get
sets then if the td has its IOC bit set USBINT should be set as well.
@ -12,7 +12,7 @@ USBINT if the IOC bit is set.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 2 +-
hw/usb-ehci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -28,6 +28,3 @@ index 11eded7..bc5f591 100644
ehci_record_interrupt(q->ehci, USBSTS_INT);
}
}
--
1.7.9.3

View File

@ -1,7 +1,7 @@
From 6e6bfa88ae3867afd8258b43e3c05cba2585ee37 Mon Sep 17 00:00:00 2001
From c65a584d05b2e2d5fa1f997981ce6c055a089b3f Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 1 Mar 2012 21:43:56 +0100
Subject: [PATCH 133/140] usb-ehci: Fix cerr tracking
Subject: [PATCH] usb-ehci: Fix cerr tracking
cerr should only be decremented on errors which cause XactErr to be set, and
when that happens the failing transaction should be retried until cerr reaches
@ -14,7 +14,7 @@ immediately set cerr to 0 on errors which set XactErr.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 19 ++++++-------------
hw/usb-ehci.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -67,6 +67,3 @@ index bc5f591..a3d5c11 100644
if (q->tbytes && q->pid == USB_TOKEN_IN) {
q->tbytes -= q->usb_status;
} else {
--
1.7.9.3

View File

@ -1,7 +1,7 @@
From 6177c3610b6416a7200ae6c6985f01fccdbdc7e5 Mon Sep 17 00:00:00 2001
From 5fd12d0e21807ff6f61794840ed4212ec45c4be4 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 1 Mar 2012 23:11:13 +0100
Subject: [PATCH 134/140] usb-ehci: Remove dead nakcnt code
Subject: [PATCH] usb-ehci: Remove dead nakcnt code
This patch removes 2 bits of dead nakcnt code:
@ -20,7 +20,7 @@ So doing this from ehci_state_fetchqh is redundant.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 20 --------------------
hw/usb-ehci.c | 20 --------------------
1 file changed, 20 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -73,6 +73,3 @@ index a3d5c11..92cdf2a 100644
// TODO verify enough time remains in the uframe as in 4.4.1.1
// TODO write back ptr to async list when done or out of time
// TODO Windows does not seem to ever set the MULT field
--
1.7.9.3

View File

@ -1,7 +1,7 @@
From 2d9b6cb9bd00ede47635dc4db413f647143d5a1d Mon Sep 17 00:00:00 2001
From 35f2ecb66299e63a76e51e6758c517cf1394c8f9 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 1 Mar 2012 23:55:11 +0100
Subject: [PATCH 135/140] usb-ehci: Fix and simplify nakcnt handling
Subject: [PATCH] usb-ehci: Fix and simplify nakcnt handling
The nakcnt code in ehci_execute_complete() marked transactions as finished
when a packet completed with a result of USB_RET_NAK, but USB_RET_NAK
@ -40,7 +40,7 @@ ehci_state_executing().
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 32 ++++----------------------------
hw/usb-ehci.c | 32 ++++----------------------------
1 file changed, 4 insertions(+), 28 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -115,6 +115,3 @@ index 92cdf2a..aa6fae5 100644
ehci_set_state(q->ehci, async, EST_HORIZONTALQH);
} else {
ehci_set_state(q->ehci, async, EST_WRITEBACK);
--
1.7.9.3

View File

@ -1,13 +1,13 @@
From 0e6cd6e6da3d0648204526e8ebd79047f48d009a Mon Sep 17 00:00:00 2001
From 8b7a0e0ea17192bd7db60a2211b0ffe04b2bac18 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 2 Mar 2012 00:36:50 +0100
Subject: [PATCH 136/140] usb-ehci: Remove dead isoch_pause code
Subject: [PATCH] usb-ehci: Remove dead isoch_pause code
I see no value in keeping this around, so lets delete it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 60 +++++++++++++++------------------------------------------
hw/usb-ehci.c | 60 +++++++++++++++--------------------------------------------
1 file changed, 15 insertions(+), 45 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -109,6 +109,3 @@ index aa6fae5..72c3f2a 100644
if (ehci->frindex > 0x00001fff) {
ehci->frindex = 0;
--
1.7.9.3

View File

@ -1,20 +1,20 @@
From 9726556968aef62213b80bd4e351a4f7f721f941 Mon Sep 17 00:00:00 2001
From c767c83ab8061664dcd6ea05b692c2acf0efb27f Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 1 Mar 2012 17:22:14 +0100
Subject: [PATCH 137/140] usb: return BABBLE rather then NAK when we receive
too much data
Subject: [PATCH] usb: return BABBLE rather then NAK when we receive too much
data
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-linux.c | 8 +++++++-
usb-redir.c | 4 ++--
usb-linux.c | 8 +++++++-
usb-redir.c | 4 ++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/usb-linux.c b/usb-linux.c
index ab4c693..b2d70f9 100644
index 749ce71..9987a2c 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -390,6 +390,10 @@ static void async_complete(void *opaque)
@@ -391,6 +391,10 @@ static void async_complete(void *opaque)
p->result = USB_RET_STALL;
break;
@ -25,7 +25,7 @@ index ab4c693..b2d70f9 100644
default:
p->result = USB_RET_NAK;
break;
@@ -718,6 +722,8 @@ static int urb_status_to_usb_ret(int status)
@@ -729,6 +733,8 @@ static int urb_status_to_usb_ret(int status)
switch (status) {
case -EPIPE:
return USB_RET_STALL;
@ -34,7 +34,7 @@ index ab4c693..b2d70f9 100644
default:
return USB_RET_NAK;
}
@@ -755,7 +761,7 @@ static int usb_host_handle_iso_data(USBHostDevice *s, USBPacket *p, int in)
@@ -766,7 +772,7 @@ static int usb_host_handle_iso_data(USBHostDevice *s, USBPacket *p, int in)
} else if (aurb[i].urb.iso_frame_desc[j].actual_length
> p->iov.size) {
printf("husb: received iso data is larger then packet\n");
@ -44,10 +44,10 @@ index ab4c693..b2d70f9 100644
} else {
len = aurb[i].urb.iso_frame_desc[j].actual_length;
diff --git a/usb-redir.c b/usb-redir.c
index 629c87d..61860ef 100644
index d10be6f..7313140 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -457,7 +457,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
@@ -456,7 +456,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
ERROR("received iso data is larger then packet ep %02X (%d > %d)\n",
ep, len, (int)p->iov.size);
bufp_free(dev, isop, ep);
@ -56,7 +56,7 @@ index 629c87d..61860ef 100644
}
usb_packet_copy(p, isop->data, len);
bufp_free(dev, isop, ep);
@@ -576,7 +576,7 @@ static int usbredir_handle_interrupt_data(USBRedirDevice *dev,
@@ -575,7 +575,7 @@ static int usbredir_handle_interrupt_data(USBRedirDevice *dev,
if (len > p->iov.size) {
ERROR("received int data is larger then packet ep %02X\n", ep);
bufp_free(dev, intp, ep);
@ -65,6 +65,3 @@ index 629c87d..61860ef 100644
}
usb_packet_copy(p, intp->data, len);
bufp_free(dev, intp, ep);
--
1.7.9.3

View File

@ -1,7 +1,7 @@
From 2a6bbdddc2aca6af038c42054c3d3a7b09e5ac3a Mon Sep 17 00:00:00 2001
From 65969230e04e8a3d80d4ca0aef29dbae735f3f13 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 2 Mar 2012 00:26:23 +0100
Subject: [PATCH 138/140] usb: add USB_RET_IOERROR
Subject: [PATCH] usb: add USB_RET_IOERROR
We already have USB_RET_NAK, but that means that a device does not want
to send/receive right now. But with host / network redirection we can
@ -20,12 +20,12 @@ Notes:
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 2 ++
hw/usb-ohci.c | 2 ++
hw/usb-uhci.c | 1 +
hw/usb.h | 11 ++++++-----
usb-linux.c | 4 ++--
usb-redir.c | 9 ++++++---
hw/usb-ehci.c | 2 ++
hw/usb-ohci.c | 2 ++
hw/usb-uhci.c | 1 +
hw/usb.h | 11 ++++++-----
usb-linux.c | 4 ++--
usb-redir.c | 9 ++++++---
6 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -49,7 +49,7 @@ index 72c3f2a..ba1b9da 100644
/* 3.3.2: XACTERR is only allowed on IN transactions */
if (dir) {
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index c2981c5..d805497 100644
index c27014a..f374cad 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -828,6 +828,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
@ -103,10 +103,10 @@ index c6e1870..4010e12 100644
#define USB_SPEED_LOW 0
#define USB_SPEED_FULL 1
diff --git a/usb-linux.c b/usb-linux.c
index b2d70f9..9f13d1e 100644
index 9987a2c..c56a74e 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -395,7 +395,7 @@ static void async_complete(void *opaque)
@@ -396,7 +396,7 @@ static void async_complete(void *opaque)
break;
default:
@ -115,7 +115,7 @@ index b2d70f9..9f13d1e 100644
break;
}
@@ -725,7 +725,7 @@ static int urb_status_to_usb_ret(int status)
@@ -736,7 +736,7 @@ static int urb_status_to_usb_ret(int status)
case -EOVERFLOW:
return USB_RET_BABBLE;
default:
@ -125,10 +125,10 @@ index b2d70f9..9f13d1e 100644
}
diff --git a/usb-redir.c b/usb-redir.c
index 61860ef..f64443e 100644
index 7313140..b044dc5 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -441,7 +441,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
@@ -440,7 +440,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
/* Check iso_error for stream errors, otherwise its an underrun */
status = dev->endpoint[EP2I(ep)].iso_error;
dev->endpoint[EP2I(ep)].iso_error = 0;
@ -137,7 +137,7 @@ index 61860ef..f64443e 100644
}
DPRINTF2("iso-token-in ep %02X status %d len %d queue-size: %d\n", ep,
isop->status, isop->len, dev->endpoint[EP2I(ep)].bufpq_size);
@@ -449,7 +449,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
@@ -448,7 +448,7 @@ static int usbredir_handle_iso_data(USBRedirDevice *dev, USBPacket *p,
status = isop->status;
if (status != usb_redir_success) {
bufp_free(dev, isop, ep);
@ -146,7 +146,7 @@ index 61860ef..f64443e 100644
}
len = isop->len;
@@ -1045,11 +1045,14 @@ static int usbredir_handle_status(USBRedirDevice *dev,
@@ -1044,11 +1044,14 @@ static int usbredir_handle_status(USBRedirDevice *dev,
return USB_RET_STALL;
case usb_redir_cancelled:
WARNING("returning cancelled packet to HC?\n");
@ -162,6 +162,3 @@ index 61860ef..f64443e 100644
}
}
--
1.7.9.3

View File

@ -1,7 +1,7 @@
From 21946e621f14553b72cde7fae221ae390a427eac Mon Sep 17 00:00:00 2001
From d6f515f1df543d17242cff93dc4fc44bb7c89ef9 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Thu, 23 Feb 2012 13:24:00 +0000
Subject: [PATCH 139/140] usb-ehci: fix reset
Subject: [PATCH] usb-ehci: fix reset
Two reset fixes:
* pick up s->usbcmd value after ehci_reset call to make sure it
@ -11,7 +11,7 @@ Two reset fixes:
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/usb-ehci.c | 3 ++-
hw/usb-ehci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -35,6 +35,3 @@ index ba1b9da..ad0f6e1 100644
}
/* not supporting dynamic frame list size at the moment */
--
1.7.9.3

View File

@ -1,7 +1,7 @@
From 985b7cfbd45960bb74a13ad8044765a8e35f2251 Mon Sep 17 00:00:00 2001
From 18fd6695ac06a6f63e75d8a390be3247e234d2cc Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Sun, 4 Mar 2012 12:41:11 +0100
Subject: [PATCH 140/140] usb-ehci: sanity-check iso xfers
Subject: [PATCH] usb-ehci: sanity-check iso xfers
This patch adds a sanity check to itd processing to make sure the
endpoint addressed by the guest is actually an iso endpoint. Also
@ -19,7 +19,7 @@ a NAK, like upstream does when the ep type check fails.]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 4 ++++
hw/usb-ehci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -37,6 +37,3 @@ index ad0f6e1..b5d7037 100644
case USB_RET_NAK:
/* no data for us, so do a zero-length transfer */
ret = 0;
--
1.7.9.3

View File

@ -1,7 +1,7 @@
From 9d604ddc4770f8f25de148e9b35687817a5d4110 Mon Sep 17 00:00:00 2001
From f57640353c847f6d7bf5a2d115caa2ea49d316b8 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 28 Mar 2012 20:31:32 +0200
Subject: [PATCH 141/146] usb-ehci: frindex always is a 14 bits counter
Subject: [PATCH] usb-ehci: frindex always is a 14 bits counter
frindex always is a 14 bits counter, and not a 13 bits one as we were
emulating. There are some subtle hints to this in the spec, first of all
@ -44,7 +44,7 @@ with other operating systems were seen.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 8 ++++++--
hw/usb-ehci.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -69,6 +69,3 @@ index b5d7037..3934bf0 100644
ehci->sofv = (ehci->frindex - 1) >> 3;
ehci->sofv &= 0x000003ff;
}
--
1.7.9.3

View File

@ -1,14 +1,14 @@
From ef3477db39f2eb38610b7e99a4a4f4d8ddb903df Mon Sep 17 00:00:00 2001
From de57c42da930470e62fb520f6c0de5d87da67385 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 29 Mar 2012 16:37:34 +0200
Subject: [PATCH 142/146] usb-ehci: Drop unused sofv value
Subject: [PATCH] usb-ehci: Drop unused sofv value
The sofv value only ever gets a value assigned and is never used (read)
anywhere, so we can just drop it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 8 --------
hw/usb-ehci.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -44,6 +44,3 @@ index 3934bf0..ff69587 100644
}
if (frames - i > ehci->maxframes) {
--
1.7.9.3

View File

@ -1,22 +1,22 @@
From 89c9752afa77c6936ab9839d8fb1ce42147086b2 Mon Sep 17 00:00:00 2001
From 1aa49526aebe5461a5c61c686a2ea83d6c7e9e7d Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Thu, 29 Mar 2012 16:41:23 +0200
Subject: [PATCH 143/146] usb-redir: Notify our peer when we reject a device
due to a speed mismatch
Subject: [PATCH] usb-redir: Notify our peer when we reject a device due to a
speed mismatch
Also cleanup (reset) our device state when we reject a device due to a
speed mismatch.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 8 +++++++-
usb-redir.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/usb-redir.c b/usb-redir.c
index f64443e..8ee3f07 100644
index b044dc5..93e892d 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -845,7 +845,13 @@ static void usbredir_do_attach(void *opaque)
@@ -844,7 +844,13 @@ static void usbredir_do_attach(void *opaque)
{
USBRedirDevice *dev = opaque;
@ -31,6 +31,3 @@ index f64443e..8ee3f07 100644
}
/*
--
1.7.9.3

View File

@ -1,7 +1,7 @@
From c6b10d4d87d8158c1b0bd8648491db8501dff784 Mon Sep 17 00:00:00 2001
From 5d5dff2fb85390c00a7b7e555b34a82ccca7c89b Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sat, 31 Mar 2012 13:07:24 +0200
Subject: [PATCH 144/146] usb-redir: An interface count of 0 is a valid value
Subject: [PATCH] usb-redir: An interface count of 0 is a valid value
An interface-count of 0 happens when a device is in unconfigured state when
it gets redirected. So we should not use 0 to detect not having received
@ -9,11 +9,11 @@ interface info from our peer.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 5 +++--
usb-redir.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/usb-redir.c b/usb-redir.c
index 8ee3f07..3187b68 100644
index 93e892d..e0eb393 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -39,6 +39,7 @@
@ -24,7 +24,7 @@ index 8ee3f07..3187b68 100644
#define EP2I(ep_address) (((ep_address & 0x80) >> 3) | (ep_address & 0x0f))
#define I2EP(i) (((i & 0x10) << 3) | (i & 0x0f))
@@ -995,7 +996,7 @@ static void usbredir_handle_destroy(USBDevice *udev)
@@ -994,7 +995,7 @@ static void usbredir_handle_destroy(USBDevice *udev)
static int usbredir_check_filter(USBRedirDevice *dev)
{
@ -33,7 +33,7 @@ index 8ee3f07..3187b68 100644
ERROR("No interface info for device\n");
goto error;
}
@@ -1158,7 +1159,7 @@ static void usbredir_device_disconnect(void *priv)
@@ -1157,7 +1158,7 @@ static void usbredir_device_disconnect(void *priv)
for (i = 0; i < MAX_ENDPOINTS; i++) {
QTAILQ_INIT(&dev->endpoint[i].bufpq);
}
@ -42,6 +42,3 @@ index 8ee3f07..3187b68 100644
}
static void usbredir_interface_info(void *priv,
--
1.7.9.3

View File

@ -1,22 +1,21 @@
From 442d81d00308b0145307b175a1910c7443184a3f Mon Sep 17 00:00:00 2001
From 28aa326b7d0068c78359f8bce00bef60e6c59d36 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sat, 31 Mar 2012 13:12:09 +0200
Subject: [PATCH 145/146] usb-redir: Reset device address and speed on
disconnect
Subject: [PATCH] usb-redir: Reset device address and speed on disconnect
Without this disconnected devices look like the last redirected device
in the monitor in "info usb".
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 2 ++
usb-redir.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/usb-redir.c b/usb-redir.c
index 3187b68..1a9d766 100644
index e0eb393..a424826 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -1160,6 +1160,8 @@ static void usbredir_device_disconnect(void *priv)
@@ -1159,6 +1159,8 @@ static void usbredir_device_disconnect(void *priv)
QTAILQ_INIT(&dev->endpoint[i].bufpq);
}
dev->interface_info.interface_count = NO_INTERFACE_INFO;
@ -25,6 +24,3 @@ index 3187b68..1a9d766 100644
}
static void usbredir_interface_info(void *priv,
--
1.7.9.3

View File

@ -1,8 +1,7 @@
From b467871a6a08b8ff12382e33e49f991fe02f3cc7 Mon Sep 17 00:00:00 2001
From 54a8b5462e71abbbf4a4c3c444f70abfc6659877 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Sat, 31 Mar 2012 13:17:13 +0200
Subject: [PATCH 146/146] usb-redir: Not finding an async urb id is not an
error
Subject: [PATCH] usb-redir: Not finding an async urb id is not an error
We clear our pending async urb list on device disconnect and we may still
receive "packet complete" packets from our peer after this, which will then
@ -10,11 +9,11 @@ refer to packet ids no longer in our list.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
usb-redir.c | 2 +-
usb-redir.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usb-redir.c b/usb-redir.c
index 1a9d766..a41c231 100644
index a424826..ec9170a 100644
--- a/usb-redir.c
+++ b/usb-redir.c
@@ -286,7 +286,7 @@ static AsyncURB *async_find(USBRedirDevice *dev, uint32_t packet_id)
@ -26,6 +25,3 @@ index 1a9d766..a41c231 100644
return NULL;
}
--
1.7.9.3

View File

@ -1,8 +1,7 @@
From 4c245e5ecbc7d5c30c8e8bb4bfcd18c79fafddfe Mon Sep 17 00:00:00 2001
From ede6c50c5236dd0cdbcef242320ad3c8bc2bbfd3 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 3 Apr 2012 14:04:31 +0200
Subject: [PATCH 147/181] usb-ehci: Ensure frindex writes leave a valid
frindex value
Subject: [PATCH] usb-ehci: Ensure frindex writes leave a valid frindex value
frindex is a 14 bits counter, so bits 31-14 should always be 0, and
after the commit titled "usb-ehci: frindex always is a 14 bits counter"
@ -13,7 +12,7 @@ things will still work when that happens.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb-ehci.c | 4 ++++
hw/usb-ehci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c
@ -31,6 +30,3 @@ index ff69587..16e6053 100644
case CONFIGFLAG:
val &= 0x1;
if (val) {
--
1.7.10

View File

@ -1,15 +1,14 @@
From 8858b6d0dac346d9f841cfa84f57cb03bffdf050 Mon Sep 17 00:00:00 2001
From d9621f01291e00340f1e9947d1d13bbda9288056 Mon Sep 17 00:00:00 2001
From: Markus Armbruster <armbru@redhat.com>
Date: Fri, 4 Nov 2011 10:34:24 +0100
Subject: [PATCH 401/434] qxl: Slot sanity check in qxl_phys2virt() is off by
one, fix
Subject: [PATCH] qxl: Slot sanity check in qxl_phys2virt() is off by one, fix
Spotted by Coverity.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.c | 2 +-
hw/qxl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -25,6 +24,3 @@ index 41500e9..e0f9d4a 100644
PANIC_ON(!qxl->guest_slots[slot].active);
PANIC_ON(offset < qxl->guest_slots[slot].delta);
offset -= qxl->guest_slots[slot].delta;
--
1.7.10

View File

@ -1,7 +1,7 @@
From f87b93c3944652f90e2c0010da6ee8c182382369 Mon Sep 17 00:00:00 2001
From 626044aeb50b2bc521cb279296fae83986ede8fa Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Wed, 15 Feb 2012 09:15:37 +0100
Subject: [PATCH 402/434] input: send kbd+mouse events only to running guests.
Subject: [PATCH] input: send kbd+mouse events only to running guests.
Trying to interact with a stopped guest will queue up the events,
then send them all at once when the guest continues running, with
@ -13,7 +13,7 @@ is in running state.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
---
input.c | 6 ++++++
input.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/input.c b/input.c
@ -40,6 +40,3 @@ index 9ade63f..b48408d 100644
if (QTAILQ_EMPTY(&mouse_handlers)) {
return;
}
--
1.7.10

View File

@ -1,11 +1,11 @@
From 3b36dd31d54b24e02493fdd86269ba5286086c98 Mon Sep 17 00:00:00 2001
From 0c2a62bf28f82dd4112dfb76f9b5a5062e22ea99 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Wed, 8 Feb 2012 15:58:35 +0100
Subject: [PATCH 403/434] qxl: fix warnings on 32bit
Subject: [PATCH] qxl: fix warnings on 32bit
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.c | 7 ++++---
hw/qxl.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -40,6 +40,3 @@ index e0f9d4a..4fd5e4e 100644
case MEMSLOT_GROUP_GUEST:
PANIC_ON(slot >= NUM_MEMSLOTS);
PANIC_ON(!qxl->guest_slots[slot].active);
--
1.7.10

View File

@ -1,7 +1,7 @@
From 29fdb0f3a401e5590e465a0cc37d82383f3d5f07 Mon Sep 17 00:00:00 2001
From ffbbf5a2455cd5c840a298a983e986c6ec46d38b Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Wed, 15 Feb 2012 14:04:44 +0100
Subject: [PATCH 404/434] qxl: don't render stuff when the vm is stopped.
Subject: [PATCH] qxl: don't render stuff when the vm is stopped.
This patch fixes the local qxl renderer to not kick spice-server
in case the vm is stopped. First it is largely pointless because
@ -19,7 +19,7 @@ is stopped.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl-render.c | 12 +++++-------
hw/qxl-render.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/hw/qxl-render.c b/hw/qxl-render.c
@ -51,6 +51,3 @@ index 2c51ba9..a7891b2 100644
if (redraw) {
memset(dirty, 0, sizeof(dirty));
dirty[0] = update;
--
1.7.10

View File

@ -1,8 +1,8 @@
From 0386bf2be16745ce87f35ce65153ef4e11f93b22 Mon Sep 17 00:00:00 2001
From c84b4be013e683978e2d55d996c3dc6d7bace2aa Mon Sep 17 00:00:00 2001
From: Yonit Halperin <yhalperi@redhat.com>
Date: Wed, 15 Feb 2012 11:22:15 +0200
Subject: [PATCH 405/434] qxl: set only off-screen surfaces dirty instead of
the whole vram
Subject: [PATCH] qxl: set only off-screen surfaces dirty instead of the whole
vram
We used to assure the guest surfaces were saved before migration by
setting the whole vram dirty. This patch sets dirty only the areas
@ -11,7 +11,7 @@ that are actually used in the vram.
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.c | 53 ++++++++++++++++++++++++++++++++++++++++++++---------
hw/qxl.c | 53 ++++++++++++++++++++++++++++++++++++++++++++---------
1 file changed, 44 insertions(+), 9 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -92,6 +92,3 @@ index 4fd5e4e..3d9b1b3 100644
}
}
--
1.7.10

View File

@ -1,15 +1,15 @@
From ba922e5e6a5687f13def623e36bfb834ece2defc Mon Sep 17 00:00:00 2001
From 73dd6f6a1e6cf8da34efff7b1e30a2d0855ed582 Mon Sep 17 00:00:00 2001
From: Yonit Halperin <yhalperi@redhat.com>
Date: Wed, 15 Feb 2012 11:22:16 +0200
Subject: [PATCH 406/434] qxl: make sure primary surface is saved on migration
also in compat mode
Subject: [PATCH] qxl: make sure primary surface is saved on migration also in
compat mode
RHBZ #790083
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.c | 2 +-
hw/qxl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -25,6 +25,3 @@ index 3d9b1b3..b910337 100644
return;
}
--
1.7.10

View File

@ -1,7 +1,7 @@
From 9ada192cfea65a92a765c6a2f6b56a08f1b865df Mon Sep 17 00:00:00 2001
From 8824f88121cc0d07fec40828bf4c02824e21c52f Mon Sep 17 00:00:00 2001
From: "Daniel P. Berrange" <berrange@redhat.com>
Date: Mon, 13 Feb 2012 13:43:08 +0000
Subject: [PATCH 407/434] Add SPICE support to add_client monitor command
Subject: [PATCH] Add SPICE support to add_client monitor command
With the acceptance of some new APIs to libspice-server.so it
is possible to add support for SPICE to the 'add_client'
@ -30,10 +30,10 @@ Changes in v3:
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
monitor.c | 9 +++++++--
qmp-commands.hx | 6 ++++--
ui/qemu-spice.h | 7 +++++++
ui/spice-core.c | 13 +++++++++++++
monitor.c | 9 +++++++--
qmp-commands.hx | 6 ++++--
ui/qemu-spice.h | 7 +++++++
ui/spice-core.c | 13 +++++++++++++
4 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/monitor.c b/monitor.c
@ -134,6 +134,3 @@ index 5639c6f..d98863e 100644
static void spice_register_config(void)
{
qemu_add_opts(&qemu_spice_opts);
--
1.7.10

View File

@ -1,8 +1,8 @@
From 6594551ebe427cae4298b038be02ddc9c335219f Mon Sep 17 00:00:00 2001
From b54dc2a6c0a6b38a2fac5db290624e904a21fe99 Mon Sep 17 00:00:00 2001
From: Yonit Halperin <yhalperi@redhat.com>
Date: Wed, 8 Feb 2012 15:40:15 +0200
Subject: [PATCH 408/434] spice: support ipv6 channel address in monitor
events and in spice info
Subject: [PATCH] spice: support ipv6 channel address in monitor events and in
spice info
RHBZ #788444
@ -11,7 +11,7 @@ CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/spice-core.c | 37 ++++++++++++++++++++++++++++++++-----
ui/spice-core.c | 37 ++++++++++++++++++++++++++++++++-----
1 file changed, 32 insertions(+), 5 deletions(-)
diff --git a/ui/spice-core.c b/ui/spice-core.c
@ -78,6 +78,3 @@ index d98863e..27216e9 100644
chan->value->connection_id = item->info->connection_id;
chan->value->channel_type = item->info->type;
--
1.7.10

View File

@ -1,13 +1,13 @@
From f7656005900f3c07450303afa66151b6a1bb9599 Mon Sep 17 00:00:00 2001
From ba6e610d1e7eeb5f2f06e7321c8153f827a6634b Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri, 17 Feb 2012 14:40:01 +0100
Subject: [PATCH 409/434] qxl: drop vram bar minimum size
Subject: [PATCH] qxl: drop vram bar minimum size
There is no reason to require a minimum size of 16 MB for the vram.
Lower the limit to 4096 (one page). Make it disapper completely would
break guests.
---
hw/qxl.c | 4 ++--
hw/qxl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -25,6 +25,3 @@ index b910337..d71c94d 100644
}
if (qxl->revision == 1) {
qxl->vram_size = 4096;
--
1.7.10

View File

@ -1,7 +1,7 @@
From 619c68418809149d56025e5b4e7a9828eef90ea8 Mon Sep 17 00:00:00 2001
From 86b1736c4105ec6073c969dc9f0aaaf899e00be1 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri, 17 Feb 2012 15:02:40 +0100
Subject: [PATCH 410/434] qxl: move ram size init to new function
Subject: [PATCH] qxl: move ram size init to new function
Factor memory bar sizing bits out to a separate function.
@ -11,7 +11,7 @@ Conflicts:
hw/qxl.c
---
hw/qxl.c | 41 ++++++++++++++++++++++-------------------
hw/qxl.c | 41 ++++++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 19 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -92,6 +92,3 @@ index d71c94d..df8efbc 100644
memory_region_init_ram(&qxl->vga.vram, &qxl->pci.qdev, "qxl.vgavram",
qxl->vga.vram_size);
qxl->vga.vram_ptr = memory_region_get_ram_ptr(&qxl->vga.vram);
--
1.7.10

View File

@ -1,15 +1,15 @@
From eff66c7db18e9a3ef0b6ce5deb9a49b61090d809 Mon Sep 17 00:00:00 2001
From b9209105173154ae0d6821e9c548011c7d04179d Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri, 17 Feb 2012 15:03:24 +0100
Subject: [PATCH 411/434] qxl: add user-friendly bar size properties
Subject: [PATCH] qxl: add user-friendly bar size properties
Add two properties to specify bar sizes in megabytes instead of bytes,
which is alot more user-friendly.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.c | 8 ++++++++
hw/qxl.h | 4 ++++
hw/qxl.c | 8 ++++++++
hw/qxl.h | 4 ++++
2 files changed, 12 insertions(+)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -58,6 +58,3 @@ index 766aa6d..d062991 100644
} PCIQXLDevice;
#define PANIC_ON(x) if ((x)) { \
--
1.7.10

View File

@ -1,7 +1,7 @@
From 1cae61c4d4fe994e5158d63d5f4fe9b52a7b8211 Mon Sep 17 00:00:00 2001
From e40909ec7cb1160ad269c1c207d218850e727eaf Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Fri, 24 Feb 2012 23:19:25 +0200
Subject: [PATCH 412/434] qxl: fix spice+sdl no cursor regression
Subject: [PATCH] qxl: fix spice+sdl no cursor regression
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@ -14,9 +14,9 @@ Reported-by: Fabiano Fidêncio <fabiano@fidencio.org>
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.c | 4 ++++
ui/spice-display.c | 23 ++++++++++++++---------
ui/spice-display.h | 1 +
hw/qxl.c | 4 ++++
ui/spice-display.c | 23 ++++++++++++++---------
ui/spice-display.h | 1 +
3 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -88,6 +88,3 @@ index 5e52df9..a23bfc8 100644
void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot,
qxl_async_io async);
--
1.7.10

View File

@ -1,12 +1,12 @@
From 4888e60d646b0f8cdfe4180bacc90857d3d2a5dd Mon Sep 17 00:00:00 2001
From 319a228b634930e2822579f85522eb6afdd3ebbe Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Fri, 24 Feb 2012 23:19:26 +0200
Subject: [PATCH 413/434] sdl: remove NULL check, g_malloc0 can't fail
Subject: [PATCH] sdl: remove NULL check, g_malloc0 can't fail
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/sdl.c | 4 ----
ui/sdl.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/ui/sdl.c b/ui/sdl.c
@ -24,6 +24,3 @@ index 8cafc44..6844c83 100644
surface->width = width;
surface->height = height;
--
1.7.10

View File

@ -1,7 +1,7 @@
From 813c46edf4f3f69347353749755e040bc5fbd597 Mon Sep 17 00:00:00 2001
From d3ca92da49658c29441ff3e1a4fdec2d1cb94baa Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Fri, 24 Feb 2012 23:19:27 +0200
Subject: [PATCH 414/434] qxl: drop qxl_spice_update_area_async definition
Subject: [PATCH] qxl: drop qxl_spice_update_area_async definition
It was never used. Introduced in
5ff4e36c804157bd84af43c139f8cd3a59722db9
@ -12,7 +12,7 @@ But not used even then.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.h | 6 ------
hw/qxl.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/hw/qxl.h b/hw/qxl.h
@ -29,6 +29,3 @@ index d062991..a615eca 100644
- uint32_t clear_dirty_region,
- int is_vga);
-#endif
--
1.7.10

View File

@ -1,7 +1,7 @@
From e07eeb01819b40b839cc12b2eb658f48f13a5ff0 Mon Sep 17 00:00:00 2001
From 824fc1518acc3c50aff5a23807a35cf3dbc753f4 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Fri, 24 Feb 2012 23:19:28 +0200
Subject: [PATCH 415/434] qxl: require spice >= 0.8.2
Subject: [PATCH] qxl: require spice >= 0.8.2
drop all ifdefs on SPICE_INTERFACE_QXL_MINOR >= 1 as a result,
any check for SPICE_SERVER_VERSION that is now always satisfied,
@ -12,15 +12,15 @@ SPICE_INTERFACE_CORE_MINOR == 3.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
configure | 2 +-
hw/qxl.c | 40 ----------------------------------------
hw/qxl.h | 4 ----
ui/spice-core.c | 17 -----------------
ui/spice-display.c | 12 ------------
configure | 2 +-
hw/qxl.c | 40 ----------------------------------------
hw/qxl.h | 4 ----
ui/spice-core.c | 17 -----------------
ui/spice-display.c | 12 ------------
5 files changed, 1 insertion(+), 74 deletions(-)
diff --git a/configure b/configure
index a4848a4..b03172c 100755
index 59f91d0..9bdeea7 100755
--- a/configure
+++ b/configure
@@ -2501,7 +2501,7 @@ int main(void) { spice_server_new(); return 0; }
@ -353,6 +353,3 @@ index c6e61d8..ad76bae 100644
} else {
ssd->worker->destroy_primary_surface(ssd->worker, id);
}
--
1.7.10

View File

@ -1,7 +1,7 @@
From f9344933bcc1425cf1e8142dc2f8321522dc00af Mon Sep 17 00:00:00 2001
From 5c858288c296f040a07311b6a754d2d79f933eb5 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Fri, 24 Feb 2012 23:19:29 +0200
Subject: [PATCH 416/434] qxl: remove flipped
Subject: [PATCH] qxl: remove flipped
Tested on linux and windows guests. For negative stride, qxl_flip copies
directly to vga->ds->surface->data, for positive it's reallocated to
@ -10,8 +10,8 @@ share qxl->guest_primary.data
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl-render.c | 66 +++++++++++++++++++++++++------------------------------
hw/qxl.h | 2 +-
hw/qxl-render.c | 66 ++++++++++++++++++++++++++-------------------------------
hw/qxl.h | 2 +-
2 files changed, 31 insertions(+), 37 deletions(-)
diff --git a/hw/qxl-render.c b/hw/qxl-render.c
@ -140,6 +140,3 @@ index 9288e46..53a3ace 100644
} guest_primary;
struct surfaces {
--
1.7.10

View File

@ -1,18 +1,18 @@
From bbe362cd6a386d98a94ac791f1263671bd79b754 Mon Sep 17 00:00:00 2001
From c9180962530868341a4ecdb5a99d942b9ce05139 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Fri, 24 Feb 2012 23:19:30 +0200
Subject: [PATCH 417/434] qxl: introduce QXLCookie
Subject: [PATCH] qxl: introduce QXLCookie
Will be used in the next patch.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl-render.c | 2 +-
hw/qxl.c | 61 ++++++++++++++++++++++++++++++++++++++++------------
hw/qxl.h | 2 +-
ui/spice-display.c | 22 ++++++++++++++++---
ui/spice-display.h | 14 ++++++++++++
hw/qxl-render.c | 2 +-
hw/qxl.c | 61 +++++++++++++++++++++++++++++++++++++++++-------------
hw/qxl.h | 2 +-
ui/spice-display.c | 22 +++++++++++++++++---
ui/spice-display.h | 14 +++++++++++++
5 files changed, 82 insertions(+), 19 deletions(-)
diff --git a/hw/qxl-render.c b/hw/qxl-render.c
@ -259,6 +259,3 @@ index a23bfc8..8a010cb 100644
typedef struct SimpleSpiceDisplay SimpleSpiceDisplay;
typedef struct SimpleSpiceUpdate SimpleSpiceUpdate;
--
1.7.10

View File

@ -1,7 +1,7 @@
From c26805e29312fee136008a57c70a2f5f140ba706 Mon Sep 17 00:00:00 2001
From f229e9b26f1606e21cd5c2d5bb984d0af012c579 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Fri, 24 Feb 2012 23:19:31 +0200
Subject: [PATCH 418/434] qxl: make qxl_render_update async
Subject: [PATCH] qxl: make qxl_render_update async
RHBZ# 747011
@ -28,10 +28,10 @@ message for problem introduced by it.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl-render.c | 96 +++++++++++++++++++++++++++++++++++++---------------
hw/qxl.c | 69 ++++++++++++++++++++++++++++++++++---
hw/qxl.h | 10 ++++++
ui/spice-display.h | 6 ++++
hw/qxl-render.c | 96 +++++++++++++++++++++++++++++++++++++++---------------
hw/qxl.c | 69 ++++++++++++++++++++++++++++++++++++---
hw/qxl.h | 10 ++++++
ui/spice-display.h | 6 ++++
4 files changed, 150 insertions(+), 31 deletions(-)
diff --git a/hw/qxl-render.c b/hw/qxl-render.c
@ -355,6 +355,3 @@ index 8a010cb..12e50b6 100644
} u;
} QXLCookie;
--
1.7.10

View File

@ -1,7 +1,7 @@
From 2b973a5ea22635211cbde2e559cc6e6355ca8205 Mon Sep 17 00:00:00 2001
From 13a3ec7847529b74584cec7da2377a755b65eb13 Mon Sep 17 00:00:00 2001
From: Christophe Fergeau <cfergeau@redhat.com>
Date: Fri, 24 Feb 2012 18:13:12 +0100
Subject: [PATCH 419/434] spice: use error_report to report errors
Subject: [PATCH] spice: use error_report to report errors
Error message reporting during spice startup wasn't consistent, it was done
with fprintf(stderr, "") but sometimes the message didn't have a trailing
@ -10,7 +10,7 @@ with the final \n for us.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/spice-core.c | 22 +++++++++++-----------
ui/spice-core.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/ui/spice-core.c b/ui/spice-core.c
@ -97,6 +97,3 @@ index 2c815f1..8503f03 100644
exit(1);
}
/*
--
1.7.10

View File

@ -1,8 +1,7 @@
From d01f59d652b8ac906ecd129afa338f56b2aaef90 Mon Sep 17 00:00:00 2001
From b3520ff11022b03f90255b5596aaa498cbea2d75 Mon Sep 17 00:00:00 2001
From: Christophe Fergeau <cfergeau@redhat.com>
Date: Fri, 24 Feb 2012 18:28:32 +0100
Subject: [PATCH 420/434] Error out when tls-channel option is used without
TLS
Subject: [PATCH] Error out when tls-channel option is used without TLS
It's currently possible to setup spice channels using TLS when
no TLS port has been specified (ie TLS is disabled). This cannot
@ -10,7 +9,7 @@ work, so better to error out in such a situation.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/spice-core.c | 8 +++++++-
ui/spice-core.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ui/spice-core.c b/ui/spice-core.c
@ -39,6 +38,3 @@ index 8503f03..98356b0 100644
if (0 != spice_server_init(spice_server, &core_interface)) {
error_report("failed to initialize spice server");
--
1.7.10

View File

@ -1,7 +1,7 @@
From 7027fa0d3be22f48a51420a45aff13bec54fef1e Mon Sep 17 00:00:00 2001
From 38803225a25d8194cbe8d372579e0bc28ae35abc Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Mon, 27 Feb 2012 11:05:09 +0100
Subject: [PATCH 421/434] qxl: properly handle upright and non-shared surfaces
Subject: [PATCH] qxl: properly handle upright and non-shared surfaces
Although qxl creates a shared displaysurface when the qxl surface is
upright and doesn't need to be flipped there is no guarantee that the
@ -10,7 +10,7 @@ qxl_blit and fix it to handle both flip and non-flip cases.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl-render.c | 20 +++++++++++++-------
hw/qxl-render.c | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/hw/qxl-render.c b/hw/qxl-render.c
@ -72,6 +72,3 @@ index 4857838..2e10e93 100644
dpy_update(vga->ds,
qxl->dirty[i].left, qxl->dirty[i].top,
qxl->dirty[i].right - qxl->dirty[i].left,
--
1.7.10

View File

@ -1,13 +1,13 @@
From 544cfc4a2c730aca346df7215a0dd83280f864d5 Mon Sep 17 00:00:00 2001
From a149ead57ceb131ff2e859549e835c8499c6ba47 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
Date: Mon, 5 Mar 2012 18:22:26 +0100
Subject: [PATCH 422/434] spice: set spice uuid and name
Subject: [PATCH] spice: set spice uuid and name
This allows a Spice client to identify a VM
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/spice-core.c | 6 ++++++
ui/spice-core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/ui/spice-core.c b/ui/spice-core.c
@ -34,6 +34,3 @@ index 98356b0..4ad0a67 100644
if (0 != spice_server_init(spice_server, &core_interface)) {
error_report("failed to initialize spice server");
exit(1);
--
1.7.10

View File

@ -1,7 +1,7 @@
From 63f3e6ee49e0a88bbd7915d81962c9046205c411 Mon Sep 17 00:00:00 2001
From 26e9af01cb047fcd1eeb8fe8e9397266afc4df72 Mon Sep 17 00:00:00 2001
From: Yonit Halperin <yhalperi@redhat.com>
Date: Sun, 18 Mar 2012 09:42:39 +0200
Subject: [PATCH 423/434] monitor: fix client_migrate_info error handling
Subject: [PATCH] monitor: fix client_migrate_info error handling
Report QERR_MISSING_PARAMETER when port is missing. Otherwise
QERR_UNDEFINED_ERROR will occur.
@ -11,7 +11,7 @@ rhbz #795652
Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
monitor.c | 5 +++++
monitor.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/monitor.c b/monitor.c
@ -30,6 +30,3 @@ index 3c23aa4..76739d7 100644
ret = qemu_spice_migrate_info(hostname, port, tls_port, subject,
cb, opaque);
if (ret != 0) {
--
1.7.10

View File

@ -1,7 +1,7 @@
From d3e6c37f68e7e4573a47b0540f626a2add0d05e4 Mon Sep 17 00:00:00 2001
From f520591e875e79ef5965d5a82d43af2fc2334241 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Sun, 18 Mar 2012 13:46:13 +0100
Subject: [PATCH 424/434] qxl: init_pipe_signaling: exit on failure
Subject: [PATCH] qxl: init_pipe_signaling: exit on failure
If pipe creation fails, exit, don't log and continue. Fix indentation at
the same time.
@ -9,7 +9,7 @@ the same time.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.c | 21 +++++++++++----------
hw/qxl.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -44,6 +44,3 @@ index 73be115..9ad5807 100644
}
/* graphics console */
--
1.7.10

View File

@ -1,7 +1,7 @@
From 29304ce6b6863b544f1ad8535a927dfc8864354c Mon Sep 17 00:00:00 2001
From 1e2fc2f3699fc61f2eaba0f292649edd4327b2d1 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Sun, 18 Mar 2012 13:46:14 +0100
Subject: [PATCH 425/434] qxl: switch qxl.c to trace-events
Subject: [PATCH] qxl: switch qxl.c to trace-events
dprint is still used for qxl_init_common one time prints.
@ -18,9 +18,9 @@ Conflicts:
trace-events
---
hw/qxl.c | 141 +++++++++++++++++++++++++---------------------------
trace-events | 59 ++++++++++++++++++++++
ui/spice-display.c | 14 +++++-
hw/qxl.c | 141 ++++++++++++++++++++++++++---------------------------
trace-events | 59 ++++++++++++++++++++++
ui/spice-display.c | 14 +++++-
3 files changed, 140 insertions(+), 74 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -602,7 +602,7 @@ index 9ad5807..813873a 100644
}
diff --git a/trace-events b/trace-events
index 962caca..0bc290f 100644
index e417897..2c7d5a3 100644
--- a/trace-events
+++ b/trace-events
@@ -631,3 +631,62 @@ win_helper_no_switch_pstate(uint32_t new_pstate_regs) "change_pstate: regs new=%
@ -748,6 +748,3 @@ index ab266ae..28d6d4a 100644
ssd->dirty.left, ssd->dirty.right,
ssd->dirty.top, ssd->dirty.bottom);
--
1.7.10

View File

@ -1,7 +1,7 @@
From 6b3e0d7afd011b8d40207fe45f6518937df1d99e Mon Sep 17 00:00:00 2001
From d1ca7c3e651d40b5d3431806d1e47c524cf6ecb8 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Sun, 18 Mar 2012 13:46:15 +0100
Subject: [PATCH 426/434] qxl/qxl_render.c: add trace events
Subject: [PATCH] qxl/qxl_render.c: add trace events
Signed-off-by: Alon Levy <alevy@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
@ -9,8 +9,8 @@ Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Cherry-pick: Added missing include "trace.h"
---
hw/qxl-render.c | 14 +++++---------
trace-events | 7 +++++++
hw/qxl-render.c | 14 +++++---------
trace-events | 7 +++++++
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/hw/qxl-render.c b/hw/qxl-render.c
@ -76,7 +76,7 @@ index 2e10e93..835dc5e 100644
qxl->render_update_cookie_num--;
qemu_mutex_unlock(&qxl->ssd.lock);
diff --git a/trace-events b/trace-events
index 0bc290f..6050d92 100644
index 2c7d5a3..d21e832 100644
--- a/trace-events
+++ b/trace-events
@@ -690,3 +690,10 @@ qxl_spice_reset_memslots(int qid) "%d"
@ -90,6 +90,3 @@ index 0bc290f..6050d92 100644
+qxl_render_blit(int32_t stride, int32_t left, int32_t right, int32_t top, int32_t bottom) "stride=%d [%d, %d, %d, %d]"
+qxl_render_guest_primary_resized(int32_t width, int32_t height, int32_t stride, int32_t bytes_pp, int32_t bits_pp) "%dx%d, stride %d, bpp %d, depth %d"
+qxl_render_update_area_done(void *cookie) "%p"
--
1.7.10

View File

@ -1,7 +1,7 @@
From 1ca7f74b31de28e9170e404ce2b932e311e4d2d0 Mon Sep 17 00:00:00 2001
From 12d059c0284e5d5c0959209aeeac73a73d3e0469 Mon Sep 17 00:00:00 2001
From: Peter Maydell <peter.maydell@linaro.org>
Date: Fri, 16 Mar 2012 13:50:04 +0000
Subject: [PATCH 427/434] hw/qxl.c: Fix compilation failures on 32 bit hosts
Subject: [PATCH] hw/qxl.c: Fix compilation failures on 32 bit hosts
Fix compilation failures on 32 bit hosts (cast from pointer to
integer of different size; %ld expects 'long int' not uint64_t).
@ -10,7 +10,7 @@ Reported-by: Steve Langasek <steve.langasek@canonical.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.c | 16 ++++++++--------
hw/qxl.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -75,6 +75,3 @@ index 813873a..bcdf274 100644
switch (cookie->type) {
case QXL_COOKIE_TYPE_IO:
--
1.7.10

View File

@ -1,7 +1,7 @@
From 9f7bc0be9a5c353d076bb42b3bfdf77d8709063f Mon Sep 17 00:00:00 2001
From 3e9665b4c19038e4bbfe22ea140181daf7adf025 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Wed, 14 Mar 2012 20:33:37 +0200
Subject: [PATCH 428/434] spice: fix broken initialization
Subject: [PATCH] spice: fix broken initialization
Commit 1b71f7c14fab6f00c2680d4489fbee7baf796e4f moved MODULE_INIT_QOM to
way before MODULE_INIT_MACHINE, thereby breaking assumptions made in
@ -19,8 +19,8 @@ Conflicts:
ui/spice-core.c
---
ui/spice-core.c | 8 +-------
vl.c | 5 +++++
ui/spice-core.c | 8 +-------
vl.c | 5 +++++
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/ui/spice-core.c b/ui/spice-core.c
@ -62,6 +62,3 @@ index fdefa86..d33eb03 100644
if (icount_option && (kvm_enabled() || xen_enabled())) {
fprintf(stderr, "-icount is not allowed with kvm or xen\n");
exit(1);
--
1.7.10

View File

@ -1,8 +1,7 @@
From 2b4d2ccd83280b22d2fea0801e11af5a944a135d Mon Sep 17 00:00:00 2001
From 32fc9bd666d17f62d331029b4b0bbb0bc21c9bab Mon Sep 17 00:00:00 2001
From: Peter Maydell <peter.maydell@linaro.org>
Date: Wed, 7 Mar 2012 13:36:48 +0000
Subject: [PATCH 429/434] ui/spice-display.c: Fix compilation warnings on 32
bit hosts
Subject: [PATCH] ui/spice-display.c: Fix compilation warnings on 32 bit hosts
Fix compilation failures ("cast from pointer to integer of
different size [-Werror=pointer-to-int-cast]") by using
@ -11,7 +10,7 @@ uintptr_t instead.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/spice-display.c | 12 ++++++------
ui/spice-display.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/ui/spice-display.c b/ui/spice-display.c
@ -51,6 +50,3 @@ index 28d6d4a..6d7563f 100644
} else {
ssd->worker->destroy_primary_surface(ssd->worker, id);
}
--
1.7.10

View File

@ -1,8 +1,8 @@
From 626eb7b96445815945600895a411ee14c10b9056 Mon Sep 17 00:00:00 2001
From 58f452225db16f00b368ad03ae689cb5dbd09940 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Wed, 21 Mar 2012 18:17:18 +0200
Subject: [PATCH 430/434] ui/spice-display: use uintptr_t when casting qxl
physical addresses
Subject: [PATCH] ui/spice-display: use uintptr_t when casting qxl physical
addresses
The current intptr_t casts are a problem when the address's highest
bit is 1, and it is cast to a intptr_t and then to uint64_t, such
@ -21,7 +21,7 @@ qemu-system-i386.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/spice-display.c | 10 +++++-----
ui/spice-display.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/ui/spice-display.c b/ui/spice-display.c
@ -73,6 +73,3 @@ index 6d7563f..cb8a7ad 100644
surface.group_id = MEMSLOT_GROUP_HOST;
qemu_spice_create_primary_surface(ssd, 0, &surface, QXL_SYNC);
--
1.7.10

View File

@ -1,7 +1,7 @@
From f1e729a041efbd2d562e8202407e927745210bbd Mon Sep 17 00:00:00 2001
From c407d1fe045eaec796dcbd4058c54d0bbf71fd53 Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
Date: Fri, 14 Oct 2011 18:05:48 +0200
Subject: [PATCH 431/434] qxl: add optinal 64bit vram bar
Subject: [PATCH] qxl: add optinal 64bit vram bar
This patch adds an 64bit pci bar for vram. It is turned off by default.
It can be enabled by setting the size of the 64bit bar to be larger than
@ -32,8 +32,8 @@ Conflicts:
hw/qxl.c
---
hw/qxl.c | 51 ++++++++++++++++++++++++++++++++++++++++++++-------
hw/qxl.h | 7 +++++++
hw/qxl.c | 51 ++++++++++++++++++++++++++++++++++++++++++++-------
hw/qxl.h | 7 +++++++
2 files changed, 51 insertions(+), 7 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -180,6 +180,3 @@ index 86e415b..11a0db3 100644
/* qxl_render_update state */
int render_update_cookie_num;
--
1.7.10

View File

@ -1,7 +1,7 @@
From c18b8163ec4ebec3a7f99865038fa1ad36b2add2 Mon Sep 17 00:00:00 2001
From 2d1649d6f8aa97abc0c26172f77d064ea029b9c6 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Thu, 29 Mar 2012 22:24:38 +0200
Subject: [PATCH 432/434] qxl: set default values of vram*_size_mb to -1
Subject: [PATCH] qxl: set default values of vram*_size_mb to -1
The addition of those values caused a regression where not specifying
any value for the vram bar size would result in a 4096 _byte_ surface
@ -12,7 +12,7 @@ behavior of having a 64 megabyte vram BAR.
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.c | 4 ++--
hw/qxl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -30,6 +30,3 @@ index 18f3759..2135fde 100644
DEFINE_PROP_END_OF_LIST(),
};
--
1.7.10

View File

@ -1,8 +1,7 @@
From 68fc3d666b28d14c5023c1f2115cd3a51389f838 Mon Sep 17 00:00:00 2001
From 8545f8bf5f4c4bb373e0805508b7789984672453 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Wed, 18 Apr 2012 12:24:28 +0300
Subject: [PATCH 433/434] qxl-render: fix broken vnc+spice since commit
f934493
Subject: [PATCH] qxl-render: fix broken vnc+spice since commit f934493
Notify any listeners such as vnc that the displaysurface has been
changed, otherwise they will segfault when first accessing the freed old
@ -10,7 +9,7 @@ displaysurface data.
Signed-off-by: Alon Levy <alevy@redhat.com>
---
hw/qxl-render.c | 1 +
hw/qxl-render.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/qxl-render.c b/hw/qxl-render.c
@ -25,6 +24,3 @@ index 835dc5e..180b8f9 100644
}
}
for (i = 0; i < qxl->num_dirty_rects; i++) {
--
1.7.10

View File

@ -1,13 +1,13 @@
From f9f547a6646d72204d88a79960191a0285774c23 Mon Sep 17 00:00:00 2001
From 2b63fc61e815ba6ab09d30381712158599810b28 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Wed, 18 Apr 2012 14:00:06 +0300
Subject: [PATCH 434/434] qxl: don't assert on guest create_guest_primary
Subject: [PATCH] qxl: don't assert on guest create_guest_primary
initiate the implicit destroy ourselves.
Signed-off-by: Alon Levy <alevy@redhat.com>
---
hw/qxl.c | 10 +++++++++-
hw/qxl.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/hw/qxl.c b/hw/qxl.c
@ -31,6 +31,3 @@ index 2135fde..29c8873 100644
qxl_exit_vga_mode(qxl);
surface.format = le32_to_cpu(sc->format);
--
1.7.10

View File

@ -1,7 +1,7 @@
From be81272bafb948278e5e5739ef975cd7bbf0ee0c Mon Sep 17 00:00:00 2001
From 5f04be57d78f368fef2fe3744261061f103c3b6a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
Date: Tue, 17 Apr 2012 14:32:35 +0200
Subject: [PATCH 501/509] audio: add VOICE_VOLUME ctl
Subject: [PATCH] audio: add VOICE_VOLUME ctl
Add a new PCM control operation to update the stream volume on the
audio backend. The argument given is a SWVoiceOut/SWVoiceIn.
@ -13,8 +13,8 @@ v4:
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
---
audio/audio.c | 12 ++++++++++++
audio/audio_int.h | 1 +
audio/audio.c | 12 ++++++++++++
audio/audio_int.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/audio/audio.c b/audio/audio.c
@ -63,6 +63,3 @@ index 2003f8b..117f95e 100644
static inline int audio_ring_dist (int dst, int src, int len)
{
--
1.7.10

View File

@ -1,7 +1,7 @@
From eaa3b2d4cc2ac17b2aaf0d6387d3991b9d08c56e Mon Sep 17 00:00:00 2001
From 15d3e952cd3e64e4cc2eee08bdbf29f4f59e1329 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
Date: Tue, 17 Apr 2012 14:32:36 +0200
Subject: [PATCH 502/509] audio: don't apply volume effect if backend has
Subject: [PATCH] audio: don't apply volume effect if backend has
VOICE_VOLUME_CAP
If the audio backend is capable of volume control, don't apply
@ -12,9 +12,9 @@ control.
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
---
audio/audio.c | 9 +++++++--
audio/audio_int.h | 5 +++++
audio/audio_template.h | 2 ++
audio/audio.c | 9 +++++++--
audio/audio_int.h | 5 +++++
audio/audio_template.h | 2 ++
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
@ -94,6 +94,3 @@ index e62a713..519432a 100644
QLIST_INIT (&hw->sw_head);
#ifdef DAC
QLIST_INIT (&hw->cap_head);
--
1.7.10

View File

@ -1,7 +1,7 @@
From e27e5ceeee3d8cb55ba0749446b49ccc6ec5b96d Mon Sep 17 00:00:00 2001
From 2464b79664069dff5082e871f2c2cf3b4af19621 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
Date: Tue, 17 Apr 2012 14:32:37 +0200
Subject: [PATCH 503/509] hw/ac97: remove USE_MIXER code
Subject: [PATCH] hw/ac97: remove USE_MIXER code
That code doesn't compile. The interesting bits for volume control are
going to be rewritten in the following patch.
@ -9,7 +9,7 @@ going to be rewritten in the following patch.
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
---
hw/ac97.c | 121 -------------------------------------------------------------
hw/ac97.c | 121 --------------------------------------------------------------
1 file changed, 121 deletions(-)
diff --git a/hw/ac97.c b/hw/ac97.c
@ -165,6 +165,3 @@ index 0dbba3b..cd893c3 100644
active[PI_INDEX] = !!(s->bm_regs[PI_INDEX].cr & CR_RPBM);
active[PO_INDEX] = !!(s->bm_regs[PO_INDEX].cr & CR_RPBM);
active[MC_INDEX] = !!(s->bm_regs[MC_INDEX].cr & CR_RPBM);
--
1.7.10

View File

@ -1,14 +1,14 @@
From c0bcb346459445db2895fb56c78ab71e592c0c90 Mon Sep 17 00:00:00 2001
From 3f4683eb76bbf666def534029c0646e1ea4a4163 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
Date: Tue, 17 Apr 2012 14:32:38 +0200
Subject: [PATCH 504/509] hw/ac97: the volume mask is not only 0x1f
Subject: [PATCH] hw/ac97: the volume mask is not only 0x1f
It's a case by case (see Table 66. AC ?97 Baseline Audio Register Map)
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
---
hw/ac97.c | 1 -
hw/ac97.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/ac97.c b/hw/ac97.c
@ -23,6 +23,3 @@ index cd893c3..aa1babf 100644
#define MUTE_SHIFT 15
#define REC_MASK 7
--
1.7.10

View File

@ -1,7 +1,7 @@
From 41d13bd2047a3a3ae8f451ff4aaf0585231ba1c6 Mon Sep 17 00:00:00 2001
From a1635094522e85b18aa23fdfb44357e829b34bd4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
Date: Tue, 17 Apr 2012 14:32:39 +0200
Subject: [PATCH 505/509] hw/ac97: add support for volume control
Subject: [PATCH] hw/ac97: add support for volume control
Combine output volume with Master and PCM registers values.
Use default values in mixer_reset ().
@ -13,7 +13,7 @@ v4,v5:
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
---
hw/ac97.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
hw/ac97.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
diff --git a/hw/ac97.c b/hw/ac97.c
@ -129,6 +129,3 @@ index aa1babf..dd4917b 100644
active[PI_INDEX] = !!(s->bm_regs[PI_INDEX].cr & CR_RPBM);
active[PO_INDEX] = !!(s->bm_regs[PO_INDEX].cr & CR_RPBM);
active[MC_INDEX] = !!(s->bm_regs[MC_INDEX].cr & CR_RPBM);
--
1.7.10

View File

@ -1,14 +1,14 @@
From a9f796f670f3c34c3b5874026b61bbe4d782be2e Mon Sep 17 00:00:00 2001
From 08e41d00c5896188f059e4030b110d44fae6edcc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
Date: Tue, 17 Apr 2012 14:32:40 +0200
Subject: [PATCH 506/509] audio/spice: add support for volume control
Subject: [PATCH] audio/spice: add support for volume control
Use Spice server volume control API when available.
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
---
audio/spiceaudio.c | 41 +++++++++++++++++++++++++++++++++++++++++
audio/spiceaudio.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/audio/spiceaudio.c b/audio/spiceaudio.c
@ -79,6 +79,3 @@ index f972110..6f15591 100644
};
void qemu_spice_audio_init (void)
--
1.7.10

View File

@ -1,7 +1,7 @@
From 5c8ce128ec78d17a8a0f49115dc07726a3d3f0c1 Mon Sep 17 00:00:00 2001
From a667ecabfd0242606e1f5f763116cd8df2ff7fc1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
Date: Tue, 17 Apr 2012 14:32:41 +0200
Subject: [PATCH 507/509] Do not use pa_simple PulseAudio API
Subject: [PATCH] Do not use pa_simple PulseAudio API
Unfortunately, pa_simple is a limited API which doesn't let us
retrieve the associated pa_stream. It is needed to control the volume
@ -13,7 +13,7 @@ In v4:
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
---
audio/paaudio.c | 377 +++++++++++++++++++++++++++++++++++++++++++++++++------
audio/paaudio.c | 377 ++++++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 339 insertions(+), 38 deletions(-)
diff --git a/audio/paaudio.c b/audio/paaudio.c
@ -568,6 +568,3 @@ index d1f3912..6f50c1c 100644
.descr = "source device name"
},
{ /* End of list */ }
--
1.7.10

View File

@ -1,16 +1,16 @@
From 1b4ee5ccd426102b9ea415a8ce563bf96d7aa1f4 Mon Sep 17 00:00:00 2001
From c0c2606fbf87ee34cca9545017471b185e7e4b46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
Date: Tue, 17 Apr 2012 14:32:42 +0200
Subject: [PATCH 508/509] configure: pa_simple is not needed anymore
Subject: [PATCH] configure: pa_simple is not needed anymore
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
---
configure | 6 +++---
configure | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/configure b/configure
index b03172c..4559836 100755
index 9bdeea7..33bdf10 100755
--- a/configure
+++ b/configure
@@ -1791,9 +1791,9 @@ for drv in $audio_drv_list; do
@ -26,6 +26,3 @@ index b03172c..4559836 100755
audio_pt_int="yes"
;;
--
1.7.10

View File

@ -1,12 +1,12 @@
From 4b09edbfdaad4536617bbb53ccadfe531156ed56 Mon Sep 17 00:00:00 2001
From 4667260627791ff2282c7ca53cffd296f0472bf0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@gmail.com>
Date: Tue, 17 Apr 2012 14:32:43 +0200
Subject: [PATCH 509/509] Allow controlling volume with PulseAudio backend
Subject: [PATCH] Allow controlling volume with PulseAudio backend
Signed-off-by: Marc-Andr? Lureau <marcandre.lureau@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
---
audio/paaudio.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
audio/paaudio.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 94 insertions(+), 5 deletions(-)
diff --git a/audio/paaudio.c b/audio/paaudio.c
@ -129,6 +129,3 @@ index 6f50c1c..e6708d0 100644
+ .voice_size_in = sizeof (PAVoiceIn),
+ .ctl_caps = VOICE_VOLUME_CAP
};
--
1.7.10

View File

@ -1,11 +1,14 @@
commit a0fa82085e175bf8ce6d69a3f83695f81af2a649
Author: Gleb Natapov <gleb@redhat.com>
Date: Thu Dec 15 12:44:05 2011 +0200
From e8b330acc45acd7e5a1d23a0a07a3caa73205be5 Mon Sep 17 00:00:00 2001
From: Gleb Natapov <gleb@redhat.com>
Date: Thu, 15 Dec 2011 12:44:05 +0200
Subject: [PATCH] enable architectural PMU cpuid leaf for kvm
enable architectural PMU cpuid leaf for kvm
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
(cherry picked from commit a0fa82085e175bf8ce6d69a3f83695f81af2a649)
---
target-i386/cpuid.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/target-i386/cpuid.c b/target-i386/cpuid.c
index 0b3af90..91a104b 100644

View File

@ -1,6 +1,51 @@
diff -ruNp qemu-kvm-1.0/default-configs/pci.mak qemu-kvm-1.0.virtio-scsi/default-configs/pci.mak
--- qemu-kvm-1.0/default-configs/pci.mak 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/default-configs/pci.mak 2012-02-07 14:44:53.424905251 -0600
From 656eb6b31a82b5fbca7257adc58bc1842de588aa Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Wed, 6 Feb 2013 16:41:30 -0500
Subject: [PATCH] virtio scsi backport
---
Makefile.target | 1 +
default-configs/pci.mak | 1 +
default-configs/s390x-softmmu.mak | 1 +
dma-helpers.c | 36 +++
dma.h | 20 +-
hw/esp.c | 3 +-
hw/ide/ahci.c | 82 +----
hw/lsi53c895a.c | 2 +-
hw/pci.h | 1 +
hw/s390-virtio-bus.c | 24 ++
hw/s390-virtio-bus.h | 2 +
hw/scsi-bus.c | 143 ++++++++-
hw/scsi-disk.c | 126 ++++++--
hw/scsi-generic.c | 25 ++
hw/scsi.h | 22 +-
hw/spapr_vscsi.c | 2 +-
hw/usb-msd.c | 2 +-
hw/virtio-pci.c | 42 +++
hw/virtio-pci.h | 2 +
hw/virtio-scsi.c | 607 ++++++++++++++++++++++++++++++++++++++
hw/virtio-scsi.h | 36 +++
hw/virtio.h | 3 +
22 files changed, 1077 insertions(+), 106 deletions(-)
create mode 100644 hw/virtio-scsi.c
create mode 100644 hw/virtio-scsi.h
diff --git a/Makefile.target b/Makefile.target
index 29eaa68..64c1b49 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -205,6 +205,7 @@ obj-y = arch_init.o cpus.o monitor.o machine.o gdbstub.o balloon.o ioport.o
obj-$(CONFIG_NO_PCI) += pci-stub.o
obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virtio-serial-bus.o
+obj-$(CONFIG_VIRTIO_SCSI) += virtio-scsi.o
obj-y += vhost_net.o
obj-$(CONFIG_VHOST_NET) += vhost.o
obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p-device.o
diff --git a/default-configs/pci.mak b/default-configs/pci.mak
index 22bd350..9c8edd4 100644
--- a/default-configs/pci.mak
+++ b/default-configs/pci.mak
@@ -1,5 +1,6 @@
CONFIG_PCI=y
CONFIG_VIRTIO_PCI=y
@ -8,58 +53,18 @@ diff -ruNp qemu-kvm-1.0/default-configs/pci.mak qemu-kvm-1.0.virtio-scsi/default
CONFIG_VIRTIO=y
CONFIG_USB_UHCI=y
CONFIG_USB_OHCI=y
diff -ruNp qemu-kvm-1.0/default-configs/s390x-softmmu.mak qemu-kvm-1.0.virtio-scsi/default-configs/s390x-softmmu.mak
--- qemu-kvm-1.0/default-configs/s390x-softmmu.mak 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/default-configs/s390x-softmmu.mak 2012-02-07 14:44:53.424905251 -0600
diff --git a/default-configs/s390x-softmmu.mak b/default-configs/s390x-softmmu.mak
index 3005729..e588803 100644
--- a/default-configs/s390x-softmmu.mak
+++ b/default-configs/s390x-softmmu.mak
@@ -1 +1,2 @@
CONFIG_VIRTIO=y
+CONFIG_VIRTIO_SCSI=y
diff -ruNp qemu-kvm-1.0/dma.h qemu-kvm-1.0.virtio-scsi/dma.h
--- qemu-kvm-1.0/dma.h 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/dma.h 2012-02-07 14:44:53.425905267 -0600
@@ -17,6 +17,13 @@
typedef struct ScatterGatherEntry ScatterGatherEntry;
+struct QEMUSGList {
+ ScatterGatherEntry *sg;
+ int nsg;
+ int nalloc;
+ size_t size;
+};
+
#if defined(TARGET_PHYS_ADDR_BITS)
typedef target_phys_addr_t dma_addr_t;
@@ -32,13 +39,6 @@ struct ScatterGatherEntry {
dma_addr_t len;
};
-struct QEMUSGList {
- ScatterGatherEntry *sg;
- int nsg;
- int nalloc;
- dma_addr_t size;
-};
-
void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint);
void qemu_sglist_add(QEMUSGList *qsg, dma_addr_t base, dma_addr_t len);
void qemu_sglist_destroy(QEMUSGList *qsg);
@@ -58,4 +58,10 @@ BlockDriverAIOCB *dma_bdrv_read(BlockDri
BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs,
QEMUSGList *sg, uint64_t sector,
BlockDriverCompletionFunc *cb, void *opaque);
+uint64_t dma_buf_read(uint8_t *ptr, int32_t len, QEMUSGList *sg);
+uint64_t dma_buf_write(uint8_t *ptr, int32_t len, QEMUSGList *sg);
+
+void dma_acct_start(BlockDriverState *bs, BlockAcctCookie *cookie,
+ QEMUSGList *sg, enum BlockAcctType type);
+
#endif
diff -ruNp qemu-kvm-1.0/dma-helpers.c qemu-kvm-1.0.virtio-scsi/dma-helpers.c
--- qemu-kvm-1.0/dma-helpers.c 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/dma-helpers.c 2012-02-07 14:44:53.424905251 -0600
@@ -196,3 +196,39 @@ BlockDriverAIOCB *dma_bdrv_write(BlockDr
diff --git a/dma-helpers.c b/dma-helpers.c
index bdcd38c..fc35f23 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -196,3 +196,39 @@ BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs,
{
return dma_bdrv_io(bs, sg, sector, bdrv_aio_writev, cb, opaque, true);
}
@ -99,9 +104,53 @@ diff -ruNp qemu-kvm-1.0/dma-helpers.c qemu-kvm-1.0.virtio-scsi/dma-helpers.c
+{
+ bdrv_acct_start(bs, cookie, sg->size, type);
+}
diff -ruNp qemu-kvm-1.0/hw/esp.c qemu-kvm-1.0.virtio-scsi/hw/esp.c
--- qemu-kvm-1.0/hw/esp.c 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/esp.c 2012-02-07 14:44:53.425905267 -0600
diff --git a/dma.h b/dma.h
index a13209d..20e86d2 100644
--- a/dma.h
+++ b/dma.h
@@ -17,6 +17,13 @@
typedef struct ScatterGatherEntry ScatterGatherEntry;
+struct QEMUSGList {
+ ScatterGatherEntry *sg;
+ int nsg;
+ int nalloc;
+ size_t size;
+};
+
#if defined(TARGET_PHYS_ADDR_BITS)
typedef target_phys_addr_t dma_addr_t;
@@ -32,13 +39,6 @@ struct ScatterGatherEntry {
dma_addr_t len;
};
-struct QEMUSGList {
- ScatterGatherEntry *sg;
- int nsg;
- int nalloc;
- dma_addr_t size;
-};
-
void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint);
void qemu_sglist_add(QEMUSGList *qsg, dma_addr_t base, dma_addr_t len);
void qemu_sglist_destroy(QEMUSGList *qsg);
@@ -58,4 +58,10 @@ BlockDriverAIOCB *dma_bdrv_read(BlockDriverState *bs,
BlockDriverAIOCB *dma_bdrv_write(BlockDriverState *bs,
QEMUSGList *sg, uint64_t sector,
BlockDriverCompletionFunc *cb, void *opaque);
+uint64_t dma_buf_read(uint8_t *ptr, int32_t len, QEMUSGList *sg);
+uint64_t dma_buf_write(uint8_t *ptr, int32_t len, QEMUSGList *sg);
+
+void dma_acct_start(BlockDriverState *bs, BlockAcctCookie *cookie,
+ QEMUSGList *sg, enum BlockAcctType type);
+
#endif
diff --git a/hw/esp.c b/hw/esp.c
index b698a43..8516db5 100644
--- a/hw/esp.c
+++ b/hw/esp.c
@@ -389,7 +389,8 @@ static void esp_do_dma(ESPState *s)
esp_dma_done(s);
}
@ -112,9 +161,10 @@ diff -ruNp qemu-kvm-1.0/hw/esp.c qemu-kvm-1.0.virtio-scsi/hw/esp.c
{
ESPState *s = DO_UPCAST(ESPState, busdev.qdev, req->bus->qbus.parent);
diff -ruNp qemu-kvm-1.0/hw/ide/ahci.c qemu-kvm-1.0.virtio-scsi/hw/ide/ahci.c
--- qemu-kvm-1.0/hw/ide/ahci.c 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/ide/ahci.c 2012-02-07 14:44:53.426905283 -0600
diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index 0af201d..c6aa058 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -425,55 +425,6 @@ static void ahci_reg_init(AHCIState *s)
}
}
@ -171,7 +221,7 @@ diff -ruNp qemu-kvm-1.0/hw/ide/ahci.c qemu-kvm-1.0.virtio-scsi/hw/ide/ahci.c
static void check_cmd(AHCIState *s, int port)
{
AHCIPortRegs *pr = &s->dev[port].port_regs;
@@ -794,9 +745,8 @@ static void process_ncq_command(AHCIStat
@@ -794,9 +745,8 @@ static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis,
DPRINTF(port, "tag %d aio read %"PRId64"\n",
ncq_tfs->tag, ncq_tfs->lba);
@ -183,7 +233,7 @@ diff -ruNp qemu-kvm-1.0/hw/ide/ahci.c qemu-kvm-1.0.virtio-scsi/hw/ide/ahci.c
ncq_tfs->aiocb = dma_bdrv_read(ncq_tfs->drive->port.ifs[0].bs,
&ncq_tfs->sglist, ncq_tfs->lba,
ncq_cb, ncq_tfs);
@@ -808,9 +758,8 @@ static void process_ncq_command(AHCIStat
@@ -808,9 +758,8 @@ static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis,
DPRINTF(port, "tag %d aio write %"PRId64"\n",
ncq_tfs->tag, ncq_tfs->lba);
@ -195,7 +245,7 @@ diff -ruNp qemu-kvm-1.0/hw/ide/ahci.c qemu-kvm-1.0.virtio-scsi/hw/ide/ahci.c
ncq_tfs->aiocb = dma_bdrv_write(ncq_tfs->drive->port.ifs[0].bs,
&ncq_tfs->sglist, ncq_tfs->lba,
ncq_cb, ncq_tfs);
@@ -1015,12 +964,12 @@ static int ahci_start_transfer(IDEDMA *d
@@ -1015,12 +964,12 @@ static int ahci_start_transfer(IDEDMA *dma)
is_write ? "writ" : "read", size, is_atapi ? "atapi" : "ata",
has_sglist ? "" : "o");
@ -214,7 +264,7 @@ diff -ruNp qemu-kvm-1.0/hw/ide/ahci.c qemu-kvm-1.0.virtio-scsi/hw/ide/ahci.c
}
/* update number of transferred bytes */
@@ -1059,14 +1008,9 @@ static int ahci_dma_prepare_buf(IDEDMA *
@@ -1059,14 +1008,9 @@ static int ahci_dma_prepare_buf(IDEDMA *dma, int is_write)
{
AHCIDevice *ad = DO_UPCAST(AHCIDevice, dma, dma);
IDEState *s = &ad->port.ifs[0];
@ -230,7 +280,7 @@ diff -ruNp qemu-kvm-1.0/hw/ide/ahci.c qemu-kvm-1.0.virtio-scsi/hw/ide/ahci.c
DPRINTF(ad->port_no, "len=%#x\n", s->io_buffer_size);
return s->io_buffer_size != 0;
@@ -1084,9 +1028,9 @@ static int ahci_dma_rw_buf(IDEDMA *dma,
@@ -1084,9 +1028,9 @@ static int ahci_dma_rw_buf(IDEDMA *dma, int is_write)
}
if (is_write) {
@ -242,10 +292,11 @@ diff -ruNp qemu-kvm-1.0/hw/ide/ahci.c qemu-kvm-1.0.virtio-scsi/hw/ide/ahci.c
}
/* update number of transferred bytes */
diff -ruNp qemu-kvm-1.0/hw/lsi53c895a.c qemu-kvm-1.0.virtio-scsi/hw/lsi53c895a.c
--- qemu-kvm-1.0/hw/lsi53c895a.c 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/lsi53c895a.c 2012-02-07 14:44:53.427905299 -0600
@@ -699,7 +699,7 @@ static int lsi_queue_req(LSIState *s, SC
diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index fcc27d7..c53760b 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -699,7 +699,7 @@ static int lsi_queue_req(LSIState *s, SCSIRequest *req, uint32_t len)
}
/* Callback to indicate that the SCSI layer has completed a command. */
@ -254,9 +305,10 @@ diff -ruNp qemu-kvm-1.0/hw/lsi53c895a.c qemu-kvm-1.0.virtio-scsi/hw/lsi53c895a.c
{
LSIState *s = DO_UPCAST(LSIState, dev.qdev, req->bus->qbus.parent);
int out;
diff -ruNp qemu-kvm-1.0/hw/pci.h qemu-kvm-1.0.virtio-scsi/hw/pci.h
--- qemu-kvm-1.0/hw/pci.h 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/pci.h 2012-02-07 14:44:53.427905299 -0600
diff --git a/hw/pci.h b/hw/pci.h
index 4220151..187bb5c 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -76,6 +76,7 @@
#define PCI_DEVICE_ID_VIRTIO_BLOCK 0x1001
#define PCI_DEVICE_ID_VIRTIO_BALLOON 0x1002
@ -265,10 +317,11 @@ diff -ruNp qemu-kvm-1.0/hw/pci.h qemu-kvm-1.0.virtio-scsi/hw/pci.h
#define FMT_PCIBUS PRIx64
diff -ruNp qemu-kvm-1.0/hw/s390-virtio-bus.c qemu-kvm-1.0.virtio-scsi/hw/s390-virtio-bus.c
--- qemu-kvm-1.0/hw/s390-virtio-bus.c 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/s390-virtio-bus.c 2012-02-07 14:44:53.428905315 -0600
@@ -158,6 +158,18 @@ static int s390_virtio_serial_init(VirtI
diff --git a/hw/s390-virtio-bus.c b/hw/s390-virtio-bus.c
index c4b9a99..2da52c2 100644
--- a/hw/s390-virtio-bus.c
+++ b/hw/s390-virtio-bus.c
@@ -158,6 +158,18 @@ static int s390_virtio_serial_init(VirtIOS390Device *dev)
return r;
}
@ -287,7 +340,7 @@ diff -ruNp qemu-kvm-1.0/hw/s390-virtio-bus.c qemu-kvm-1.0.virtio-scsi/hw/s390-vi
static uint64_t s390_virtio_device_vq_token(VirtIOS390Device *dev, int vq)
{
ram_addr_t token_off;
@@ -370,6 +382,17 @@ static VirtIOS390DeviceInfo s390_virtio_
@@ -370,6 +382,17 @@ static VirtIOS390DeviceInfo s390_virtio_serial = {
},
};
@ -313,9 +366,10 @@ diff -ruNp qemu-kvm-1.0/hw/s390-virtio-bus.c qemu-kvm-1.0.virtio-scsi/hw/s390-vi
}
device_init(s390_virtio_register);
diff -ruNp qemu-kvm-1.0/hw/s390-virtio-bus.h qemu-kvm-1.0.virtio-scsi/hw/s390-virtio-bus.h
--- qemu-kvm-1.0/hw/s390-virtio-bus.h 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/s390-virtio-bus.h 2012-02-07 14:44:53.428905315 -0600
diff --git a/hw/s390-virtio-bus.h b/hw/s390-virtio-bus.h
index f1bece7..a840936 100644
--- a/hw/s390-virtio-bus.h
+++ b/hw/s390-virtio-bus.h
@@ -19,6 +19,7 @@
#include "virtio-net.h"
@ -332,9 +386,10 @@ diff -ruNp qemu-kvm-1.0/hw/s390-virtio-bus.h qemu-kvm-1.0.virtio-scsi/hw/s390-vi
} VirtIOS390Device;
typedef struct VirtIOS390Bus {
diff -ruNp qemu-kvm-1.0/hw/scsi-bus.c qemu-kvm-1.0.virtio-scsi/hw/scsi-bus.c
--- qemu-kvm-1.0/hw/scsi-bus.c 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/scsi-bus.c 2012-02-07 14:44:53.428905315 -0600
diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c
index 64e709e..a1bfbbe 100644
--- a/hw/scsi-bus.c
+++ b/hw/scsi-bus.c
@@ -5,6 +5,7 @@
#include "qdev.h"
#include "blockdev.h"
@ -343,7 +398,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-bus.c qemu-kvm-1.0.virtio-scsi/hw/scsi-bus.c
static char *scsibus_get_fw_dev_path(DeviceState *dev);
static int scsi_req_parse(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf);
@@ -50,6 +51,7 @@ static void scsi_dma_restart_bh(void *op
@@ -50,6 +51,7 @@ static void scsi_dma_restart_bh(void *opaque)
scsi_req_continue(req);
break;
case SCSI_XFER_NONE:
@ -351,7 +406,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-bus.c qemu-kvm-1.0.virtio-scsi/hw/scsi-bus.c
scsi_req_dequeue(req);
scsi_req_enqueue(req);
break;
@@ -512,6 +514,8 @@ SCSIRequest *scsi_req_new(SCSIDevice *d,
@@ -512,6 +514,8 @@ SCSIRequest *scsi_req_new(SCSIDevice *d, uint32_t tag, uint32_t lun,
}
req->cmd = cmd;
@ -360,7 +415,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-bus.c qemu-kvm-1.0.virtio-scsi/hw/scsi-bus.c
switch (buf[0]) {
case INQUIRY:
trace_scsi_inquiry(d->id, lun, tag, cmd.buf[1], cmd.buf[2]);
@@ -624,15 +628,25 @@ void scsi_req_build_sense(SCSIRequest *r
@@ -624,15 +628,25 @@ void scsi_req_build_sense(SCSIRequest *req, SCSISense sense)
req->sense_len = 18;
}
@ -406,7 +461,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-bus.c qemu-kvm-1.0.virtio-scsi/hw/scsi-bus.c
+ req->resid -= len;
req->bus->info->transfer_data(req, len);
+ return;
+ }
}
+
+ /* If the device calls scsi_req_data and the HBA specified a
+ * scatter/gather list, the transfer has to happen in a single
@ -419,12 +474,12 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-bus.c qemu-kvm-1.0.virtio-scsi/hw/scsi-bus.c
+ req->resid = dma_buf_read(buf, len, req->sg);
+ } else {
+ req->resid = dma_buf_write(buf, len, req->sg);
}
+ }
+ scsi_req_continue(req);
}
void scsi_req_print(SCSIRequest *req)
@@ -1318,7 +1352,7 @@ void scsi_req_complete(SCSIRequest *req,
@@ -1318,7 +1352,7 @@ void scsi_req_complete(SCSIRequest *req, int status)
scsi_req_ref(req);
scsi_req_dequeue(req);
@ -433,7 +488,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-bus.c qemu-kvm-1.0.virtio-scsi/hw/scsi-bus.c
scsi_req_unref(req);
}
@@ -1393,3 +1427,100 @@ SCSIDevice *scsi_device_find(SCSIBus *bu
@@ -1393,3 +1427,100 @@ SCSIDevice *scsi_device_find(SCSIBus *bus, int channel, int id, int lun)
}
return target_dev;
}
@ -534,10 +589,11 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-bus.c qemu-kvm-1.0.virtio-scsi/hw/scsi-bus.c
+ VMSTATE_END_OF_LIST()
+ }
+};
diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
--- qemu-kvm-1.0/hw/scsi-disk.c 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c 2012-02-07 14:44:53.429905331 -0600
@@ -38,6 +38,7 @@ do { fprintf(stderr, "scsi-disk: " fmt ,
diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c
index 673948c..c3474f2 100644
--- a/hw/scsi-disk.c
+++ b/hw/scsi-disk.c
@@ -38,6 +38,7 @@ do { fprintf(stderr, "scsi-disk: " fmt , ## __VA_ARGS__); } while (0)
#include "sysemu.h"
#include "blockdev.h"
#include "block_int.h"
@ -545,7 +601,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
#ifdef __linux
#include <scsi/sg.h>
@@ -110,12 +111,12 @@ static void scsi_cancel_io(SCSIRequest *
@@ -110,12 +111,12 @@ static void scsi_cancel_io(SCSIRequest *req)
r->req.aiocb = NULL;
}
@ -560,7 +616,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
r->iov.iov_base = qemu_blockalign(s->qdev.conf.bs, r->buflen);
}
r->iov.iov_len = MIN(r->sector_count * 512, r->buflen);
@@ -123,6 +124,56 @@ static uint32_t scsi_init_iovec(SCSIDisk
@@ -123,6 +124,56 @@ static uint32_t scsi_init_iovec(SCSIDiskReq *r)
return r->qiov.size / 512;
}
@ -617,7 +673,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
static void scsi_read_complete(void * opaque, int ret)
{
SCSIDiskReq *r = (SCSIDiskReq *)opaque;
@@ -213,10 +264,17 @@ static void scsi_read_data(SCSIRequest *
@@ -213,10 +264,17 @@ static void scsi_read_data(SCSIRequest *req)
return;
}
@ -639,7 +695,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
if (r->req.aiocb == NULL) {
scsi_read_complete(r, -EIO);
}
@@ -290,7 +348,7 @@ static void scsi_write_complete(void * o
@@ -290,7 +348,7 @@ static void scsi_write_complete(void * opaque, int ret)
if (r->sector_count == 0) {
scsi_req_complete(&r->req, GOOD);
} else {
@ -648,7 +704,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
DPRINTF("Write complete tag=0x%x more=%d\n", r->req.tag, r->qiov.size);
scsi_req_data(&r->req, r->qiov.size);
}
@@ -318,21 +376,29 @@ static void scsi_write_data(SCSIRequest
@@ -318,21 +376,29 @@ static void scsi_write_data(SCSIRequest *req)
return;
}
@ -690,7 +746,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
}
}
@@ -1601,6 +1667,8 @@ static const SCSIReqOps scsi_disk_reqops
@@ -1601,6 +1667,8 @@ static const SCSIReqOps scsi_disk_reqops = {
.write_data = scsi_write_data,
.cancel_io = scsi_cancel_io,
.get_buf = scsi_get_buf,
@ -699,7 +755,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
};
static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun,
@@ -1729,6 +1797,22 @@ static SCSIRequest *scsi_block_new_reque
@@ -1729,6 +1797,22 @@ static SCSIRequest *scsi_block_new_request(SCSIDevice *d, uint32_t tag,
DEFINE_PROP_STRING("ver", SCSIDiskState, version), \
DEFINE_PROP_STRING("serial", SCSIDiskState, serial)
@ -722,7 +778,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
static SCSIDeviceInfo scsi_disk_info[] = {
{
.qdev.name = "scsi-hd",
@@ -1736,6 +1820,7 @@ static SCSIDeviceInfo scsi_disk_info[] =
@@ -1736,6 +1820,7 @@ static SCSIDeviceInfo scsi_disk_info[] = {
.qdev.desc = "virtual SCSI disk",
.qdev.size = sizeof(SCSIDiskState),
.qdev.reset = scsi_disk_reset,
@ -730,7 +786,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
.init = scsi_hd_initfn,
.destroy = scsi_destroy,
.alloc_req = scsi_new_request,
@@ -1751,6 +1836,7 @@ static SCSIDeviceInfo scsi_disk_info[] =
@@ -1751,6 +1836,7 @@ static SCSIDeviceInfo scsi_disk_info[] = {
.qdev.desc = "virtual SCSI CD-ROM",
.qdev.size = sizeof(SCSIDiskState),
.qdev.reset = scsi_disk_reset,
@ -738,7 +794,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
.init = scsi_cd_initfn,
.destroy = scsi_destroy,
.alloc_req = scsi_new_request,
@@ -1766,6 +1852,7 @@ static SCSIDeviceInfo scsi_disk_info[] =
@@ -1766,6 +1852,7 @@ static SCSIDeviceInfo scsi_disk_info[] = {
.qdev.desc = "SCSI block device passthrough",
.qdev.size = sizeof(SCSIDiskState),
.qdev.reset = scsi_disk_reset,
@ -746,7 +802,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
.init = scsi_block_initfn,
.destroy = scsi_destroy,
.alloc_req = scsi_block_new_request,
@@ -1780,6 +1867,7 @@ static SCSIDeviceInfo scsi_disk_info[] =
@@ -1780,6 +1867,7 @@ static SCSIDeviceInfo scsi_disk_info[] = {
.qdev.desc = "virtual SCSI disk or CD-ROM (legacy)",
.qdev.size = sizeof(SCSIDiskState),
.qdev.reset = scsi_disk_reset,
@ -754,9 +810,10 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-disk.c qemu-kvm-1.0.virtio-scsi/hw/scsi-disk.c
.init = scsi_disk_initfn,
.destroy = scsi_destroy,
.alloc_req = scsi_new_request,
diff -ruNp qemu-kvm-1.0/hw/scsi-generic.c qemu-kvm-1.0.virtio-scsi/hw/scsi-generic.c
--- qemu-kvm-1.0/hw/scsi-generic.c 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/scsi-generic.c 2012-02-07 14:44:53.430905347 -0600
diff --git a/hw/scsi-generic.c b/hw/scsi-generic.c
index e62044f..378359c 100644
--- a/hw/scsi-generic.c
+++ b/hw/scsi-generic.c
@@ -59,6 +59,28 @@ typedef struct SCSIGenericReq {
sg_io_hdr_t io_header;
} SCSIGenericReq;
@ -786,7 +843,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-generic.c qemu-kvm-1.0.virtio-scsi/hw/scsi-gener
static void scsi_free_request(SCSIRequest *req)
{
SCSIGenericReq *r = DO_UPCAST(SCSIGenericReq, req, req);
@@ -450,6 +472,8 @@ const SCSIReqOps scsi_generic_req_ops =
@@ -450,6 +472,8 @@ const SCSIReqOps scsi_generic_req_ops = {
.write_data = scsi_write_data,
.cancel_io = scsi_cancel_io,
.get_buf = scsi_get_buf,
@ -795,7 +852,7 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-generic.c qemu-kvm-1.0.virtio-scsi/hw/scsi-gener
};
static SCSIRequest *scsi_new_request(SCSIDevice *d, uint32_t tag, uint32_t lun,
@@ -467,6 +491,7 @@ static SCSIDeviceInfo scsi_generic_info
@@ -467,6 +491,7 @@ static SCSIDeviceInfo scsi_generic_info = {
.qdev.desc = "pass through generic scsi device (/dev/sg*)",
.qdev.size = sizeof(SCSIDevice),
.qdev.reset = scsi_generic_reset,
@ -803,9 +860,10 @@ diff -ruNp qemu-kvm-1.0/hw/scsi-generic.c qemu-kvm-1.0.virtio-scsi/hw/scsi-gener
.init = scsi_generic_initfn,
.destroy = scsi_destroy,
.alloc_req = scsi_new_request,
diff -ruNp qemu-kvm-1.0/hw/scsi.h qemu-kvm-1.0.virtio-scsi/hw/scsi.h
--- qemu-kvm-1.0/hw/scsi.h 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/scsi.h 2012-02-07 14:44:53.430905347 -0600
diff --git a/hw/scsi.h b/hw/scsi.h
index ab6e952..f933937 100644
--- a/hw/scsi.h
+++ b/hw/scsi.h
@@ -47,8 +47,11 @@ struct SCSIRequest {
uint32_t tag;
uint32_t lun;
@ -859,10 +917,11 @@ diff -ruNp qemu-kvm-1.0/hw/scsi.h qemu-kvm-1.0.virtio-scsi/hw/scsi.h
};
struct SCSIBus {
diff -ruNp qemu-kvm-1.0/hw/spapr_vscsi.c qemu-kvm-1.0.virtio-scsi/hw/spapr_vscsi.c
--- qemu-kvm-1.0/hw/spapr_vscsi.c 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/spapr_vscsi.c 2012-02-07 14:44:53.430905347 -0600
@@ -494,7 +494,7 @@ static void vscsi_transfer_data(SCSIRequ
diff --git a/hw/spapr_vscsi.c b/hw/spapr_vscsi.c
index 00e2d2d..c28bba9 100644
--- a/hw/spapr_vscsi.c
+++ b/hw/spapr_vscsi.c
@@ -494,7 +494,7 @@ static void vscsi_transfer_data(SCSIRequest *sreq, uint32_t len)
}
/* Callback to indicate that the SCSI layer has completed a transfer. */
@ -871,10 +930,11 @@ diff -ruNp qemu-kvm-1.0/hw/spapr_vscsi.c qemu-kvm-1.0.virtio-scsi/hw/spapr_vscsi
{
VSCSIState *s = DO_UPCAST(VSCSIState, vdev.qdev, sreq->bus->qbus.parent);
vscsi_req *req = sreq->hba_private;
diff -ruNp qemu-kvm-1.0/hw/usb-msd.c qemu-kvm-1.0.virtio-scsi/hw/usb-msd.c
--- qemu-kvm-1.0/hw/usb-msd.c 2012-02-07 14:44:04.881123501 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/usb-msd.c 2012-02-07 14:44:53.431905363 -0600
@@ -223,7 +223,7 @@ static void usb_msd_transfer_data(SCSIRe
diff --git a/hw/usb-msd.c b/hw/usb-msd.c
index 3147131..4b572a0 100644
--- a/hw/usb-msd.c
+++ b/hw/usb-msd.c
@@ -223,7 +223,7 @@ static void usb_msd_transfer_data(SCSIRequest *req, uint32_t len)
}
}
@ -883,29 +943,10 @@ diff -ruNp qemu-kvm-1.0/hw/usb-msd.c qemu-kvm-1.0.virtio-scsi/hw/usb-msd.c
{
MSDState *s = DO_UPCAST(MSDState, dev.qdev, req->bus->qbus.parent);
USBPacket *p = s->packet;
diff -ruNp qemu-kvm-1.0/hw/virtio.h qemu-kvm-1.0.virtio-scsi/hw/virtio.h
--- qemu-kvm-1.0/hw/virtio.h 2011-12-04 04:38:06.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/virtio.h 2012-02-07 14:44:53.433905395 -0600
@@ -199,6 +199,8 @@ VirtIODevice *virtio_net_init(DeviceStat
typedef struct virtio_serial_conf virtio_serial_conf;
VirtIODevice *virtio_serial_init(DeviceState *dev, virtio_serial_conf *serial);
VirtIODevice *virtio_balloon_init(DeviceState *dev);
+typedef struct VirtIOSCSIConf VirtIOSCSIConf;
+VirtIODevice *virtio_scsi_init(DeviceState *dev, VirtIOSCSIConf *conf);
#ifdef CONFIG_LINUX
VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf);
#endif
@@ -208,6 +210,7 @@ void virtio_net_exit(VirtIODevice *vdev)
void virtio_blk_exit(VirtIODevice *vdev);
void virtio_serial_exit(VirtIODevice *vdev);
void virtio_balloon_exit(VirtIODevice *vdev);
+void virtio_scsi_exit(VirtIODevice *vdev);
#define DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) \
DEFINE_PROP_BIT("indirect_desc", _state, _field, \
diff -ruNp qemu-kvm-1.0/hw/virtio-pci.c qemu-kvm-1.0.virtio-scsi/hw/virtio-pci.c
--- qemu-kvm-1.0/hw/virtio-pci.c 2012-02-07 14:44:04.850123002 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/virtio-pci.c 2012-02-07 14:44:53.432905379 -0600
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 6fbab07..7f7b598 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -19,6 +19,7 @@
#include "virtio-blk.h"
#include "virtio-net.h"
@ -914,7 +955,7 @@ diff -ruNp qemu-kvm-1.0/hw/virtio-pci.c qemu-kvm-1.0.virtio-scsi/hw/virtio-pci.c
#include "pci.h"
#include "qemu-error.h"
#include "msix.h"
@@ -855,6 +856,32 @@ static int virtio_balloon_exit_pci(PCIDe
@@ -855,6 +856,32 @@ static int virtio_balloon_exit_pci(PCIDevice *pci_dev)
return virtio_exit_pci(pci_dev);
}
@ -969,9 +1010,10 @@ diff -ruNp qemu-kvm-1.0/hw/virtio-pci.c qemu-kvm-1.0.virtio-scsi/hw/virtio-pci.c
/* end of list */
}
};
diff -ruNp qemu-kvm-1.0/hw/virtio-pci.h qemu-kvm-1.0.virtio-scsi/hw/virtio-pci.h
--- qemu-kvm-1.0/hw/virtio-pci.h 2012-02-07 14:44:04.850123002 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/virtio-pci.h 2012-02-07 14:44:53.432905379 -0600
diff --git a/hw/virtio-pci.h b/hw/virtio-pci.h
index 344c22b..e560428 100644
--- a/hw/virtio-pci.h
+++ b/hw/virtio-pci.h
@@ -17,6 +17,7 @@
#include "virtio-net.h"
@ -988,9 +1030,11 @@ diff -ruNp qemu-kvm-1.0/hw/virtio-pci.h qemu-kvm-1.0.virtio-scsi/hw/virtio-pci.h
bool ioeventfd_disabled;
bool ioeventfd_started;
} VirtIOPCIProxy;
diff -ruNp qemu-kvm-1.0/hw/virtio-scsi.c qemu-kvm-1.0.virtio-scsi/hw/virtio-scsi.c
--- qemu-kvm-1.0/hw/virtio-scsi.c 1969-12-31 18:00:00.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/virtio-scsi.c 2012-02-07 14:44:53.432905379 -0600
diff --git a/hw/virtio-scsi.c b/hw/virtio-scsi.c
new file mode 100644
index 0000000..f5cecfc
--- /dev/null
+++ b/hw/virtio-scsi.c
@@ -0,0 +1,607 @@
+/*
+ * Virtio SCSI HBA
@ -1599,9 +1643,11 @@ diff -ruNp qemu-kvm-1.0/hw/virtio-scsi.c qemu-kvm-1.0.virtio-scsi/hw/virtio-scsi
+{
+ virtio_cleanup(vdev);
+}
diff -ruNp qemu-kvm-1.0/hw/virtio-scsi.h qemu-kvm-1.0.virtio-scsi/hw/virtio-scsi.h
--- qemu-kvm-1.0/hw/virtio-scsi.h 1969-12-31 18:00:00.000000000 -0600
+++ qemu-kvm-1.0.virtio-scsi/hw/virtio-scsi.h 2012-02-07 14:44:53.432905379 -0600
diff --git a/hw/virtio-scsi.h b/hw/virtio-scsi.h
new file mode 100644
index 0000000..4bc889d
--- /dev/null
+++ b/hw/virtio-scsi.h
@@ -0,0 +1,36 @@
+/*
+ * Virtio SCSI HBA
@ -1639,14 +1685,24 @@ diff -ruNp qemu-kvm-1.0/hw/virtio-scsi.h qemu-kvm-1.0.virtio-scsi/hw/virtio-scsi
+ DEFINE_PROP_UINT32("cmd_per_lun", _state, _conf_field.cmd_per_lun, 128)
+
+#endif /* _QEMU_VIRTIO_SCSI_H */
diff -ruNp qemu-kvm-1.0/Makefile.target qemu-kvm-1.0.virtio-scsi/Makefile.target
--- qemu-kvm-1.0/Makefile.target 2012-02-07 14:44:04.965124855 -0600
+++ qemu-kvm-1.0.virtio-scsi/Makefile.target 2012-02-07 14:44:53.126900450 -0600
@@ -205,6 +205,7 @@ obj-y = arch_init.o cpus.o monitor.o mac
obj-$(CONFIG_NO_PCI) += pci-stub.o
obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_VIRTIO) += virtio.o virtio-blk.o virtio-balloon.o virtio-net.o virtio-serial-bus.o
+obj-$(CONFIG_VIRTIO_SCSI) += virtio-scsi.o
obj-y += vhost_net.o
obj-$(CONFIG_VHOST_NET) += vhost.o
obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virtio-9p-device.o
diff --git a/hw/virtio.h b/hw/virtio.h
index 25f5564..400c092 100644
--- a/hw/virtio.h
+++ b/hw/virtio.h
@@ -199,6 +199,8 @@ VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf,
typedef struct virtio_serial_conf virtio_serial_conf;
VirtIODevice *virtio_serial_init(DeviceState *dev, virtio_serial_conf *serial);
VirtIODevice *virtio_balloon_init(DeviceState *dev);
+typedef struct VirtIOSCSIConf VirtIOSCSIConf;
+VirtIODevice *virtio_scsi_init(DeviceState *dev, VirtIOSCSIConf *conf);
#ifdef CONFIG_LINUX
VirtIODevice *virtio_9p_init(DeviceState *dev, V9fsConf *conf);
#endif
@@ -208,6 +210,7 @@ void virtio_net_exit(VirtIODevice *vdev);
void virtio_blk_exit(VirtIODevice *vdev);
void virtio_serial_exit(VirtIODevice *vdev);
void virtio_balloon_exit(VirtIODevice *vdev);
+void virtio_scsi_exit(VirtIODevice *vdev);
#define DEFINE_VIRTIO_COMMON_FEATURES(_state, _field) \
DEFINE_PROP_BIT("indirect_desc", _state, _field, \

View File

@ -0,0 +1,44 @@
From 9dfc18664eff3d85be4a7bcb7c503adc41099565 Mon Sep 17 00:00:00 2001
From: "Daniel P. Berrange" <berrange@redhat.com>
Date: Mon, 16 Jan 2012 18:11:40 +0000
Subject: [PATCH] hw/9pfs: Remove O_NOATIME flag from 9pfs open() calls in
readonly mode
When 2c74c2cb4bedddbfa67628fbd5f9273b4e0e9903 added support for
the 'readonly' flag against 9p filesystems, it also made QEMU
add the O_NOATIME flag as a side-effect.
The O_NOATIME flag, however, may only be set by the file owner,
or a user with CAP_FOWNER capability. QEMU cannot assume that
this is the case for filesytems exported to QEMU.
eg, run QEMU as non-root, and attempt to pass the host OS
filesystem through to the guest OS with readonly enable.
The result is that the guest OS cannot open any files at
all.
If O_NOATIME is really required, it should be optionally
enabled via a separate QEMU command line flag.
* hw/9pfs/virtio-9p.c: Remove O_NOATIME
Acked-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
(cherry picked from commit eed968607d656a218712df47a5e0432c21fd6994)
---
hw/9pfs/virtio-9p.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index b3fc3d0..2503e49 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -1560,7 +1560,6 @@ static void v9fs_open(void *opaque)
err = -EROFS;
goto out;
}
- flags |= O_NOATIME;
}
err = v9fs_co_open(pdu, fidp, flags);
if (err < 0) {

View File

@ -0,0 +1,36 @@
From 61c38140c3453b854502ed2eac2c7d844b844ad0 Mon Sep 17 00:00:00 2001
From: Avi Kivity <avi@redhat.com>
Date: Wed, 4 Jan 2012 16:28:42 +0200
Subject: [PATCH] pci: fix corrupted pci conf index register by unaligned write
Commit d0ed8076cbdc261 converted the PCI config access to the memory
API, but also inadvertantly changed it to accept unaligned writes,
and corrupt the index register in the process. This causes a regression
booting NetBSD.
Fix by ignoring unaligned or non-dword writes.
https://bugs.launchpad.net/qemu/+bug/897771
Reported-by: Andreas Gustafsson <gson@gson.org>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit cdde6ffc27517bdf069734fbc5693ce2b14edc75)
---
hw/pci_host.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/pci_host.c b/hw/pci_host.c
index 44c6c20..8041778 100644
--- a/hw/pci_host.c
+++ b/hw/pci_host.c
@@ -101,6 +101,9 @@ static void pci_host_config_write(void *opaque, target_phys_addr_t addr,
PCI_DPRINTF("%s addr " TARGET_FMT_plx " len %d val %"PRIx64"\n",
__func__, addr, len, val);
+ if (addr != 0 || len != 4) {
+ return;
+ }
s->config_reg = val;
}

View File

@ -1,27 +1,30 @@
commit ed8e5a85a1741147ce06932b478a509ce3407061
Author: Christian Borntraeger <borntraeger@de.ibm.com>
Date: Thu Dec 29 13:47:43 2011 +0100
From 7f090a666a5d0408b98dc4b339c00222cf66163b Mon Sep 17 00:00:00 2001
From: Christian Borntraeger <borntraeger@de.ibm.com>
Date: Thu, 29 Dec 2011 13:47:43 +0100
Subject: [PATCH] virtio-console: Fix failure on unconnected pty
virtio-console: Fix failure on unconnected pty
when I tried qemu with -virtio-console pty the guest hangs and attaching
on /dev/pts/<x> does not return anything if the attachment is too late.
This results in pty_chr_write() returning 0, which causes the port to
get throttled. This results in the guest getting frozen as the
guest->host virtio_console writes don't return until the host releases
the vq element back to the guest.
For the virtio-serial use case we don't want to lose data but for the
console case we better drop data instead of "killing" the guest
console. If we get chardev->frontend notification and a better behaving
virtio-console we can revert this fix.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
when I tried qemu with -virtio-console pty the guest hangs and attaching
on /dev/pts/<x> does not return anything if the attachment is too late.
This results in pty_chr_write() returning 0, which causes the port to
get throttled. This results in the guest getting frozen as the
guest->host virtio_console writes don't return until the host releases
the vq element back to the guest.
For the virtio-serial use case we don't want to lose data but for the
console case we better drop data instead of "killing" the guest
console. If we get chardev->frontend notification and a better behaving
virtio-console we can revert this fix.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
(cherry picked from commit ed8e5a85a1741147ce06932b478a509ce3407061)
---
hw/virtio-serial-bus.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c
index fe0233f..3a9004a 100644
index e5f343f..b126a83 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -163,7 +163,19 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq,

View File

@ -0,0 +1,23 @@
From 5b2531d6e6cbedfd1f2987680bded39ddcd4954c Mon Sep 17 00:00:00 2001
From: malc <av1474@comtv.ru>
Date: Mon, 16 Jul 2012 18:08:36 +0400
Subject: [PATCH] audio: Unbreak capturing in mixemu case
Signed-off-by: malc <av1474@comtv.ru>
(cherry picked from commit 83617103984eb4d81cf46c94435f3da2c6f33b55)
---
audio/audio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/audio/audio.c b/audio/audio.c
index 0fe95a7..5779f9a 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -815,6 +815,7 @@ static int audio_attach_capture (HWVoiceOut *hw)
sw->active = hw->enabled;
sw->conv = noop_conv;
sw->ratio = ((int64_t) hw_cap->info.freq << 32) / sw->info.freq;
+ sw->vol = nominal_volume;
sw->rate = st_rate_start (sw->info.freq, hw_cap->info.freq);
if (!sw->rate) {
dolog ("Could not start rate conversion for `%s'\n", SW_NAME (sw));

View File

@ -1,24 +1,43 @@
diff -rup qemu-kvm-1.0.1/block/vvfat.c foo/block/vvfat.c
--- qemu-kvm-1.0.1/block/vvfat.c 2012-04-16 22:15:17.000000000 -0400
+++ foo/block/vvfat.c 2012-07-29 20:00:15.515321504 -0400
@@ -2799,7 +2799,12 @@ static int enable_write_target(BDRVVVFAT
array_init(&(s->commits), sizeof(commit_t));
s->qcow_filename = g_malloc(1024);
- get_tmp_filename(s->qcow_filename, 1024);
+ ret = get_tmp_filename(s->qcow_filename, 1024);
+ if (ret < 0) {
+ g_free(s->qcow_filename);
+ s->qcow_filename = NULL;
+ return ret;
+ }
bdrv_qcow = bdrv_find_format("qcow");
options = parse_option_parameters("", bdrv_qcow->create_options, NULL);
diff -rup qemu-kvm-1.0.1/block.c foo/block.c
--- qemu-kvm-1.0.1/block.c 2012-04-16 22:15:17.000000000 -0400
+++ foo/block.c 2012-07-29 20:00:15.513321760 -0400
@@ -272,28 +272,36 @@ int bdrv_create_file(const char* filenam
From 2d96e0d8673003d961c1c7b01c26a2fe60ca5bdd Mon Sep 17 00:00:00 2001
From: Jim Meyering <jim@meyering.net>
Date: Mon, 28 May 2012 09:27:54 +0200
Subject: [PATCH] block: prevent snapshot mode $TMPDIR symlink attack
In snapshot mode, bdrv_open creates an empty temporary file without
checking for mkstemp or close failure, and ignoring the possibility
of a buffer overrun given a surprisingly long $TMPDIR.
Change the get_tmp_filename function to return int (not void),
so that it can inform its two callers of those failures.
Also avoid the risk of buffer overrun and do not ignore mkstemp
or close failure.
Update both callers (in block.c and vvfat.c) to propagate
temp-file-creation failure to their callers.
get_tmp_filename creates and closes an empty file, while its
callers later open that presumed-existing file with O_CREAT.
The problem was that a malicious user could provoke mkstemp failure
and race to create a symlink with the selected temporary file name,
thus causing the qemu process (usually root owned) to open through
the symlink, overwriting an attacker-chosen file.
This addresses CVE-2012-2652.
http://bugzilla.redhat.com/CVE-2012-2652
Signed-off-by: Jim Meyering <meyering@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit c2d76497b6eafcaedc806e07804e7bed55a98a0b)
---
block.c | 37 ++++++++++++++++++++++++-------------
block/vvfat.c | 7 ++++++-
block_int.h | 2 +-
3 files changed, 31 insertions(+), 15 deletions(-)
diff --git a/block.c b/block.c
index d015887..b752e84 100644
--- a/block.c
+++ b/block.c
@@ -272,28 +272,36 @@ int bdrv_create_file(const char* filename, QEMUOptionParameter *options)
return bdrv_create(drv, filename, options);
}
@ -67,7 +86,7 @@ diff -rup qemu-kvm-1.0.1/block.c foo/block.c
/*
* Detect host devices. By convention, /dev/cdrom[N] is always
@@ -601,7 +609,10 @@ int bdrv_open(BlockDriverState *bs, cons
@@ -601,7 +609,10 @@ int bdrv_open(BlockDriverState *bs, const char *filename, int flags,
bdrv_delete(bs1);
@ -79,9 +98,28 @@ diff -rup qemu-kvm-1.0.1/block.c foo/block.c
/* Real path is meaningless for protocols */
if (is_protocol)
diff -rup qemu-kvm-1.0.1/block_int.h foo/block_int.h
--- qemu-kvm-1.0.1/block_int.h 2012-04-16 22:15:17.000000000 -0400
+++ foo/block_int.h 2012-07-29 20:00:15.515321504 -0400
diff --git a/block/vvfat.c b/block/vvfat.c
index a310ce8..19e3aca 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2799,7 +2799,12 @@ static int enable_write_target(BDRVVVFATState *s)
array_init(&(s->commits), sizeof(commit_t));
s->qcow_filename = g_malloc(1024);
- get_tmp_filename(s->qcow_filename, 1024);
+ ret = get_tmp_filename(s->qcow_filename, 1024);
+ if (ret < 0) {
+ g_free(s->qcow_filename);
+ s->qcow_filename = NULL;
+ return ret;
+ }
bdrv_qcow = bdrv_find_format("qcow");
options = parse_option_parameters("", bdrv_qcow->create_options, NULL);
diff --git a/block_int.h b/block_int.h
index 77c0187..415a84a 100644
--- a/block_int.h
+++ b/block_int.h
@@ -238,7 +238,7 @@ struct BlockDriverAIOCB {
BlockDriverAIOCB *next;
};

View File

@ -0,0 +1,30 @@
From 7d065557153bd8fdcb6c97aed8554bb1f2c39496 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Wed, 6 Feb 2013 16:48:17 -0500
Subject: [PATCH] Fix systemtap keyword collisions
This is all upstream, this is just a manual backport
---
scripts/tracetool | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/scripts/tracetool b/scripts/tracetool
index 4c9951d..3b4e39b 100755
--- a/scripts/tracetool
+++ b/scripts/tracetool
@@ -500,6 +500,15 @@ EOF
if [ "$arg" = "limit" ]; then
arg="_limit"
fi
+ if [ "$arg" = "in" ]; then
+ arg="_in"
+ fi
+ if [ "$arg" = "next" ]; then
+ arg="_next"
+ fi
+ if [ "$arg" = "self" ]; then
+ arg="_self"
+ fi
cat <<EOF
$arg = \$arg$i;
EOF

View File

@ -0,0 +1,30 @@
From c11f76ad4c357f585ab4809142512274c5a6b304 Mon Sep 17 00:00:00 2001
From: Kenneth Salerno <kennethsalerno@yahoo.com>
Date: Sat, 18 Feb 2012 16:05:44 -0800
Subject: [PATCH] qemu-1.0.1/VERSION
Hello,
The VERSION file in stable release qemu-1.0.1 has what I believe might be a typo: "1.0,1" rather than "1.0.1". This is causing a parsing issue for windres.exe in Win32 which chokes on:
#define CONFIG_FILEVERSION 1,0,1,0,1,0
#define CONFIG_PRODUCTVERSION 1,0,1,0,1,0
when it should be seeing this:
#define CONFIG_FILEVERSION 1,0,1,0
#define CONFIG_PRODUCTVERSION 1,0,1,0
Patch:
Signed-off-by: Justin M. Forbes <jforbes@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
VERSION | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/VERSION b/VERSION
index b70c292..7dea76e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.0,1
+1.0.1

View File

@ -0,0 +1,123 @@
From 7d3636fdbf59f1e7c2a50d73cc55475a0af00d0a Mon Sep 17 00:00:00 2001
From: Ian Campbell <ian.campbell@citrix.com>
Date: Tue, 4 Sep 2012 10:26:09 -0500
Subject: [PATCH] console: bounds check whenever changing the cursor due to an
escape code
This is XSA-17 / CVE-2012-3515
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 3eea5498ca501922520b3447ba94815bfc109743)
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
console.c | 57 ++++++++++++++++++++++++++++-----------------------------
1 file changed, 28 insertions(+), 29 deletions(-)
diff --git a/console.c b/console.c
index ed6a653..bfad360 100644
--- a/console.c
+++ b/console.c
@@ -841,6 +841,26 @@ static void console_clear_xy(TextConsole *s, int x, int y)
update_xy(s, x, y);
}
+/* set cursor, checking bounds */
+static void set_cursor(TextConsole *s, int x, int y)
+{
+ if (x < 0) {
+ x = 0;
+ }
+ if (y < 0) {
+ y = 0;
+ }
+ if (y >= s->height) {
+ y = s->height - 1;
+ }
+ if (x >= s->width) {
+ x = s->width - 1;
+ }
+
+ s->x = x;
+ s->y = y;
+}
+
static void console_putchar(TextConsole *s, int ch)
{
TextCell *c;
@@ -912,7 +932,8 @@ static void console_putchar(TextConsole *s, int ch)
s->esc_params[s->nb_esc_params] * 10 + ch - '0';
}
} else {
- s->nb_esc_params++;
+ if (s->nb_esc_params < MAX_ESC_PARAMS)
+ s->nb_esc_params++;
if (ch == ';')
break;
#ifdef DEBUG_CONSOLE
@@ -926,59 +947,37 @@ static void console_putchar(TextConsole *s, int ch)
if (s->esc_params[0] == 0) {
s->esc_params[0] = 1;
}
- s->y -= s->esc_params[0];
- if (s->y < 0) {
- s->y = 0;
- }
+ set_cursor(s, s->x, s->y - s->esc_params[0]);
break;
case 'B':
/* move cursor down */
if (s->esc_params[0] == 0) {
s->esc_params[0] = 1;
}
- s->y += s->esc_params[0];
- if (s->y >= s->height) {
- s->y = s->height - 1;
- }
+ set_cursor(s, s->x, s->y + s->esc_params[0]);
break;
case 'C':
/* move cursor right */
if (s->esc_params[0] == 0) {
s->esc_params[0] = 1;
}
- s->x += s->esc_params[0];
- if (s->x >= s->width) {
- s->x = s->width - 1;
- }
+ set_cursor(s, s->x + s->esc_params[0], s->y);
break;
case 'D':
/* move cursor left */
if (s->esc_params[0] == 0) {
s->esc_params[0] = 1;
}
- s->x -= s->esc_params[0];
- if (s->x < 0) {
- s->x = 0;
- }
+ set_cursor(s, s->x - s->esc_params[0], s->y);
break;
case 'G':
/* move cursor to column */
- s->x = s->esc_params[0] - 1;
- if (s->x < 0) {
- s->x = 0;
- }
+ set_cursor(s, s->esc_params[0] - 1, s->y);
break;
case 'f':
case 'H':
/* move cursor to row, column */
- s->x = s->esc_params[1] - 1;
- if (s->x < 0) {
- s->x = 0;
- }
- s->y = s->esc_params[0] - 1;
- if (s->y < 0) {
- s->y = 0;
- }
+ set_cursor(s, s->esc_params[1] - 1, s->esc_params[0] - 1);
break;
case 'J':
switch (s->esc_params[0]) {

Some files were not shown because too many files have changed in this diff Show More