Update to qemu 1.5

KVM for ARM support
A native GTK+ UI with internationalization support
Experimental VFIO support for VGA passthrough
Support for VMware PVSCSI and VMXNET3 device emulation
CPU hot-add support
This commit is contained in:
Cole Robinson 2013-05-21 12:12:56 -04:00
parent d8d9ba50c6
commit 7fae7fbaf1
22 changed files with 161 additions and 2117 deletions

1
.gitignore vendored
View File

@ -19,3 +19,4 @@ qemu-kvm-0.13.0-25fdf4a.tar.gz
/qemu-1.3.0.tar.bz2
/qemu-1.4.0.tar.bz2
/qemu-1.4.1.tar.bz2
/qemu-1.5.0.tar.bz2

View File

@ -1,54 +0,0 @@
From bed754a15e27a3630681959cf1d3161084f29fe9 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] char: Split out tcp socket close code in a separate function
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
qemu-char.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/qemu-char.c b/qemu-char.c
index f4a74ac..ac2abeb 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -2155,6 +2155,21 @@ typedef struct {
static void tcp_chr_accept(void *opaque);
+static void tcp_closed(void *opaque)
+{
+ CharDriverState *chr = opaque;
+ TCPCharDriver *s = chr->opaque;
+
+ s->connected = 0;
+ if (s->listen_fd >= 0) {
+ qemu_set_fd_handler2(s->listen_fd, NULL, tcp_chr_accept, NULL, chr);
+ }
+ qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
+ closesocket(s->fd);
+ s->fd = -1;
+ qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
+}
+
static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
{
TCPCharDriver *s = chr->opaque;
@@ -2316,15 +2331,7 @@ static void tcp_chr_read(void *opaque)
len = s->max_size;
size = tcp_chr_recv(chr, (void *)buf, len);
if (size == 0) {
- /* connection closed */
- s->connected = 0;
- if (s->listen_fd >= 0) {
- qemu_set_fd_handler2(s->listen_fd, NULL, tcp_chr_accept, NULL, chr);
- }
- qemu_set_fd_handler2(s->fd, NULL, NULL, NULL, NULL);
- closesocket(s->fd);
- s->fd = -1;
- qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
+ tcp_closed(chr);
} else if (size > 0) {
if (s->do_telnetopt)
tcp_chr_process_IAC_bytes(chr, s, buf, &size);

View File

@ -1,4 +1,4 @@
From c6c153bfd7f9da48eb541d78bf09bc03bcc337e5 Mon Sep 17 00:00:00 2001
From 7cd5a50e02ed4866932c2a70680bec48a75dae72 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 19 Feb 2013 14:39:05 -0500
Subject: [PATCH] configure: Add --enable-migration-from-qemu-kvm
@ -9,25 +9,23 @@ perform migration from qemu-kvm to qemu. It's just a stub for now.
This compat will break incoming migration from qemu < 1.3, but for
distros where qemu-kvm was the only shipped package for years it's
not a big loss (and I don't know any way to avoid it).
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
configure | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/configure b/configure
index e7468a9..719e348 100755
index 5ae7e4a..fb41cb6 100755
--- a/configure
+++ b/configure
@@ -170,6 +170,7 @@ xfs=""
@@ -179,6 +179,7 @@ xfs=""
vhost_net="no"
vhost_scsi="no"
kvm="no"
+migrate_from_kvm="no"
gprof="no"
debug_tcg="no"
debug="no"
@@ -759,6 +760,8 @@ for opt do
@@ -777,6 +778,8 @@ for opt do
;;
--enable-kvm) kvm="yes"
;;
@ -36,7 +34,7 @@ index e7468a9..719e348 100755
--disable-tcg-interpreter) tcg_interpreter="no"
;;
--enable-tcg-interpreter) tcg_interpreter="yes"
@@ -1087,6 +1090,9 @@ echo " --enable-bluez enable bluez stack connectivity"
@@ -1136,6 +1139,9 @@ echo " --enable-bluez enable bluez stack connectivity"
echo " --disable-slirp disable SLIRP userspace network connectivity"
echo " --disable-kvm disable KVM acceleration support"
echo " --enable-kvm enable KVM acceleration support"
@ -46,7 +44,7 @@ index e7468a9..719e348 100755
echo " --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)"
echo " --disable-nptl disable usermode NPTL support"
echo " --enable-nptl enable usermode NPTL support"
@@ -3324,6 +3330,7 @@ echo "Linux AIO support $linux_aio"
@@ -3554,6 +3560,7 @@ echo "Linux AIO support $linux_aio"
echo "ATTR/XATTR support $attr"
echo "Install blobs $blobs"
echo "KVM support $kvm"
@ -54,7 +52,7 @@ index e7468a9..719e348 100755
echo "TCG interpreter $tcg_interpreter"
echo "fdt support $fdt"
echo "preadv support $preadv"
@@ -3612,6 +3619,9 @@ fi
@@ -3863,6 +3870,9 @@ fi
if test "$signalfd" = "yes" ; then
echo "CONFIG_SIGNALFD=y" >> $config_host_mak
fi

View File

@ -1,4 +1,4 @@
From 75e3acce2d9302a2344b3de381a49f6cd0fa04ad Mon Sep 17 00:00:00 2001
From 9df0fd5765377d32a0e9f2d855dc1d428c19f767 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 19 Feb 2013 14:44:49 -0500
Subject: [PATCH] acpi_piix4: Drop minimum_version_id to handle qemu-kvm
@ -15,17 +15,15 @@ qemu-kvm.
If --enable-migration-from-qemu-kvm is enabled, drop minimum_version_id
to 2. Migration from qemu-kvm version_id=2 and qemu 1.3+ version_id=3
works, but migration from qemu < 1.3 is broken.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
hw/acpi_piix4.c | 15 +++++++++------
hw/acpi/piix4.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 1beac21..2abcc9d 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -257,16 +257,19 @@ static int acpi_load_old(QEMUFile *f, void *opaque, int version_id)
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index c4af1cc..95d227d 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -269,16 +269,19 @@ static int acpi_load_old(QEMUFile *f, void *opaque, int version_id)
return ret;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
From c50ed212c0b0814a0edefb2d2a2fc7abc6aed2af Mon Sep 17 00:00:00 2001
From e1f0936bbf84664d7d7fe7bbbdd1595be745b539 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 19 Feb 2013 15:04:59 -0500
Subject: [PATCH] i8254: Fix migration from qemu-kvm < 1.1
@ -8,16 +8,14 @@ but the logic can't be carried unconditionally in qemu.git without
breaking migration from qemu < 1.1.
Conditionalize it with --enable-migrate-from-qemu-kvm
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
hw/i8254_common.c | 8 ++++++++
hw/timer/i8254_common.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/i8254_common.c b/hw/i8254_common.c
index 8c2e45a..072fa09 100644
--- a/hw/i8254_common.c
+++ b/hw/i8254_common.c
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
index 5342df4..e74afe3 100644
--- a/hw/timer/i8254_common.c
+++ b/hw/timer/i8254_common.c
@@ -275,7 +275,15 @@ static const VMStateDescription vmstate_pit_common = {
.pre_save = pit_dispatch_pre_save,
.post_load = pit_dispatch_post_load,

View File

@ -1,74 +0,0 @@
From 64080f1b8983660b707ed8c0d10ace22e9b46f7a 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] 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>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
include/qemu/main-loop.h | 3 +++
iohandler.c | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 38 insertions(+)
diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h
index e8059c3..faaf47d 100644
--- a/include/qemu/main-loop.h
+++ b/include/qemu/main-loop.h
@@ -166,6 +166,9 @@ void qemu_del_wait_object(HANDLE handle, WaitObjectFunc *func, void *opaque);
typedef void IOReadHandler(void *opaque, const uint8_t *buf, int size);
typedef int IOCanReadHandler(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
*
diff --git a/iohandler.c b/iohandler.c
index 2523adc..a49cfd4 100644
--- a/iohandler.c
+++ b/iohandler.c
@@ -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;
+
+ QLIST_FOREACH(ioh, &io_handlers, next) {
+ if (ioh->fd == fd) {
+ return ioh;
+ }
+ }
+ return NULL;
+}
+
+void enable_write_fd_handler(int fd, IOHandler *fd_write)
+{
+ IOHandlerRecord *ioh;
+
+ ioh = find_iohandler(fd);
+ if (!ioh) {
+ return;
+ }
+
+ ioh->fd_write = fd_write;
+}
+
+void disable_write_fd_handler(int fd)
+{
+ IOHandlerRecord *ioh;
+
+ ioh = find_iohandler(fd);
+ if (!ioh) {
+ return;
+ }
+
+ 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(). */

View File

@ -1,59 +0,0 @@
From 84877040f31425a8fecdbee19cb24fcc5a8212df 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] 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
pointer that will be called back when the driver becomes writable. This
patch just adds the function pointers to the CharDriverState structure,
future patches will enable the nonblocking and callback functionality.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
include/char/char.h | 4 ++++
qemu-char.c | 3 +++
2 files changed, 7 insertions(+)
diff --git a/include/char/char.h b/include/char/char.h
index 3027cc1..2fee107 100644
--- a/include/char/char.h
+++ b/include/char/char.h
@@ -63,6 +63,9 @@ struct CharDriverState {
IOEventHandler *chr_event;
IOCanReadHandler *chr_can_read;
IOReadHandler *chr_read;
+ IOHandler *chr_write_unblocked;
+ void (*chr_enable_write_fd_handler)(struct CharDriverState *chr);
+ void (*chr_disable_write_fd_handler)(struct CharDriverState *chr);
void *handler_opaque;
void (*chr_close)(struct CharDriverState *chr);
void (*chr_accept_input)(struct CharDriverState *chr);
@@ -76,6 +79,7 @@ struct CharDriverState {
int opened;
int avail_connections;
QemuOpts *opts;
+ bool write_blocked; /* Are we in a blocked state? */
QTAILQ_ENTRY(CharDriverState) next;
};
diff --git a/qemu-char.c b/qemu-char.c
index 0c97bdf..ab0c552 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -211,11 +211,14 @@ void qemu_chr_add_handlers(CharDriverState *s,
}
s->chr_can_read = handlers->fd_can_read;
s->chr_read = handlers->fd_read;
+ s->chr_write_unblocked = handlers->fd_write_unblocked;
s->chr_event = handlers->fd_event;
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
also get the open event */
if (s->opened) {

View File

@ -1,4 +1,4 @@
From 271e4d924c39efd716cc3ad86a5f615660b13f22 Mon Sep 17 00:00:00 2001
From 3e580f65ac69c7a84b672a59de6772dae24b5a8a Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 19 Feb 2013 15:35:40 -0500
Subject: [PATCH] pc_piix: Add compat handling for qemu-kvm VGA mem size
@ -14,17 +14,15 @@ except cirrus.
If --enable-migration-from-qemu-kvm is specified, make sure cirrus
uses 16MB for <= pc-1.2 (the qemu-kvm merge), and 16MB always for
all others. This will break incoming qemu migration for qemu < 1.3.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
hw/pc_piix.c | 20 ++++++++++++++++----
hw/i386/pc_piix.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index 0af436c..e3f8e96 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -331,6 +331,13 @@ static QEMUMachine pc_machine_v1_3 = {
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 43ab480..48fb7b7 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -383,6 +383,13 @@ static QEMUMachine pc_machine_v1_3 = {
DEFAULT_MACHINE_OPTIONS,
};
@ -38,7 +36,7 @@ index 0af436c..e3f8e96 100644
#define PC_COMPAT_1_2 \
PC_COMPAT_1_3,\
{\
@@ -354,6 +361,10 @@ static QEMUMachine pc_machine_v1_3 = {
@@ -406,6 +413,10 @@ static QEMUMachine pc_machine_v1_3 = {
.property = "revision",\
.value = stringify(3),\
},{\
@ -49,7 +47,7 @@ index 0af436c..e3f8e96 100644
.driver = "VGA",\
.property = "mmio",\
.value = "off",\
@@ -371,6 +382,7 @@ static QEMUMachine pc_machine_v1_2 = {
@@ -423,6 +434,7 @@ static QEMUMachine pc_machine_v1_2 = {
DEFAULT_MACHINE_OPTIONS,
};
@ -57,7 +55,7 @@ index 0af436c..e3f8e96 100644
#define PC_COMPAT_1_1 \
PC_COMPAT_1_2,\
{\
@@ -384,19 +396,19 @@ static QEMUMachine pc_machine_v1_2 = {
@@ -436,19 +448,19 @@ static QEMUMachine pc_machine_v1_2 = {
},{\
.driver = "VGA",\
.property = "vgamem_mb",\

View File

@ -1,178 +0,0 @@
From c7e9b2a5b981209f4e77b26562758663cc060900 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] 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
WSAEWOULDBLOCK on non-Windows and Windows platforms respectively. This
is only done when the caller sets a callback function handler indicating
it's not interested in blocking till the driver has written out all the
data.
Currently there's no driver or caller that supports this. Future
commits will add such capability.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
include/qemu/sockets.h | 3 ++-
qemu-char.c | 69 +++++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 65 insertions(+), 7 deletions(-)
diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h
index 0ccf32f..42ca690 100644
--- a/include/qemu/sockets.h
+++ b/include/qemu/sockets.h
@@ -29,6 +29,7 @@ int inet_aton(const char *cp, struct in_addr *ia);
#include "qemu/option.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
+#include "char/char.h"
/* misc helpers */
int qemu_socket(int domain, int type, int protocol);
@@ -36,7 +37,7 @@ int qemu_accept(int s, struct sockaddr *addr, socklen_t *addrlen);
int socket_set_cork(int fd, int v);
void qemu_set_block(int fd);
void qemu_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);
/* callback function for nonblocking connect
* valid fd on success, negative error code on failure
diff --git a/qemu-char.c b/qemu-char.c
index ab0c552..96fc54e 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -508,7 +508,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;
@@ -516,9 +516,14 @@ int send_all(int fd, const void *buf, int len1)
while (len > 0) {
ret = send(fd, buf, len, 0);
if (ret < 0) {
+ if (nonblock && len1 - len) {
+ return len1 - len;
+ }
errno = WSAGetLastError();
if (errno != WSAEWOULDBLOCK) {
return -1;
+ } else if (errno == WSAEWOULDBLOCK && nonblock) {
+ return WSAEWOULDBLOCK;
}
} else if (ret == 0) {
break;
@@ -532,7 +537,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)
{
int ret, len;
const uint8_t *buf = _buf;
@@ -541,8 +546,15 @@ int send_all(int fd, const void *_buf, int len1)
while (len > 0) {
ret = write(fd, buf, len);
if (ret < 0) {
- if (errno != EINTR && errno != EAGAIN)
+ if (nonblock && len1 - len) {
+ return len1 - len;
+ }
+ if (errno == EAGAIN && nonblock) {
+ return -EAGAIN;
+ }
+ if (errno != EINTR && errno != EAGAIN) {
return -1;
+ }
} else if (ret == 0) {
break;
} else {
@@ -557,6 +569,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;
+ bool nonblock;
+
+ if (chr && chr->write_blocked) {
+ /*
+ * The caller should not send us data while we're blocked,
+ * but this can happen when multiple writers are woken at once,
+ * so simply return -EAGAIN.
+ */
+ return -EAGAIN;
+ }
+
+ nonblock = false;
+ /*
+ * Ensure the char backend is able to receive and handle the
+ * 'write unblocked' event before we turn on nonblock support.
+ */
+ if (chr && chr->chr_enable_write_fd_handler && chr->chr_write_unblocked) {
+ nonblock = true;
+ }
+ ret = do_send(fd, _buf, len1, nonblock);
+
+#ifdef _WIN32
+ eagain_errno = WSAEWOULDBLOCK;
+#else
+ eagain_errno = -EAGAIN;
+#endif
+
+ if (nonblock && (ret == eagain_errno || (ret >= 0 && ret < len1))) {
+ /* Update fd handler to wake up when chr becomes writable */
+ chr->chr_enable_write_fd_handler(chr);
+ chr->write_blocked = true;
+ }
+ return ret;
+}
+
#ifndef _WIN32
typedef struct {
@@ -568,7 +618,7 @@ typedef struct {
static int fd_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
{
FDCharDriver *s = chr->opaque;
- 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)
@@ -893,7 +943,7 @@ static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
pty_chr_update_read_handler(chr);
return 0;
}
- return send_all(s->fd, buf, len);
+ return send_all(chr, s->fd, buf, len);
}
static int pty_chr_read_poll(void *opaque)
@@ -2188,8 +2238,15 @@ static void tcp_closed(void *opaque)
static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
{
TCPCharDriver *s = chr->opaque;
+
if (s->connected) {
- return send_all(s->fd, buf, len);
+ int ret;
+
+ ret = send_all(chr, s->fd, buf, len);
+ if (ret == -1 && errno == EPIPE) {
+ tcp_closed(chr);
+ }
+ return ret;
} else {
/* XXX: indicate an error ? */
return len;

View File

@ -1,4 +1,4 @@
From 66cc6383d6b1d934d22e9a16b432cacacd58c315 Mon Sep 17 00:00:00 2001
From ae8d642477d87287b42b0b40c133637dd1cdd8b9 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 19 Feb 2013 16:19:02 -0500
Subject: [PATCH] qxl: Add rom_size compat property, fix migration from 1.2
@ -18,52 +18,16 @@ https://lists.gnu.org/archive/html/qemu-devel/2013-02/msg03154.html
However these sizes match what native Fedora packages get, so it's
good enough for now.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
hw/pc_piix.c | 16 ++++++++++++++++
hw/qxl.c | 9 ++++-----
hw/display/qxl.c | 9 ++++-----
hw/i386/pc_piix.c | 16 ++++++++++++++++
2 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index e3f8e96..a1a6794 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -317,6 +317,14 @@ static QEMUMachine pc_i440fx_machine_v1_4 = {
.driver = "virtio-net-pci", \
.property = "mq", \
.value = "off", \
+ },{ \
+ .driver = "qxl", \
+ .property = "rom_size", \
+ .value = stringify(16384), \
+ },{\
+ .driver = "qxl-vga", \
+ .property = "rom_size", \
+ .value = stringify(16384), \
}
static QEMUMachine pc_machine_v1_3 = {
@@ -413,6 +421,14 @@ static QEMUMachine pc_machine_v1_2 = {
.driver = "virtio-blk-pci",\
.property = "config-wce",\
.value = "off",\
+ },{ \
+ .driver = "qxl", \
+ .property = "rom_size", \
+ .value = stringify(8192), \
+ },{\
+ .driver = "qxl-vga", \
+ .property = "rom_size", \
+ .value = stringify(8192), \
}
static QEMUMachine pc_machine_v1_1 = {
diff --git a/hw/qxl.c b/hw/qxl.c
index ca094e6..80bd92a 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -302,16 +302,14 @@ static inline uint32_t msb_mask(uint32_t val)
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index c475cb1..74f07c0 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -306,16 +306,14 @@ static inline uint32_t msb_mask(uint32_t val)
return mask;
}
@ -91,7 +55,7 @@ index ca094e6..80bd92a 100644
memory_region_init_ram(&qxl->rom_bar, "qxl.vrom", qxl->rom_size);
vmstate_register_ram(&qxl->rom_bar, &qxl->pci.qdev);
init_qxl_rom(qxl);
@@ -2296,6 +2294,7 @@ static Property qxl_properties[] = {
@@ -2302,6 +2300,7 @@ static Property qxl_properties[] = {
DEFINE_PROP_UINT32("vram64_size_mb", PCIQXLDevice, vram_size_mb, -1),
DEFINE_PROP_UINT32("vgamem_mb", PCIQXLDevice, vgamem_size_mb, 16),
DEFINE_PROP_INT32("surfaces", PCIQXLDevice, ssd.num_surfaces, 1024),
@ -99,3 +63,37 @@ index ca094e6..80bd92a 100644
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 48fb7b7..2307d26 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -369,6 +369,14 @@ static QEMUMachine pc_i440fx_machine_v1_4 = {
.driver = "e1000",\
.property = "autonegotiation",\
.value = "off",\
+ },{ \
+ .driver = "qxl", \
+ .property = "rom_size", \
+ .value = stringify(16384), \
+ },{\
+ .driver = "qxl-vga", \
+ .property = "rom_size", \
+ .value = stringify(16384), \
}
static QEMUMachine pc_machine_v1_3 = {
@@ -465,6 +473,14 @@ static QEMUMachine pc_machine_v1_2 = {
.driver = "virtio-blk-pci",\
.property = "config-wce",\
.value = "off",\
+ },{ \
+ .driver = "qxl", \
+ .property = "rom_size", \
+ .value = stringify(8192), \
+ },{\
+ .driver = "qxl-vga", \
+ .property = "rom_size", \
+ .value = stringify(8192), \
}
static QEMUMachine pc_machine_v1_1 = {

View File

@ -1,72 +0,0 @@
From 6540bebbaa749d405df91516e1ca5a075e354628 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] 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
set or remove an fd's write handler. This handler checks if the driver
became writable.
A generic callback routine is used for unblocking writes and letting
users of chardevs know that a driver became writable again.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
qemu-char.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/qemu-char.c b/qemu-char.c
index 96fc54e..53d2c13 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -105,6 +105,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.
+ */
+static void char_write_unblocked(void *opaque)
+{
+ CharDriverState *chr = opaque;
+
+ chr->write_blocked = false;
+ chr->chr_disable_write_fd_handler(chr);
+ chr->chr_write_unblocked(chr->handler_opaque);
+}
+
void qemu_chr_be_event(CharDriverState *s, int event)
{
/* Keep track if the char device is open */
@@ -126,6 +139,9 @@ static void qemu_chr_fire_open_event(void *opaque)
{
CharDriverState *s = opaque;
qemu_chr_be_event(s, CHR_EVENT_OPENED);
+ if (s->write_blocked) {
+ char_write_unblocked(s);
+ }
qemu_free_timer(s->open_timer);
s->open_timer = NULL;
}
@@ -2245,6 +2261,17 @@ static int tcp_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
ret = send_all(chr, s->fd, buf, len);
if (ret == -1 && errno == EPIPE) {
tcp_closed(chr);
+
+ if (chr->chr_enable_write_fd_handler && chr->chr_write_unblocked) {
+ /*
+ * Since we haven't written out anything, let's say
+ * we're throttled. This will prevent any output from
+ * the guest getting lost if host-side chardev goes
+ * down. Unthrottle when we re-connect.
+ */
+ chr->write_blocked = true;
+ return 0;
+ }
}
return ret;
} else {

View File

@ -1,47 +0,0 @@
From 33f3874dc760f0960d408be2f916d04373de543b 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] 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
otherwise. This helps in guests continuing to run normally while the vq
keeps getting full and eventually the guest stops queueing more data.
As soon as the chardev indicates it can accept more data, start pushing!
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
hw/virtio-console.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/virtio-console.c b/hw/virtio-console.c
index dd6f614..0e12514 100644
--- a/hw/virtio-console.c
+++ b/hw/virtio-console.c
@@ -20,6 +20,16 @@ typedef struct VirtConsole {
CharDriverState *chr;
} VirtConsole;
+/*
+ * Callback function that's called from chardevs when backend becomes
+ * writable.
+ */
+static void chr_write_unblocked(void *opaque)
+{
+ VirtConsole *vcon = opaque;
+
+ 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)
@@ -110,6 +120,7 @@ static const QemuChrHandlers chr_handlers = {
.fd_can_read = chr_can_read,
.fd_read = chr_read,
.fd_event = chr_event,
+ .fd_write_unblocked = chr_write_unblocked,
};
static int virtconsole_initfn(VirtIOSerialPort *port)

View File

@ -1,132 +0,0 @@
From aa0a2c94c70ae5ed0fb215328c8ecebbef10cbe9 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Tue, 22 Mar 2011 12:27:59 +0200
Subject: [PATCH] spice-qemu-char.c: add throttling
BZ: 672191
upstream: not submitted (explained below)
Adds throttling support to spicevmc chardev. Uses a timer to avoid recursing:
1. spice-server: reds.c: read_from_vdi_port
2. qemu: spice-qemu-char.c: vmc_read
3. chr_write_unblocked
(calls virtio_serial_throttle_port(port, false))
4. qemu: virtio ...
5. qemu: spice-qemu-char.c: spice_chr_write
6. qemu: spice-qemu-char.c: wakeup (calls into spice-server)
7. spice-server: ...
8. qemu: spice-qemu-char.c: vmc_read
Instead, in vmc_read if we were throttled and we are just about to return
all the bytes we will set a timer to be triggered immediately to call
chr_write_unblocked. Then we return after 2 above, and 3 is called from the
timer callback. This also means we can later remove some ugly recursion protection
from spice-server.
The other tricky point in this patch is not returning the leftover chunk twice.
When we throttle, by definition we have data that spice server didn't consume.
It is being kept by virtio-serial, and by us. The next vmc_read callback needs
to not return it, but just do unthrottling. Then virtio will give us the remaining
chunk as usual in spice_chr_write, and we will pass it to spice server in the
next vmc_read.
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.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
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 a4d7de8..75bb125 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -1,4 +1,6 @@
#include "config-host.h"
+#include "qemu-common.h"
+#include "qemu/timer.h"
#include "trace.h"
#include "ui/qemu-spice.h"
#include "char/char.h"
@@ -25,6 +27,7 @@ typedef struct SpiceCharDriver {
uint8_t *datapos;
ssize_t bufsize, datalen;
uint32_t debug;
+ QEMUTimer *unblock_timer;
QLIST_ENTRY(SpiceCharDriver) next;
} SpiceCharDriver;
@@ -54,6 +57,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;
+
+ if (scd->chr->chr_write_unblocked == NULL) {
+ dprintf(scd, 1, "%s: backend doesn't support unthrottling.\n", __func__);
+ return;
+ }
+ scd->chr->chr_write_unblocked(scd->chr->handler_opaque);
+}
+
static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
{
SpiceCharDriver *scd = container_of(sin, SpiceCharDriver, sin);
@@ -65,9 +79,16 @@ static int vmc_read(SpiceCharDeviceInstance *sin, uint8_t *buf, int len)
scd->datapos += bytes;
scd->datalen -= bytes;
assert(scd->datalen >= 0);
- if (scd->datalen == 0) {
- scd->datapos = 0;
- }
+ }
+ if (scd->datalen == 0 && scd->chr->write_blocked) {
+ dprintf(scd, 1, "%s: unthrottling (%d)\n", __func__, bytes);
+ scd->chr->write_blocked = false;
+ /*
+ * set a timer instead of calling scd->chr->chr_write_unblocked directly,
+ * because that will call back into spice_chr_write (see
+ * virtio-console.c:chr_write_unblocked), which is unwanted.
+ */
+ qemu_mod_timer(scd->unblock_timer, 0);
}
trace_spice_vmc_read(bytes, len);
return bytes;
@@ -163,6 +184,7 @@ static void vmc_unregister_interface(SpiceCharDriver *scd)
static int spice_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
{
SpiceCharDriver *s = chr->opaque;
+ int read_bytes;
dprintf(s, 2, "%s: %d\n", __func__, len);
vmc_register_interface(s);
@@ -175,7 +197,15 @@ static int spice_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
s->datapos = s->buffer;
s->datalen = len;
spice_server_char_device_wakeup(&s->sin);
- return len;
+ read_bytes = len - s->datalen;
+ if (read_bytes != len) {
+ dprintf(s, 1, "%s: throttling: %d < %d (%zd)\n", __func__,
+ read_bytes, len, s->bufsize);
+ s->chr->write_blocked = true;
+ /* We'll get passed in the unconsumed data with the next call */
+ s->datalen = 0;
+ }
+ return read_bytes;
}
static void spice_chr_close(struct CharDriverState *chr)
@@ -234,6 +264,7 @@ static CharDriverState *chr_open(QemuOpts *opts, const char *subtype)
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);
QLIST_INSERT_HEAD(&spice_chars, s, next);

View File

@ -1,70 +0,0 @@
From de979c48aa4b5e7f3f8658f9ac69030f3de3c99c Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Tue, 22 Mar 2011 12:28:00 +0200
Subject: [PATCH] spice-qemu-char.c: remove intermediate buffer
BZ: 672191
upstream: not submitted (explained below)
virtio-serial's buffer is valid when it calls us, and we don't
access it otherwise: vmc_read is only called in response to wakeup,
or else we set datalen=0 and throttle. Then vmc_read is called back,
we return 0 (not accessing the buffer) and set the timer to unthrottle.
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.
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
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 75bb125..5065240 100644
--- a/spice-qemu-char.c
+++ b/spice-qemu-char.c
@@ -23,9 +23,8 @@ typedef struct SpiceCharDriver {
SpiceCharDeviceInstance sin;
char *subtype;
bool active;
- uint8_t *buffer;
- uint8_t *datapos;
- ssize_t bufsize, datalen;
+ const uint8_t *datapos;
+ int datalen;
uint32_t debug;
QEMUTimer *unblock_timer;
QLIST_ENTRY(SpiceCharDriver) next;
@@ -73,7 +72,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) {
memcpy(buf, scd->datapos, bytes);
scd->datapos += bytes;
@@ -189,18 +188,13 @@ static int spice_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
dprintf(s, 2, "%s: %d\n", __func__, len);
vmc_register_interface(s);
assert(s->datalen == 0);
- if (s->bufsize < len) {
- s->bufsize = len;
- s->buffer = g_realloc(s->buffer, s->bufsize);
- }
- memcpy(s->buffer, buf, len);
- s->datapos = s->buffer;
+ s->datapos = buf;
s->datalen = len;
spice_server_char_device_wakeup(&s->sin);
read_bytes = len - s->datalen;
if (read_bytes != len) {
- dprintf(s, 1, "%s: throttling: %d < %d (%zd)\n", __func__,
- read_bytes, len, s->bufsize);
+ dprintf(s, 1, "%s: throttling: %d < %d\n", __func__,
+ read_bytes, len);
s->chr->write_blocked = true;
/* We'll get passed in the unconsumed data with the next call */
s->datalen = 0;

View File

@ -1,62 +0,0 @@
From 1e87b85766f9c18a2f9dffd289c0e56d640637c4 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] usb-redir: Add flow control support
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
hw/usb/redirect.c | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index bb07c62..4d23b66 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -257,8 +257,9 @@ static int usbredir_read(void *priv, uint8_t *data, int count)
static int usbredir_write(void *priv, uint8_t *data, int count)
{
USBRedirDevice *dev = priv;
+ int r;
- if (!dev->cs->opened) {
+ if (!dev->cs->opened || dev->cs->write_blocked) {
return 0;
}
@@ -267,7 +268,16 @@ static int usbredir_write(void *priv, uint8_t *data, int count)
return 0;
}
- return qemu_chr_fe_write(dev->cs, data, count);
+ r = qemu_chr_fe_write(dev->cs, data, count);
+
+ if (r < 0) {
+ if (dev->cs->write_blocked) {
+ return 0;
+ }
+ return -1;
+ }
+
+ return r;
}
/*
@@ -1227,10 +1237,18 @@ static void usbredir_chardev_event(void *opaque, int event)
}
}
+static void usbredir_chardev_write_unblocked(void *opaque)
+{
+ USBRedirDevice *dev = opaque;
+
+ usbredirparser_do_write(dev->parser);
+}
+
static const QemuChrHandlers usbredir_chr_handlers = {
.fd_can_read = usbredir_chardev_can_read,
.fd_read = usbredir_chardev_read,
.fd_event = usbredir_chardev_event,
+ .fd_write_unblocked = usbredir_chardev_write_unblocked,
};
/*

View File

@ -1,33 +0,0 @@
From 42931bebb2856307dcdc9babc5dd9954b60c8094 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] 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.
Bugzilla: 745758
Upstream: Not applicable, since throttling is a RHEL6-only feature.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
qemu-char.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/qemu-char.c b/qemu-char.c
index 53d2c13..fde72ff 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -223,6 +223,11 @@ void qemu_chr_add_handlers(CharDriverState *s,
++s->avail_connections;
}
if (!handlers) {
+ if (s->write_blocked) {
+ /* Ensure we disable the callback if we were throttled */
+ s->chr_disable_write_fd_handler(s);
+ /* s->write_blocked is cleared below */
+ }
handlers = &null_handlers;
}
s->chr_can_read = handlers->fd_can_read;

View File

@ -1,51 +0,0 @@
From 81ab56732f4990c288c88a545925dc4431c313d2 Mon Sep 17 00:00:00 2001
From: Alon Levy <alevy@redhat.com>
Date: Fri, 16 Nov 2012 16:24:47 +0200
Subject: [PATCH] hw/virtio-serial-bus: replay guest open on destination
This is rewrite of a patch carried in Fedora previously based
on new code upstream, here is the original message, it still applies:
(the original fedora patch was commit id
a9bc20afc1f0604ee81c23b7c67d627e51d2e8d4, this is useful for grepping in
logs, it isn't in upstream)
When migrating a host with with a spice agent running the mouse becomes
non operational after the migration. This is rhbz #725965.
The problem is that after migration spice doesn't know the guest agent
is open. Spice is just a char dev here. And a chardev cannot query it's
device, the device has to let the chardev know when it is open. Right
now after migration the chardev which is recreated is in it's default
state, which assumes the guest is disconnected.
Char devices carry no information across migration, but the
virtio-serial does already carry the guest_connected state. This patch
passes that bit to the chardev.
---
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 aa7d0d7..5078129 100644
--- a/hw/virtio-serial-bus.c
+++ b/hw/virtio-serial-bus.c
@@ -642,6 +642,7 @@ static void virtio_serial_post_load_timer_cb(void *opaque)
VirtIOSerial *s = opaque;
VirtIOSerialPort *port;
uint8_t host_connected;
+ VirtIOSerialPortClass *vsc;
if (!s->post_load) {
return;
@@ -657,6 +658,11 @@ static void virtio_serial_post_load_timer_cb(void *opaque)
send_control_event(s, port->id, VIRTIO_CONSOLE_PORT_OPEN,
port->host_connected);
}
+ vsc = VIRTIO_SERIAL_PORT_GET_CLASS(port);
+ if (port->guest_connected && vsc->guest_open) {
+ /* replay guest open */
+ vsc->guest_open(port);
+ }
}
g_free(s->post_load->connected);
qemu_free_timer(s->post_load->timer);

View File

@ -1,46 +0,0 @@
From f76e7a03ac948a7649878d7ddbb02ace0f6e3625 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Wed, 20 Feb 2013 11:14:45 -0500
Subject: [PATCH] docs: Fix generating qemu-doc.html with texinfo 5
LC_ALL=C makeinfo --no-headers --no-split --number-sections --html qemu-doc.texi -o qemu-doc.html
./qemu-options.texi:1521: unknown command `list'
./qemu-options.texi:1521: table requires an argument: the formatter for @item
./qemu-options.texi:1521: warning: @table has text but no @item
CC: qemu-stable@nongnu.org
Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
qemu-options.hx | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/qemu-options.hx b/qemu-options.hx
index 15dc29e..470c2b4 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2092,18 +2092,13 @@ QEMU supports using either local sheepdog devices or remote networked
devices.
Syntax for specifying a sheepdog device
-@table @list
-``sheepdog:<vdiname>''
-
-``sheepdog:<vdiname>:<snapid>''
-
-``sheepdog:<vdiname>:<tag>''
-
-``sheepdog:<host>:<port>:<vdiname>''
-
-``sheepdog:<host>:<port>:<vdiname>:<snapid>''
-
-``sheepdog:<host>:<port>:<vdiname>:<tag>''
+@table @code
+@item sheepdog:<vdiname>
+@item sheepdog:<vdiname>:<snapid>
+@item sheepdog:<vdiname>:<tag>
+@item sheepdog:<host>:<port>:<vdiname>
+@item sheepdog:<host>:<port>:<vdiname>:<snapid>
+@item sheepdog:<host>:<port>:<vdiname>:<tag>
@end table
Example

View File

@ -1,31 +0,0 @@
From 106a39c50211b7c7e96ffb47ad9deae5d9be6d84 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Fri, 15 Mar 2013 11:52:37 +0100
Subject: [PATCH] usb-redir: Fix crash on migration with no client connected
If no client is connected on the src side, then we won't receive a
parser during migrate, in this case usbredir_post_load() should be a nop,
rather then to try to derefefence the NULL dev->parser pointer.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 3713e1485e6eace7d48b9c790602cfd92c616e5f)
---
hw/usb/redirect.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 4d23b66..bf6aaf0 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -2008,6 +2008,10 @@ static int usbredir_post_load(void *priv, int version_id)
{
USBRedirDevice *dev = priv;
+ if (dev->parser == NULL) {
+ return 0;
+ }
+
switch (dev->device_info.speed) {
case usb_redir_speed_low:
dev->dev.speed = USB_SPEED_LOW;

140
qemu.spec
View File

@ -29,6 +29,7 @@
%bcond_without seccomp # enabled
%bcond_with xfsprogs # disabled
%bcond_with separate_kvm # disabled - for EPEL
%bcond_with gtk # disabled
%else
# General defaults:
%bcond_with kvmonly # disabled
@ -38,9 +39,10 @@
%bcond_without seccomp # enabled
%bcond_without xfsprogs # enabled
%bcond_with separate_kvm # disabled
%bcond_without gtk # enabled
%endif
%global SLOF_gittagdate 20121018
%global SLOF_gittagdate 20130430
%if %{without separate_kvm}
%global kvm_archs %{ix86} x86_64 ppc64 s390x
@ -121,6 +123,7 @@
%global system_x86 system-x86
%global system_xtensa system-xtensa
%global system_unicore32 system-unicore32
%global system_moxie system-moxie
%endif
# libfdt is only needed to build ARM, Microblaze or PPC emulators
@ -130,9 +133,8 @@
Summary: QEMU is a FAST! processor emulator
Name: qemu
Version: 1.4.1
Release: 3%{?dist}
# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped
Version: 1.5.0
Release: 1%{?dist}
Epoch: 2
License: GPLv2+ and LGPLv2+ and BSD
Group: Development/Tools
@ -173,31 +175,13 @@ Source12: bridge.conf
# qemu-kvm back compat wrapper
Source13: qemu-kvm.sh
# Flow control series
Patch0001: 0001-char-Split-out-tcp-socket-close-code-in-a-separate-f.patch
Patch0002: 0002-char-Add-a-QemuChrHandlers-struct-to-initialise-char.patch
Patch0003: 0003-iohandlers-Add-enable-disable_write_fd_handler-funct.patch
Patch0004: 0004-char-Add-framework-for-a-write-unblocked-callback.patch
Patch0005: 0005-char-Update-send_all-to-handle-nonblocking-chardev-w.patch
Patch0006: 0006-char-Equip-the-unix-tcp-backend-to-handle-nonblockin.patch
Patch0007: 0007-virtio-console-Enable-port-throttling-when-chardev-i.patch
Patch0008: 0008-spice-qemu-char.c-add-throttling.patch
Patch0009: 0009-spice-qemu-char.c-remove-intermediate-buffer.patch
Patch0010: 0010-usb-redir-Add-flow-control-support.patch
Patch0011: 0011-char-Disable-write-callback-if-throttled-chardev-is-.patch
Patch0012: 0012-hw-virtio-serial-bus-replay-guest-open-on-destinatio.patch
# qemu-kvm migration compat (posted upstream)
Patch0101: 0101-configure-Add-enable-migration-from-qemu-kvm.patch
Patch0102: 0102-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch
Patch0103: 0103-i8254-Fix-migration-from-qemu-kvm-1.1.patch
Patch0104: 0104-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch
Patch0001: 0001-configure-Add-enable-migration-from-qemu-kvm.patch
Patch0002: 0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch
Patch0003: 0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch
Patch0004: 0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch
# Fix migration w/ qxl from qemu-kvm 1.2 (solution pending upstream)
Patch0105: 0105-qxl-Add-rom_size-compat-property-fix-migration-from-.patch
# Fix generating docs with texinfo 5 (posted upstream)
Patch0106: 0106-docs-Fix-generating-qemu-doc.html-with-texinfo-5.patch
# Fix crash with usbredir (bz #962826)
Patch0107: 0107-usb-redir-Fix-crash-on-migration-with-no-client-conn.patch
Patch0005: 0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch
BuildRequires: SDL-devel
BuildRequires: zlib-devel
@ -268,6 +252,16 @@ BuildRequires: pixman-devel
BuildRequires: glusterfs-devel >= 3.4.0
BuildRequires: glusterfs-api-devel >= 3.4.0
%endif
# Needed for usb passthrough for qemu >= 1.5
BuildRequires: libusbx-devel
# SSH block driver
BuildRequires: libssh2-devel
%if %{with gtk}
# GTK frontend
BuildRequires: gtk3-devel
BuildRequires: vte3-devel
%endif
%if 0%{?user:1}
Requires: %{name}-%{user} = %{epoch}:%{version}-%{release}
@ -317,6 +311,9 @@ Requires: %{name}-%{system_x86} = %{epoch}:%{version}-%{release}
%if 0%{?system_xtensa:1}
Requires: %{name}-%{system_xtensa} = %{epoch}:%{version}-%{release}
%endif
%if 0%{?system_moxie:1}
Requires: %{name}-%{system_moxie} = %{epoch}:%{version}-%{release}
%endif
%if %{without separate_kvm}
Requires: %{name}-img = %{epoch}:%{version}-%{release}
%else
@ -424,7 +421,7 @@ Obsoletes: kvm < 85
Requires: seavgabios-bin
Requires: seabios-bin >= 0.6.0-2
Requires: sgabios-bin
Requires: ipxe-roms-qemu
Requires: ipxe-roms-qemu >= 20130517-2.gitc4bce43
%if 0%{?have_seccomp:1}
Requires: libseccomp >= 1.0.0
%endif
@ -577,7 +574,7 @@ Summary: QEMU system emulator for PPC
Group: Development/Tools
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: openbios
Requires: SLOF = 0.1.git%{SLOF_gittagdate}
Requires: SLOF >= 0.1.git%{SLOF_gittagdate}
%description %{system_ppc}
QEMU is a generic and open source processor emulator which achieves a good
emulation speed by using dynamic translation.
@ -609,6 +606,18 @@ emulation speed by using dynamic translation.
This package provides the system emulator for Unicore32 boards.
%endif
%if 0%{?system_moxie:1}
%package %{system_moxie}
Summary: QEMU system emulator for Moxie
Group: Development/Tools
Requires: %{name}-common = %{epoch}:%{version}-%{release}
%description %{system_moxie}
QEMU is a generic and open source processor emulator which achieves a good
emulation speed by using dynamic translation.
This package provides the system emulator for Moxie boards.
%endif
%ifarch %{kvm_archs}
%package kvm-tools
Summary: KVM debugging and diagnostics tools
@ -647,31 +656,13 @@ CAC emulation development files.
%prep
%setup -q
# Flow control series
# qemu-kvm migration compat (posted upstream)
%patch0001 -p1
%patch0002 -p1
%patch0003 -p1
%patch0004 -p1
%patch0005 -p1
%patch0006 -p1
%patch0007 -p1
%patch0008 -p1
%patch0009 -p1
%patch0010 -p1
%patch0011 -p1
%patch0012 -p1
# qemu-kvm migration compat (posted upstream)
%patch0101 -p1
%patch0102 -p1
%patch0103 -p1
%patch0104 -p1
# Fix migration w/ qxl from qemu-kvm 1.2 (solution pending upstream)
%patch0105 -p1
# Fix generating docs with texinfo 5 (posted upstream)
%patch0106 -p1
# Fix crash with usbredir (bz #962826)
%patch0107 -p1
%patch0005 -p1
%build
@ -683,11 +674,13 @@ CAC emulation development files.
microblazeel-softmmu mips-softmmu mipsel-softmmu mips64-softmmu \
mips64el-softmmu or32-softmmu ppc-softmmu ppcemb-softmmu ppc64-softmmu \
s390x-softmmu sh4-softmmu sh4eb-softmmu sparc-softmmu sparc64-softmmu \
xtensa-softmmu xtensaeb-softmmu unicore32-softmmu \
xtensa-softmmu xtensaeb-softmmu unicore32-softmmu moxie-softmmu \
i386-linux-user x86_64-linux-user alpha-linux-user arm-linux-user \
armeb-linux-user cris-linux-user m68k-linux-user \
microblaze-linux-user microblazeel-linux-user mips-linux-user \
mipsel-linux-user or32-linux-user ppc-linux-user ppc64-linux-user \
mipsel-linux-user mips64-linux-user mips64el-linux-user \
mipsn32-linux-user mipsn32el-linux-user \
or32-linux-user ppc-linux-user ppc64-linux-user \
ppc64abi32-linux-user s390x-linux-user sh4-linux-user sh4eb-linux-user \
sparc-linux-user sparc64-linux-user sparc32plus-linux-user \
unicore32-linux-user"
@ -736,6 +729,10 @@ dobuild() {
%else
--disable-fdt \
%endif
%if %{with gtk}
--with-gtkabi="3.0" \
%endif
--enable-tpm \
"$@"
echo "config-host.mak contents:"
@ -778,6 +775,8 @@ install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_udevdir}
make DESTDIR=$RPM_BUILD_ROOT install
%find_lang %{name}
%if 0%{?need_qemu_kvm}
install -m 0755 %{SOURCE13} $RPM_BUILD_ROOT%{_bindir}/qemu-kvm
%endif
@ -788,7 +787,7 @@ rm $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}.stp
%endif
chmod -x ${RPM_BUILD_ROOT}%{_mandir}/man1/*
install -D -p -m 0644 -t ${RPM_BUILD_ROOT}%{qemudocdir} Changelog README TODO COPYING COPYING.LIB LICENSE
install -D -p -m 0644 -t ${RPM_BUILD_ROOT}%{qemudocdir} Changelog README COPYING COPYING.LIB LICENSE
install -D -p -m 0644 qemu.sasl $RPM_BUILD_ROOT%{_sysconfdir}/sasl2/qemu.conf
@ -817,10 +816,12 @@ rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/spapr-rtas.bin
%endif
%if 0%{!?system_s390x:1}
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/s390-zipl.rom
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/s390-ccw.img
%endif
# Provided by package ipxe
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/pxe*rom
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/efi*rom
# Provided by package seavgabios
rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/vgabios*bin
# Provided by package seabios
@ -834,6 +835,7 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/sgabios.bin
# for other paths, yet.
pxe_link() {
ln -s ../ipxe/$2.rom %{buildroot}%{_datadir}/%{name}/pxe-$1.rom
ln -s ../ipxe.efi/$2.rom %{buildroot}%{_datadir}/%{name}/efi-$1.rom
}
pxe_link e1000 8086100e
@ -999,12 +1001,11 @@ getent passwd qemu >/dev/null || \
%defattr(-,root,root)
%endif
%files common
%files common -f %{name}.lang
%defattr(-,root,root)
%dir %{qemudocdir}
%doc %{qemudocdir}/Changelog
%doc %{qemudocdir}/README
%doc %{qemudocdir}/TODO
%doc %{qemudocdir}/qemu-doc.html
%doc %{qemudocdir}/qemu-tech.html
%doc %{qemudocdir}/qmp-commands.txt
@ -1012,6 +1013,7 @@ getent passwd qemu >/dev/null || \
%doc %{qemudocdir}/COPYING.LIB
%doc %{qemudocdir}/LICENSE
%dir %{_datadir}/%{name}/
%{_datadir}/%{name}/qemu-icon.bmp
%{_datadir}/%{name}/keymaps/
%{_mandir}/man1/qemu.1*
%{_mandir}/man1/virtfs-proxy-helper.1*
@ -1053,6 +1055,10 @@ getent passwd qemu >/dev/null || \
%{_bindir}/qemu-microblazeel
%{_bindir}/qemu-mips
%{_bindir}/qemu-mipsel
%{_bindir}/qemu-mips64
%{_bindir}/qemu-mips64el
%{_bindir}/qemu-mipsn32
%{_bindir}/qemu-mipsn32el
%{_bindir}/qemu-or32
%{_bindir}/qemu-ppc
%{_bindir}/qemu-ppc64
@ -1075,6 +1081,10 @@ getent passwd qemu >/dev/null || \
%{_datadir}/systemtap/tapset/qemu-microblazeel.stp
%{_datadir}/systemtap/tapset/qemu-mips.stp
%{_datadir}/systemtap/tapset/qemu-mipsel.stp
%{_datadir}/systemtap/tapset/qemu-mips64.stp
%{_datadir}/systemtap/tapset/qemu-mips64el.stp
%{_datadir}/systemtap/tapset/qemu-mipsn32.stp
%{_datadir}/systemtap/tapset/qemu-mipsn32el.stp
%{_datadir}/systemtap/tapset/qemu-or32.stp
%{_datadir}/systemtap/tapset/qemu-ppc.stp
%{_datadir}/systemtap/tapset/qemu-ppc64.stp
@ -1110,11 +1120,15 @@ getent passwd qemu >/dev/null || \
%{_datadir}/%{name}/vgabios-stdvga.bin
%{_datadir}/%{name}/vgabios-vmware.bin
%{_datadir}/%{name}/pxe-e1000.rom
%{_datadir}/%{name}/efi-e1000.rom
%{_datadir}/%{name}/pxe-virtio.rom
%{_datadir}/%{name}/efi-virtio.rom
%{_datadir}/%{name}/pxe-pcnet.rom
%{_datadir}/%{name}/efi-pcnet.rom
%{_datadir}/%{name}/pxe-rtl8139.rom
%{_datadir}/%{name}/efi-rtl8139.rom
%{_datadir}/%{name}/pxe-ne2k_pci.rom
%{_datadir}/%{name}/qemu-icon.bmp
%{_datadir}/%{name}/efi-ne2k_pci.rom
%config(noreplace) %{_sysconfdir}/qemu/target-x86_64.conf
%if %{without separate_kvm}
%ifarch %{ix86} x86_64
@ -1202,6 +1216,7 @@ getent passwd qemu >/dev/null || \
%{_bindir}/qemu-system-s390x
%{_datadir}/systemtap/tapset/qemu-system-s390x.stp
%{_datadir}/%{name}/s390-zipl.rom
%{_datadir}/%{name}/s390-ccw.img
%ifarch s390x
%{?kvm_files:}
%{?qemu_kvm_files:}
@ -1262,6 +1277,13 @@ getent passwd qemu >/dev/null || \
%{_datadir}/systemtap/tapset/qemu-system-xtensaeb.stp
%endif
%if 0%{?system_moxie:1}
%files %{system_moxie}
%defattr(-,root,root)
%{_bindir}/qemu-system-moxie
%{_datadir}/systemtap/tapset/qemu-system-moxie.stp
%endif
%if %{without separate_kvm}
%files img
%defattr(-,root,root)
@ -1288,6 +1310,14 @@ getent passwd qemu >/dev/null || \
%endif
%changelog
* Tue May 21 2013 Cole Robinson <crobinso@redhat.com> - 2:1.5.0-1
- Update to qemu 1.5
- KVM for ARM support
- A native GTK+ UI with internationalization support
- Experimental VFIO support for VGA passthrough
- Support for VMware PVSCSI and VMXNET3 device emulation
- CPU hot-add support
* Thu May 16 2013 Paolo Bonzini <pbonzini@redhat.com> - 2:1.4.1-3
- Drop loading of vhost-net module (bz #963198)

View File

@ -1 +1 @@
eb2d696956324722b5ecfa46e41f9a75 qemu-1.4.1.tar.bz2
b6f3265b8ed39d77e8f354f35cc26e16 qemu-1.5.0.tar.bz2