From 7fae7fbaf1f5bef597f2a7512206ed05ec193853 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 21 May 2013 12:12:56 -0400 Subject: [PATCH 01/45] 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 --- .gitignore | 1 + ...cp-socket-close-code-in-a-separate-f.patch | 54 - ...e-Add-enable-migration-from-qemu-kvm.patch | 18 +- ...minimum_version_id-to-handle-qemu-kv.patch | 16 +- ...hrHandlers-struct-to-initialise-char.patch | 1068 ----------------- ...8254-Fix-migration-from-qemu-kvm-1.1.patch | 14 +- ...nable-disable_write_fd_handler-funct.patch | 74 -- ...ework-for-a-write-unblocked-callback.patch | 59 - ...at-handling-for-qemu-kvm-VGA-mem-siz.patch | 22 +- ..._all-to-handle-nonblocking-chardev-w.patch | 178 --- ...-compat-property-fix-migration-from-.patch | 88 +- ...nix-tcp-backend-to-handle-nonblockin.patch | 72 -- ...nable-port-throttling-when-chardev-i.patch | 47 - 0008-spice-qemu-char.c-add-throttling.patch | 132 -- ...mu-char.c-remove-intermediate-buffer.patch | 70 -- 0010-usb-redir-Add-flow-control-support.patch | 62 - ...te-callback-if-throttled-chardev-is-.patch | 33 - ...-bus-replay-guest-open-on-destinatio.patch | 51 - ...erating-qemu-doc.html-with-texinfo-5.patch | 46 - ...ash-on-migration-with-no-client-conn.patch | 31 - qemu.spec | 140 ++- sources | 2 +- 22 files changed, 161 insertions(+), 2117 deletions(-) delete mode 100644 0001-char-Split-out-tcp-socket-close-code-in-a-separate-f.patch rename 0101-configure-Add-enable-migration-from-qemu-kvm.patch => 0001-configure-Add-enable-migration-from-qemu-kvm.patch (85%) rename 0102-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch => 0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch (81%) delete mode 100644 0002-char-Add-a-QemuChrHandlers-struct-to-initialise-char.patch rename 0103-i8254-Fix-migration-from-qemu-kvm-1.1.patch => 0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch (81%) delete mode 100644 0003-iohandlers-Add-enable-disable_write_fd_handler-funct.patch delete mode 100644 0004-char-Add-framework-for-a-write-unblocked-callback.patch rename 0104-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch => 0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch (80%) delete mode 100644 0005-char-Update-send_all-to-handle-nonblocking-chardev-w.patch rename 0105-qxl-Add-rom_size-compat-property-fix-migration-from-.patch => 0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch (79%) delete mode 100644 0006-char-Equip-the-unix-tcp-backend-to-handle-nonblockin.patch delete mode 100644 0007-virtio-console-Enable-port-throttling-when-chardev-i.patch delete mode 100644 0008-spice-qemu-char.c-add-throttling.patch delete mode 100644 0009-spice-qemu-char.c-remove-intermediate-buffer.patch delete mode 100644 0010-usb-redir-Add-flow-control-support.patch delete mode 100644 0011-char-Disable-write-callback-if-throttled-chardev-is-.patch delete mode 100644 0012-hw-virtio-serial-bus-replay-guest-open-on-destinatio.patch delete mode 100644 0106-docs-Fix-generating-qemu-doc.html-with-texinfo-5.patch delete mode 100644 0107-usb-redir-Fix-crash-on-migration-with-no-client-conn.patch diff --git a/.gitignore b/.gitignore index 7641bf6..bf06366 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/0001-char-Split-out-tcp-socket-close-code-in-a-separate-f.patch b/0001-char-Split-out-tcp-socket-close-code-in-a-separate-f.patch deleted file mode 100644 index 7322db2..0000000 --- a/0001-char-Split-out-tcp-socket-close-code-in-a-separate-f.patch +++ /dev/null @@ -1,54 +0,0 @@ -From bed754a15e27a3630681959cf1d3161084f29fe9 Mon Sep 17 00:00:00 2001 -From: Amit Shah -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 -Signed-off-by: Cole Robinson ---- - 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); diff --git a/0101-configure-Add-enable-migration-from-qemu-kvm.patch b/0001-configure-Add-enable-migration-from-qemu-kvm.patch similarity index 85% rename from 0101-configure-Add-enable-migration-from-qemu-kvm.patch rename to 0001-configure-Add-enable-migration-from-qemu-kvm.patch index 695a659..6e9de6d 100644 --- a/0101-configure-Add-enable-migration-from-qemu-kvm.patch +++ b/0001-configure-Add-enable-migration-from-qemu-kvm.patch @@ -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 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 --- 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 diff --git a/0102-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch b/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch similarity index 81% rename from 0102-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch rename to 0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch index 9514db4..d6107a8 100644 --- a/0102-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch +++ b/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch @@ -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 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 --- - 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; } diff --git a/0002-char-Add-a-QemuChrHandlers-struct-to-initialise-char.patch b/0002-char-Add-a-QemuChrHandlers-struct-to-initialise-char.patch deleted file mode 100644 index e96d513..0000000 --- a/0002-char-Add-a-QemuChrHandlers-struct-to-initialise-char.patch +++ /dev/null @@ -1,1068 +0,0 @@ -From de768f74c31d04063889c5dc588d55bc19cf7315 Mon Sep 17 00:00:00 2001 -From: Amit Shah -Date: Mon, 21 Mar 2011 20:31:45 +0100 -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 -Signed-off-by: Cole Robinson ---- - backends/rng-egd.c | 12 +++++++++--- - gdbstub.c | 9 +++++++-- - hw/cadence_uart.c | 9 +++++++-- - hw/ccid-card-passthru.c | 11 +++++++---- - hw/debugcon.c | 2 +- - hw/escc.c | 9 +++++++-- - hw/etraxfs_ser.c | 13 +++++++++---- - hw/exynos4210_uart.c | 9 +++++++-- - hw/grlib_apbuart.c | 12 +++++++----- - hw/imx_serial.c | 9 +++++++-- - hw/ipoctal232.c | 9 +++++++-- - 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/qdev-properties-system.c | 2 +- - hw/s390x/sclpconsole.c | 9 +++++++-- - hw/serial.c | 11 ++++++++--- - hw/sh_serial.c | 12 +++++++++--- - hw/spapr_vty.c | 8 ++++++-- - hw/strongarm.c | 12 +++++++----- - hw/usb/dev-serial.c | 11 ++++++++--- - hw/usb/redirect.c | 9 +++++++-- - hw/virtio-console.c | 9 +++++++-- - hw/xen_console.c | 16 +++++++++++----- - hw/xilinx_uartlite.c | 11 +++++++++-- - include/char/char.h | 13 +++++++++---- - monitor.c | 18 ++++++++++++++---- - net/slirp.c | 8 ++++++-- - qemu-char.c | 32 ++++++++++++++++++++++---------- - qtest.c | 9 ++++++++- - 34 files changed, 280 insertions(+), 97 deletions(-) - -diff --git a/backends/rng-egd.c b/backends/rng-egd.c -index 5e012e9..b09876a 100644 ---- a/backends/rng-egd.c -+++ b/backends/rng-egd.c -@@ -133,6 +133,13 @@ static void rng_egd_cancel_requests(RngBackend *b) - rng_egd_free_requests(s); - } - -+static const QemuChrHandlers rng_egd_handlers = { -+ .fd_can_read = rng_egd_chr_can_read, -+ .fd_read = rng_egd_chr_read, -+ .fd_event = NULL, -+}; -+ -+ - static void rng_egd_opened(RngBackend *b, Error **errp) - { - RngEgd *s = RNG_EGD(b); -@@ -150,8 +157,7 @@ static void rng_egd_opened(RngBackend *b, Error **errp) - } - - /* FIXME we should resubmit pending requests when the CDS reconnects. */ -- qemu_chr_add_handlers(s->chr, rng_egd_chr_can_read, rng_egd_chr_read, -- NULL, s); -+ qemu_chr_add_handlers(s->chr, &rng_egd_handlers, s); - } - - static void rng_egd_set_chardev(Object *obj, const char *value, Error **errp) -@@ -190,7 +196,7 @@ static void rng_egd_finalize(Object *obj) - RngEgd *s = RNG_EGD(obj); - - if (s->chr) { -- qemu_chr_add_handlers(s->chr, NULL, NULL, NULL, NULL); -+ qemu_chr_add_handlers(s->chr, NULL, NULL); - } - - g_free(s->chr_name); -diff --git a/gdbstub.c b/gdbstub.c -index 6cd26f1..2da07e9 100644 ---- a/gdbstub.c -+++ b/gdbstub.c -@@ -2992,6 +2992,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, -+ .fd_event = gdb_chr_event, -+}; -+ - int gdbserver_start(const char *device) - { - GDBState *s; -@@ -3021,8 +3027,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/cadence_uart.c b/hw/cadence_uart.c -index 5766d38..dd1a7d6 100644 ---- a/hw/cadence_uart.c -+++ b/hw/cadence_uart.c -@@ -439,6 +439,12 @@ static void cadence_uart_reset(UartState *s) - s->rx_wpos = 0; - } - -+static const QemuChrHandlers cadence_uart_handlers = { -+ .fd_can_read = uart_can_receive, -+ .fd_read = uart_receive, -+ .fd_event = uart_event, -+}; -+ - static int cadence_uart_init(SysBusDevice *dev) - { - UartState *s = FROM_SYSBUS(UartState, dev); -@@ -460,8 +466,7 @@ static int cadence_uart_init(SysBusDevice *dev) - cadence_uart_reset(s); - - if (s->chr) { -- qemu_chr_add_handlers(s->chr, uart_can_receive, uart_receive, -- uart_event, s); -+ qemu_chr_add_handlers(s->chr, &cadence_uart_handlers, s); - } - - return 0; -diff --git a/hw/ccid-card-passthru.c b/hw/ccid-card-passthru.c -index 984bd0b..0dde761 100644 ---- a/hw/ccid-card-passthru.c -+++ b/hw/ccid-card-passthru.c -@@ -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, -+ .fd_event = ccid_card_vscard_event, -+}; -+ - static int passthru_initfn(CCIDCardState *base) - { - PassthruState *card = DO_UPCAST(PassthruState, base, base); -@@ -282,10 +288,7 @@ static int passthru_initfn(CCIDCardState *base) - card->vscard_in_hdr = 0; - if (card->cs) { - DPRINTF(card, D_INFO, "initing chardev\n"); -- qemu_chr_add_handlers(card->cs, -- ccid_card_vscard_can_read, -- ccid_card_vscard_read, -- ccid_card_vscard_event, card); -+ qemu_chr_add_handlers(card->cs, &passthru_handlers, card); - ccid_card_vscard_send_init(card); - } else { - error_report("missing chardev"); -diff --git a/hw/debugcon.c b/hw/debugcon.c -index 81b2bb0..58e1f90 100644 ---- a/hw/debugcon.c -+++ b/hw/debugcon.c -@@ -88,7 +88,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 18c0292..a29784a 100644 ---- a/hw/escc.c -+++ b/hw/escc.c -@@ -867,6 +867,12 @@ void slavio_serial_ms_kbd_init(hwaddr 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, -+ .fd_event = serial_event, -+}; -+ - static int escc_init1(SysBusDevice *dev) - { - SerialState *s = FROM_SYSBUS(SerialState, dev); -@@ -879,8 +885,7 @@ static int escc_init1(SysBusDevice *dev) - s->chn[i].chn = 1 - i; - s->chn[i].clock = s->frequency / 2; - if (s->chn[i].chr) { -- qemu_chr_add_handlers(s->chn[i].chr, serial_can_receive, -- serial_receive1, serial_event, &s->chn[i]); -+ qemu_chr_add_handlers(s->chn[i].chr, &serial_handlers, &s->chn[i]); - } - } - s->chn[0].otherchn = &s->chn[1]; -diff --git a/hw/etraxfs_ser.c b/hw/etraxfs_ser.c -index 72c8868..eb93166 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, -+ .fd_event = serial_event, -+}; -+ - static int etraxfs_ser_init(SysBusDevice *dev) - { - struct etrax_serial *s = FROM_SYSBUS(typeof (*s), dev); -@@ -217,10 +223,9 @@ static int etraxfs_ser_init(SysBusDevice *dev) - sysbus_init_mmio(dev, &s->mmio); - - s->chr = qemu_char_get_next_serial(); -- if (s->chr) -- qemu_chr_add_handlers(s->chr, -- serial_can_receive, serial_receive, -- serial_event, s); -+ if (s->chr) { -+ qemu_chr_add_handlers(s->chr, &serial_handlers, s); -+ } - return 0; - } - -diff --git a/hw/exynos4210_uart.c b/hw/exynos4210_uart.c -index bdf797a..8419deb 100644 ---- a/hw/exynos4210_uart.c -+++ b/hw/exynos4210_uart.c -@@ -625,6 +625,12 @@ DeviceState *exynos4210_uart_create(hwaddr addr, - return dev; - } - -+static const QemuChrHandlers exynos4210_handlers = { -+ .fd_can_read = exynos4210_uart_can_receive, -+ .fd_read = exynos4210_uart_receive, -+ .fd_event = exynos4210_uart_event, -+}; -+ - static int exynos4210_uart_init(SysBusDevice *dev) - { - Exynos4210UartState *s = FROM_SYSBUS(Exynos4210UartState, dev); -@@ -636,8 +642,7 @@ static int exynos4210_uart_init(SysBusDevice *dev) - - sysbus_init_irq(dev, &s->irq); - -- qemu_chr_add_handlers(s->chr, exynos4210_uart_can_receive, -- exynos4210_uart_receive, exynos4210_uart_event, s); -+ qemu_chr_add_handlers(s->chr, &exynos4210_handlers, s); - - return 0; - } -diff --git a/hw/grlib_apbuart.c b/hw/grlib_apbuart.c -index 760bed0..7ede2be 100644 ---- a/hw/grlib_apbuart.c -+++ b/hw/grlib_apbuart.c -@@ -222,15 +222,17 @@ static const MemoryRegionOps grlib_apbuart_ops = { - .endianness = DEVICE_NATIVE_ENDIAN, - }; - -+static const QemuChrHandlers grlib_handlers = { -+ .fd_can_read = grlib_apbuart_can_receive, -+ .fd_read = grlib_apbuart_receive, -+ .fd_event = grlib_apbuart_event, -+}; -+ - static int grlib_apbuart_init(SysBusDevice *dev) - { - UART *uart = FROM_SYSBUS(typeof(*uart), dev); - -- 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/imx_serial.c b/hw/imx_serial.c -index 2d8253e..b0401a1 100644 ---- a/hw/imx_serial.c -+++ b/hw/imx_serial.c -@@ -381,6 +381,12 @@ static const struct MemoryRegionOps imx_serial_ops = { - .endianness = DEVICE_NATIVE_ENDIAN, - }; - -+static const QemuChrHandlers imx_handlers = { -+ .fd_can_read = imx_can_receive, -+ .fd_read = imx_receive, -+ .fd_event = imx_event, -+}; -+ - static int imx_serial_init(SysBusDevice *dev) - { - IMXSerialState *s = FROM_SYSBUS(IMXSerialState, dev); -@@ -391,8 +397,7 @@ static int imx_serial_init(SysBusDevice *dev) - sysbus_init_irq(dev, &s->irq); - - if (s->chr) { -- qemu_chr_add_handlers(s->chr, imx_can_receive, imx_receive, -- imx_event, s); -+ qemu_chr_add_handlers(s->chr, &imx_handlers, s); - } else { - DPRINTF("No char dev for uart at 0x%lx\n", - (unsigned long)s->iomem.ram_addr); -diff --git a/hw/ipoctal232.c b/hw/ipoctal232.c -index c1e3b19..9d1eacf 100644 ---- a/hw/ipoctal232.c -+++ b/hw/ipoctal232.c -@@ -535,6 +535,12 @@ static void hostdev_event(void *opaque, int event) - } - } - -+static const QemuChrHandlers ipoctal_chr_handlers = { -+ .fd_can_read = hostdev_can_receive, -+ .fd_read = hostdev_receive, -+ .fd_event = hostdev_event, -+}; -+ - static int ipoctal_init(IPackDevice *ip) - { - IPOctalState *s = IPOCTAL(ip); -@@ -556,8 +562,7 @@ static int ipoctal_init(IPackDevice *ip) - - if (ch->dev) { - index++; -- qemu_chr_add_handlers(ch->dev, hostdev_can_receive, -- hostdev_receive, hostdev_event, ch); -+ qemu_chr_add_handlers(ch->dev, &ipoctal_chr_handlers, ch); - DPRINTF("Redirecting channel %u to %s (%s)\n", - i, ch->devpath, label); - } else { -diff --git a/hw/ivshmem.c b/hw/ivshmem.c -index afaf9b3..7577307 100644 ---- a/hw/ivshmem.c -+++ b/hw/ivshmem.c -@@ -278,6 +278,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, -+ .fd_event = ivshmem_event, -+}; -+ -+static const QemuChrHandlers ivshmem_msi_handlers = { -+ .fd_can_read = ivshmem_can_receive, -+ .fd_read = fake_irqfd, -+ .fd_event = ivshmem_event, -+}; -+ - static CharDriverState* create_eventfd_chr_device(void * opaque, EventNotifier *n, - int vector) - { -@@ -298,11 +310,10 @@ static CharDriverState* create_eventfd_chr_device(void * opaque, EventNotifier * - 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, -+ &s->eventfd_table[vector]); - } else { -- qemu_chr_add_handlers(chr, ivshmem_can_receive, ivshmem_receive, -- ivshmem_event, s); -+ qemu_chr_add_handlers(chr, &ivshmem_handlers, s); - } - - return chr; -@@ -636,6 +647,12 @@ static void ivshmem_write_config(PCIDevice *pci_dev, uint32_t address, - msix_write_config(pci_dev, address, val, len); - } - -+static const QemuChrHandlers ivshmem_server_handlers = { -+ .fd_can_read = ivshmem_can_receive, -+ .fd_read = ivshmem_read, -+ .fd_event = ivshmem_event, -+}; -+ - static int pci_ivshmem_init(PCIDevice *dev) - { - IVShmemState *s = DO_UPCAST(IVShmemState, dev, dev); -@@ -726,8 +743,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); - } else { - /* just map the file immediately, we're not using a server */ - int fd; -diff --git a/hw/lm32_juart.c b/hw/lm32_juart.c -index 8c82c85..840f588 100644 ---- a/hw/lm32_juart.c -+++ b/hw/lm32_juart.c -@@ -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, -+ .fd_event = juart_event, -+}; -+ - static int lm32_juart_init(SysBusDevice *dev) - { - LM32JuartState *s = FROM_SYSBUS(typeof(*s), dev); - - s->chr = qemu_char_get_next_serial(); - 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 9c89cca..19cfd01 100644 ---- a/hw/lm32_uart.c -+++ b/hw/lm32_uart.c -@@ -243,6 +243,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, -+ .fd_event = uart_event, -+}; -+ - static int lm32_uart_init(SysBusDevice *dev) - { - LM32UartState *s = FROM_SYSBUS(typeof(*s), dev); -@@ -254,7 +260,7 @@ static int lm32_uart_init(SysBusDevice *dev) - - s->chr = qemu_char_get_next_serial(); - 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 c443443..fc491f1 100644 ---- a/hw/mcf_uart.c -+++ b/hw/mcf_uart.c -@@ -272,6 +272,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, -+ .fd_event = mcf_uart_event, -+}; -+ - void *mcf_uart_init(qemu_irq irq, CharDriverState *chr) - { - mcf_uart_state *s; -@@ -280,8 +286,7 @@ void *mcf_uart_init(qemu_irq irq, CharDriverState *chr) - s->chr = chr; - s->irq = irq; - if (chr) { -- qemu_chr_add_handlers(chr, mcf_uart_can_receive, mcf_uart_receive, -- mcf_uart_event, s); -+ qemu_chr_add_handlers(chr, &mcf_uart_handlers, s); - } - mcf_uart_reset(s); - return s; -diff --git a/hw/milkymist-uart.c b/hw/milkymist-uart.c -index e73eb84..3e03c5c 100644 ---- a/hw/milkymist-uart.c -+++ b/hw/milkymist-uart.c -@@ -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, -+ .fd_event = uart_event, -+}; -+ - static int milkymist_uart_init(SysBusDevice *dev) - { - MilkymistUartState *s = FROM_SYSBUS(typeof(*s), dev); -@@ -201,7 +207,7 @@ static int milkymist_uart_init(SysBusDevice *dev) - - s->chr = qemu_char_get_next_serial(); - 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 002a50e..3224bc9 100644 ---- a/hw/pl011.c -+++ b/hw/pl011.c -@@ -261,6 +261,12 @@ static const VMStateDescription vmstate_pl011 = { - } - }; - -+static const QemuChrHandlers pl011_handlers = { -+ .fd_can_read = pl011_can_receive, -+ .fd_read = pl011_receive, -+ .fd_event = pl011_event, -+}; -+ - static int pl011_init(SysBusDevice *dev, const unsigned char *id) - { - pl011_state *s = FROM_SYSBUS(pl011_state, dev); -@@ -276,8 +282,7 @@ static int pl011_init(SysBusDevice *dev, const unsigned char *id) - s->cr = 0x300; - s->flags = 0x90; - if (s->chr) { -- qemu_chr_add_handlers(s->chr, pl011_can_receive, pl011_receive, -- pl011_event, s); -+ qemu_chr_add_handlers(s->chr, &pl011_handlers, s); - } - vmstate_register(&dev->qdev, -1, &vmstate_pl011, s); - return 0; -diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c -index d303320..06f43d5 100644 ---- a/hw/pxa2xx.c -+++ b/hw/pxa2xx.c -@@ -1962,6 +1962,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, -+ .fd_event = pxa2xx_fir_event, -+}; -+ - static PXA2xxFIrState *pxa2xx_fir_init(MemoryRegion *sysmem, - hwaddr base, - qemu_irq irq, qemu_irq rx_dma, qemu_irq tx_dma, -@@ -1980,10 +1986,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); -- -+ if (chr) { -+ qemu_chr_add_handlers(chr, &pxa2xx_handlers, s); -+ } - register_savevm(NULL, "pxa2xx_fir", 0, 0, pxa2xx_fir_save, - pxa2xx_fir_load, s); - -diff --git a/hw/qdev-properties-system.c b/hw/qdev-properties-system.c -index ce3af22..dd37f58 100644 ---- a/hw/qdev-properties-system.c -+++ b/hw/qdev-properties-system.c -@@ -138,7 +138,7 @@ static void release_chr(Object *obj, const char *name, void *opaque) - CharDriverState **ptr = qdev_get_prop_ptr(dev, prop); - - if (*ptr) { -- qemu_chr_add_handlers(*ptr, NULL, NULL, NULL, NULL); -+ qemu_chr_add_handlers(*ptr, NULL, NULL); - } - } - -diff --git a/hw/s390x/sclpconsole.c b/hw/s390x/sclpconsole.c -index effe511..7a77d64 100644 ---- a/hw/s390x/sclpconsole.c -+++ b/hw/s390x/sclpconsole.c -@@ -238,6 +238,12 @@ static void trigger_ascii_console_data(void *env, int n, int level) - sclp_service_interrupt(0); - } - -+static const QemuChrHandlers sclp_chr_handlers = { -+ .fd_can_read = chr_can_read, -+ .fd_read = chr_read, -+ .fd_event = chr_event, -+}; -+ - /* qemu object creation and initialization functions */ - - /* tell character layer our call-back functions */ -@@ -254,8 +260,7 @@ static int console_init(SCLPEvent *event) - console_available = true; - event->event_type = SCLP_EVENT_ASCII_CONSOLE_DATA; - if (scon->chr) { -- qemu_chr_add_handlers(scon->chr, chr_can_read, -- chr_read, chr_event, scon); -+ qemu_chr_add_handlers(scon->chr, &sclp_chr_handlers, scon); - } - scon->irq_read_vt220 = *qemu_allocate_irqs(trigger_ascii_console_data, - NULL, 1); -diff --git a/hw/serial.c b/hw/serial.c -index f0ce9b0..589c18a 100644 ---- a/hw/serial.c -+++ b/hw/serial.c -@@ -674,6 +674,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, -+ .fd_event = serial_event, -+}; -+ - void serial_init_core(SerialState *s) - { - if (!s->chr) { -@@ -688,13 +694,12 @@ 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); - } - - void serial_exit_core(SerialState *s) - { -- qemu_chr_add_handlers(s->chr, NULL, NULL, NULL, NULL); -+ qemu_chr_add_handlers(s->chr, NULL, NULL); - qemu_unregister_reset(serial_reset, s); - } - -diff --git a/hw/sh_serial.c b/hw/sh_serial.c -index 21c5b13..1cae7e9 100644 ---- a/hw/sh_serial.c -+++ b/hw/sh_serial.c -@@ -352,6 +352,12 @@ static const MemoryRegionOps sh_serial_ops = { - .endianness = DEVICE_NATIVE_ENDIAN, - }; - -+static const QemuChrHandlers sh_serial_handlers = { -+ .fd_can_read = sh_serial_can_receive1, -+ .fd_read = sh_serial_receive1, -+ .fd_event = sh_serial_event, -+}; -+ - void sh_serial_init(MemoryRegion *sysmem, - hwaddr base, int feat, - uint32_t freq, CharDriverState *chr, -@@ -396,9 +402,9 @@ void sh_serial_init(MemoryRegion *sysmem, - - 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 5c63eaa..af2173a 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, -+}; -+ - static int spapr_vty_init(VIOsPAPRDevice *sdev) - { - VIOsPAPRVTYDevice *dev = (VIOsPAPRVTYDevice *)sdev; -@@ -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 -index ab736e3..9099a06 100644 ---- a/hw/strongarm.c -+++ b/hw/strongarm.c -@@ -1200,6 +1200,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, -+ .fd_event = strongarm_uart_event, -+}; -+ - static int strongarm_uart_init(SysBusDevice *dev) - { - StrongARMUARTState *s = FROM_SYSBUS(StrongARMUARTState, dev); -@@ -1212,11 +1218,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, -- strongarm_uart_receive, -- strongarm_uart_event, -- s); -+ qemu_chr_add_handlers(s->chr, &strongarm_uart_handlers, s); - } - - return 0; -diff --git a/hw/usb/dev-serial.c b/hw/usb/dev-serial.c -index 47ac8c9..2f8757f 100644 ---- a/hw/usb/dev-serial.c -+++ b/hw/usb/dev-serial.c -@@ -414,7 +414,7 @@ static void usb_serial_handle_destroy(USBDevice *dev) - { - USBSerialState *s = (USBSerialState *)dev; - -- qemu_chr_add_handlers(s->cs, NULL, NULL, NULL, NULL); -+ qemu_chr_add_handlers(s->cs, NULL, NULL); - } - - static int usb_serial_can_read(void *opaque) -@@ -478,6 +478,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, -+ .fd_event = usb_serial_event, -+}; -+ - static int usb_serial_initfn(USBDevice *dev) - { - USBSerialState *s = DO_UPCAST(USBSerialState, dev, dev); -@@ -491,8 +497,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); - usb_serial_handle_reset(dev); - - if (s->cs->opened && !dev->attached) { -diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c -index 8c0ead0..bb07c62 100644 ---- a/hw/usb/redirect.c -+++ b/hw/usb/redirect.c -@@ -1227,6 +1227,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, -+ .fd_event = usbredir_chardev_event, -+}; -+ - /* - * init + destroy - */ -@@ -1288,8 +1294,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); - - qemu_add_vm_change_state_handler(usbredir_vm_state_change, dev); - add_boot_device_path(dev->bootindex, &udev->qdev, NULL); -diff --git a/hw/virtio-console.c b/hw/virtio-console.c -index 46072a0..dd6f614 100644 ---- a/hw/virtio-console.c -+++ b/hw/virtio-console.c -@@ -106,6 +106,12 @@ static void chr_event(void *opaque, int event) - } - } - -+static const QemuChrHandlers chr_handlers = { -+ .fd_can_read = chr_can_read, -+ .fd_read = chr_read, -+ .fd_event = chr_event, -+}; -+ - static int virtconsole_initfn(VirtIOSerialPort *port) - { - VirtConsole *vcon = DO_UPCAST(VirtConsole, port, port); -@@ -117,8 +123,7 @@ static int virtconsole_initfn(VirtIOSerialPort *port) - } - - if (vcon->chr) { -- qemu_chr_add_handlers(vcon->chr, chr_can_read, chr_read, chr_event, -- vcon); -+ qemu_chr_add_handlers(vcon->chr, &chr_handlers, vcon); - } - - return 0; -diff --git a/hw/xen_console.c b/hw/xen_console.c -index 44141f8..db1eea5 100644 ---- a/hw/xen_console.c -+++ b/hw/xen_console.c -@@ -215,6 +215,11 @@ out: - return ret; - } - -+static const QemuChrHandlers xencons_handlers = { -+ .fd_can_read = xencons_can_receive, -+ .fd_read = xencons_receive, -+}; -+ - static int con_initialise(struct XenDevice *xendev) - { - struct XenConsole *con = container_of(xendev, struct XenConsole, xendev); -@@ -241,9 +246,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, -- NULL, con); -+ 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, -@@ -260,8 +265,9 @@ static void con_disconnect(struct XenDevice *xendev) - if (!xendev->dev) { - return; - } -- 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 9963982..f5e4cde 100644 ---- a/hw/xilinx_uartlite.c -+++ b/hw/xilinx_uartlite.c -@@ -192,6 +192,12 @@ static void uart_event(void *opaque, int event) - - } - -+static const QemuChrHandlers uart_handlers = { -+ .fd_can_read = uart_can_rx, -+ .fd_read = uart_rx, -+ .fd_event = uart_event, -+}; -+ - static int xilinx_uartlite_init(SysBusDevice *dev) - { - struct xlx_uartlite *s = FROM_SYSBUS(typeof (*s), dev); -@@ -204,8 +210,9 @@ static int xilinx_uartlite_init(SysBusDevice *dev) - sysbus_init_mmio(dev, &s->mmio); - - s->chr = qemu_char_get_next_serial(); -- if (s->chr) -- qemu_chr_add_handlers(s->chr, uart_can_rx, uart_rx, uart_event, s); -+ if (s->chr) { -+ qemu_chr_add_handlers(s->chr, &uart_handlers, s); -+ } - return 0; - } - -diff --git a/include/char/char.h b/include/char/char.h -index c91ce3c..3027cc1 100644 ---- a/include/char/char.h -+++ b/include/char/char.h -@@ -225,10 +225,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, -- IOEventHandler *fd_event, -+ -+typedef struct QemuChrHandlers { -+ IOCanReadHandler *fd_can_read; -+ IOReadHandler *fd_read; -+ IOHandler *fd_write_unblocked; -+ IOEventHandler *fd_event; -+} QemuChrHandlers; -+ -+void qemu_chr_add_handlers(CharDriverState *s, const QemuChrHandlers *handlers, - void *opaque); - - void qemu_chr_generic_open(CharDriverState *s); -diff --git a/monitor.c b/monitor.c -index 20bd19b..be83dd6 100644 ---- a/monitor.c -+++ b/monitor.c -@@ -4701,6 +4701,18 @@ static void sortcmdlist(void) - * End: - */ - -+static const QemuChrHandlers monitor_handlers = { -+ .fd_can_read = monitor_can_read, -+ .fd_read = monitor_read, -+ .fd_event = monitor_event, -+}; -+ -+static const QemuChrHandlers monitor_control_handlers = { -+ .fd_can_read = monitor_can_read, -+ .fd_read = monitor_control_read, -+ .fd_event = monitor_control_event, -+}; -+ - void monitor_init(CharDriverState *chr, int flags) - { - static int is_first_init = 1; -@@ -4723,14 +4735,12 @@ void monitor_init(CharDriverState *chr, int flags) - if (monitor_ctrl_mode(mon)) { - mon->mc = g_malloc0(sizeof(MonitorControl)); - /* Control mode requires special handlers */ -- qemu_chr_add_handlers(chr, monitor_can_read, monitor_control_read, -- monitor_control_event, mon); -+ qemu_chr_add_handlers(chr, &monitor_control_handlers, mon); - qemu_chr_fe_set_echo(chr, true); - - json_message_parser_init(&mon->mc->parser, handle_qmp_command); - } else { -- qemu_chr_add_handlers(chr, monitor_can_read, monitor_read, -- 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 4df550f..2868229 100644 ---- a/net/slirp.c -+++ b/net/slirp.c -@@ -595,6 +595,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, -+}; -+ - static int slirp_guestfwd(SlirpState *s, const char *config_str, - int legacy_format) - { -@@ -660,8 +665,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; - -diff --git a/qemu-char.c b/qemu-char.c -index ac2abeb..0c97bdf 100644 ---- a/qemu-char.c -+++ b/qemu-char.c -@@ -192,19 +192,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 */ -+}; -+ - void qemu_chr_add_handlers(CharDriverState *s, -- IOCanReadHandler *fd_can_read, -- IOReadHandler *fd_read, -- IOEventHandler *fd_event, -- void *opaque) -+ const QemuChrHandlers *handlers, void *opaque) - { -- if (!opaque && !fd_can_read && !fd_read && !fd_event) { -+ if (!s) { -+ return; -+ } -+ if (!opaque && !handlers) { - /* chr driver being released. */ - ++s->avail_connections; - } -- s->chr_can_read = fd_can_read; -- s->chr_read = fd_read; -- s->chr_event = fd_event; -+ if (!handlers) { -+ handlers = &null_handlers; -+ } -+ s->chr_can_read = handlers->fd_can_read; -+ s->chr_read = handlers->fd_read; -+ s->chr_event = handlers->fd_event; - s->handler_opaque = opaque; - if (s->chr_update_read_handler) - s->chr_update_read_handler(s); -@@ -442,6 +449,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, -+ .fd_event = mux_chr_event, -+}; -+ - static void mux_chr_update_read_handler(CharDriverState *chr) - { - MuxDriver *d = chr->opaque; -@@ -456,8 +469,7 @@ static void mux_chr_update_read_handler(CharDriverState *chr) - d->chr_event[d->mux_cnt] = chr->chr_event; - /* Fix up the real driver with mux routines */ - if (d->mux_cnt == 0) { -- qemu_chr_add_handlers(d->drv, mux_chr_can_read, mux_chr_read, -- mux_chr_event, chr); -+ qemu_chr_add_handlers(d->drv, &mux_chr_handlers, chr); - } - if (d->focus != -1) { - mux_chr_send_event(d, d->focus, CHR_EVENT_MUX_OUT); -diff --git a/qtest.c b/qtest.c -index 4663a38..eb8e7ef 100644 ---- a/qtest.c -+++ b/qtest.c -@@ -416,6 +416,13 @@ static void qtest_event(void *opaque, int event) - } - } - -+static const QemuChrHandlers test_handlers = { -+ .fd_can_read = qtest_can_read, -+ .fd_read = qtest_read, -+ .fd_event = qtest_event, -+}; -+ -+ - int qtest_init(void) - { - CharDriverState *chr; -@@ -425,7 +432,7 @@ int qtest_init(void) - configure_icount("0"); - chr = qemu_chr_new("qtest", qtest_chrdev, NULL); - -- qemu_chr_add_handlers(chr, qtest_can_read, qtest_read, qtest_event, chr); -+ qemu_chr_add_handlers(chr, &test_handlers, chr); - qemu_chr_fe_set_echo(chr, true); - - inbuf = g_string_new(""); diff --git a/0103-i8254-Fix-migration-from-qemu-kvm-1.1.patch b/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch similarity index 81% rename from 0103-i8254-Fix-migration-from-qemu-kvm-1.1.patch rename to 0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch index 317f6ea..44c1e8f 100644 --- a/0103-i8254-Fix-migration-from-qemu-kvm-1.1.patch +++ b/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch @@ -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 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 --- - 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, diff --git a/0003-iohandlers-Add-enable-disable_write_fd_handler-funct.patch b/0003-iohandlers-Add-enable-disable_write_fd_handler-funct.patch deleted file mode 100644 index 7c9c131..0000000 --- a/0003-iohandlers-Add-enable-disable_write_fd_handler-funct.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 64080f1b8983660b707ed8c0d10ace22e9b46f7a Mon Sep 17 00:00:00 2001 -From: Amit Shah -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 -Signed-off-by: Cole Robinson ---- - 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(). */ diff --git a/0004-char-Add-framework-for-a-write-unblocked-callback.patch b/0004-char-Add-framework-for-a-write-unblocked-callback.patch deleted file mode 100644 index 4a41a18..0000000 --- a/0004-char-Add-framework-for-a-write-unblocked-callback.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 84877040f31425a8fecdbee19cb24fcc5a8212df Mon Sep 17 00:00:00 2001 -From: Amit Shah -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 -Signed-off-by: Cole Robinson ---- - 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) { diff --git a/0104-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch b/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch similarity index 80% rename from 0104-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch rename to 0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch index 1d39ec0..820e99d 100644 --- a/0104-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch +++ b/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch @@ -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 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 --- - 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",\ diff --git a/0005-char-Update-send_all-to-handle-nonblocking-chardev-w.patch b/0005-char-Update-send_all-to-handle-nonblocking-chardev-w.patch deleted file mode 100644 index b8f1f78..0000000 --- a/0005-char-Update-send_all-to-handle-nonblocking-chardev-w.patch +++ /dev/null @@ -1,178 +0,0 @@ -From c7e9b2a5b981209f4e77b26562758663cc060900 Mon Sep 17 00:00:00 2001 -From: Amit Shah -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 -Signed-off-by: Cole Robinson ---- - 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; diff --git a/0105-qxl-Add-rom_size-compat-property-fix-migration-from-.patch b/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch similarity index 79% rename from 0105-qxl-Add-rom_size-compat-property-fix-migration-from-.patch rename to 0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch index e98bba9..4fa4a8b 100644 --- a/0105-qxl-Add-rom_size-compat-property-fix-migration-from-.patch +++ b/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch @@ -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 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 --- - 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 = { diff --git a/0006-char-Equip-the-unix-tcp-backend-to-handle-nonblockin.patch b/0006-char-Equip-the-unix-tcp-backend-to-handle-nonblockin.patch deleted file mode 100644 index 62bcd1b..0000000 --- a/0006-char-Equip-the-unix-tcp-backend-to-handle-nonblockin.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 6540bebbaa749d405df91516e1ca5a075e354628 Mon Sep 17 00:00:00 2001 -From: Amit Shah -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 -Signed-off-by: Cole Robinson ---- - 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 { diff --git a/0007-virtio-console-Enable-port-throttling-when-chardev-i.patch b/0007-virtio-console-Enable-port-throttling-when-chardev-i.patch deleted file mode 100644 index 3f57b0b..0000000 --- a/0007-virtio-console-Enable-port-throttling-when-chardev-i.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 33f3874dc760f0960d408be2f916d04373de543b Mon Sep 17 00:00:00 2001 -From: Amit Shah -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 -Signed-off-by: Cole Robinson ---- - 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) diff --git a/0008-spice-qemu-char.c-add-throttling.patch b/0008-spice-qemu-char.c-add-throttling.patch deleted file mode 100644 index b73b620..0000000 --- a/0008-spice-qemu-char.c-add-throttling.patch +++ /dev/null @@ -1,132 +0,0 @@ -From aa0a2c94c70ae5ed0fb215328c8ecebbef10cbe9 Mon Sep 17 00:00:00 2001 -From: Alon Levy -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 ---- - 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); - diff --git a/0009-spice-qemu-char.c-remove-intermediate-buffer.patch b/0009-spice-qemu-char.c-remove-intermediate-buffer.patch deleted file mode 100644 index a5ded75..0000000 --- a/0009-spice-qemu-char.c-remove-intermediate-buffer.patch +++ /dev/null @@ -1,70 +0,0 @@ -From de979c48aa4b5e7f3f8658f9ac69030f3de3c99c Mon Sep 17 00:00:00 2001 -From: Alon Levy -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 ---- - 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; diff --git a/0010-usb-redir-Add-flow-control-support.patch b/0010-usb-redir-Add-flow-control-support.patch deleted file mode 100644 index 5ff7b70..0000000 --- a/0010-usb-redir-Add-flow-control-support.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 1e87b85766f9c18a2f9dffd289c0e56d640637c4 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 19 Jul 2011 10:56:19 +0200 -Subject: [PATCH] usb-redir: Add flow control support - -Signed-off-by: Hans de Goede ---- - 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, - }; - - /* diff --git a/0011-char-Disable-write-callback-if-throttled-chardev-is-.patch b/0011-char-Disable-write-callback-if-throttled-chardev-is-.patch deleted file mode 100644 index b686ccd..0000000 --- a/0011-char-Disable-write-callback-if-throttled-chardev-is-.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 42931bebb2856307dcdc9babc5dd9954b60c8094 Mon Sep 17 00:00:00 2001 -From: Amit Shah -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 -Signed-off-by: Cole Robinson ---- - 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; diff --git a/0012-hw-virtio-serial-bus-replay-guest-open-on-destinatio.patch b/0012-hw-virtio-serial-bus-replay-guest-open-on-destinatio.patch deleted file mode 100644 index 078cf15..0000000 --- a/0012-hw-virtio-serial-bus-replay-guest-open-on-destinatio.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 81ab56732f4990c288c88a545925dc4431c313d2 Mon Sep 17 00:00:00 2001 -From: Alon Levy -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); diff --git a/0106-docs-Fix-generating-qemu-doc.html-with-texinfo-5.patch b/0106-docs-Fix-generating-qemu-doc.html-with-texinfo-5.patch deleted file mode 100644 index 22b31bf..0000000 --- a/0106-docs-Fix-generating-qemu-doc.html-with-texinfo-5.patch +++ /dev/null @@ -1,46 +0,0 @@ -From f76e7a03ac948a7649878d7ddbb02ace0f6e3625 Mon Sep 17 00:00:00 2001 -From: Cole Robinson -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 ---- - 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:'' -- --``sheepdog::'' -- --``sheepdog::'' -- --``sheepdog:::'' -- --``sheepdog::::'' -- --``sheepdog::::'' -+@table @code -+@item sheepdog: -+@item sheepdog:: -+@item sheepdog:: -+@item sheepdog::: -+@item sheepdog:::: -+@item sheepdog:::: - @end table - - Example diff --git a/0107-usb-redir-Fix-crash-on-migration-with-no-client-conn.patch b/0107-usb-redir-Fix-crash-on-migration-with-no-client-conn.patch deleted file mode 100644 index c8b87a0..0000000 --- a/0107-usb-redir-Fix-crash-on-migration-with-no-client-conn.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 106a39c50211b7c7e96ffb47ad9deae5d9be6d84 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -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 -Signed-off-by: Gerd Hoffmann -(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; diff --git a/qemu.spec b/qemu.spec index c58ae55..515a669 100644 --- a/qemu.spec +++ b/qemu.spec @@ -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 - 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 - 2:1.4.1-3 - Drop loading of vhost-net module (bz #963198) diff --git a/sources b/sources index fc2703b..56d3af3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -eb2d696956324722b5ecfa46e41f9a75 qemu-1.4.1.tar.bz2 +b6f3265b8ed39d77e8f354f35cc26e16 qemu-1.5.0.tar.bz2 From b9a8d0404003f1f8b89ab80dc8bda1eab771c68e Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 21 May 2013 14:51:10 -0400 Subject: [PATCH 02/45] Add BuildRequires: gettext --- qemu.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu.spec b/qemu.spec index 515a669..da94f27 100644 --- a/qemu.spec +++ b/qemu.spec @@ -261,6 +261,8 @@ BuildRequires: libssh2-devel BuildRequires: gtk3-devel BuildRequires: vte3-devel %endif +# GTK translations +BuildRequires: gettext %if 0%{?user:1} From 979ec189488cbf5f5a97b2fe007bc5adcaeefb9d Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sat, 25 May 2013 14:54:03 -0400 Subject: [PATCH 03/45] Alias qemu-system-* man page to qemu.1 (bz #907746) Drop execute bit on service files (bz #963917) Conditionalize KSM service on host virt support (bz #963681) Split out KSM package, make it not pulled in by default --- ksm.service | 1 + ksmtuned.service | 1 + qemu.spec | 77 +++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 65 insertions(+), 14 deletions(-) diff --git a/ksm.service b/ksm.service index ccc2767..018b744 100644 --- a/ksm.service +++ b/ksm.service @@ -1,6 +1,7 @@ [Unit] Description=Kernel Samepage Merging ConditionPathExists=/sys/kernel/mm/ksm +ConditionVirtualization=no [Service] Type=oneshot diff --git a/ksmtuned.service b/ksmtuned.service index 39febcc..09dffa1 100644 --- a/ksmtuned.service +++ b/ksmtuned.service @@ -2,6 +2,7 @@ Description=Kernel Samepage Merging (KSM) Tuning Daemon After=ksm.service Requires=ksm.service +ConditionVirtualization=no [Service] ExecStart=/usr/sbin/ksmtuned diff --git a/qemu.spec b/qemu.spec index da94f27..f0eb61f 100644 --- a/qemu.spec +++ b/qemu.spec @@ -134,7 +134,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.0 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -399,6 +399,19 @@ This package does not need to be installed on the host OS. %systemd_postun_with_restart qemu-guest-agent.service +%package -n ksm +Summary: Kernel Samepage Merging services +Group: Development/Tools +Requires: %{name}-common = %{epoch}:%{version}-%{release} +Requires(post): systemd-units +Requires(postun): systemd-units +%description -n ksm +Kernel Samepage Merging (KSM) is a memory-saving de-duplication feature, +that merges anonymous (private) pages (not pagecache ones). + +This package provides service files for disabling and tuning KSM. + + %if 0%{?user:1} %package %{user} Summary: QEMU user mode emulation of qemu targets @@ -754,11 +767,11 @@ gcc %{SOURCE6} -O2 -g -o ksmctl %define _udevdir /lib/udev/rules.d -install -D -p -m 0755 %{SOURCE4} $RPM_BUILD_ROOT/lib/systemd/system/ksm.service +install -D -p -m 0744 %{SOURCE4} $RPM_BUILD_ROOT/lib/systemd/system/ksm.service install -D -p -m 0644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ksm install -D -p -m 0755 ksmctl $RPM_BUILD_ROOT/lib/systemd/ksmctl -install -D -p -m 0755 %{SOURCE7} $RPM_BUILD_ROOT/lib/systemd/system/ksmtuned.service +install -D -p -m 0744 %{SOURCE7} $RPM_BUILD_ROOT/lib/systemd/system/ksmtuned.service install -D -p -m 0755 %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}/ksmtuned install -D -p -m 0644 %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/ksmtuned.conf @@ -790,6 +803,10 @@ rm $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}.stp chmod -x ${RPM_BUILD_ROOT}%{_mandir}/man1/* install -D -p -m 0644 -t ${RPM_BUILD_ROOT}%{qemudocdir} Changelog README COPYING COPYING.LIB LICENSE +for emu in $RPM_BUILD_ROOT%{_bindir}/qemu-system-*; do + ln -sf qemu.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $emu).1.gz +done +ln -sf qemu.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/qemu-kvm.1.gz install -D -p -m 0644 qemu.sasl $RPM_BUILD_ROOT%{_sysconfdir}/sasl2/qemu.conf @@ -955,22 +972,19 @@ udevadm trigger --subsystem-match=misc --sysname-match=kvm --action=add || : %if %{without separate_kvm} %post common -%systemd_post ksm.service -%systemd_post ksmtuned.service - getent group kvm >/dev/null || groupadd -g 36 -r kvm getent group qemu >/dev/null || groupadd -g 107 -r qemu getent passwd qemu >/dev/null || \ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ -c "qemu user" qemu - -%preun common +%post -n ksm +%systemd_post ksm.service +%systemd_post ksmtuned.service +%preun -n ksm %systemd_preun ksm.service %systemd_preun ksmtuned.service - - -%postun common +%postun -n ksm %systemd_postun_with_restart ksm.service %systemd_postun_with_restart ksmtuned.service %endif @@ -992,7 +1006,8 @@ getent passwd qemu >/dev/null || \ %if 0%{?need_qemu_kvm} %global qemu_kvm_files \ -%{_bindir}/qemu-kvm +%{_bindir}/qemu-kvm \ +%{_mandir}/man1/qemu-kvm.1* %endif %files @@ -1022,7 +1037,11 @@ getent passwd qemu >/dev/null || \ %{_bindir}/virtfs-proxy-helper %{_libexecdir}/qemu-bridge-helper %config(noreplace) %{_sysconfdir}/sasl2/qemu.conf +%dir %{_sysconfdir}/qemu +%config(noreplace) %{_sysconfdir}/qemu/bridge.conf + %if %{without separate_kvm} +%files -n ksm /lib/systemd/system/ksm.service /lib/systemd/ksmctl %config(noreplace) %{_sysconfdir}/sysconfig/ksm @@ -1030,8 +1049,6 @@ getent passwd qemu >/dev/null || \ %{_sbindir}/ksmtuned %config(noreplace) %{_sysconfdir}/ksmtuned.conf %endif -%dir %{_sysconfdir}/qemu -%config(noreplace) %{_sysconfdir}/qemu/bridge.conf %if %{without separate_kvm} %files guest-agent @@ -1108,6 +1125,8 @@ getent passwd qemu >/dev/null || \ %{_bindir}/qemu-system-x86_64 %{_datadir}/systemtap/tapset/qemu-system-i386.stp %{_datadir}/systemtap/tapset/qemu-system-x86_64.stp +%{_mandir}/man1/qemu-system-i386.1* +%{_mandir}/man1/qemu-system-x86_64.1* %endif %{_datadir}/%{name}/acpi-dsdt.aml %{_datadir}/%{name}/q35-acpi-dsdt.aml @@ -1151,6 +1170,7 @@ getent passwd qemu >/dev/null || \ %defattr(-,root,root) %{_bindir}/qemu-system-alpha %{_datadir}/systemtap/tapset/qemu-system-alpha.stp +%{_mandir}/man1/qemu-system-alpha.1* %{_datadir}/%{name}/palcode-clipper %endif @@ -1159,6 +1179,7 @@ getent passwd qemu >/dev/null || \ %defattr(-,root,root) %{_bindir}/qemu-system-arm %{_datadir}/systemtap/tapset/qemu-system-arm.stp +%{_mandir}/man1/qemu-system-arm.1* %endif %if 0%{?system_mips:1} @@ -1172,6 +1193,10 @@ getent passwd qemu >/dev/null || \ %{_datadir}/systemtap/tapset/qemu-system-mipsel.stp %{_datadir}/systemtap/tapset/qemu-system-mips64el.stp %{_datadir}/systemtap/tapset/qemu-system-mips64.stp +%{_mandir}/man1/qemu-system-mips.1* +%{_mandir}/man1/qemu-system-mipsel.1* +%{_mandir}/man1/qemu-system-mips64el.1* +%{_mandir}/man1/qemu-system-mips64.1* %endif %if 0%{?system_cris:1} @@ -1179,6 +1204,7 @@ getent passwd qemu >/dev/null || \ %defattr(-,root,root) %{_bindir}/qemu-system-cris %{_datadir}/systemtap/tapset/qemu-system-cris.stp +%{_mandir}/man1/qemu-system-cris.1* %endif %if 0%{?system_lm32:1} @@ -1186,6 +1212,7 @@ getent passwd qemu >/dev/null || \ %defattr(-,root,root) %{_bindir}/qemu-system-lm32 %{_datadir}/systemtap/tapset/qemu-system-lm32.stp +%{_mandir}/man1/qemu-system-lm32.1* %endif %if 0%{?system_m68k:1} @@ -1193,6 +1220,7 @@ getent passwd qemu >/dev/null || \ %defattr(-,root,root) %{_bindir}/qemu-system-m68k %{_datadir}/systemtap/tapset/qemu-system-m68k.stp +%{_mandir}/man1/qemu-system-m68k.1* %endif %if 0%{?system_microblaze:1} @@ -1202,6 +1230,8 @@ getent passwd qemu >/dev/null || \ %{_bindir}/qemu-system-microblazeel %{_datadir}/systemtap/tapset/qemu-system-microblaze.stp %{_datadir}/systemtap/tapset/qemu-system-microblazeel.stp +%{_mandir}/man1/qemu-system-microblaze.1* +%{_mandir}/man1/qemu-system-microblazeel.1* %{_datadir}/%{name}/petalogix*.dtb %endif @@ -1210,6 +1240,7 @@ getent passwd qemu >/dev/null || \ %defattr(-,root,root) %{_bindir}/qemu-system-or32 %{_datadir}/systemtap/tapset/qemu-system-or32.stp +%{_mandir}/man1/qemu-system-or32.1* %endif %if 0%{?system_s390x:1} @@ -1217,6 +1248,7 @@ getent passwd qemu >/dev/null || \ %defattr(-,root,root) %{_bindir}/qemu-system-s390x %{_datadir}/systemtap/tapset/qemu-system-s390x.stp +%{_mandir}/man1/qemu-system-s390x.1* %{_datadir}/%{name}/s390-zipl.rom %{_datadir}/%{name}/s390-ccw.img %ifarch s390x @@ -1232,6 +1264,8 @@ getent passwd qemu >/dev/null || \ %{_bindir}/qemu-system-sh4eb %{_datadir}/systemtap/tapset/qemu-system-sh4.stp %{_datadir}/systemtap/tapset/qemu-system-sh4eb.stp +%{_mandir}/man1/qemu-system-sh4.1* +%{_mandir}/man1/qemu-system-sh4eb.1* %endif %if 0%{?system_sparc:1} @@ -1241,6 +1275,8 @@ getent passwd qemu >/dev/null || \ %{_bindir}/qemu-system-sparc64 %{_datadir}/systemtap/tapset/qemu-system-sparc.stp %{_datadir}/systemtap/tapset/qemu-system-sparc64.stp +%{_mandir}/man1/qemu-system-sparc.1* +%{_mandir}/man1/qemu-system-sparc64.1* %endif %if 0%{?system_ppc:1} @@ -1253,6 +1289,9 @@ getent passwd qemu >/dev/null || \ %{_datadir}/systemtap/tapset/qemu-system-ppc.stp %{_datadir}/systemtap/tapset/qemu-system-ppc64.stp %{_datadir}/systemtap/tapset/qemu-system-ppcemb.stp +%{_mandir}/man1/qemu-system-ppc.1* +%{_mandir}/man1/qemu-system-ppc64.1* +%{_mandir}/man1/qemu-system-ppcemb.1* %endif %{_datadir}/%{name}/bamboo.dtb %{_datadir}/%{name}/ppc_rom.bin @@ -1268,6 +1307,7 @@ getent passwd qemu >/dev/null || \ %defattr(-,root,root) %{_bindir}/qemu-system-unicore32 %{_datadir}/systemtap/tapset/qemu-system-unicore32.stp +%{_mandir}/man1/qemu-system-unicore32.1* %endif %if 0%{?system_xtensa:1} @@ -1277,6 +1317,8 @@ getent passwd qemu >/dev/null || \ %{_bindir}/qemu-system-xtensaeb %{_datadir}/systemtap/tapset/qemu-system-xtensa.stp %{_datadir}/systemtap/tapset/qemu-system-xtensaeb.stp +%{_mandir}/man1/qemu-system-xtensa.1* +%{_mandir}/man1/qemu-system-xtensaeb.1* %endif %if 0%{?system_moxie:1} @@ -1284,6 +1326,7 @@ getent passwd qemu >/dev/null || \ %defattr(-,root,root) %{_bindir}/qemu-system-moxie %{_datadir}/systemtap/tapset/qemu-system-moxie.stp +%{_mandir}/man1/qemu-system-moxie.1* %endif %if %{without separate_kvm} @@ -1312,6 +1355,12 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Sat May 25 2013 Cole Robinson - 2:1.5.0-2 +- Alias qemu-system-* man page to qemu.1 (bz #907746) +- Drop execute bit on service files (bz #963917) +- Conditionalize KSM service on host virt support (bz #963681) +- Split out KSM package, make it not pulled in by default + * Tue May 21 2013 Cole Robinson - 2:1.5.0-1 - Update to qemu 1.5 - KVM for ARM support From f81e73803f7b26d2c25f4199f2ce997708b72a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Mon, 27 May 2013 14:30:37 +0200 Subject: [PATCH 04/45] - Install the qemu-kvm.1 man page only on arches with kvm --- qemu.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index f0eb61f..8d9bce3 100644 --- a/qemu.spec +++ b/qemu.spec @@ -134,7 +134,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.0 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -806,7 +806,9 @@ install -D -p -m 0644 -t ${RPM_BUILD_ROOT}%{qemudocdir} Changelog README COPYING for emu in $RPM_BUILD_ROOT%{_bindir}/qemu-system-*; do ln -sf qemu.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $emu).1.gz done +%if 0%{?need_qemu_kvm} ln -sf qemu.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/qemu-kvm.1.gz +%endif install -D -p -m 0644 qemu.sasl $RPM_BUILD_ROOT%{_sysconfdir}/sasl2/qemu.conf @@ -1355,6 +1357,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Mon May 27 2013 Dan Horák - 2:1.5.0-3 +- Install the qemu-kvm.1 man page only on arches with kvm + * Sat May 25 2013 Cole Robinson - 2:1.5.0-2 - Alias qemu-system-* man page to qemu.1 (bz #907746) - Drop execute bit on service files (bz #963917) From 441340007b52c3c68b74bd59ec8bf54293b681ba Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sat, 1 Jun 2013 23:30:46 +0100 Subject: [PATCH 05/45] build qemu-kvm on ARMv7 --- qemu.spec | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/qemu.spec b/qemu.spec index 8d9bce3..0abe1e5 100644 --- a/qemu.spec +++ b/qemu.spec @@ -45,9 +45,9 @@ %global SLOF_gittagdate 20130430 %if %{without separate_kvm} -%global kvm_archs %{ix86} x86_64 ppc64 s390x +%global kvm_archs %{ix86} x86_64 ppc64 s390x armv7hl %else -%global kvm_archs %{ix86} ppc64 s390x +%global kvm_archs %{ix86} ppc64 s390x armv7hl %endif %if %{with exclusive_x86_64} %global kvm_archs x86_64 @@ -100,6 +100,12 @@ %global kvm_target s390x %global need_kvm_modfile 1 %endif +%ifarch armv7hl +%global system_arm kvm +%global kvm_package system-arm +%global kvm_target arm +%global need_qemu_kvm 1 +%endif %if %{with kvmonly} # If kvmonly, put the qemu-kvm binary in the qemu-kvm package @@ -134,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.0 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -1154,7 +1160,7 @@ getent passwd qemu >/dev/null || \ %{_datadir}/%{name}/efi-ne2k_pci.rom %config(noreplace) %{_sysconfdir}/qemu/target-x86_64.conf %if %{without separate_kvm} -%ifarch %{ix86} x86_64 +%ifarch %{ix86} x86_64 %{arm} %{?kvm_files:} %{?qemu_kvm_files:} %endif @@ -1182,6 +1188,7 @@ getent passwd qemu >/dev/null || \ %{_bindir}/qemu-system-arm %{_datadir}/systemtap/tapset/qemu-system-arm.stp %{_mandir}/man1/qemu-system-arm.1* +%{?kvm_files:} %endif %if 0%{?system_mips:1} @@ -1357,6 +1364,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Sat Jun 1 2013 Peter Robinson 2:1.5.0-4 +- build qemu-kvm on ARMv7 + * Mon May 27 2013 Dan Horák - 2:1.5.0-3 - Install the qemu-kvm.1 man page only on arches with kvm From e1f7cc577f04d7248e97921c025468951794a7ad Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 11 Jun 2013 16:56:15 -0400 Subject: [PATCH 06/45] Fix rtl8139 + windows 7 + large transfers (bz #970240) --- qemu.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index 0abe1e5..5287056 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.0 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -188,6 +188,8 @@ 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) Patch0005: 0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch +# Fix rtl8139 + windows 7 + large transfers (bz #970240) +Patch0006: 0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -684,6 +686,8 @@ CAC emulation development files. %patch0004 -p1 # Fix migration w/ qxl from qemu-kvm 1.2 (solution pending upstream) %patch0005 -p1 +# Fix rtl8139 + windows 7 + large transfers (bz #970240) +%patch0006 -p1 %build @@ -1364,6 +1368,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Jun 11 2013 Cole Robinson - 2:1.5.0-5 +- Fix rtl8139 + windows 7 + large transfers (bz #970240) + * Sat Jun 1 2013 Peter Robinson 2:1.5.0-4 - build qemu-kvm on ARMv7 From 77dc39eae64e5d85ed641e01a4fe125a55264871 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 11 Jun 2013 17:12:46 -0400 Subject: [PATCH 07/45] Add forgotten patch --- ...eued-packets-when-RxBufPtr-is-writte.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch diff --git a/0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch b/0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch new file mode 100644 index 0000000..9b9fb4a --- /dev/null +++ b/0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch @@ -0,0 +1,47 @@ +From 4044e0670486ad089367952843f17351c4f6faa0 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Wed, 22 May 2013 14:50:18 +0200 +Subject: [PATCH] rtl8139: flush queued packets when RxBufPtr is written + +Net queues support efficient "receive disable". For example, tap's file +descriptor will not be polled while its peer has receive disabled. This +saves CPU cycles for needlessly copying and then dropping packets which +the peer cannot receive. + +rtl8139 is missing the qemu_flush_queued_packets() call that wakes the +queue up when receive becomes possible again. + +As a result, the Windows 7 guest driver reaches a state where the +rtl8139 cannot receive packets. The driver has actually refilled the +receive buffer but we never resume reception. + +The bug can be reproduced by running a large FTP 'get' inside a Windows +7 guest: + + $ qemu -netdev tap,id=tap0,... + -device rtl8139,netdev=tap0 + +The Linux guest driver does not trigger the bug, probably due to a +different buffer management strategy. + +Reported-by: Oliver Francke +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 00b7ade807b5ce6779ddd86ce29c5521ec5c529a) +--- + hw/net/rtl8139.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c +index 9369507..7993f9f 100644 +--- a/hw/net/rtl8139.c ++++ b/hw/net/rtl8139.c +@@ -2575,6 +2575,9 @@ static void rtl8139_RxBufPtr_write(RTL8139State *s, uint32_t val) + /* this value is off by 16 */ + s->RxBufPtr = MOD2(val + 0x10, s->RxBufferSize); + ++ /* more buffer space may be available so try to receive */ ++ qemu_flush_queued_packets(qemu_get_queue(s->nic)); ++ + DPRINTF(" CAPR write: rx buffer length %d head 0x%04x read 0x%04x\n", + s->RxBufferSize, s->RxBufAddr, s->RxBufPtr); + } From 05409c73811a8b2388be249fed7e95860737f883 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 12 Jun 2013 12:37:46 -0400 Subject: [PATCH 08/45] Fix build with rawhide libfdt --- ...Remove-libfdt_env-use-system-version.patch | 54 +++++++++++++++++++ qemu.spec | 9 +++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 0007-Remove-libfdt_env-use-system-version.patch diff --git a/0007-Remove-libfdt_env-use-system-version.patch b/0007-Remove-libfdt_env-use-system-version.patch new file mode 100644 index 0000000..b9d078b --- /dev/null +++ b/0007-Remove-libfdt_env-use-system-version.patch @@ -0,0 +1,54 @@ +From f93b077671cbdabd16fc05bb33d9e49110fb0e63 Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Wed, 12 Jun 2013 12:33:48 -0400 +Subject: [PATCH] Remove libfdt_env, use system version + +Seems to conflict with newer libfdt, see discussion here: +https://bugzilla.redhat.com/show_bug.cgi?id=969955 +--- + include/libfdt_env.h | 36 ------------------------------------ + 1 file changed, 36 deletions(-) + delete mode 100644 include/libfdt_env.h + +diff --git a/include/libfdt_env.h b/include/libfdt_env.h +deleted file mode 100644 +index 3667d4c..0000000 +--- a/include/libfdt_env.h ++++ /dev/null +@@ -1,36 +0,0 @@ +-/* +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License, version 2, as +- * published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, see . +- * +- * Copyright IBM Corp. 2008 +- * Authors: Hollis Blanchard +- * +- */ +- +-#ifndef _LIBFDT_ENV_H +-#define _LIBFDT_ENV_H +- +-#include "qemu/bswap.h" +- +-#ifdef HOST_WORDS_BIGENDIAN +-#define fdt32_to_cpu(x) (x) +-#define cpu_to_fdt32(x) (x) +-#define fdt64_to_cpu(x) (x) +-#define cpu_to_fdt64(x) (x) +-#else +-#define fdt32_to_cpu(x) bswap32(x) +-#define cpu_to_fdt32(x) bswap32(x) +-#define fdt64_to_cpu(x) bswap64(x) +-#define cpu_to_fdt64(x) bswap64(x) +-#endif +- +-#endif /* _LIBFDT_ENV_H */ diff --git a/qemu.spec b/qemu.spec index 5287056..5941b7c 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.0 -Release: 5%{?dist} +Release: 6%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -190,6 +190,8 @@ Patch0004: 0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch Patch0005: 0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch # Fix rtl8139 + windows 7 + large transfers (bz #970240) Patch0006: 0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch +# Fix build with rawhide libfdt +Patch0007: 0007-Remove-libfdt_env-use-system-version.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -688,6 +690,8 @@ CAC emulation development files. %patch0005 -p1 # Fix rtl8139 + windows 7 + large transfers (bz #970240) %patch0006 -p1 +# Fix build with rawhide libfdt +%patch0007 -p1 %build @@ -1368,6 +1372,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Wed Jun 12 2013 Cole Robinson - 2:1.5.0-6 +- Fix build with rawhide libfdt + * Tue Jun 11 2013 Cole Robinson - 2:1.5.0-5 - Fix rtl8139 + windows 7 + large transfers (bz #970240) From 562b652dea1b96dbed191a8629313a524c715701 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Thu, 13 Jun 2013 14:57:15 -0400 Subject: [PATCH 09/45] Fix build with both new and old fdt --- ...Remove-libfdt_env-use-system-version.patch | 54 ------------- ...ded-header-file-from-upstream-to-fix.patch | 80 +++++++++++++++++++ qemu.spec | 7 +- 3 files changed, 85 insertions(+), 56 deletions(-) delete mode 100644 0007-Remove-libfdt_env-use-system-version.patch create mode 100644 0007-fdt-update-embedded-header-file-from-upstream-to-fix.patch diff --git a/0007-Remove-libfdt_env-use-system-version.patch b/0007-Remove-libfdt_env-use-system-version.patch deleted file mode 100644 index b9d078b..0000000 --- a/0007-Remove-libfdt_env-use-system-version.patch +++ /dev/null @@ -1,54 +0,0 @@ -From f93b077671cbdabd16fc05bb33d9e49110fb0e63 Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Wed, 12 Jun 2013 12:33:48 -0400 -Subject: [PATCH] Remove libfdt_env, use system version - -Seems to conflict with newer libfdt, see discussion here: -https://bugzilla.redhat.com/show_bug.cgi?id=969955 ---- - include/libfdt_env.h | 36 ------------------------------------ - 1 file changed, 36 deletions(-) - delete mode 100644 include/libfdt_env.h - -diff --git a/include/libfdt_env.h b/include/libfdt_env.h -deleted file mode 100644 -index 3667d4c..0000000 ---- a/include/libfdt_env.h -+++ /dev/null -@@ -1,36 +0,0 @@ --/* -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License, version 2, as -- * published by the Free Software Foundation. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, see . -- * -- * Copyright IBM Corp. 2008 -- * Authors: Hollis Blanchard -- * -- */ -- --#ifndef _LIBFDT_ENV_H --#define _LIBFDT_ENV_H -- --#include "qemu/bswap.h" -- --#ifdef HOST_WORDS_BIGENDIAN --#define fdt32_to_cpu(x) (x) --#define cpu_to_fdt32(x) (x) --#define fdt64_to_cpu(x) (x) --#define cpu_to_fdt64(x) (x) --#else --#define fdt32_to_cpu(x) bswap32(x) --#define cpu_to_fdt32(x) bswap32(x) --#define fdt64_to_cpu(x) bswap64(x) --#define cpu_to_fdt64(x) bswap64(x) --#endif -- --#endif /* _LIBFDT_ENV_H */ diff --git a/0007-fdt-update-embedded-header-file-from-upstream-to-fix.patch b/0007-fdt-update-embedded-header-file-from-upstream-to-fix.patch new file mode 100644 index 0000000..bf86b54 --- /dev/null +++ b/0007-fdt-update-embedded-header-file-from-upstream-to-fix.patch @@ -0,0 +1,80 @@ +From 53800f1a71cdbc9e0deadd00e77d5d60a45ab999 Mon Sep 17 00:00:00 2001 +From: Andre Przywara +Date: Tue, 7 May 2013 14:36:59 +0200 +Subject: [PATCH] fdt: update embedded header file from upstream to fix + compilation + +Upstream dtc.git introduced a change in libfdt_env.h, which breaks +compilation with QEMU's version of it: + + CC arm-softmmu/device_tree.o +In file included from /usr/include/libfdt.h:55:0, + from /src/qemu.git/device_tree.c:28: +/usr/include/fdt.h:7:2: error: unknown type name 'fdt32_t' + ... + +The culprit is: +commit feafcd972cb744750a65728440c99526e6199a6d +Author: Kim Phillips +Date: Wed Nov 28 17:33:01 2012 -0600 + + dtc/libfdt: introduce fdt types for annotation by endian checkers + ... + +Pull the new definitions into QEMU's version of the file. This change +also works with older installed versions of dtc. +The upstream version got a "GPL or BSD" dual license header meanwhile. +I retained the original GPL license header from QEMU, only added +the original copyrights. + +Signed-off-by: Andre Przywara +--- + include/libfdt_env.h | 25 ++++++++++++++++++++----- + 1 file changed, 20 insertions(+), 5 deletions(-) + +diff --git a/include/libfdt_env.h b/include/libfdt_env.h +index 3667d4c..aad54bb 100644 +--- a/include/libfdt_env.h ++++ b/include/libfdt_env.h +@@ -1,4 +1,12 @@ ++#ifndef _LIBFDT_ENV_H ++#define _LIBFDT_ENV_H + /* ++ * libfdt - Flat Device Tree manipulation ++ * Copyright (C) 2006 David Gibson, IBM Corporation. ++ * Copyright 2012 Kim Phillips, Freescale Semiconductor. ++ * Adaptation to QEMU: Copyright IBM Corp. 2008 ++ * by Hollis Blanchard ++ * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation. +@@ -11,16 +19,23 @@ + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + * +- * Copyright IBM Corp. 2008 +- * Authors: Hollis Blanchard + * + */ + +-#ifndef _LIBFDT_ENV_H +-#define _LIBFDT_ENV_H +- + #include "qemu/bswap.h" + ++#ifdef __CHECKER__ ++#define __force __attribute__((force)) ++#define __bitwise __attribute__((bitwise)) ++#else ++#define __force ++#define __bitwise ++#endif ++ ++typedef uint16_t __bitwise fdt16_t; ++typedef uint32_t __bitwise fdt32_t; ++typedef uint64_t __bitwise fdt64_t; ++ + #ifdef HOST_WORDS_BIGENDIAN + #define fdt32_to_cpu(x) (x) + #define cpu_to_fdt32(x) (x) diff --git a/qemu.spec b/qemu.spec index 5941b7c..4204095 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.0 -Release: 6%{?dist} +Release: 7%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -191,7 +191,7 @@ Patch0005: 0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch # Fix rtl8139 + windows 7 + large transfers (bz #970240) Patch0006: 0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch # Fix build with rawhide libfdt -Patch0007: 0007-Remove-libfdt_env-use-system-version.patch +Patch0007: 0007-fdt-update-embedded-header-file-from-upstream-to-fix.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -1372,6 +1372,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Thu Jun 13 2013 Cole Robinson - 2:1.5.0-7 +- Fix build with both new and old fdt + * Wed Jun 12 2013 Cole Robinson - 2:1.5.0-6 - Fix build with rawhide libfdt From 09747c8a31f6e14e3d187ac6a336c2d6383b8a9f Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Sat, 15 Jun 2013 17:41:18 +0100 Subject: [PATCH 10/45] Put ARM kvm bits in right sub package --- qemu.spec | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/qemu.spec b/qemu.spec index 4204095..b8b1558 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.0 -Release: 7%{?dist} +Release: 8%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -1168,7 +1168,7 @@ getent passwd qemu >/dev/null || \ %{_datadir}/%{name}/efi-ne2k_pci.rom %config(noreplace) %{_sysconfdir}/qemu/target-x86_64.conf %if %{without separate_kvm} -%ifarch %{ix86} x86_64 %{arm} +%ifarch %{ix86} x86_64 %{?kvm_files:} %{?qemu_kvm_files:} %endif @@ -1196,7 +1196,13 @@ getent passwd qemu >/dev/null || \ %{_bindir}/qemu-system-arm %{_datadir}/systemtap/tapset/qemu-system-arm.stp %{_mandir}/man1/qemu-system-arm.1* +%if %{without separate_kvm} +%ifarch armv7hl %{?kvm_files:} +%{?qemu_kvm_files:} +%endif +%endif + %endif %if 0%{?system_mips:1} @@ -1372,6 +1378,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Fri Jun 14 2013 Peter Robinson 2:1.5.0-8 +- Put ARM kvm bits in right sub package + * Thu Jun 13 2013 Cole Robinson - 2:1.5.0-7 - Fix build with both new and old fdt From 81a3da8be996b8878b59677614f9374f5010f558 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 19 Jun 2013 10:35:19 -0400 Subject: [PATCH 11/45] Don't install conflicting binfmt handler on arm (bz #974804) Use upstream patch for libfdt build fix --- ...configure-dtc-Probe-for-libfdt_env.h.patch | 85 +++++++++++++++++++ ...ded-header-file-from-upstream-to-fix.patch | 80 ----------------- qemu.spec | 10 ++- 3 files changed, 92 insertions(+), 83 deletions(-) create mode 100644 0007-configure-dtc-Probe-for-libfdt_env.h.patch delete mode 100644 0007-fdt-update-embedded-header-file-from-upstream-to-fix.patch diff --git a/0007-configure-dtc-Probe-for-libfdt_env.h.patch b/0007-configure-dtc-Probe-for-libfdt_env.h.patch new file mode 100644 index 0000000..dc48971 --- /dev/null +++ b/0007-configure-dtc-Probe-for-libfdt_env.h.patch @@ -0,0 +1,85 @@ +From 7e72644adb7ed1092a90cf26c4edbba4b3f2b11b Mon Sep 17 00:00:00 2001 +From: Peter Crosthwaite +Date: Mon, 27 May 2013 14:20:57 +1000 +Subject: [PATCH] configure: dtc: Probe for libfdt_env.h + +Currently QEMU provides a local clone of the file libfdt_env.h in +/include. This file is supposed to come with the libfdt package and is +only needed for broken installs of libfdt. Now that we have submodule +dtc, just ignore these broken installs and prompt for the dtc submodule +install instead. QEMU's local libfdt_env.h is removed accordingly. + +Manifests as a bug when building QEMU with modern libfdt. The new +version of libfdt does not compile when QEMUs libfdt_env.h takes +precedence over the hosts. + +Signed-off-by: Peter Crosthwaite +Reviewed-by: Peter Maydell +Acked-by: David Gibson +Signed-off-by: Kim Phillips +Acked-by: Paolo Bonzini +Message-id: 9b6a3a52e3f46cfbc1ded9ab56385ec045e46705.1369628289.git.peter.crosthwaite@xilinx.com +Signed-off-by: Peter Maydell +(cherry picked from commit 96ce65457690561417ae8e6f0e85f3c6f135018b) +--- + configure | 2 ++ + include/libfdt_env.h | 36 ------------------------------------ + 2 files changed, 2 insertions(+), 36 deletions(-) + delete mode 100644 include/libfdt_env.h + +diff --git a/configure b/configure +index fb41cb6..7e07cb7 100755 +--- a/configure ++++ b/configure +@@ -2526,7 +2526,9 @@ fi + # fdt probe + if test "$fdt" != "no" ; then + fdt_libs="-lfdt" ++ # explicitly check for libfdt_env.h as it is missing in some stable installs + cat > $TMPC << EOF ++#include + int main(void) { return 0; } + EOF + if compile_prog "" "$fdt_libs" ; then +diff --git a/include/libfdt_env.h b/include/libfdt_env.h +deleted file mode 100644 +index 3667d4c..0000000 +--- a/include/libfdt_env.h ++++ /dev/null +@@ -1,36 +0,0 @@ +-/* +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License, version 2, as +- * published by the Free Software Foundation. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with this program; if not, see . +- * +- * Copyright IBM Corp. 2008 +- * Authors: Hollis Blanchard +- * +- */ +- +-#ifndef _LIBFDT_ENV_H +-#define _LIBFDT_ENV_H +- +-#include "qemu/bswap.h" +- +-#ifdef HOST_WORDS_BIGENDIAN +-#define fdt32_to_cpu(x) (x) +-#define cpu_to_fdt32(x) (x) +-#define fdt64_to_cpu(x) (x) +-#define cpu_to_fdt64(x) (x) +-#else +-#define fdt32_to_cpu(x) bswap32(x) +-#define cpu_to_fdt32(x) bswap32(x) +-#define fdt64_to_cpu(x) bswap64(x) +-#define cpu_to_fdt64(x) bswap64(x) +-#endif +- +-#endif /* _LIBFDT_ENV_H */ diff --git a/0007-fdt-update-embedded-header-file-from-upstream-to-fix.patch b/0007-fdt-update-embedded-header-file-from-upstream-to-fix.patch deleted file mode 100644 index bf86b54..0000000 --- a/0007-fdt-update-embedded-header-file-from-upstream-to-fix.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 53800f1a71cdbc9e0deadd00e77d5d60a45ab999 Mon Sep 17 00:00:00 2001 -From: Andre Przywara -Date: Tue, 7 May 2013 14:36:59 +0200 -Subject: [PATCH] fdt: update embedded header file from upstream to fix - compilation - -Upstream dtc.git introduced a change in libfdt_env.h, which breaks -compilation with QEMU's version of it: - - CC arm-softmmu/device_tree.o -In file included from /usr/include/libfdt.h:55:0, - from /src/qemu.git/device_tree.c:28: -/usr/include/fdt.h:7:2: error: unknown type name 'fdt32_t' - ... - -The culprit is: -commit feafcd972cb744750a65728440c99526e6199a6d -Author: Kim Phillips -Date: Wed Nov 28 17:33:01 2012 -0600 - - dtc/libfdt: introduce fdt types for annotation by endian checkers - ... - -Pull the new definitions into QEMU's version of the file. This change -also works with older installed versions of dtc. -The upstream version got a "GPL or BSD" dual license header meanwhile. -I retained the original GPL license header from QEMU, only added -the original copyrights. - -Signed-off-by: Andre Przywara ---- - include/libfdt_env.h | 25 ++++++++++++++++++++----- - 1 file changed, 20 insertions(+), 5 deletions(-) - -diff --git a/include/libfdt_env.h b/include/libfdt_env.h -index 3667d4c..aad54bb 100644 ---- a/include/libfdt_env.h -+++ b/include/libfdt_env.h -@@ -1,4 +1,12 @@ -+#ifndef _LIBFDT_ENV_H -+#define _LIBFDT_ENV_H - /* -+ * libfdt - Flat Device Tree manipulation -+ * Copyright (C) 2006 David Gibson, IBM Corporation. -+ * Copyright 2012 Kim Phillips, Freescale Semiconductor. -+ * Adaptation to QEMU: Copyright IBM Corp. 2008 -+ * by Hollis Blanchard -+ * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation. -@@ -11,16 +19,23 @@ - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * -- * Copyright IBM Corp. 2008 -- * Authors: Hollis Blanchard - * - */ - --#ifndef _LIBFDT_ENV_H --#define _LIBFDT_ENV_H -- - #include "qemu/bswap.h" - -+#ifdef __CHECKER__ -+#define __force __attribute__((force)) -+#define __bitwise __attribute__((bitwise)) -+#else -+#define __force -+#define __bitwise -+#endif -+ -+typedef uint16_t __bitwise fdt16_t; -+typedef uint32_t __bitwise fdt32_t; -+typedef uint64_t __bitwise fdt64_t; -+ - #ifdef HOST_WORDS_BIGENDIAN - #define fdt32_to_cpu(x) (x) - #define cpu_to_fdt32(x) (x) diff --git a/qemu.spec b/qemu.spec index b8b1558..04f29f2 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.0 -Release: 8%{?dist} +Release: 9%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -191,7 +191,7 @@ Patch0005: 0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch # Fix rtl8139 + windows 7 + large transfers (bz #970240) Patch0006: 0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch # Fix build with rawhide libfdt -Patch0007: 0007-fdt-update-embedded-header-file-from-upstream-to-fix.patch +Patch0007: 0007-configure-dtc-Probe-for-libfdt_env.h.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -901,7 +901,7 @@ for i in dummy \ %ifnarch alpha qemu-alpha \ %endif -%ifnarch arm +%ifnarch %{arm} qemu-arm \ %endif qemu-armeb \ @@ -1378,6 +1378,10 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Wed Jun 19 2013 Cole Robinson - 2:1.5.0-9 +- Don't install conflicting binfmt handler on arm (bz #974804) +- Use upstream patch for libfdt build fix + * Fri Jun 14 2013 Peter Robinson 2:1.5.0-8 - Put ARM kvm bits in right sub package From 8a0cce2bab1d72dce83a76722318454d9a7f258f Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 28 Jun 2013 20:11:02 -0400 Subject: [PATCH 12/45] Rebased to version 1.5.1 --- .gitignore | 1 + ...e-Add-enable-migration-from-qemu-kvm.patch | 12 ++--- ...minimum_version_id-to-handle-qemu-kv.patch | 2 +- ...8254-Fix-migration-from-qemu-kvm-1.1.patch | 2 +- ...at-handling-for-qemu-kvm-VGA-mem-siz.patch | 4 +- ...-compat-property-fix-migration-from-.patch | 4 +- ...configure-dtc-Probe-for-libfdt_env.h.patch | 6 +-- ...eued-packets-when-RxBufPtr-is-writte.patch | 47 ------------------- qemu.spec | 15 +++--- sources | 2 +- 10 files changed, 24 insertions(+), 71 deletions(-) rename 0007-configure-dtc-Probe-for-libfdt_env.h.patch => 0006-configure-dtc-Probe-for-libfdt_env.h.patch (96%) delete mode 100644 0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch diff --git a/.gitignore b/.gitignore index bf06366..6bf18a7 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ qemu-kvm-0.13.0-25fdf4a.tar.gz /qemu-1.4.0.tar.bz2 /qemu-1.4.1.tar.bz2 /qemu-1.5.0.tar.bz2 +/qemu-1.5.1.tar.bz2 diff --git a/0001-configure-Add-enable-migration-from-qemu-kvm.patch b/0001-configure-Add-enable-migration-from-qemu-kvm.patch index 6e9de6d..23dbc2e 100644 --- a/0001-configure-Add-enable-migration-from-qemu-kvm.patch +++ b/0001-configure-Add-enable-migration-from-qemu-kvm.patch @@ -1,4 +1,4 @@ -From 7cd5a50e02ed4866932c2a70680bec48a75dae72 Mon Sep 17 00:00:00 2001 +From 0f8c8df923aea533c4b573a013b9a35c3581c2df Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 19 Feb 2013 14:39:05 -0500 Subject: [PATCH] configure: Add --enable-migration-from-qemu-kvm @@ -14,7 +14,7 @@ not a big loss (and I don't know any way to avoid it). 1 file changed, 10 insertions(+) diff --git a/configure b/configure -index 5ae7e4a..fb41cb6 100755 +index eb74510..f558a21 100755 --- a/configure +++ b/configure @@ -179,6 +179,7 @@ xfs="" @@ -25,7 +25,7 @@ index 5ae7e4a..fb41cb6 100755 gprof="no" debug_tcg="no" debug="no" -@@ -777,6 +778,8 @@ for opt do +@@ -776,6 +777,8 @@ for opt do ;; --enable-kvm) kvm="yes" ;; @@ -34,7 +34,7 @@ index 5ae7e4a..fb41cb6 100755 --disable-tcg-interpreter) tcg_interpreter="no" ;; --enable-tcg-interpreter) tcg_interpreter="yes" -@@ -1136,6 +1139,9 @@ echo " --enable-bluez enable bluez stack connectivity" +@@ -1135,6 +1138,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" @@ -44,7 +44,7 @@ index 5ae7e4a..fb41cb6 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" -@@ -3554,6 +3560,7 @@ echo "Linux AIO support $linux_aio" +@@ -3553,6 +3559,7 @@ echo "Linux AIO support $linux_aio" echo "ATTR/XATTR support $attr" echo "Install blobs $blobs" echo "KVM support $kvm" @@ -52,7 +52,7 @@ index 5ae7e4a..fb41cb6 100755 echo "TCG interpreter $tcg_interpreter" echo "fdt support $fdt" echo "preadv support $preadv" -@@ -3863,6 +3870,9 @@ fi +@@ -3862,6 +3869,9 @@ fi if test "$signalfd" = "yes" ; then echo "CONFIG_SIGNALFD=y" >> $config_host_mak fi diff --git a/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch b/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch index d6107a8..bdc73fc 100644 --- a/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch +++ b/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch @@ -1,4 +1,4 @@ -From 9df0fd5765377d32a0e9f2d855dc1d428c19f767 Mon Sep 17 00:00:00 2001 +From eebf11b36cdd88ed2273eda6258760c59a9aaf9b Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 19 Feb 2013 14:44:49 -0500 Subject: [PATCH] acpi_piix4: Drop minimum_version_id to handle qemu-kvm diff --git a/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch b/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch index 44c1e8f..9ae2d5c 100644 --- a/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch +++ b/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch @@ -1,4 +1,4 @@ -From e1f0936bbf84664d7d7fe7bbbdd1595be745b539 Mon Sep 17 00:00:00 2001 +From 05d94ec26781d83f78bb6e9c7a5610cf88f69293 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 19 Feb 2013 15:04:59 -0500 Subject: [PATCH] i8254: Fix migration from qemu-kvm < 1.1 diff --git a/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch b/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch index 820e99d..50f11ef 100644 --- a/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch +++ b/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch @@ -1,4 +1,4 @@ -From 3e580f65ac69c7a84b672a59de6772dae24b5a8a Mon Sep 17 00:00:00 2001 +From 437b8cb633fa6402546bf0f2e808a64ea447b55e Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 19 Feb 2013 15:35:40 -0500 Subject: [PATCH] pc_piix: Add compat handling for qemu-kvm VGA mem size @@ -19,7 +19,7 @@ all others. This will break incoming qemu migration for qemu < 1.3. 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c -index 43ab480..48fb7b7 100644 +index 06416ce..0787f38 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -383,6 +383,13 @@ static QEMUMachine pc_machine_v1_3 = { diff --git a/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch b/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch index 4fa4a8b..258040c 100644 --- a/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch +++ b/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch @@ -1,4 +1,4 @@ -From ae8d642477d87287b42b0b40c133637dd1cdd8b9 Mon Sep 17 00:00:00 2001 +From 9642978bbeba188570ec62fd989cad4da32589c3 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 19 Feb 2013 16:19:02 -0500 Subject: [PATCH] qxl: Add rom_size compat property, fix migration from 1.2 @@ -64,7 +64,7 @@ index c475cb1..74f07c0 100644 }; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c -index 48fb7b7..2307d26 100644 +index 0787f38..e26c93d 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -369,6 +369,14 @@ static QEMUMachine pc_i440fx_machine_v1_4 = { diff --git a/0007-configure-dtc-Probe-for-libfdt_env.h.patch b/0006-configure-dtc-Probe-for-libfdt_env.h.patch similarity index 96% rename from 0007-configure-dtc-Probe-for-libfdt_env.h.patch rename to 0006-configure-dtc-Probe-for-libfdt_env.h.patch index dc48971..c46c885 100644 --- a/0007-configure-dtc-Probe-for-libfdt_env.h.patch +++ b/0006-configure-dtc-Probe-for-libfdt_env.h.patch @@ -1,4 +1,4 @@ -From 7e72644adb7ed1092a90cf26c4edbba4b3f2b11b Mon Sep 17 00:00:00 2001 +From 93178ab04a3dd129848e398838e14f22ba0ba23f Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Mon, 27 May 2013 14:20:57 +1000 Subject: [PATCH] configure: dtc: Probe for libfdt_env.h @@ -28,10 +28,10 @@ Signed-off-by: Peter Maydell delete mode 100644 include/libfdt_env.h diff --git a/configure b/configure -index fb41cb6..7e07cb7 100755 +index f558a21..ed09648 100755 --- a/configure +++ b/configure -@@ -2526,7 +2526,9 @@ fi +@@ -2525,7 +2525,9 @@ fi # fdt probe if test "$fdt" != "no" ; then fdt_libs="-lfdt" diff --git a/0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch b/0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch deleted file mode 100644 index 9b9fb4a..0000000 --- a/0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 4044e0670486ad089367952843f17351c4f6faa0 Mon Sep 17 00:00:00 2001 -From: Stefan Hajnoczi -Date: Wed, 22 May 2013 14:50:18 +0200 -Subject: [PATCH] rtl8139: flush queued packets when RxBufPtr is written - -Net queues support efficient "receive disable". For example, tap's file -descriptor will not be polled while its peer has receive disabled. This -saves CPU cycles for needlessly copying and then dropping packets which -the peer cannot receive. - -rtl8139 is missing the qemu_flush_queued_packets() call that wakes the -queue up when receive becomes possible again. - -As a result, the Windows 7 guest driver reaches a state where the -rtl8139 cannot receive packets. The driver has actually refilled the -receive buffer but we never resume reception. - -The bug can be reproduced by running a large FTP 'get' inside a Windows -7 guest: - - $ qemu -netdev tap,id=tap0,... - -device rtl8139,netdev=tap0 - -The Linux guest driver does not trigger the bug, probably due to a -different buffer management strategy. - -Reported-by: Oliver Francke -Signed-off-by: Stefan Hajnoczi -(cherry picked from commit 00b7ade807b5ce6779ddd86ce29c5521ec5c529a) ---- - hw/net/rtl8139.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c -index 9369507..7993f9f 100644 ---- a/hw/net/rtl8139.c -+++ b/hw/net/rtl8139.c -@@ -2575,6 +2575,9 @@ static void rtl8139_RxBufPtr_write(RTL8139State *s, uint32_t val) - /* this value is off by 16 */ - s->RxBufPtr = MOD2(val + 0x10, s->RxBufferSize); - -+ /* more buffer space may be available so try to receive */ -+ qemu_flush_queued_packets(qemu_get_queue(s->nic)); -+ - DPRINTF(" CAPR write: rx buffer length %d head 0x%04x read 0x%04x\n", - s->RxBufferSize, s->RxBufAddr, s->RxBufPtr); - } diff --git a/qemu.spec b/qemu.spec index 04f29f2..c14209c 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,8 +139,8 @@ Summary: QEMU is a FAST! processor emulator Name: qemu -Version: 1.5.0 -Release: 9%{?dist} +Version: 1.5.1 +Release: 1%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -188,10 +188,8 @@ 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) Patch0005: 0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch -# Fix rtl8139 + windows 7 + large transfers (bz #970240) -Patch0006: 0006-rtl8139-flush-queued-packets-when-RxBufPtr-is-writte.patch # Fix build with rawhide libfdt -Patch0007: 0007-configure-dtc-Probe-for-libfdt_env.h.patch +Patch0006: 0006-configure-dtc-Probe-for-libfdt_env.h.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -688,10 +686,8 @@ CAC emulation development files. %patch0004 -p1 # Fix migration w/ qxl from qemu-kvm 1.2 (solution pending upstream) %patch0005 -p1 -# Fix rtl8139 + windows 7 + large transfers (bz #970240) -%patch0006 -p1 # Fix build with rawhide libfdt -%patch0007 -p1 +%patch0006 -p1 %build @@ -1378,6 +1374,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Fri Jun 28 2013 Cole Robinson - 2:1.5.1-1 +- Rebased to version 1.5.1 + * Wed Jun 19 2013 Cole Robinson - 2:1.5.0-9 - Don't install conflicting binfmt handler on arm (bz #974804) - Use upstream patch for libfdt build fix diff --git a/sources b/sources index 56d3af3..198c322 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b6f3265b8ed39d77e8f354f35cc26e16 qemu-1.5.0.tar.bz2 +b56e73bdcfdb214d5c68e13111aca96f qemu-1.5.1.tar.bz2 From bc2c95de5f282705c2e15807208e68ee31f03130 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 1 Jul 2013 11:21:43 -0400 Subject: [PATCH 13/45] Remove BuildRequires: check-devel, not needed for a while --- qemu.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/qemu.spec b/qemu.spec index c14209c..3fef815 100644 --- a/qemu.spec +++ b/qemu.spec @@ -249,8 +249,6 @@ BuildRequires: brlapi-devel # For FDT device tree support BuildRequires: libfdt-devel %endif -# For test suite -BuildRequires: check-devel # For virtfs BuildRequires: libcap-devel # Hard requirement for version >= 1.3 From b6a83a54d0c22c196adfc44e60d26ae9ad1ebd3b Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 9 Jul 2013 10:33:08 -0400 Subject: [PATCH 14/45] Update to work with seabios 1.7.3 --- qemu.spec | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qemu.spec b/qemu.spec index 3fef815..a223edb 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.1 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -440,7 +440,8 @@ Requires: %{name}-common = %{epoch}:%{version}-%{release} Provides: kvm = 85 Obsoletes: kvm < 85 Requires: seavgabios-bin -Requires: seabios-bin >= 0.6.0-2 +# First version that ships aml files which we depend on +Requires: seabios-bin >= 1.7.3-2 Requires: sgabios-bin Requires: ipxe-roms-qemu >= 20130517-2.gitc4bce43 %if 0%{?have_seccomp:1} @@ -855,6 +856,8 @@ rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/efi*rom rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/vgabios*bin # Provided by package seabios rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/bios.bin +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/acpi-dsdt.aml +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/q35-acpi-dsdt.aml # Provided by package sgabios rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/sgabios.bin @@ -883,6 +886,8 @@ rom_link ../seavgabios/vgabios-qxl.bin vgabios-qxl.bin rom_link ../seavgabios/vgabios-stdvga.bin vgabios-stdvga.bin rom_link ../seavgabios/vgabios-vmware.bin vgabios-vmware.bin rom_link ../seabios/bios.bin bios.bin +rom_link ../seabios/acpi-dsdt.aml acpi-dsdt.aml +rom_link ../seabios/q35-acpi-dsdt.aml q35-acpi-dsdt.aml rom_link ../sgabios/sgabios.bin sgabios.bin %endif @@ -1372,6 +1377,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Jul 09 2013 Cole Robinson - 2:1.5.1-2 +- Update to work with seabios 1.7.3 + * Fri Jun 28 2013 Cole Robinson - 2:1.5.1-1 - Rebased to version 1.5.1 From 67ad330b45d21bd3addf592a45c9ea1dbf9c5e4f Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 29 Jul 2013 14:24:38 -0400 Subject: [PATCH 15/45] Rebased to version 1.5.2 Fix mouse display with spice and latest libvirt (bz #981094) --- .gitignore | 1 + ...e-Add-enable-migration-from-qemu-kvm.patch | 2 +- ...minimum_version_id-to-handle-qemu-kv.patch | 2 +- ...8254-Fix-migration-from-qemu-kvm-1.1.patch | 2 +- ...at-handling-for-qemu-kvm-VGA-mem-siz.patch | 2 +- ...-compat-property-fix-migration-from-.patch | 2 +- ...configure-dtc-Probe-for-libfdt_env.h.patch | 2 +- 0007-spice-fix-display-initialization.patch | 92 +++++++++++++++++++ qemu.spec | 14 ++- sources | 2 +- 10 files changed, 112 insertions(+), 9 deletions(-) create mode 100644 0007-spice-fix-display-initialization.patch diff --git a/.gitignore b/.gitignore index 6bf18a7..4ca7953 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ qemu-kvm-0.13.0-25fdf4a.tar.gz /qemu-1.4.1.tar.bz2 /qemu-1.5.0.tar.bz2 /qemu-1.5.1.tar.bz2 +/qemu-1.5.2.tar.bz2 diff --git a/0001-configure-Add-enable-migration-from-qemu-kvm.patch b/0001-configure-Add-enable-migration-from-qemu-kvm.patch index 23dbc2e..38af8b0 100644 --- a/0001-configure-Add-enable-migration-from-qemu-kvm.patch +++ b/0001-configure-Add-enable-migration-from-qemu-kvm.patch @@ -1,4 +1,4 @@ -From 0f8c8df923aea533c4b573a013b9a35c3581c2df Mon Sep 17 00:00:00 2001 +From e49e68d5b504f22919c6134e3a06d3838e872d2f Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 19 Feb 2013 14:39:05 -0500 Subject: [PATCH] configure: Add --enable-migration-from-qemu-kvm diff --git a/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch b/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch index bdc73fc..3639e60 100644 --- a/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch +++ b/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch @@ -1,4 +1,4 @@ -From eebf11b36cdd88ed2273eda6258760c59a9aaf9b Mon Sep 17 00:00:00 2001 +From 28886fb9f7d908bf0f2406dc6f39ee6fe9040cfd Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 19 Feb 2013 14:44:49 -0500 Subject: [PATCH] acpi_piix4: Drop minimum_version_id to handle qemu-kvm diff --git a/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch b/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch index 9ae2d5c..a341878 100644 --- a/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch +++ b/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch @@ -1,4 +1,4 @@ -From 05d94ec26781d83f78bb6e9c7a5610cf88f69293 Mon Sep 17 00:00:00 2001 +From 08aac015d8ba0228dc4277dd7163f014b20c1ca5 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 19 Feb 2013 15:04:59 -0500 Subject: [PATCH] i8254: Fix migration from qemu-kvm < 1.1 diff --git a/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch b/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch index 50f11ef..3b71119 100644 --- a/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch +++ b/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch @@ -1,4 +1,4 @@ -From 437b8cb633fa6402546bf0f2e808a64ea447b55e Mon Sep 17 00:00:00 2001 +From 9def7a9ed113f7b40e868f663bfaa4f9717219ae Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 19 Feb 2013 15:35:40 -0500 Subject: [PATCH] pc_piix: Add compat handling for qemu-kvm VGA mem size diff --git a/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch b/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch index 258040c..3616869 100644 --- a/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch +++ b/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch @@ -1,4 +1,4 @@ -From 9642978bbeba188570ec62fd989cad4da32589c3 Mon Sep 17 00:00:00 2001 +From dbeb3f1e3282bef66b459e3197b2078c24ad7daf Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 19 Feb 2013 16:19:02 -0500 Subject: [PATCH] qxl: Add rom_size compat property, fix migration from 1.2 diff --git a/0006-configure-dtc-Probe-for-libfdt_env.h.patch b/0006-configure-dtc-Probe-for-libfdt_env.h.patch index c46c885..664453e 100644 --- a/0006-configure-dtc-Probe-for-libfdt_env.h.patch +++ b/0006-configure-dtc-Probe-for-libfdt_env.h.patch @@ -1,4 +1,4 @@ -From 93178ab04a3dd129848e398838e14f22ba0ba23f Mon Sep 17 00:00:00 2001 +From 12f9c64a068d3c5e67886dde367ccacde48fbbbd Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Mon, 27 May 2013 14:20:57 +1000 Subject: [PATCH] configure: dtc: Probe for libfdt_env.h diff --git a/0007-spice-fix-display-initialization.patch b/0007-spice-fix-display-initialization.patch new file mode 100644 index 0000000..49530b5 --- /dev/null +++ b/0007-spice-fix-display-initialization.patch @@ -0,0 +1,92 @@ +From 49c090ab950547cb807e90866439072a191513d1 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Tue, 23 Jul 2013 13:55:43 +0200 +Subject: [PATCH] spice: fix display initialization + +Spice has two display interface implementations: One integrated into +the qxl graphics card, and one generic which can operate with every +qemu-emulated graphics card. + +The generic one is activated in case spice is used without qxl. The +logic for that only caught the "-vga qxl" case, "-device qxl-vga" goes +unnoticed. Fix that by adding a check in the spice interface +registration so we'll notice the qxl card no matter how it is created. + +https://bugzilla.redhat.com/show_bug.cgi?id=981094 + +Signed-off-by: Gerd Hoffmann +--- + include/sysemu/sysemu.h | 1 - + include/ui/qemu-spice.h | 2 ++ + ui/spice-core.c | 5 +++++ + vl.c | 2 +- + 4 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h +index 2fb71af..8c8a36f 100644 +--- a/include/sysemu/sysemu.h ++++ b/include/sysemu/sysemu.h +@@ -103,7 +103,6 @@ typedef enum { + + extern int vga_interface_type; + #define xenfb_enabled (vga_interface_type == VGA_XENFB) +-#define qxl_enabled (vga_interface_type == VGA_QXL) + + extern int graphic_width; + extern int graphic_height; +diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h +index eba6d77..c6c756b 100644 +--- a/include/ui/qemu-spice.h ++++ b/include/ui/qemu-spice.h +@@ -27,6 +27,7 @@ + #include "monitor/monitor.h" + + extern int using_spice; ++extern int spice_displays; + + void qemu_spice_init(void); + void qemu_spice_input_init(void); +@@ -57,6 +58,7 @@ static inline CharDriverState *qemu_chr_open_spice_port(const char *name) + #include "monitor/monitor.h" + + #define using_spice 0 ++#define spice_displays 0 + static inline int qemu_spice_set_passwd(const char *passwd, + bool fail_if_connected, + bool disconnect_if_connected) +diff --git a/ui/spice-core.c b/ui/spice-core.c +index bcc4199..c8337ab 100644 +--- a/ui/spice-core.c ++++ b/ui/spice-core.c +@@ -48,6 +48,7 @@ static char *auth_passwd; + static time_t auth_expires = TIME_MAX; + static int spice_migration_completed; + int using_spice = 0; ++int spice_displays; + + static QemuThread me; + +@@ -823,6 +824,10 @@ int qemu_spice_add_interface(SpiceBaseInstance *sin) + qemu_add_vm_change_state_handler(vm_change_state_handler, NULL); + } + ++ if (strcmp(sin->sif->type, SPICE_INTERFACE_QXL) == 0) { ++ spice_displays++; ++ } ++ + return spice_server_add_interface(spice_server, sin); + } + +diff --git a/vl.c b/vl.c +index efb073f..3559f76 100644 +--- a/vl.c ++++ b/vl.c +@@ -4374,7 +4374,7 @@ int main(int argc, char **argv, char **envp) + } + #endif + #ifdef CONFIG_SPICE +- if (using_spice && !qxl_enabled) { ++ if (using_spice && !spice_displays) { + qemu_spice_display_init(ds); + } + #endif diff --git a/qemu.spec b/qemu.spec index a223edb..e17f81b 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,8 +139,8 @@ Summary: QEMU is a FAST! processor emulator Name: qemu -Version: 1.5.1 -Release: 2%{?dist} +Version: 1.5.2 +Release: 1%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -190,6 +190,9 @@ Patch0004: 0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch Patch0005: 0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch # Fix build with rawhide libfdt Patch0006: 0006-configure-dtc-Probe-for-libfdt_env.h.patch +# Fix mouse display with spice and latest libvirt (bz #981094) +# (patch posted upstream but not applied yet) +Patch0007: 0007-spice-fix-display-initialization.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -687,6 +690,9 @@ CAC emulation development files. %patch0005 -p1 # Fix build with rawhide libfdt %patch0006 -p1 +# Fix mouse display with spice and latest libvirt (bz #981094) +# (patch posted upstream but not applied yet) +%patch0007 -p1 %build @@ -1377,6 +1383,10 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Mon Jul 29 2013 Cole Robinson - 2:1.5.2-1 +- Rebased to version 1.5.2 +- Fix mouse display with spice and latest libvirt (bz #981094) + * Tue Jul 09 2013 Cole Robinson - 2:1.5.1-2 - Update to work with seabios 1.7.3 diff --git a/sources b/sources index 198c322..38a3273 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b56e73bdcfdb214d5c68e13111aca96f qemu-1.5.1.tar.bz2 +04b94189ba587b3280713ded3b7f959a qemu-1.5.2.tar.bz2 From 1c81baa208e931427bd7607f366f3dfebb139d12 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 2 Aug 2013 17:38:43 +0200 Subject: [PATCH 16/45] Rebuild for libiscsi soname bump --- qemu.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index e17f81b..c112763 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.2 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -1383,6 +1383,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Fri Aug 2 2013 Paolo Bonzini - 2:1.5.2-2 +- Rebuild for libiscsi soname bump + * Mon Jul 29 2013 Cole Robinson - 2:1.5.2-1 - Rebased to version 1.5.2 - Fix mouse display with spice and latest libvirt (bz #981094) From 558d4c194e31fdd7302936882e31079dd1a3280e Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Fri, 2 Aug 2013 21:47:40 -0500 Subject: [PATCH 17/45] build without spice support to build against new libiscsi - spice requires parts of qemu --- qemu.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/qemu.spec b/qemu.spec index c112763..06d70d6 100644 --- a/qemu.spec +++ b/qemu.spec @@ -61,7 +61,7 @@ %global have_seccomp 1 %endif %if %{with spice} -%global have_spice 1 +%global have_spice 0 %endif %else %if 0%{?rhel} @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.2 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -1383,6 +1383,10 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Fri Aug 02 2013 Dennis Gilmore - 2:1.5.2-3 +- build without spice support to build against new libiscsi +- spice requires parts of qemu + * Fri Aug 2 2013 Paolo Bonzini - 2:1.5.2-2 - Rebuild for libiscsi soname bump From 2ed53bed7d8e1e0ebb3a4412563afea2cbc3c31a Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sat, 3 Aug 2013 08:12:44 -0500 Subject: [PATCH 18/45] try another way to disable spice --- qemu.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu.spec b/qemu.spec index 06d70d6..a6d75ed 100644 --- a/qemu.spec +++ b/qemu.spec @@ -25,7 +25,7 @@ %bcond_without kvmonly # enabled %bcond_without exclusive_x86_64 # enabled %bcond_with rbd # disabled -%bcond_without spice # enabled +%bcond_with spice # disabled %bcond_without seccomp # enabled %bcond_with xfsprogs # disabled %bcond_with separate_kvm # disabled - for EPEL @@ -35,7 +35,7 @@ %bcond_with kvmonly # disabled %bcond_with exclusive_x86_64 # disabled %bcond_without rbd # enabled -%bcond_without spice # enabled +%bcond_with spice # disabled %bcond_without seccomp # enabled %bcond_without xfsprogs # enabled %bcond_with separate_kvm # disabled @@ -61,7 +61,7 @@ %global have_seccomp 1 %endif %if %{with spice} -%global have_spice 0 +%global have_spice 1 %endif %else %if 0%{?rhel} From 54ffecd5cfa7c7298fd1457f4456eb7ccfd5fc79 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Sun, 4 Aug 2013 08:02:10 -0500 Subject: [PATCH 19/45] re-enable spice support --- qemu.spec | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qemu.spec b/qemu.spec index a6d75ed..749171a 100644 --- a/qemu.spec +++ b/qemu.spec @@ -25,7 +25,7 @@ %bcond_without kvmonly # enabled %bcond_without exclusive_x86_64 # enabled %bcond_with rbd # disabled -%bcond_with spice # disabled +%bcond_without spice # enabled %bcond_without seccomp # enabled %bcond_with xfsprogs # disabled %bcond_with separate_kvm # disabled - for EPEL @@ -35,7 +35,7 @@ %bcond_with kvmonly # disabled %bcond_with exclusive_x86_64 # disabled %bcond_without rbd # enabled -%bcond_with spice # disabled +%bcond_without spice # enabled %bcond_without seccomp # enabled %bcond_without xfsprogs # enabled %bcond_with separate_kvm # disabled @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.5.2 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -1383,6 +1383,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Sun Aug 04 2013 Dennis Gilmore - 2:1.5.2-4 +- re-enable spice support + * Fri Aug 02 2013 Dennis Gilmore - 2:1.5.2-3 - build without spice support to build against new libiscsi - spice requires parts of qemu From 76dcac38f6279c5073b1f6df54ba2a277dc437c4 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 16 Aug 2013 14:20:08 -0400 Subject: [PATCH 20/45] Rebased to version 1.6.0 Support for live migration over RDMA TCG target for aarch64. Support for auto-convergence in live migration ("CPU stunning") The XHCI (USB 3.0) controller supports live migration. New device "nvme" provides a PCI device that implements the NVMe standard. ACPI hotplug of devices behind a PCI bridge is supported --- .gitignore | 1 + 0001-Fix-migration-from-qemu-kvm.patch | 212 ++++++++++++++++++ ...e-Add-enable-migration-from-qemu-kvm.patch | 64 ------ ...minimum_version_id-to-handle-qemu-kv.patch | 51 ----- ...8254-Fix-migration-from-qemu-kvm-1.1.patch | 34 --- ...at-handling-for-qemu-kvm-VGA-mem-siz.patch | 81 ------- ...-compat-property-fix-migration-from-.patch | 99 -------- ...configure-dtc-Probe-for-libfdt_env.h.patch | 85 ------- 0007-spice-fix-display-initialization.patch | 92 -------- qemu.spec | 47 ++-- sources | 2 +- 11 files changed, 233 insertions(+), 535 deletions(-) create mode 100644 0001-Fix-migration-from-qemu-kvm.patch delete mode 100644 0001-configure-Add-enable-migration-from-qemu-kvm.patch delete mode 100644 0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch delete mode 100644 0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch delete mode 100644 0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch delete mode 100644 0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch delete mode 100644 0006-configure-dtc-Probe-for-libfdt_env.h.patch delete mode 100644 0007-spice-fix-display-initialization.patch diff --git a/.gitignore b/.gitignore index 4ca7953..1ac9888 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ qemu-kvm-0.13.0-25fdf4a.tar.gz /qemu-1.5.0.tar.bz2 /qemu-1.5.1.tar.bz2 /qemu-1.5.2.tar.bz2 +/qemu-1.6.0.tar.bz2 diff --git a/0001-Fix-migration-from-qemu-kvm.patch b/0001-Fix-migration-from-qemu-kvm.patch new file mode 100644 index 0000000..4db56ab --- /dev/null +++ b/0001-Fix-migration-from-qemu-kvm.patch @@ -0,0 +1,212 @@ +From 846f71f534a6a026793eacb0c620f54eb30540a8 Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Fri, 16 Aug 2013 12:14:51 -0400 +Subject: [PATCH] Fix migration from qemu-kvm + +Details are in the code comments for each change. Just lumped this together +to ease patch maintenance. + +Everything except the video memory bits can likely be dropped by Fedora 21 +time frame. Need to figure out if there's anything to upstream for the +video memory bits. +--- + hw/acpi/piix4.c | 8 ++++++- + hw/display/qxl.c | 9 ++++---- + hw/i386/pc_piix.c | 61 +++++++++++++++++++++++++++++++++++++++++++++---- + hw/timer/i8254_common.c | 7 +++++- + 4 files changed, 74 insertions(+), 11 deletions(-) + +diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c +index c885690..e6c4c8b 100644 +--- a/hw/acpi/piix4.c ++++ b/hw/acpi/piix4.c +@@ -289,7 +289,13 @@ static int acpi_load_old(QEMUFile *f, void *opaque, int version_id) + static const VMStateDescription vmstate_acpi = { + .name = "piix4_pm", + .version_id = 3, +- .minimum_version_id = 3, ++ /* ++ * qemu-kvm 1.2 uses qemu.git version 3 format, but advertised as 2. ++ * This allows incoming migration from qemu-kvm, but breaks incoming ++ * migration from qemu < 1.3. ++ */ ++ //minimum_version_id = 3, ++ .minimum_version_id = 2, + .minimum_version_id_old = 1, + .load_state_old = acpi_load_old, + .post_load = vmstate_acpi_post_load, +diff --git a/hw/display/qxl.c b/hw/display/qxl.c +index c537057..7ef3eff 100644 +--- a/hw/display/qxl.c ++++ b/hw/display/qxl.c +@@ -307,16 +307,14 @@ static inline uint32_t msb_mask(uint32_t val) + return mask; + } + +-static ram_addr_t qxl_rom_size(void) ++static void check_qxl_rom_size(PCIQXLDevice *d) + { + uint32_t required_rom_size = sizeof(QXLRom) + sizeof(QXLModes) + + sizeof(qxl_modes); +- uint32_t rom_size = 8192; /* two pages */ + + required_rom_size = MAX(required_rom_size, TARGET_PAGE_SIZE); + required_rom_size = msb_mask(required_rom_size * 2 - 1); +- assert(required_rom_size <= rom_size); +- return rom_size; ++ assert(required_rom_size <= d->rom_size); + } + + static void init_qxl_rom(PCIQXLDevice *d) +@@ -1981,7 +1979,7 @@ static int qxl_init_common(PCIQXLDevice *qxl) + pci_set_byte(&config[PCI_REVISION_ID], pci_device_rev); + pci_set_byte(&config[PCI_INTERRUPT_PIN], 1); + +- qxl->rom_size = qxl_rom_size(); ++ check_qxl_rom_size(qxl); + memory_region_init_ram(&qxl->rom_bar, OBJECT(qxl), "qxl.vrom", + qxl->rom_size); + vmstate_register_ram(&qxl->rom_bar, &qxl->pci.qdev); +@@ -2309,6 +2307,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), ++ DEFINE_PROP_UINT32("rom_size", PCIQXLDevice, rom_size, 8192), + DEFINE_PROP_END_OF_LIST(), + }; + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 6e1e654..4fd5b6d 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -377,6 +377,24 @@ static QEMUMachine pc_i440fx_machine_v1_4 = { + DEFAULT_MACHINE_OPTIONS, + }; + ++/* ++ * Commit 038c1879a00153b14bce113315b693e8c2944fa9 changed the qxl rom ++ * size to 8192, which fixes incoming migration from qemu 1.0. However ++ * from qemu 1.2 and 1.3 had rom size 16384, so incoming migration ++ * from those versions is now broken. ++ * ++ * Add a rom_size compat property. 1.2 and 1.3 get 16384, everything ++ * else is 8192. ++ * ++ * This isn't actually fool proof, since rom_size can be dependent on ++ * the version of spice qemu is built against: ++ * ++ * 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. ++ */ ++ + #define PC_COMPAT_1_3 \ + PC_COMPAT_1_4, \ + {\ +@@ -395,8 +413,17 @@ 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 = { + .name = "pc-1.3", + .desc = "Standard PC", +@@ -409,6 +436,19 @@ static QEMUMachine pc_machine_v1_3 = { + DEFAULT_MACHINE_OPTIONS, + }; + ++ ++/* ++ * https://lists.gnu.org/archive/html/qemu-devel/2013-01/msg02540.html ++ * ++ * qemu-kvm defaulted to vgamem=16MB since at least 0.15, while qemu used ++ * 8MB. For qemu 1.2, the default was changed to 16MB for all devices ++ * except cirrus. ++ * ++ * 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. ++ */ ++ + #define PC_COMPAT_1_2 \ + PC_COMPAT_1_3,\ + {\ +@@ -432,6 +472,10 @@ static QEMUMachine pc_machine_v1_3 = { + .property = "revision",\ + .value = stringify(3),\ + },{\ ++ .driver = "cirrus-vga",\ ++ .property = "vgamem_mb",\ ++ .value = stringify(16),\ ++ },{\ + .driver = "VGA",\ + .property = "mmio",\ + .value = "off",\ +@@ -462,25 +506,34 @@ static QEMUMachine pc_machine_v1_2 = { + },{\ + .driver = "VGA",\ + .property = "vgamem_mb",\ +- .value = stringify(8),\ ++ .value = stringify(16),\ + },{\ + .driver = "vmware-svga",\ + .property = "vgamem_mb",\ +- .value = stringify(8),\ ++ .value = stringify(16),\ + },{\ + .driver = "qxl-vga",\ + .property = "vgamem_mb",\ +- .value = stringify(8),\ ++ .value = stringify(16),\ + },{\ + .driver = "qxl",\ + .property = "vgamem_mb",\ +- .value = stringify(8),\ ++ .value = stringify(16),\ + },{\ + .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 = { + .name = "pc-1.1", + .desc = "Standard PC", +diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c +index 4e5bf0b..cbc00a0 100644 +--- a/hw/timer/i8254_common.c ++++ b/hw/timer/i8254_common.c +@@ -267,7 +267,12 @@ static const VMStateDescription vmstate_pit_common = { + .pre_save = pit_dispatch_pre_save, + .post_load = pit_dispatch_post_load, + .fields = (VMStateField[]) { +- VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3), ++ /* qemu-kvm version_id=2 had 'flags' here which is equivalent ++ * This fixes incoming migration from qemu-kvm 1.0, but breaks ++ * incoming migration from qemu < 1.1 ++ */ ++ //VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3), ++ VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), + VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2, + vmstate_pit_channel, PITChannelState), + VMSTATE_INT64(channels[0].next_transition_time, diff --git a/0001-configure-Add-enable-migration-from-qemu-kvm.patch b/0001-configure-Add-enable-migration-from-qemu-kvm.patch deleted file mode 100644 index 38af8b0..0000000 --- a/0001-configure-Add-enable-migration-from-qemu-kvm.patch +++ /dev/null @@ -1,64 +0,0 @@ -From e49e68d5b504f22919c6134e3a06d3838e872d2f Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Tue, 19 Feb 2013 14:39:05 -0500 -Subject: [PATCH] configure: Add --enable-migration-from-qemu-kvm - -This switch will turn on all the migration compat bits needed to -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). ---- - configure | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/configure b/configure -index eb74510..f558a21 100755 ---- a/configure -+++ b/configure -@@ -179,6 +179,7 @@ xfs="" - vhost_net="no" - vhost_scsi="no" - kvm="no" -+migrate_from_kvm="no" - gprof="no" - debug_tcg="no" - debug="no" -@@ -776,6 +777,8 @@ for opt do - ;; - --enable-kvm) kvm="yes" - ;; -+ --enable-migration-from-qemu-kvm) migrate_from_kvm="yes" -+ ;; - --disable-tcg-interpreter) tcg_interpreter="no" - ;; - --enable-tcg-interpreter) tcg_interpreter="yes" -@@ -1135,6 +1138,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" -+echo " --enable-migration-from-qemu-kvm Allow migration from qemu-kvm." -+echo " This will break migration from " -+echo " qemu < 1.3 in most cases" - echo " --enable-tcg-interpreter enable TCG with bytecode interpreter (TCI)" - echo " --disable-nptl disable usermode NPTL support" - echo " --enable-nptl enable usermode NPTL support" -@@ -3553,6 +3559,7 @@ echo "Linux AIO support $linux_aio" - echo "ATTR/XATTR support $attr" - echo "Install blobs $blobs" - echo "KVM support $kvm" -+echo "Migrate from qemu-kvm $migrate_from_kvm" - echo "TCG interpreter $tcg_interpreter" - echo "fdt support $fdt" - echo "preadv support $preadv" -@@ -3862,6 +3869,9 @@ fi - if test "$signalfd" = "yes" ; then - echo "CONFIG_SIGNALFD=y" >> $config_host_mak - fi -+if test "$migrate_from_kvm" = "yes"; then -+ echo "CONFIG_MIGRATE_FROM_QEMU_KVM=y" >> $config_host_mak -+fi - if test "$tcg_interpreter" = "yes" ; then - echo "CONFIG_TCG_INTERPRETER=y" >> $config_host_mak - fi diff --git a/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch b/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch deleted file mode 100644 index 3639e60..0000000 --- a/0002-acpi_piix4-Drop-minimum_version_id-to-handle-qemu-kv.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 28886fb9f7d908bf0f2406dc6f39ee6fe9040cfd Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Tue, 19 Feb 2013 14:44:49 -0500 -Subject: [PATCH] acpi_piix4: Drop minimum_version_id to handle qemu-kvm - migration - -qemu-kvm 1.2 advertised version_id=2, but it was not the same -format as qemu.git version_id=2. - -commit b0b873a07872f7ab7f66f259c73fb9dd42aa66a9 added the qemu-kvm -format to qemu.git, but was forced to call it version_id=3, and -bumped minimum_version_id to 3. This breaks incoming migration from -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. ---- - 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 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; - } - --/* qemu-kvm 1.2 uses version 3 but advertised as 2 -- * To support incoming qemu-kvm 1.2 migration, change version_id -- * and minimum_version_id to 2 below (which breaks migration from -- * qemu 1.2). -- * -- */ - static const VMStateDescription vmstate_acpi = { - .name = "piix4_pm", - .version_id = 3, -+#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM -+ /* -+ * qemu-kvm 1.2 uses qemu.git version 3 format, but advertised as 2. -+ * This allows incoming migration from qemu-kvm, but breaks incoming -+ * migration from qemu < 1.3. -+ */ -+ .minimum_version_id = 2, -+#else - .minimum_version_id = 3, -+#endif - .minimum_version_id_old = 1, - .load_state_old = acpi_load_old, - .post_load = vmstate_acpi_post_load, diff --git a/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch b/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch deleted file mode 100644 index a341878..0000000 --- a/0003-i8254-Fix-migration-from-qemu-kvm-1.1.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 08aac015d8ba0228dc4277dd7163f014b20c1ca5 Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Tue, 19 Feb 2013 15:04:59 -0500 -Subject: [PATCH] i8254: Fix migration from qemu-kvm < 1.1 - -qemu-kvm commit 81bdec908fb2be0ccaff1d4ee67956c509e440ad did this, -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 ---- - hw/timer/i8254_common.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -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, - .fields = (VMStateField[]) { -+#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM -+ /* qemu-kvm version_id=2 had 'flags' here which is equivalent -+ * This fixes incoming migration from qemu-kvm 1.0, but breaks -+ * incoming migration from qemu < 1.1 -+ */ -+ VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), -+#else - VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3), -+#endif - VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2, - vmstate_pit_channel, PITChannelState), - VMSTATE_INT64(channels[0].next_transition_time, diff --git a/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch b/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch deleted file mode 100644 index 3b71119..0000000 --- a/0004-pc_piix-Add-compat-handling-for-qemu-kvm-VGA-mem-siz.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 9def7a9ed113f7b40e868f663bfaa4f9717219ae Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Tue, 19 Feb 2013 15:35:40 -0500 -Subject: [PATCH] pc_piix: Add compat handling for qemu-kvm VGA mem size - -Paolo outlines this here: - -https://lists.gnu.org/archive/html/qemu-devel/2013-01/msg02540.html - -qemu-kvm defaulted to vgamem=16MB since at least 0.15, while qemu used -8MB. For qemu 1.2, the default was changed to 16MB for all devices -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. ---- - hw/i386/pc_piix.c | 20 ++++++++++++++++---- - 1 file changed, 16 insertions(+), 4 deletions(-) - -diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c -index 06416ce..0787f38 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, - }; - -+#ifdef CONFIG_MIGRATE_FROM_QEMU_KVM -+/* qemu-kvm defaulted to 16MB video memory since 0.15 at least. */ -+# define OLD_VGA_MEM stringify(16) -+#else -+# define OLD_VGA_MEM stringify(8) -+#endif -+ - #define PC_COMPAT_1_2 \ - PC_COMPAT_1_3,\ - {\ -@@ -406,6 +413,10 @@ static QEMUMachine pc_machine_v1_3 = { - .property = "revision",\ - .value = stringify(3),\ - },{\ -+ .driver = "cirrus-vga",\ -+ .property = "vgamem_mb",\ -+ .value = OLD_VGA_MEM,\ -+ },{\ - .driver = "VGA",\ - .property = "mmio",\ - .value = "off",\ -@@ -423,6 +434,7 @@ static QEMUMachine pc_machine_v1_2 = { - DEFAULT_MACHINE_OPTIONS, - }; - -+ - #define PC_COMPAT_1_1 \ - PC_COMPAT_1_2,\ - {\ -@@ -436,19 +448,19 @@ static QEMUMachine pc_machine_v1_2 = { - },{\ - .driver = "VGA",\ - .property = "vgamem_mb",\ -- .value = stringify(8),\ -+ .value = OLD_VGA_MEM,\ - },{\ - .driver = "vmware-svga",\ - .property = "vgamem_mb",\ -- .value = stringify(8),\ -+ .value = OLD_VGA_MEM,\ - },{\ - .driver = "qxl-vga",\ - .property = "vgamem_mb",\ -- .value = stringify(8),\ -+ .value = OLD_VGA_MEM,\ - },{\ - .driver = "qxl",\ - .property = "vgamem_mb",\ -- .value = stringify(8),\ -+ .value = OLD_VGA_MEM,\ - },{\ - .driver = "virtio-blk-pci",\ - .property = "config-wce",\ diff --git a/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch b/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch deleted file mode 100644 index 3616869..0000000 --- a/0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch +++ /dev/null @@ -1,99 +0,0 @@ -From dbeb3f1e3282bef66b459e3197b2078c24ad7daf Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Tue, 19 Feb 2013 16:19:02 -0500 -Subject: [PATCH] qxl: Add rom_size compat property, fix migration from 1.2 - -Commit 038c1879a00153b14bce113315b693e8c2944fa9 changed the qxl rom -size to 8192, which fixes incoming migration from qemu 1.0. However -from qemu 1.2 and 1.3 had rom size 16384, so incoming migration -from those versions is now broken. - -Add a rom_size compat property. 1.2 and 1.3 get 16384, everything -else is 8192. - -This isn't actually fool proof, since rom_size can be dependent on -the version of spice qemu is built against: - -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. ---- - hw/display/qxl.c | 9 ++++----- - hw/i386/pc_piix.c | 16 ++++++++++++++++ - 2 files changed, 20 insertions(+), 5 deletions(-) - -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; - } - --static ram_addr_t qxl_rom_size(void) -+static void check_qxl_rom_size(PCIQXLDevice *d) - { - uint32_t required_rom_size = sizeof(QXLRom) + sizeof(QXLModes) + - sizeof(qxl_modes); -- uint32_t rom_size = 8192; /* two pages */ - - required_rom_size = MAX(required_rom_size, TARGET_PAGE_SIZE); - required_rom_size = msb_mask(required_rom_size * 2 - 1); -- assert(required_rom_size <= rom_size); -- return rom_size; -+ assert(required_rom_size <= d->rom_size); - } - - static void init_qxl_rom(PCIQXLDevice *d) -@@ -1979,7 +1977,7 @@ static int qxl_init_common(PCIQXLDevice *qxl) - pci_set_byte(&config[PCI_REVISION_ID], pci_device_rev); - pci_set_byte(&config[PCI_INTERRUPT_PIN], 1); - -- qxl->rom_size = qxl_rom_size(); -+ check_qxl_rom_size(qxl); - 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); -@@ -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), -+ DEFINE_PROP_UINT32("rom_size", PCIQXLDevice, rom_size, 8192), - DEFINE_PROP_END_OF_LIST(), - }; - -diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c -index 0787f38..e26c93d 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 = { diff --git a/0006-configure-dtc-Probe-for-libfdt_env.h.patch b/0006-configure-dtc-Probe-for-libfdt_env.h.patch deleted file mode 100644 index 664453e..0000000 --- a/0006-configure-dtc-Probe-for-libfdt_env.h.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 12f9c64a068d3c5e67886dde367ccacde48fbbbd Mon Sep 17 00:00:00 2001 -From: Peter Crosthwaite -Date: Mon, 27 May 2013 14:20:57 +1000 -Subject: [PATCH] configure: dtc: Probe for libfdt_env.h - -Currently QEMU provides a local clone of the file libfdt_env.h in -/include. This file is supposed to come with the libfdt package and is -only needed for broken installs of libfdt. Now that we have submodule -dtc, just ignore these broken installs and prompt for the dtc submodule -install instead. QEMU's local libfdt_env.h is removed accordingly. - -Manifests as a bug when building QEMU with modern libfdt. The new -version of libfdt does not compile when QEMUs libfdt_env.h takes -precedence over the hosts. - -Signed-off-by: Peter Crosthwaite -Reviewed-by: Peter Maydell -Acked-by: David Gibson -Signed-off-by: Kim Phillips -Acked-by: Paolo Bonzini -Message-id: 9b6a3a52e3f46cfbc1ded9ab56385ec045e46705.1369628289.git.peter.crosthwaite@xilinx.com -Signed-off-by: Peter Maydell -(cherry picked from commit 96ce65457690561417ae8e6f0e85f3c6f135018b) ---- - configure | 2 ++ - include/libfdt_env.h | 36 ------------------------------------ - 2 files changed, 2 insertions(+), 36 deletions(-) - delete mode 100644 include/libfdt_env.h - -diff --git a/configure b/configure -index f558a21..ed09648 100755 ---- a/configure -+++ b/configure -@@ -2525,7 +2525,9 @@ fi - # fdt probe - if test "$fdt" != "no" ; then - fdt_libs="-lfdt" -+ # explicitly check for libfdt_env.h as it is missing in some stable installs - cat > $TMPC << EOF -+#include - int main(void) { return 0; } - EOF - if compile_prog "" "$fdt_libs" ; then -diff --git a/include/libfdt_env.h b/include/libfdt_env.h -deleted file mode 100644 -index 3667d4c..0000000 ---- a/include/libfdt_env.h -+++ /dev/null -@@ -1,36 +0,0 @@ --/* -- * This program is free software; you can redistribute it and/or modify -- * it under the terms of the GNU General Public License, version 2, as -- * published by the Free Software Foundation. -- * -- * This program is distributed in the hope that it will be useful, -- * but WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- * GNU General Public License for more details. -- * -- * You should have received a copy of the GNU General Public License -- * along with this program; if not, see . -- * -- * Copyright IBM Corp. 2008 -- * Authors: Hollis Blanchard -- * -- */ -- --#ifndef _LIBFDT_ENV_H --#define _LIBFDT_ENV_H -- --#include "qemu/bswap.h" -- --#ifdef HOST_WORDS_BIGENDIAN --#define fdt32_to_cpu(x) (x) --#define cpu_to_fdt32(x) (x) --#define fdt64_to_cpu(x) (x) --#define cpu_to_fdt64(x) (x) --#else --#define fdt32_to_cpu(x) bswap32(x) --#define cpu_to_fdt32(x) bswap32(x) --#define fdt64_to_cpu(x) bswap64(x) --#define cpu_to_fdt64(x) bswap64(x) --#endif -- --#endif /* _LIBFDT_ENV_H */ diff --git a/0007-spice-fix-display-initialization.patch b/0007-spice-fix-display-initialization.patch deleted file mode 100644 index 49530b5..0000000 --- a/0007-spice-fix-display-initialization.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 49c090ab950547cb807e90866439072a191513d1 Mon Sep 17 00:00:00 2001 -From: Gerd Hoffmann -Date: Tue, 23 Jul 2013 13:55:43 +0200 -Subject: [PATCH] spice: fix display initialization - -Spice has two display interface implementations: One integrated into -the qxl graphics card, and one generic which can operate with every -qemu-emulated graphics card. - -The generic one is activated in case spice is used without qxl. The -logic for that only caught the "-vga qxl" case, "-device qxl-vga" goes -unnoticed. Fix that by adding a check in the spice interface -registration so we'll notice the qxl card no matter how it is created. - -https://bugzilla.redhat.com/show_bug.cgi?id=981094 - -Signed-off-by: Gerd Hoffmann ---- - include/sysemu/sysemu.h | 1 - - include/ui/qemu-spice.h | 2 ++ - ui/spice-core.c | 5 +++++ - vl.c | 2 +- - 4 files changed, 8 insertions(+), 2 deletions(-) - -diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h -index 2fb71af..8c8a36f 100644 ---- a/include/sysemu/sysemu.h -+++ b/include/sysemu/sysemu.h -@@ -103,7 +103,6 @@ typedef enum { - - extern int vga_interface_type; - #define xenfb_enabled (vga_interface_type == VGA_XENFB) --#define qxl_enabled (vga_interface_type == VGA_QXL) - - extern int graphic_width; - extern int graphic_height; -diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h -index eba6d77..c6c756b 100644 ---- a/include/ui/qemu-spice.h -+++ b/include/ui/qemu-spice.h -@@ -27,6 +27,7 @@ - #include "monitor/monitor.h" - - extern int using_spice; -+extern int spice_displays; - - void qemu_spice_init(void); - void qemu_spice_input_init(void); -@@ -57,6 +58,7 @@ static inline CharDriverState *qemu_chr_open_spice_port(const char *name) - #include "monitor/monitor.h" - - #define using_spice 0 -+#define spice_displays 0 - static inline int qemu_spice_set_passwd(const char *passwd, - bool fail_if_connected, - bool disconnect_if_connected) -diff --git a/ui/spice-core.c b/ui/spice-core.c -index bcc4199..c8337ab 100644 ---- a/ui/spice-core.c -+++ b/ui/spice-core.c -@@ -48,6 +48,7 @@ static char *auth_passwd; - static time_t auth_expires = TIME_MAX; - static int spice_migration_completed; - int using_spice = 0; -+int spice_displays; - - static QemuThread me; - -@@ -823,6 +824,10 @@ int qemu_spice_add_interface(SpiceBaseInstance *sin) - qemu_add_vm_change_state_handler(vm_change_state_handler, NULL); - } - -+ if (strcmp(sin->sif->type, SPICE_INTERFACE_QXL) == 0) { -+ spice_displays++; -+ } -+ - return spice_server_add_interface(spice_server, sin); - } - -diff --git a/vl.c b/vl.c -index efb073f..3559f76 100644 ---- a/vl.c -+++ b/vl.c -@@ -4374,7 +4374,7 @@ int main(int argc, char **argv, char **envp) - } - #endif - #ifdef CONFIG_SPICE -- if (using_spice && !qxl_enabled) { -+ if (using_spice && !spice_displays) { - qemu_spice_display_init(ds); - } - #endif diff --git a/qemu.spec b/qemu.spec index 749171a..6839775 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,8 +139,8 @@ Summary: QEMU is a FAST! processor emulator Name: qemu -Version: 1.5.2 -Release: 4%{?dist} +Version: 1.6.0 +Release: 1%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -181,18 +181,8 @@ Source12: bridge.conf # qemu-kvm back compat wrapper Source13: qemu-kvm.sh -# qemu-kvm migration compat (posted upstream) -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) -Patch0005: 0005-qxl-Add-rom_size-compat-property-fix-migration-from-.patch -# Fix build with rawhide libfdt -Patch0006: 0006-configure-dtc-Probe-for-libfdt_env.h.patch -# Fix mouse display with spice and latest libvirt (bz #981094) -# (patch posted upstream but not applied yet) -Patch0007: 0007-spice-fix-display-initialization.patch +# qemu-kvm migration compat (not for upstream, drop by Fedora 21?) +Patch0001: 0001-Fix-migration-from-qemu-kvm.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -221,7 +211,7 @@ BuildRequires: spice-protocol >= 0.12.2 BuildRequires: spice-server-devel >= 0.12.0 %endif %if 0%{?have_seccomp:1} -BuildRequires: libseccomp-devel >= 1.0.0 +BuildRequires: libseccomp-devel >= 2.1.0 %endif # For network block driver BuildRequires: libcurl-devel @@ -272,7 +262,8 @@ BuildRequires: vte3-devel %endif # GTK translations BuildRequires: gettext - +# RDMA migration +BuildRequires: librdmacm-devel %if 0%{?user:1} Requires: %{name}-%{user} = %{epoch}:%{version}-%{release} @@ -681,18 +672,8 @@ CAC emulation development files. %prep %setup -q -# qemu-kvm migration compat (posted upstream) +# qemu-kvm migration compat (not for upstream, drop by Fedora 21?) %patch0001 -p1 -%patch0002 -p1 -%patch0003 -p1 -%patch0004 -p1 -# Fix migration w/ qxl from qemu-kvm 1.2 (solution pending upstream) -%patch0005 -p1 -# Fix build with rawhide libfdt -%patch0006 -p1 -# Fix mouse display with spice and latest libvirt (bz #981094) -# (patch posted upstream but not applied yet) -%patch0007 -p1 %build @@ -744,7 +725,6 @@ dobuild() { --disable-werror \ --disable-xen \ --enable-kvm \ - --enable-migration-from-qemu-kvm \ %if 0%{?have_spice:1} --enable-spice \ %endif @@ -1052,6 +1032,7 @@ getent passwd qemu >/dev/null || \ %doc %{qemudocdir}/LICENSE %dir %{_datadir}/%{name}/ %{_datadir}/%{name}/qemu-icon.bmp +%{_datadir}/%{name}/qemu_logo_no_text.svg %{_datadir}/%{name}/keymaps/ %{_mandir}/man1/qemu.1* %{_mandir}/man1/virtfs-proxy-helper.1* @@ -1383,6 +1364,16 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Fri Aug 16 2013 Cole Robinson - 2:1.6.0-1 +- Rebased to version 1.6.0 +- Support for live migration over RDMA +- TCG target for aarch64. +- Support for auto-convergence in live migration ("CPU stunning") +- The XHCI (USB 3.0) controller supports live migration. +- New device "nvme" provides a PCI device that implements the NVMe + standard. +- ACPI hotplug of devices behind a PCI bridge is supported + * Sun Aug 04 2013 Dennis Gilmore - 2:1.5.2-4 - re-enable spice support diff --git a/sources b/sources index 38a3273..4936b74 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -04b94189ba587b3280713ded3b7f959a qemu-1.5.2.tar.bz2 +f3f39308472d629aca57a255a0c91ba9 qemu-1.6.0.tar.bz2 From 64e123aeee810a6d5d5de36ac064c483b67869e9 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 20 Aug 2013 12:31:51 +0100 Subject: [PATCH 21/45] Try to rebuild since previous i686 build was broken (RHBZ#998722). - In build, qemu -help just to check the binary is not broken. --- qemu.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index 6839775..8dc2799 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.6.0 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -757,6 +757,12 @@ dobuild --target-list="$buildarch" gcc %{SOURCE6} -O2 -g -o ksmctl +# Check the binary runs (see eg RHBZ#998722). +%ifarch %{kvm_archs} +b="./x86_64-softmmu/qemu-system-x86_64" +if [ -x "$b" ]; then "$b" -help; fi +%endif + %install @@ -1364,6 +1370,10 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Aug 20 2013 Richard W.M. Jones - 2:1.6.0-2 +- Try to rebuild since previous i686 build was broken (RHBZ#998722). +- In build, qemu -help just to check the binary is not broken. + * Fri Aug 16 2013 Cole Robinson - 2:1.6.0-1 - Rebased to version 1.6.0 - Support for live migration over RDMA From f950cd7985506fd67b1bf318a842b92c2d09bb5f Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 20 Aug 2013 14:13:58 -0400 Subject: [PATCH 22/45] Require newer ceph-libs to fix symbol error (bz #995883) --- qemu.spec | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/qemu.spec b/qemu.spec index 8dc2799..a9bc698 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.6.0 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -217,7 +217,7 @@ BuildRequires: libseccomp-devel >= 2.1.0 BuildRequires: libcurl-devel %if %{with rbd} # For rbd block driver -BuildRequires: ceph-devel +BuildRequires: ceph-devel >= 0.61 %endif # We need both because the 'stap' binary is probed for by configure BuildRequires: systemtap @@ -367,6 +367,14 @@ Requires(post): /usr/sbin/useradd Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units + +# ceph added new symbol rbd_aio_flush which qemu wants to use, but ceph +# lacks symbol versioning so RPM doesn't pick up the dependency. +# Can probably be dropped after Fedora 20 beta +%if %{with rbd} +Requires: ceph-libs >= 0.61 +%endif + %description common QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation. @@ -1370,6 +1378,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Aug 20 2013 Cole Robinson - 2:1.6.0-3 +- Require newer ceph-libs to fix symbol error (bz #995883) + * Tue Aug 20 2013 Richard W.M. Jones - 2:1.6.0-2 - Try to rebuild since previous i686 build was broken (RHBZ#998722). - In build, qemu -help just to check the binary is not broken. From bfefcc20b87b189c6fd282af34c2cde360ab2096 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 21 Aug 2013 09:48:54 +0100 Subject: [PATCH 23/45] Require newer libssh2 to fix missing libssh2_sftp_fsync (bz #999161) --- qemu.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index a9bc698..d311b11 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.6.0 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -375,6 +375,10 @@ Requires(postun): systemd-units Requires: ceph-libs >= 0.61 %endif +# New symbol libssh2_sftp_fsync. +# Can probably be dropped after Fedora 20 beta. +Requires: libssh2 >= 1.4.3-5 + %description common QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation. @@ -1378,6 +1382,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Wed Aug 21 2013 Richard W.M. Jones - 2:1.6.0-4 +- Require newer libssh2 to fix missing libssh2_sftp_fsync (bz #999161) + * Tue Aug 20 2013 Cole Robinson - 2:1.6.0-3 - Require newer ceph-libs to fix symbol error (bz #995883) From 89d8790801629f652b6426bfdfff67006bf57a62 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 28 Aug 2013 08:36:13 -0400 Subject: [PATCH 24/45] Only build against libssh2 on F20+ to fix virt-preview --- qemu.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qemu.spec b/qemu.spec index d311b11..375a813 100644 --- a/qemu.spec +++ b/qemu.spec @@ -254,7 +254,9 @@ BuildRequires: glusterfs-api-devel >= 3.4.0 # Needed for usb passthrough for qemu >= 1.5 BuildRequires: libusbx-devel # SSH block driver +%if 0%{?fedora} >= 20 BuildRequires: libssh2-devel +%endif %if %{with gtk} # GTK frontend BuildRequires: gtk3-devel @@ -377,7 +379,9 @@ Requires: ceph-libs >= 0.61 # New symbol libssh2_sftp_fsync. # Can probably be dropped after Fedora 20 beta. +%if 0%{?fedora} >= 20 Requires: libssh2 >= 1.4.3-5 +%endif %description common QEMU is a generic and open source processor emulator which achieves a good From 54891983e0f260aef09015aadbc3a8d3497f4ecc Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 21 Aug 2013 14:10:09 +0100 Subject: [PATCH 25/45] Enable qemu-sanity-check, however do not fail the build if it fails. --- qemu.spec | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index 375a813..77348e6 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.6.0 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -266,6 +266,9 @@ BuildRequires: vte3-devel BuildRequires: gettext # RDMA migration BuildRequires: librdmacm-devel +# For sanity test +BuildRequires: qemu-sanity-check-nodeps +BuildRequires: kernel %if 0%{?user:1} Requires: %{name}-%{user} = %{epoch}:%{version}-%{release} @@ -985,6 +988,12 @@ rm -rf $RPM_BUILD_ROOT%{_includedir}/cacard %check make check +# Sanity-check current kernel can boot on this qemu. +# The results are advisory only. +%ifarch x86_64 +qemu-sanity-check --qemu=x86_64-softmmu/qemu-system-x86_64 || : +%endif + %ifarch %{kvm_archs} %post %{kvm_package} # load kvm modules now, so we can make sure no reboot is needed. @@ -1386,6 +1395,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Wed Aug 28 2013 Richard W.M. Jones - 2:1.6.0-5 +- Enable qemu-sanity-check, however do not fail the build if it fails. + * Wed Aug 21 2013 Richard W.M. Jones - 2:1.6.0-4 - Require newer libssh2 to fix missing libssh2_sftp_fsync (bz #999161) From 81ec822962abcd90ca246e19576bf63d4cb721ed Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Thu, 29 Aug 2013 12:26:19 -0400 Subject: [PATCH 26/45] Only dependy on qemu-sanity-check where it's currently available --- qemu.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qemu.spec b/qemu.spec index 77348e6..1f226f1 100644 --- a/qemu.spec +++ b/qemu.spec @@ -267,8 +267,10 @@ BuildRequires: gettext # RDMA migration BuildRequires: librdmacm-devel # For sanity test +%if 0%{?fedora} >= 20 BuildRequires: qemu-sanity-check-nodeps BuildRequires: kernel +%endif %if 0%{?user:1} Requires: %{name}-%{user} = %{epoch}:%{version}-%{release} @@ -990,9 +992,11 @@ make check # Sanity-check current kernel can boot on this qemu. # The results are advisory only. +%if 0%{?fedora} >= 20 %ifarch x86_64 qemu-sanity-check --qemu=x86_64-softmmu/qemu-system-x86_64 || : %endif +%endif %ifarch %{kvm_archs} %post %{kvm_package} From 9e0a86718c5c91e964eb4b2a87375926bd3a36cf Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 3 Sep 2013 14:49:39 -0400 Subject: [PATCH 27/45] Fix qmp capabilities calls on i686 (bz #1003162) Fix crash with -M isapc -cpu Haswell (bz #986790) Fix crash in lsi_soft_reset (bz #1000947) Fix initial /dev/kvm permissions (bz #993491) --- ...pes.py-Fix-enum-struct-sizes-on-i686.patch | 38 +++++ 0003-isapc-disable-kvmvapic.patch | 36 +++++ 0004-pci-do-not-export-pci_bus_reset.patch | 72 +++++++++ ...pre-and-post-order-vists-in-qdev-wal.patch | 141 +++++++++++++++++ 0006-qdev-switch-reset-to-post-order.patch | 143 ++++++++++++++++++ qemu.spec | 29 +++- 6 files changed, 458 insertions(+), 1 deletion(-) create mode 100644 0002-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch create mode 100644 0003-isapc-disable-kvmvapic.patch create mode 100644 0004-pci-do-not-export-pci_bus_reset.patch create mode 100644 0005-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch create mode 100644 0006-qdev-switch-reset-to-post-order.patch diff --git a/0002-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch b/0002-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch new file mode 100644 index 0000000..607826c --- /dev/null +++ b/0002-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch @@ -0,0 +1,38 @@ +From f3e59ce7c471d3f0f1f293ecd0ef3e1797ce411f Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Sat, 31 Aug 2013 18:25:01 -0400 +Subject: [PATCH] qapi-types.py: Fix enum struct sizes on i686 + +Unlike other list types, enum wasn't adding any padding, which caused +a mismatch between the generated struct size and GenericList struct +size. More details in a678e26cbe89f7a27cbce794c2c2784571ee9d21 + +This crashed qemu if calling qmp query-tpm-types for example, which +upsets libvirt capabilities probing. Reproducer on i686: + +(sleep 5; printf '{"execute":"qmp_capabilities"}\n{"execute":"query-tpm-types"}\n') | ./i386-softmmu/qemu-system-i386 -S -nodefaults -nographic -M none -qmp stdio + +https://bugs.launchpad.net/qemu/+bug/1219207 + +Cc: qemu-stable@nongnu.org +(cherry picked from commit a9d960fb0b1bc104294ab965116a2d53038b4692) +--- + scripts/qapi-types.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py +index 5ee46ea..5d31b06 100644 +--- a/scripts/qapi-types.py ++++ b/scripts/qapi-types.py +@@ -51,7 +51,10 @@ def generate_fwd_enum_struct(name, members): + return mcgen(''' + typedef struct %(name)sList + { +- %(name)s value; ++ union { ++ %(name)s value; ++ uint64_t padding; ++ }; + struct %(name)sList *next; + } %(name)sList; + ''', diff --git a/0003-isapc-disable-kvmvapic.patch b/0003-isapc-disable-kvmvapic.patch new file mode 100644 index 0000000..1fd2899 --- /dev/null +++ b/0003-isapc-disable-kvmvapic.patch @@ -0,0 +1,36 @@ +From 56cee96f3c71ffee457d8fbdf427c47824a12e05 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Tue, 13 Aug 2013 00:02:18 +0200 +Subject: [PATCH] isapc: disable kvmvapic + +vapic requires the VAPIC ROM to be mapped into RAM. This is not +possible without PAM hardware. This fixes a segmentation fault +running with -M isapc. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini + +(crobinso: s/kvmvapic/vapic/g) + +Signed-off-by: Cole Robinson +--- + hw/i386/pc_piix.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 4fd5b6d..462d991 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -795,7 +795,11 @@ static QEMUMachine isapc_machine = { + .init = pc_init_isa, + .max_cpus = 1, + .compat_props = (GlobalProperty[]) { +- { /* end of list */ } ++ { ++ .driver = "apic-common", ++ .property = "vapic", ++ .value = "off", ++ }, + }, + DEFAULT_MACHINE_OPTIONS, + }; diff --git a/0004-pci-do-not-export-pci_bus_reset.patch b/0004-pci-do-not-export-pci_bus_reset.patch new file mode 100644 index 0000000..a7fb21d --- /dev/null +++ b/0004-pci-do-not-export-pci_bus_reset.patch @@ -0,0 +1,72 @@ +From b8decc166db51601a6ad6f1df1752e9a9dc4544c Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Thu, 2 May 2013 11:38:37 +0200 +Subject: [PATCH] pci: do not export pci_bus_reset + +qbus_reset_all can be used instead. There is no semantic change +because pcibus_reset returns 1 and takes care of the device +tree traversal. + +This will be necessary once the traversal is done always in +qbus_reset_all *before* invoking pcibus_reset itself. + +Tested-by: Claudio Bley +Signed-off-by: Paolo Bonzini +--- + hw/pci/pci.c | 8 ++------ + hw/pci/pci_bridge.c | 2 +- + include/hw/pci/pci.h | 1 - + 3 files changed, 3 insertions(+), 8 deletions(-) + +diff --git a/hw/pci/pci.c b/hw/pci/pci.c +index 4c004f5..0389375 100644 +--- a/hw/pci/pci.c ++++ b/hw/pci/pci.c +@@ -210,8 +210,9 @@ void pci_device_reset(PCIDevice *dev) + * Trigger pci bus reset under a given bus. + * To be called on RST# assert. + */ +-void pci_bus_reset(PCIBus *bus) ++static int pcibus_reset(BusState *qbus) + { ++ PCIBus *bus = DO_UPCAST(PCIBus, qbus, qbus); + int i; + + for (i = 0; i < bus->nirq; i++) { +@@ -222,11 +223,6 @@ void pci_bus_reset(PCIBus *bus) + pci_device_reset(bus->devices[i]); + } + } +-} +- +-static int pcibus_reset(BusState *qbus) +-{ +- pci_bus_reset(DO_UPCAST(PCIBus, qbus, qbus)); + + /* topology traverse is done by pci_bus_reset(). + Tell qbus/qdev walker not to traverse the tree */ +diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c +index a90671d..5d0e5ff 100644 +--- a/hw/pci/pci_bridge.c ++++ b/hw/pci/pci_bridge.c +@@ -268,7 +268,7 @@ void pci_bridge_write_config(PCIDevice *d, + newctl = pci_get_word(d->config + PCI_BRIDGE_CONTROL); + if (~oldctl & newctl & PCI_BRIDGE_CTL_BUS_RESET) { + /* Trigger hot reset on 0->1 transition. */ +- pci_bus_reset(&s->sec_bus); ++ qbus_reset_all(&s->sec_bus.qbus); + } + } + +diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h +index ccec2ba..32f1419 100644 +--- a/include/hw/pci/pci.h ++++ b/include/hw/pci/pci.h +@@ -376,7 +376,6 @@ void pci_bus_fire_intx_routing_notifier(PCIBus *bus); + void pci_device_set_intx_routing_notifier(PCIDevice *dev, + PCIINTxRoutingNotifier notifier); + void pci_device_reset(PCIDevice *dev); +-void pci_bus_reset(PCIBus *bus); + + PCIDevice *pci_nic_init(NICInfo *nd, PCIBus *rootbus, + const char *default_model, diff --git a/0005-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch b/0005-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch new file mode 100644 index 0000000..a418e80 --- /dev/null +++ b/0005-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch @@ -0,0 +1,141 @@ +From 7dbd6881f10537bf586f1eedf5a3bda2e50174ca Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Thu, 2 May 2013 11:38:38 +0200 +Subject: [PATCH] qdev: allow both pre- and post-order vists in qdev walking + functions + +Resetting should be done in post-order, not pre-order. However, +qdev_walk_children and qbus_walk_children do not allow this. Fix +it by adding two extra arguments to the functions. + +Tested-by: Claudio Bley +Signed-off-by: Paolo Bonzini +--- + hw/core/qdev.c | 45 +++++++++++++++++++++++++++++++++------------ + include/hw/qdev-core.h | 13 +++++++++---- + 2 files changed, 42 insertions(+), 16 deletions(-) + +diff --git a/hw/core/qdev.c b/hw/core/qdev.c +index 9190a7e..842804f 100644 +--- a/hw/core/qdev.c ++++ b/hw/core/qdev.c +@@ -240,12 +240,12 @@ static int qbus_reset_one(BusState *bus, void *opaque) + + void qdev_reset_all(DeviceState *dev) + { +- qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL); ++ qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL); + } + + void qbus_reset_all(BusState *bus) + { +- qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL); ++ qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL); + } + + void qbus_reset_all_fn(void *opaque) +@@ -343,49 +343,70 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name) + return NULL; + } + +-int qbus_walk_children(BusState *bus, qdev_walkerfn *devfn, +- qbus_walkerfn *busfn, void *opaque) ++int qbus_walk_children(BusState *bus, ++ qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn, ++ qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn, ++ void *opaque) + { + BusChild *kid; + int err; + +- if (busfn) { +- err = busfn(bus, opaque); ++ if (pre_busfn) { ++ err = pre_busfn(bus, opaque); + if (err) { + return err; + } + } + + QTAILQ_FOREACH(kid, &bus->children, sibling) { +- err = qdev_walk_children(kid->child, devfn, busfn, opaque); ++ err = qdev_walk_children(kid->child, ++ pre_devfn, pre_busfn, ++ post_devfn, post_busfn, opaque); + if (err < 0) { + return err; + } + } + ++ if (post_busfn) { ++ err = post_busfn(bus, opaque); ++ if (err) { ++ return err; ++ } ++ } ++ + return 0; + } + +-int qdev_walk_children(DeviceState *dev, qdev_walkerfn *devfn, +- qbus_walkerfn *busfn, void *opaque) ++int qdev_walk_children(DeviceState *dev, ++ qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn, ++ qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn, ++ void *opaque) + { + BusState *bus; + int err; + +- if (devfn) { +- err = devfn(dev, opaque); ++ if (pre_devfn) { ++ err = pre_devfn(dev, opaque); + if (err) { + return err; + } + } + + QLIST_FOREACH(bus, &dev->child_bus, sibling) { +- err = qbus_walk_children(bus, devfn, busfn, opaque); ++ err = qbus_walk_children(bus, pre_devfn, pre_busfn, ++ post_devfn, post_busfn, opaque); + if (err < 0) { + return err; + } + } + ++ if (post_devfn) { ++ err = post_devfn(dev, opaque); ++ if (err) { ++ return err; ++ } ++ } ++ + return 0; + } + +diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h +index 46972f4..c6c9b14 100644 +--- a/include/hw/qdev-core.h ++++ b/include/hw/qdev-core.h +@@ -270,10 +270,15 @@ BusState *qbus_create(const char *typename, DeviceState *parent, const char *nam + /* Returns > 0 if either devfn or busfn skip walk somewhere in cursion, + * < 0 if either devfn or busfn terminate walk somewhere in cursion, + * 0 otherwise. */ +-int qbus_walk_children(BusState *bus, qdev_walkerfn *devfn, +- qbus_walkerfn *busfn, void *opaque); +-int qdev_walk_children(DeviceState *dev, qdev_walkerfn *devfn, +- qbus_walkerfn *busfn, void *opaque); ++int qbus_walk_children(BusState *bus, ++ qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn, ++ qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn, ++ void *opaque); ++int qdev_walk_children(DeviceState *dev, ++ qdev_walkerfn *pre_devfn, qbus_walkerfn *pre_busfn, ++ qdev_walkerfn *post_devfn, qbus_walkerfn *post_busfn, ++ void *opaque); ++ + void qdev_reset_all(DeviceState *dev); + + /** diff --git a/0006-qdev-switch-reset-to-post-order.patch b/0006-qdev-switch-reset-to-post-order.patch new file mode 100644 index 0000000..4679fc5 --- /dev/null +++ b/0006-qdev-switch-reset-to-post-order.patch @@ -0,0 +1,143 @@ +From 59164410b2f021d53be2ce45630647e952ccf9c2 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Thu, 2 May 2013 11:38:39 +0200 +Subject: [PATCH] qdev: switch reset to post-order + +Post-order is the only sensible direction for the reset signals. +For example, suppose pre-order is used and the parent has some data +structures that cache children state (for example a list of active +requests). When the reset method is invoked on the parent, these caches +could be in any state. + +If post-order is used, on the other hand, these will be in a known state +when the reset method is invoked on the parent. + +This change means that it is no longer possible to block the visit of +the devices, so the callback is changed to return void. This is not +a problem, because PCI was returning 1 exactly in order to achieve the +same ordering that this patch implements. + +PCI can then rely on the qdev core having sent a "reset signal" +(whatever that means) to the device, and only do the PCI-specific +initialization with the new function pci_do_device_reset, extracted +from pci_device_reset. There is no change in the operation of FLR, +which used and still uses pci_device_reset. + +Tested-by: Claudio Bley +Signed-off-by: Paolo Bonzini +--- + hw/core/qdev.c | 6 +++--- + hw/pci/pci.c | 31 ++++++++++++++++--------------- + include/hw/qdev-core.h | 2 +- + 3 files changed, 20 insertions(+), 19 deletions(-) + +diff --git a/hw/core/qdev.c b/hw/core/qdev.c +index 842804f..87d7e1e 100644 +--- a/hw/core/qdev.c ++++ b/hw/core/qdev.c +@@ -233,19 +233,19 @@ static int qbus_reset_one(BusState *bus, void *opaque) + { + BusClass *bc = BUS_GET_CLASS(bus); + if (bc->reset) { +- return bc->reset(bus); ++ bc->reset(bus); + } + return 0; + } + + void qdev_reset_all(DeviceState *dev) + { +- qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL); ++ qdev_walk_children(dev, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL); + } + + void qbus_reset_all(BusState *bus) + { +- qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL); ++ qbus_walk_children(bus, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL); + } + + void qbus_reset_all_fn(void *opaque) +diff --git a/hw/pci/pci.c b/hw/pci/pci.c +index 0389375..bbca696 100644 +--- a/hw/pci/pci.c ++++ b/hw/pci/pci.c +@@ -46,7 +46,7 @@ + static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent); + static char *pcibus_get_dev_path(DeviceState *dev); + static char *pcibus_get_fw_dev_path(DeviceState *dev); +-static int pcibus_reset(BusState *qbus); ++static void pcibus_reset(BusState *qbus); + + static Property pci_props[] = { + DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1), +@@ -165,16 +165,10 @@ void pci_device_deassert_intx(PCIDevice *dev) + } + } + +-/* +- * This function is called on #RST and FLR. +- * FLR if PCI_EXP_DEVCTL_BCR_FLR is set +- */ +-void pci_device_reset(PCIDevice *dev) ++static void pci_do_device_reset(PCIDevice *dev) + { + int r; + +- qdev_reset_all(&dev->qdev); +- + dev->irq_state = 0; + pci_update_irq_status(dev); + pci_device_deassert_intx(dev); +@@ -207,10 +201,21 @@ void pci_device_reset(PCIDevice *dev) + } + + /* ++ * This function is called on #RST and FLR. ++ * FLR if PCI_EXP_DEVCTL_BCR_FLR is set ++ */ ++void pci_device_reset(PCIDevice *dev) ++{ ++ qdev_reset_all(&dev->qdev); ++ pci_do_device_reset(dev); ++} ++ ++/* + * Trigger pci bus reset under a given bus. +- * To be called on RST# assert. ++ * Called via qbus_reset_all on RST# assert, after the devices ++ * have been reset qdev_reset_all-ed already. + */ +-static int pcibus_reset(BusState *qbus) ++static void pcibus_reset(BusState *qbus) + { + PCIBus *bus = DO_UPCAST(PCIBus, qbus, qbus); + int i; +@@ -220,13 +225,9 @@ static int pcibus_reset(BusState *qbus) + } + for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) { + if (bus->devices[i]) { +- pci_device_reset(bus->devices[i]); ++ pci_do_device_reset(bus->devices[i]); + } + } +- +- /* topology traverse is done by pci_bus_reset(). +- Tell qbus/qdev walker not to traverse the tree */ +- return 1; + } + + static void pci_host_bus_register(PCIBus *bus, DeviceState *parent) +diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h +index c6c9b14..89dcbad 100644 +--- a/include/hw/qdev-core.h ++++ b/include/hw/qdev-core.h +@@ -174,7 +174,7 @@ struct BusClass { + * bindings can be found at http://playground.sun.com/1275/bindings/. + */ + char *(*get_fw_dev_path)(DeviceState *dev); +- int (*reset)(BusState *bus); ++ void (*reset)(BusState *bus); + /* maximum devices allowed on the bus, 0: no limit. */ + int max_dev; + }; diff --git a/qemu.spec b/qemu.spec index 1f226f1..2b2147c 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.6.0 -Release: 5%{?dist} +Release: 6%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -183,6 +183,16 @@ Source13: qemu-kvm.sh # qemu-kvm migration compat (not for upstream, drop by Fedora 21?) Patch0001: 0001-Fix-migration-from-qemu-kvm.patch +# Fix qmp capabilities calls on i686 (bz #1003162) +# Patch posted upstream +Patch0002: 0002-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch +# Fix crash with -M isapc -cpu Haswell (bz #986790) +Patch0003: 0003-isapc-disable-kvmvapic.patch +# Fix crash in lsi_soft_reset (bz #1000947) +# Patches posted upstream +Patch0004: 0004-pci-do-not-export-pci_bus_reset.patch +Patch0005: 0005-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch +Patch0006: 0006-qdev-switch-reset-to-post-order.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -695,6 +705,16 @@ CAC emulation development files. # qemu-kvm migration compat (not for upstream, drop by Fedora 21?) %patch0001 -p1 +# Fix qmp capabilities calls on i686 (bz #1003162) +# Patch posted upstream +%patch0002 -p1 +# Fix crash with -M isapc -cpu Haswell (bz #986790) +%patch0003 -p1 +# Fix crash in lsi_soft_reset (bz #1000947) +# Patches posted upstream +%patch0004 -p1 +%patch0005 -p1 +%patch0006 -p1 %build @@ -1003,6 +1023,7 @@ qemu-sanity-check --qemu=x86_64-softmmu/qemu-system-x86_64 || : # load kvm modules now, so we can make sure no reboot is needed. # If there's already a kvm module installed, we don't mess with it sh %{_sysconfdir}/sysconfig/modules/kvm.modules &> /dev/null || : +setfacl --remove-all /dev/kvm &> /dev/null || : udevadm trigger --subsystem-match=misc --sysname-match=kvm --action=add || : %endif @@ -1399,6 +1420,12 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Sep 03 2013 Cole Robinson - 2:1.6.0-6 +- Fix qmp capabilities calls on i686 (bz #1003162) +- Fix crash with -M isapc -cpu Haswell (bz #986790) +- Fix crash in lsi_soft_reset (bz #1000947) +- Fix initial /dev/kvm permissions (bz #993491) + * Wed Aug 28 2013 Richard W.M. Jones - 2:1.6.0-5 - Enable qemu-sanity-check, however do not fail the build if it fails. From 52cf04624c334193effe580fc420a6350988c8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Hor=C3=A1k?= Date: Thu, 12 Sep 2013 19:09:51 +0200 Subject: [PATCH 28/45] - Enable TCG interpreter for s390 as the native backend supports 64-bit only - Don't require RDMA on s390(x) --- qemu.spec | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index 2b2147c..6a644df 100644 --- a/qemu.spec +++ b/qemu.spec @@ -140,7 +140,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.6.0 -Release: 6%{?dist} +Release: 7%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -275,7 +275,9 @@ BuildRequires: vte3-devel # GTK translations BuildRequires: gettext # RDMA migration +%ifnarch s390 s390x BuildRequires: librdmacm-devel +%endif # For sanity test %if 0%{?fedora} >= 20 BuildRequires: qemu-sanity-check-nodeps @@ -784,6 +786,9 @@ dobuild() { --with-gtkabi="3.0" \ %endif --enable-tpm \ +%ifarch s390 + --enable-tcg-interpreter \ +%endif "$@" echo "config-host.mak contents:" @@ -1420,6 +1425,10 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Thu Sep 12 2013 Dan Horák - 2:1.6.0-7 +- Enable TCG interpreter for s390 as the native backend supports 64-bit only +- Don't require RDMA on s390(x) + * Tue Sep 03 2013 Cole Robinson - 2:1.6.0-6 - Fix qmp capabilities calls on i686 (bz #1003162) - Fix crash with -M isapc -cpu Haswell (bz #986790) From 840b28a1f8805fe2f53d9c78a0bd61dbc5eac302 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 24 Sep 2013 10:17:48 -0400 Subject: [PATCH 29/45] Fix -vga qxl with -display vnc (bz #948717) Fix USB crash when installing reactos (bz #1005495) Don't ship x86 kvm wrapper on arm (bz #1005581) --- 0007-qxl-fix-local-renderer.patch | 65 +++++++++++++++++++ ...hci-save-device-pointer-in-EHCIState.patch | 65 +++++++++++++++++++ qemu.spec | 20 +++++- 3 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 0007-qxl-fix-local-renderer.patch create mode 100644 0008-ehci-save-device-pointer-in-EHCIState.patch diff --git a/0007-qxl-fix-local-renderer.patch b/0007-qxl-fix-local-renderer.patch new file mode 100644 index 0000000..fa226de --- /dev/null +++ b/0007-qxl-fix-local-renderer.patch @@ -0,0 +1,65 @@ +From 909d4a71878f3568b6c636a07d9f4f2c97a5de12 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Thu, 5 Sep 2013 21:57:19 +0200 +Subject: [PATCH] qxl: fix local renderer + +The local spice renderer assumes the primary surface is located at the +start of the "ram" bar. This used to be a requirement in qxl hardware +revision 1. In revision 2+ this is relaxed. Nevertheless guest drivers +continued to use the traditional location, for historical and backward +compatibility reasons. The qxl kms driver doesn't though as it depends +on qxl revision 4+ anyway. + +Result is that local rendering is hosed for recent linux guests, you'll +get pixel garbage with non-spice ui (gtk, sdl, vnc) and when doing +screendumps. Fix that by doing a proper mapping of the guest-specified +memory location. + +https://bugzilla.redhat.com/show_bug.cgi?id=948717 + +Signed-off-by: Gerd Hoffmann +(cherry picked from commit c58c7b959b93b864a27fd6b3646ee1465ab8832b) +--- + hw/display/qxl-render.c | 15 ++++++++++----- + 1 file changed, 10 insertions(+), 5 deletions(-) + +diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c +index 269b1a7..d34b0c4 100644 +--- a/hw/display/qxl-render.c ++++ b/hw/display/qxl-render.c +@@ -31,10 +31,6 @@ static void qxl_blit(PCIQXLDevice *qxl, QXLRect *rect) + if (is_buffer_shared(surface)) { + return; + } +- if (!qxl->guest_primary.data) { +- trace_qxl_render_blit_guest_primary_initialized(); +- qxl->guest_primary.data = memory_region_get_ram_ptr(&qxl->vga.vram); +- } + trace_qxl_render_blit(qxl->guest_primary.qxl_stride, + rect->left, rect->right, rect->top, rect->bottom); + src = qxl->guest_primary.data; +@@ -104,7 +100,12 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) + + if (qxl->guest_primary.resized) { + qxl->guest_primary.resized = 0; +- qxl->guest_primary.data = memory_region_get_ram_ptr(&qxl->vga.vram); ++ qxl->guest_primary.data = qxl_phys2virt(qxl, ++ qxl->guest_primary.surface.mem, ++ MEMSLOT_GROUP_GUEST); ++ if (!qxl->guest_primary.data) { ++ return; ++ } + qxl_set_rect_to_surface(qxl, &qxl->dirty[0]); + qxl->num_dirty_rects = 1; + trace_qxl_render_guest_primary_resized( +@@ -128,6 +129,10 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) + } + dpy_gfx_replace_surface(vga->con, surface); + } ++ ++ if (!qxl->guest_primary.data) { ++ return; ++ } + for (i = 0; i < qxl->num_dirty_rects; i++) { + if (qemu_spice_rect_is_empty(qxl->dirty+i)) { + break; diff --git a/0008-ehci-save-device-pointer-in-EHCIState.patch b/0008-ehci-save-device-pointer-in-EHCIState.patch new file mode 100644 index 0000000..0168d9c --- /dev/null +++ b/0008-ehci-save-device-pointer-in-EHCIState.patch @@ -0,0 +1,65 @@ +From f0679fb95d2c1b9597b83184309e70cc3c3e3b1d Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Mon, 9 Sep 2013 10:18:17 +0200 +Subject: [PATCH] ehci: save device pointer in EHCIState + +We'll need a pointer to the actual pci/sysbus device, +stick a pointer to it into the EHCIState struct. + +https://bugzilla.redhat.com/show_bug.cgi?id=1005495 + +Signed-off-by: Gerd Hoffmann +(cherry picked from commit adbecc89731cf3e0ae656d50ea9fa58c589c4bdc) +--- + hw/usb/hcd-ehci.c | 7 +++---- + hw/usb/hcd-ehci.h | 1 + + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c +index 010a0d0..e9fb20c 100644 +--- a/hw/usb/hcd-ehci.c ++++ b/hw/usb/hcd-ehci.c +@@ -1241,13 +1241,11 @@ static int ehci_init_transfer(EHCIPacket *p) + { + uint32_t cpage, offset, bytes, plen; + dma_addr_t page; +- USBBus *bus = &p->queue->ehci->bus; +- BusState *qbus = BUS(bus); + + cpage = get_field(p->qtd.token, QTD_TOKEN_CPAGE); + bytes = get_field(p->qtd.token, QTD_TOKEN_TBYTES); + offset = p->qtd.bufptr[0] & ~QTD_BUFPTR_MASK; +- qemu_sglist_init(&p->sgl, qbus->parent, 5, p->queue->ehci->as); ++ qemu_sglist_init(&p->sgl, p->queue->ehci->device, 5, p->queue->ehci->as); + + while (bytes > 0) { + if (cpage > 4) { +@@ -1486,7 +1484,7 @@ static int ehci_process_itd(EHCIState *ehci, + return -1; + } + +- qemu_sglist_init(&ehci->isgl, DEVICE(ehci), 2, ehci->as); ++ qemu_sglist_init(&ehci->isgl, ehci->device, 2, ehci->as); + if (off + len > 4096) { + /* transfer crosses page border */ + uint32_t len2 = off + len - 4096; +@@ -2529,6 +2527,7 @@ void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp) + + s->frame_timer = qemu_new_timer_ns(vm_clock, ehci_frame_timer, s); + s->async_bh = qemu_bh_new(ehci_frame_timer, s); ++ s->device = dev; + + qemu_register_reset(ehci_reset, s); + qemu_add_vm_change_state_handler(usb_ehci_vm_state_change, s); +diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h +index 15a28e8..065c9fa 100644 +--- a/hw/usb/hcd-ehci.h ++++ b/hw/usb/hcd-ehci.h +@@ -255,6 +255,7 @@ typedef QTAILQ_HEAD(EHCIQueueHead, EHCIQueue) EHCIQueueHead; + + struct EHCIState { + USBBus bus; ++ DeviceState *device; + qemu_irq irq; + MemoryRegion mem; + AddressSpace *as; diff --git a/qemu.spec b/qemu.spec index 6a644df..11201f2 100644 --- a/qemu.spec +++ b/qemu.spec @@ -104,7 +104,6 @@ %global system_arm kvm %global kvm_package system-arm %global kvm_target arm -%global need_qemu_kvm 1 %endif %if %{with kvmonly} @@ -140,7 +139,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.6.0 -Release: 7%{?dist} +Release: 8%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -193,6 +192,12 @@ Patch0003: 0003-isapc-disable-kvmvapic.patch Patch0004: 0004-pci-do-not-export-pci_bus_reset.patch Patch0005: 0005-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch Patch0006: 0006-qdev-switch-reset-to-post-order.patch +# Fix -vga qxl with -display vnc (bz #948717) +# Patch posted upstream +Patch0007: 0007-qxl-fix-local-renderer.patch +# Fix USB crash when installing reactos (bz #1005495) +# Patch posted upstream +Patch0008: 0008-ehci-save-device-pointer-in-EHCIState.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -717,6 +722,12 @@ CAC emulation development files. %patch0004 -p1 %patch0005 -p1 %patch0006 -p1 +# Fix -vga qxl with -display vnc (bz #948717) +# Patch posted upstream +%patch0007 -p1 +# Fix USB crash when installing reactos (bz #1005495) +# Patch posted upstream +%patch0008 -p1 %build @@ -1425,6 +1436,11 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Sep 24 2013 Cole Robinson - 2:1.6.0-8 +- Fix -vga qxl with -display vnc (bz #948717) +- Fix USB crash when installing reactos (bz #1005495) +- Don't ship x86 kvm wrapper on arm (bz #1005581) + * Thu Sep 12 2013 Dan Horák - 2:1.6.0-7 - Enable TCG interpreter for s390 as the native backend supports 64-bit only - Don't require RDMA on s390(x) From 2983660f65e196adaefdadc807effe9c1af85cb3 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sun, 6 Oct 2013 14:33:55 -0400 Subject: [PATCH 30/45] Rebase to pending 1.6.1 stable CVE-2013-4377: Fix crash when unplugging virtio devices (bz #1012633, bz #1012641) Fix 'new snapshot' slowness after the first snap (bz #988436) Fix 9pfs xattrs on kernel 3.11 (bz #1013676) CVE-2013-4344: buffer overflow in scsi_target_emulate_report_luns (bz #1015274, bz #1007330) --- ...v_drain_all-works-during-bdrv_delete.patch | 36 ++ ...register_coprocessor-register-counti.patch | 96 ++++ ...-fix-bit-extraction-for-FPBF-and-FPL.patch | 40 ++ 0004-rdma-silly-ipv6-bugfix.patch | 37 ++ ...Avoid-syntax-not-supported-by-Python.patch | 32 ++ ...fied-usb-tablet-category-from-Misc-t.patch | 35 ++ ...s_legacy_add_drive-scsi-generic-with.patch | 49 ++ ...fix-regression-for-64-bit-PCI-memory.patch | 116 +++++ ...stalls-on-hypervisor-virtual-console.patch | 45 ++ ..._get_avail_bytes-fix-desc_pa-when-lo.patch | 41 ++ ...ci-fix-endpoint-interval-calculation.patch | 27 ++ ...-hub-report-status-changes-only-once.patch | 48 ++ ...ect-errors-from-bdrv_co_is_allocated.patch | 149 ++++++ ...i386-fix-disassembly-with-PAE-1-PG-0.patch | 76 +++ ...-sort-offsets-in-portio-registration.patch | 35 ++ ...-to-MMIO-area-with-non-power-of-two-.patch | 37 ++ ..._pci-fix-level-interrupts-with-irqfd.patch | 38 ++ 0018-exec-always-use-MADV_DONTFORK.patch | 43 ++ ...-xhci-reset-port-when-disabling-slot.patch | 26 + 0020-usb-parallelize-usb3-streams.patch | 52 ++ ...ix-access-to-host-devices-regression.patch | 86 ++++ ...eparate-handling-of-unassigned-io-po.patch | 78 +++ ...turn-1-again-on-reads-from-unsigned-.patch | 34 ++ ...t_within_address_space-for-register-.patch | 40 ++ 0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch | 35 ++ ...hci-save-device-pointer-in-EHCIState.patch | 4 +- ...patch => 0027-qxl-fix-local-renderer.patch | 4 +- ...pc-Initializing-ram_memory-under-Xen.patch | 107 +++++ 0029-pc_q35-Initialize-Xen.patch | 31 ++ ...pes.py-Fix-enum-struct-sizes-on-i686.patch | 12 +- ...i-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch | 45 ++ 0032-chardev-fix-pty_chr_timer.patch | 52 ++ 0033-kvmvapic-Catch-invalid-ROM-size.patch | 59 +++ ...ter-inactive-state-on-hardware-reset.patch | 34 ++ ...lso-physical-ROM-address-when-enteri.patch | 39 ++ ...pha-on-32-bit-hosts-wrong-assertions.patch | 125 +++++ ...o-not-default-cache.no-flush-to-true.patch | 33 ++ ...t-relay-a-previous-driver-s-WCE-conf.patch | 111 +++++ ...te-intr-endpoint-intervals-correctly.patch | 131 +++++ ..._len-may-be-used-unitialized-warning.patch | 37 ++ ...ered-tap-tun-devices-on-all-BSD-OS-s.patch | 47 ++ ...void-qemu_rbd_snap_list-memory-leaks.patch | 43 ++ ...-cluster-size-check-for-flat-extents.patch | 64 +++ 0044-piix4-disable-io-on-reset.patch | 33 ++ ...d-.-configure-disable-coroutine-pool.patch | 163 +++++++ 0046-qemu-Adjust-qemu-wakeup.patch | 123 +++++ ...qemu-xen-logic-for-Xen-HVM-S3-resume.patch | 53 +++ ...cate-SCSITargetReq-r-buf-dynamically.patch | 154 ++++++ 0049-Update-VERSION-for-1.6.1-release.patch | 17 + ... => 0101-Fix-migration-from-qemu-kvm.patch | 6 +- ...patch => 0102-isapc-disable-kvmvapic.patch | 4 +- ...0103-pci-do-not-export-pci_bus_reset.patch | 2 +- ...pre-and-post-order-vists-in-qdev-wal.patch | 2 +- ...0105-qdev-switch-reset-to-post-order.patch | 2 +- 0106-virtio-bus-remove-vdev-field.patch | 251 ++++++++++ 0107-virtio-pci-remove-vdev-field.patch | 447 ++++++++++++++++++ 0108-virtio-ccw-remove-vdev-field.patch | 293 ++++++++++++ ...io-bus-cleanup-plug-unplug-interface.patch | 148 ++++++ ...h-exit-callback-to-VirtioDeviceClass.patch | 53 +++ ...itch-exit-callback-to-VirtioDeviceCl.patch | 53 +++ ...h-exit-callback-to-VirtioDeviceClass.patch | 58 +++ ...ch-exit-callback-to-VirtioDeviceClas.patch | 112 +++++ ...witch-exit-callback-to-VirtioDeviceC.patch | 49 ++ ...h-exit-callback-to-VirtioDeviceClass.patch | 49 ++ ...io-pci-add-device_unplugged-callback.patch | 59 +++ ...scard-type-to-qcow2_discard_clusters.patch | 81 ++++ ...-state-in-active-L1-after-creating-s.patch | 73 +++ ...-Fix-errno-value-for-xattr-functions.patch | 68 +++ qemu.spec | 185 +++++++- 69 files changed, 4810 insertions(+), 37 deletions(-) create mode 100644 0001-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch create mode 100644 0002-gdbstub-Fix-gdb_register_coprocessor-register-counti.patch create mode 100644 0003-target-ppc-fix-bit-extraction-for-FPBF-and-FPL.patch create mode 100644 0004-rdma-silly-ipv6-bugfix.patch create mode 100644 0005-scripts-qapi.py-Avoid-syntax-not-supported-by-Python.patch create mode 100644 0006-usb-dev-hid-Modified-usb-tablet-category-from-Misc-t.patch create mode 100644 0007-scsi-Fix-scsi_bus_legacy_add_drive-scsi-generic-with.patch create mode 100644 0008-pc-fix-regression-for-64-bit-PCI-memory.patch create mode 100644 0009-pseries-Fix-stalls-on-hypervisor-virtual-console.patch create mode 100644 0010-virtio-virtqueue_get_avail_bytes-fix-desc_pa-when-lo.patch create mode 100644 0011-xhci-fix-endpoint-interval-calculation.patch create mode 100644 0012-Revert-usb-hub-report-status-changes-only-once.patch create mode 100644 0013-block-expect-errors-from-bdrv_co_is_allocated.patch create mode 100644 0014-target-i386-fix-disassembly-with-PAE-1-PG-0.patch create mode 100644 0015-adlib-sort-offsets-in-portio-registration.patch create mode 100644 0016-exec-fix-writing-to-MMIO-area-with-non-power-of-two-.patch create mode 100644 0017-virtio_pci-fix-level-interrupts-with-irqfd.patch create mode 100644 0018-exec-always-use-MADV_DONTFORK.patch create mode 100644 0019-xhci-reset-port-when-disabling-slot.patch create mode 100644 0020-usb-parallelize-usb3-streams.patch create mode 100644 0021-w32-Fix-access-to-host-devices-regression.patch create mode 100644 0022-memory-Provide-separate-handling-of-unassigned-io-po.patch create mode 100644 0023-Revert-memory-Return-1-again-on-reads-from-unsigned-.patch create mode 100644 0024-exec-check-offset_within_address_space-for-register-.patch create mode 100644 0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch rename 0008-ehci-save-device-pointer-in-EHCIState.patch => 0026-ehci-save-device-pointer-in-EHCIState.patch (95%) rename 0007-qxl-fix-local-renderer.patch => 0027-qxl-fix-local-renderer.patch (95%) create mode 100644 0028-pc-Initializing-ram_memory-under-Xen.patch create mode 100644 0029-pc_q35-Initialize-Xen.patch rename 0002-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch => 0030-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch (73%) create mode 100644 0031-pcnet-pci-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch create mode 100644 0032-chardev-fix-pty_chr_timer.patch create mode 100644 0033-kvmvapic-Catch-invalid-ROM-size.patch create mode 100644 0034-kvmvapic-Enter-inactive-state-on-hardware-reset.patch create mode 100644 0035-kvmvapic-Clear-also-physical-ROM-address-when-enteri.patch create mode 100644 0036-tci-Fix-qemu-alpha-on-32-bit-hosts-wrong-assertions.patch create mode 100644 0037-blockdev-do-not-default-cache.no-flush-to-true.patch create mode 100644 0038-virtio-blk-do-not-relay-a-previous-driver-s-WCE-conf.patch create mode 100644 0039-xhci-emulate-intr-endpoint-intervals-correctly.patch create mode 100644 0040-iov-avoid-orig_len-may-be-used-unitialized-warning.patch create mode 100644 0041-tap-Use-numbered-tap-tun-devices-on-all-BSD-OS-s.patch create mode 100644 0042-rbd-avoid-qemu_rbd_snap_list-memory-leaks.patch create mode 100644 0043-vmdk-fix-cluster-size-check-for-flat-extents.patch create mode 100644 0044-piix4-disable-io-on-reset.patch create mode 100644 0045-coroutine-add-.-configure-disable-coroutine-pool.patch create mode 100644 0046-qemu-Adjust-qemu-wakeup.patch create mode 100644 0047-qemu-Add-qemu-xen-logic-for-Xen-HVM-S3-resume.patch create mode 100644 0048-scsi-Allocate-SCSITargetReq-r-buf-dynamically.patch create mode 100644 0049-Update-VERSION-for-1.6.1-release.patch rename 0001-Fix-migration-from-qemu-kvm.patch => 0101-Fix-migration-from-qemu-kvm.patch (98%) rename 0003-isapc-disable-kvmvapic.patch => 0102-isapc-disable-kvmvapic.patch (91%) rename 0004-pci-do-not-export-pci_bus_reset.patch => 0103-pci-do-not-export-pci_bus_reset.patch (97%) rename 0005-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch => 0104-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch (98%) rename 0006-qdev-switch-reset-to-post-order.patch => 0105-qdev-switch-reset-to-post-order.patch (98%) create mode 100644 0106-virtio-bus-remove-vdev-field.patch create mode 100644 0107-virtio-pci-remove-vdev-field.patch create mode 100644 0108-virtio-ccw-remove-vdev-field.patch create mode 100644 0109-virtio-bus-cleanup-plug-unplug-interface.patch create mode 100644 0110-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch create mode 100644 0111-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch create mode 100644 0112-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch create mode 100644 0113-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch create mode 100644 0114-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch create mode 100644 0115-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch create mode 100644 0116-virtio-pci-add-device_unplugged-callback.patch create mode 100644 0201-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch create mode 100644 0202-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch create mode 100644 0203-hw-9pfs-Fix-errno-value-for-xattr-functions.patch diff --git a/0001-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch b/0001-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch new file mode 100644 index 0000000..7268607 --- /dev/null +++ b/0001-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch @@ -0,0 +1,36 @@ +From 670599a08c052f6ef841743731a8f06d4b50ec99 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Thu, 27 Jun 2013 15:32:26 +0200 +Subject: [PATCH] block: ensure bdrv_drain_all() works during bdrv_delete() + +In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close() +so that the device is still seen by bdrv_drain_all() when iterating +bdrv_states. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit e1b5c52e04d04bb93546c6e37e8884889d047cb1) + +Signed-off-by: Michael Roth +--- + block.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/block.c b/block.c +index 01b66d8..d5ce8d3 100644 +--- a/block.c ++++ b/block.c +@@ -1606,11 +1606,11 @@ void bdrv_delete(BlockDriverState *bs) + assert(!bs->job); + assert(!bs->in_use); + ++ bdrv_close(bs); ++ + /* remove from list, if necessary */ + bdrv_make_anon(bs); + +- bdrv_close(bs); +- + g_free(bs); + } + diff --git a/0002-gdbstub-Fix-gdb_register_coprocessor-register-counti.patch b/0002-gdbstub-Fix-gdb_register_coprocessor-register-counti.patch new file mode 100644 index 0000000..46cb0d9 --- /dev/null +++ b/0002-gdbstub-Fix-gdb_register_coprocessor-register-counti.patch @@ -0,0 +1,96 @@ +From c0c080c5d1ce6c236ba8ab5db3a17043c665d0f6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20F=C3=A4rber?= +Date: Mon, 12 Aug 2013 18:09:47 +0200 +Subject: [PATCH] gdbstub: Fix gdb_register_coprocessor() register counting +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit a0e372f0c49ac01faeaeb73a6e8f50e8ac615f34 reorganized the register +counting for GDB. While it seems correct not to let the total number of +registers skyrocket in an SMP scenario through a static variable, the +distinction between total register count and 'g' packet register count +(last_reg vs. num_g_regs) got lost among the way. + +Fix this by introducing CPUState::gdb_num_g_regs and using that in +gdb_handle_packet(). + +Reported-by: Aneesh Kumar K.V +Cc: qemu-stable@nongnu.org (stable-1.6) +Tested-by: Aneesh Kumar K.V +Tested-by: Max Filippov +Tested-by: Peter Maydell +Signed-off-by: Andreas Färber +(cherry picked from commit 35143f0164e6933a85c7c2b8a89a040d881a9151) + +Signed-off-by: Michael Roth +--- + gdbstub.c | 6 ++++-- + include/qom/cpu.h | 2 ++ + qom/cpu.c | 2 +- + 3 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/gdbstub.c b/gdbstub.c +index 1af25a6..9d067d6 100644 +--- a/gdbstub.c ++++ b/gdbstub.c +@@ -621,6 +621,8 @@ void gdb_register_coprocessor(CPUState *cpu, + if (g_pos != s->base_reg) { + fprintf(stderr, "Error: Bad gdb register numbering for '%s'\n" + "Expected %d got %d\n", xml, g_pos, s->base_reg); ++ } else { ++ cpu->gdb_num_g_regs = cpu->gdb_num_regs; + } + } + } +@@ -902,7 +904,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) + case 'g': + cpu_synchronize_state(s->g_cpu); + len = 0; +- for (addr = 0; addr < s->g_cpu->gdb_num_regs; addr++) { ++ for (addr = 0; addr < s->g_cpu->gdb_num_g_regs; addr++) { + reg_size = gdb_read_register(s->g_cpu, mem_buf + len, addr); + len += reg_size; + } +@@ -914,7 +916,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) + registers = mem_buf; + len = strlen(p) / 2; + hextomem((uint8_t *)registers, p, len); +- for (addr = 0; addr < s->g_cpu->gdb_num_regs && len > 0; addr++) { ++ for (addr = 0; addr < s->g_cpu->gdb_num_g_regs && len > 0; addr++) { + reg_size = gdb_write_register(s->g_cpu, registers, addr); + len -= reg_size; + registers += reg_size; +diff --git a/include/qom/cpu.h b/include/qom/cpu.h +index 0d6e95c..3e49936 100644 +--- a/include/qom/cpu.h ++++ b/include/qom/cpu.h +@@ -152,6 +152,7 @@ struct kvm_run; + * @current_tb: Currently executing TB. + * @gdb_regs: Additional GDB registers. + * @gdb_num_regs: Number of total registers accessible to GDB. ++ * @gdb_num_g_regs: Number of registers in GDB 'g' packets. + * @next_cpu: Next CPU sharing TB cache. + * @kvm_fd: vCPU file descriptor for KVM. + * +@@ -188,6 +189,7 @@ struct CPUState { + struct TranslationBlock *current_tb; + struct GDBRegisterState *gdb_regs; + int gdb_num_regs; ++ int gdb_num_g_regs; + CPUState *next_cpu; + + int kvm_fd; +diff --git a/qom/cpu.c b/qom/cpu.c +index aa95108..e71e57b 100644 +--- a/qom/cpu.c ++++ b/qom/cpu.c +@@ -240,7 +240,7 @@ static void cpu_common_initfn(Object *obj) + CPUState *cpu = CPU(obj); + CPUClass *cc = CPU_GET_CLASS(obj); + +- cpu->gdb_num_regs = cc->gdb_num_core_regs; ++ cpu->gdb_num_regs = cpu->gdb_num_g_regs = cc->gdb_num_core_regs; + } + + static int64_t cpu_common_get_arch_id(CPUState *cpu) diff --git a/0003-target-ppc-fix-bit-extraction-for-FPBF-and-FPL.patch b/0003-target-ppc-fix-bit-extraction-for-FPBF-and-FPL.patch new file mode 100644 index 0000000..faf651b --- /dev/null +++ b/0003-target-ppc-fix-bit-extraction-for-FPBF-and-FPL.patch @@ -0,0 +1,40 @@ +From 52f99b02e5ff1004fb3b41846d2c34f190127456 Mon Sep 17 00:00:00 2001 +From: Aurelien Jarno +Date: Thu, 15 Aug 2013 13:32:38 +0200 +Subject: [PATCH] target-ppc: fix bit extraction for FPBF and FPL + +Bit extraction for the FP BF and L field of the MTFSFI and MTFSF +instructions is wrong and doesn't match the reference manual (which +explain the bit number in big endian format). It has been broken in +commit 7d08d85645def18eac2a9d672c1868a35e0bcf79. + +This patch fixes this, which in turn fixes the problem reported by +Khem Raj about the floor() function of libm. + +Reported-by: Khem Raj +Signed-off-by: Aurelien Jarno +CC: qemu-stable@nongnu.org (1.6) +Signed-off-by: Alexander Graf +(cherry picked from commit 779f659021d1754117bce1aab9370dc22f37ae07) + +Signed-off-by: Michael Roth +--- + target-ppc/translate.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/target-ppc/translate.c b/target-ppc/translate.c +index f07d70d..41f4048 100644 +--- a/target-ppc/translate.c ++++ b/target-ppc/translate.c +@@ -428,9 +428,9 @@ EXTRACT_HELPER(CRM, 12, 8); + EXTRACT_HELPER(SR, 16, 4); + + /* mtfsf/mtfsfi */ +-EXTRACT_HELPER(FPBF, 19, 3); ++EXTRACT_HELPER(FPBF, 23, 3); + EXTRACT_HELPER(FPIMM, 12, 4); +-EXTRACT_HELPER(FPL, 21, 1); ++EXTRACT_HELPER(FPL, 25, 1); + EXTRACT_HELPER(FPFLM, 17, 8); + EXTRACT_HELPER(FPW, 16, 1); + diff --git a/0004-rdma-silly-ipv6-bugfix.patch b/0004-rdma-silly-ipv6-bugfix.patch new file mode 100644 index 0000000..6ee6865 --- /dev/null +++ b/0004-rdma-silly-ipv6-bugfix.patch @@ -0,0 +1,37 @@ +From 260790645e95891cb264c2d657648f43401ac915 Mon Sep 17 00:00:00 2001 +From: "Michael R. Hines" +Date: Sun, 18 Aug 2013 22:27:08 -0400 +Subject: [PATCH] rdma: silly ipv6 bugfix + +My bad - but it's very important for us to warn the user that +IPv6 is broken on RoCE in linux right now, until linux releases +a fixed version. + +Signed-off-by: Michael R. Hines +Signed-off-by: Michael Tokarev +(cherry picked from commit c89aa2f1851b08c3efa8a1070c0a6b9a36e1227f) + +Signed-off-by: Michael Roth +--- + migration-rdma.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/migration-rdma.c b/migration-rdma.c +index 3d1266f..f5e75d6 100644 +--- a/migration-rdma.c ++++ b/migration-rdma.c +@@ -920,9 +920,11 @@ static int qemu_rdma_resolve_host(RDMAContext *rdma, Error **errp) + ret = rdma_resolve_addr(rdma->cm_id, NULL, e->ai_dst_addr, + RDMA_RESOLVE_TIMEOUT_MS); + if (!ret) { +- ret = qemu_rdma_broken_ipv6_kernel(errp, rdma->cm_id->verbs); +- if (ret) { +- continue; ++ if (e->ai_family == AF_INET6) { ++ ret = qemu_rdma_broken_ipv6_kernel(errp, rdma->cm_id->verbs); ++ if (ret) { ++ continue; ++ } + } + goto route; + } diff --git a/0005-scripts-qapi.py-Avoid-syntax-not-supported-by-Python.patch b/0005-scripts-qapi.py-Avoid-syntax-not-supported-by-Python.patch new file mode 100644 index 0000000..292328e --- /dev/null +++ b/0005-scripts-qapi.py-Avoid-syntax-not-supported-by-Python.patch @@ -0,0 +1,32 @@ +From d6dcfd69f8b2aa2cad79486bbadef7d51f7f4e7d Mon Sep 17 00:00:00 2001 +From: Peter Maydell +Date: Tue, 20 Aug 2013 15:50:15 +0100 +Subject: [PATCH] scripts/qapi.py: Avoid syntax not supported by Python 2.4 + +The Python "except Foo as x" syntax was only introduced in +Python 2.6, but we aim to support Python 2.4 and later. +Use the old-style "except Foo, x" syntax instead, thus +fixing configure/compile on systems with older Python. + +Signed-off-by: Peter Maydell +Signed-off-by: Luiz Capitulino +(cherry picked from commit 21e0043bada1a24ae2ba6cd0051e104c0cbf9634) + +Signed-off-by: Michael Roth +--- + scripts/qapi.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/qapi.py b/scripts/qapi.py +index 0ebea94..1069310 100644 +--- a/scripts/qapi.py ++++ b/scripts/qapi.py +@@ -161,7 +161,7 @@ class QAPISchema: + def parse_schema(fp): + try: + schema = QAPISchema(fp) +- except QAPISchemaError as e: ++ except QAPISchemaError, e: + print >>sys.stderr, e + exit(1) + diff --git a/0006-usb-dev-hid-Modified-usb-tablet-category-from-Misc-t.patch b/0006-usb-dev-hid-Modified-usb-tablet-category-from-Misc-t.patch new file mode 100644 index 0000000..ed4a84b --- /dev/null +++ b/0006-usb-dev-hid-Modified-usb-tablet-category-from-Misc-t.patch @@ -0,0 +1,35 @@ +From 11b0ab70a58e3e6c06dc1fd1ea318b1c5806d955 Mon Sep 17 00:00:00 2001 +From: Marcel Apfelbaum +Date: Thu, 22 Aug 2013 20:11:36 +0300 +Subject: [PATCH] usb/dev-hid: Modified usb-tablet category from Misc to Input +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +usb-tablet device was wrongly assigned to Misc category + +Reported-by: Markus Armbruster +Cc: qemu-stable@nongnu.org +Signed-off-by: Marcel Apfelbaum +Reviewed-by: Andreas Färber +Signed-off-by: Gerd Hoffmann +(cherry picked from commit 31efd2e883018b4c079ad082105bc161fbb3fef8) + +Signed-off-by: Michael Roth +--- + hw/usb/dev-hid.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c +index 66c6331..5956720 100644 +--- a/hw/usb/dev-hid.c ++++ b/hw/usb/dev-hid.c +@@ -658,7 +658,7 @@ static void usb_tablet_class_initfn(ObjectClass *klass, void *data) + uc->product_desc = "QEMU USB Tablet"; + dc->vmsd = &vmstate_usb_ptr; + dc->props = usb_tablet_properties; +- set_bit(DEVICE_CATEGORY_MISC, dc->categories); ++ set_bit(DEVICE_CATEGORY_INPUT, dc->categories); + } + + static const TypeInfo usb_tablet_info = { diff --git a/0007-scsi-Fix-scsi_bus_legacy_add_drive-scsi-generic-with.patch b/0007-scsi-Fix-scsi_bus_legacy_add_drive-scsi-generic-with.patch new file mode 100644 index 0000000..868951b --- /dev/null +++ b/0007-scsi-Fix-scsi_bus_legacy_add_drive-scsi-generic-with.patch @@ -0,0 +1,49 @@ +From 964e0d4ec52ea7400ccc69de69b05ac913bbfff8 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Fri, 23 Aug 2013 18:01:58 +0200 +Subject: [PATCH] scsi: Fix scsi_bus_legacy_add_drive() scsi-generic with + serial +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +scsi_bus_legacy_add_drive() creates either a scsi-disk or a +scsi-generic device. It sets property "serial" to argument serial +unless null. Crashes with scsi-generic, because it doesn't have such +the property. + +Only usb_msd_initfn_storage() passes non-null serial. Reproducer: + + $ qemu-system-x86_64 -nodefaults -display none -S -usb \ + -drive if=none,file=/dev/sg1,id=usb-drv0 \ + -device usb-storage,id=usb-msd0,drive=usb-drv0,serial=123 + qemu-system-x86_64: -device usb-storage,id=usb-msd0,drive=usb-drv0,serial=123: Property '.serial' not found + Aborted (core dumped) + +Fix by handling exactly like "removable": set the property only when +it exists. + +Cc: qemu-stable@nongnu.org +Reviewed-by: Andreas Färber +Signed-off-by: Markus Armbruster +Signed-off-by: Paolo Bonzini +(cherry picked from commit c24e7517ee4a98e90eee5f0f07708a1fa12326b3) + +Signed-off-by: Michael Roth +--- + hw/scsi/scsi-bus.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c +index fbf9173..8fe4f4c 100644 +--- a/hw/scsi/scsi-bus.c ++++ b/hw/scsi/scsi-bus.c +@@ -224,7 +224,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockDriverState *bdrv, + if (object_property_find(OBJECT(dev), "removable", NULL)) { + qdev_prop_set_bit(dev, "removable", removable); + } +- if (serial) { ++ if (serial && object_property_find(OBJECT(dev), "serial", NULL)) { + qdev_prop_set_string(dev, "serial", serial); + } + if (qdev_prop_set_drive(dev, "drive", bdrv) < 0) { diff --git a/0008-pc-fix-regression-for-64-bit-PCI-memory.patch b/0008-pc-fix-regression-for-64-bit-PCI-memory.patch new file mode 100644 index 0000000..c2a1152 --- /dev/null +++ b/0008-pc-fix-regression-for-64-bit-PCI-memory.patch @@ -0,0 +1,116 @@ +From a73c74f63aa8f977ece88c97280a03ea9b1ca395 Mon Sep 17 00:00:00 2001 +From: "Michael S. Tsirkin" +Date: Tue, 27 Aug 2013 08:37:26 +0300 +Subject: [PATCH] pc: fix regression for 64 bit PCI memory + +commit 398489018183d613306ab022653552247d93919f + pc: limit 64 bit hole to 2G by default +introduced a way for management to control +the window allocated to the 64 bit PCI hole. + +This is useful, but existing management tools do not know how to set +this property. As a result, e.g. specifying a large ivshmem device with +size > 4G is broken by default. For example this configuration no +longer works: + +-device ivshmem,size=4294967296,chardev=cfoo +-chardev socket,path=/tmp/sock,id=cfoo,server,nowait + +Fix this by detecting that hole size was not specified +and defaulting to the backwards-compatible value of 1 << 62. + +Cc: qemu-stable@nongnu.org +Cc: Igor Mammedov +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 1466cef32dd5e7ef3c6477e96d85d92302ad02e3) + +Signed-off-by: Michael Roth +--- + hw/pci-host/piix.c | 9 ++++++--- + hw/pci-host/q35.c | 8 +++++--- + include/hw/i386/pc.h | 11 ++++++++++- + 3 files changed, 21 insertions(+), 7 deletions(-) + +diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c +index dc1718f..221d82b 100644 +--- a/hw/pci-host/piix.c ++++ b/hw/pci-host/piix.c +@@ -320,6 +320,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, + PCII440FXState *f; + unsigned i; + I440FXState *i440fx; ++ uint64_t pci_hole64_size; + + dev = qdev_create(NULL, TYPE_I440FX_PCI_HOST_BRIDGE); + s = PCI_HOST_BRIDGE(dev); +@@ -351,13 +352,15 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, + pci_hole_start, pci_hole_size); + memory_region_add_subregion(f->system_memory, pci_hole_start, &f->pci_hole); + ++ pci_hole64_size = pci_host_get_hole64_size(i440fx->pci_hole64_size); ++ + pc_init_pci64_hole(&i440fx->pci_info, 0x100000000ULL + above_4g_mem_size, +- i440fx->pci_hole64_size); ++ pci_hole64_size); + memory_region_init_alias(&f->pci_hole_64bit, OBJECT(d), "pci-hole64", + f->pci_address_space, + i440fx->pci_info.w64.begin, +- i440fx->pci_hole64_size); +- if (i440fx->pci_hole64_size) { ++ pci_hole64_size); ++ if (pci_hole64_size) { + memory_region_add_subregion(f->system_memory, + i440fx->pci_info.w64.begin, + &f->pci_hole_64bit); +diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c +index 12314d8..4febd24 100644 +--- a/hw/pci-host/q35.c ++++ b/hw/pci-host/q35.c +@@ -320,6 +320,7 @@ static int mch_init(PCIDevice *d) + { + int i; + MCHPCIState *mch = MCH_PCI_DEVICE(d); ++ uint64_t pci_hole64_size; + + /* setup pci memory regions */ + memory_region_init_alias(&mch->pci_hole, OBJECT(mch), "pci-hole", +@@ -329,13 +330,14 @@ static int mch_init(PCIDevice *d) + memory_region_add_subregion(mch->system_memory, mch->below_4g_mem_size, + &mch->pci_hole); + ++ pci_hole64_size = pci_host_get_hole64_size(mch->pci_hole64_size); + pc_init_pci64_hole(&mch->pci_info, 0x100000000ULL + mch->above_4g_mem_size, +- mch->pci_hole64_size); ++ pci_hole64_size); + memory_region_init_alias(&mch->pci_hole_64bit, OBJECT(mch), "pci-hole64", + mch->pci_address_space, + mch->pci_info.w64.begin, +- mch->pci_hole64_size); +- if (mch->pci_hole64_size) { ++ pci_hole64_size); ++ if (pci_hole64_size) { + memory_region_add_subregion(mch->system_memory, + mch->pci_info.w64.begin, + &mch->pci_hole_64bit); +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index f79d478..475ba9e 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -106,7 +106,16 @@ PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size, + #define PCI_HOST_PROP_PCI_HOLE64_START "pci-hole64-start" + #define PCI_HOST_PROP_PCI_HOLE64_END "pci-hole64-end" + #define PCI_HOST_PROP_PCI_HOLE64_SIZE "pci-hole64-size" +-#define DEFAULT_PCI_HOLE64_SIZE (1ULL << 31) ++#define DEFAULT_PCI_HOLE64_SIZE (~0x0ULL) ++ ++static inline uint64_t pci_host_get_hole64_size(uint64_t pci_hole64_size) ++{ ++ if (pci_hole64_size == DEFAULT_PCI_HOLE64_SIZE) { ++ return 1ULL << 62; ++ } else { ++ return pci_hole64_size; ++ } ++} + + void pc_init_pci64_hole(PcPciInfo *pci_info, uint64_t pci_hole64_start, + uint64_t pci_hole64_size); diff --git a/0009-pseries-Fix-stalls-on-hypervisor-virtual-console.patch b/0009-pseries-Fix-stalls-on-hypervisor-virtual-console.patch new file mode 100644 index 0000000..28878e7 --- /dev/null +++ b/0009-pseries-Fix-stalls-on-hypervisor-virtual-console.patch @@ -0,0 +1,45 @@ +From 3fe494efc5eb107c4c90e96df3e6131f9960f4b9 Mon Sep 17 00:00:00 2001 +From: Anton Blanchard +Date: Tue, 13 Aug 2013 14:10:04 +1000 +Subject: [PATCH] pseries: Fix stalls on hypervisor virtual console + +A number of users are reporting stalls when using the pseries +hypervisor virtual console. + +A simple test case is to paste 15 or 17 characters at a time +into the console. Pasting 15 characters at a time works fine +but pasting 17 characters hangs for a random amount of time. +Other activity (network, qemu monitor etc) unblocks it. + +If qemu-char tries to send more than 16 characters at once, +vty_can_receive returns false. At this point we have to +wait for the guest to consume that output. Everything is good +so far. + +The problem occurs when the the guest does consume the output. +We need to signal back to the qemu-char layer that we are +ready for more input. Without this we block until something +else kicks us (eg network activity). + +Signed-off-by: Anton Blanchard +Signed-off-by: Alexander Graf +(cherry picked from commit 7770b6f78a2d655e03852a5de238f5926c92be6a) + +Signed-off-by: Michael Roth +--- + hw/char/spapr_vty.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c +index a799721..9c2aef8 100644 +--- a/hw/char/spapr_vty.c ++++ b/hw/char/spapr_vty.c +@@ -47,6 +47,8 @@ static int vty_getchars(VIOsPAPRDevice *sdev, uint8_t *buf, int max) + buf[n++] = dev->buf[dev->out++ % VTERM_BUFSIZE]; + } + ++ qemu_chr_accept_input(dev->chardev); ++ + return n; + } + diff --git a/0010-virtio-virtqueue_get_avail_bytes-fix-desc_pa-when-lo.patch b/0010-virtio-virtqueue_get_avail_bytes-fix-desc_pa-when-lo.patch new file mode 100644 index 0000000..ed450ab --- /dev/null +++ b/0010-virtio-virtqueue_get_avail_bytes-fix-desc_pa-when-lo.patch @@ -0,0 +1,41 @@ +From 358bb0daa1ce332a18cc996fcd078a3989f77d36 Mon Sep 17 00:00:00 2001 +From: yinyin +Date: Thu, 22 Aug 2013 14:47:16 +0800 +Subject: [PATCH] virtio: virtqueue_get_avail_bytes: fix desc_pa when loop over + the indirect descriptor table + +virtqueue_get_avail_bytes: when found a indirect desc, we need loop over it. + /* loop over the indirect descriptor table */ + indirect = 1; + max = vring_desc_len(desc_pa, i) / sizeof(VRingDesc); + num_bufs = i = 0; + desc_pa = vring_desc_addr(desc_pa, i); +But, It init i to 0, then use i to update desc_pa. so we will always get: +desc_pa = vring_desc_addr(desc_pa, 0); +the last two line should swap. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Yin Yin +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 1ae2757c6c4525c9b42f408c86818f843bad7418) + +Signed-off-by: Michael Roth +--- + hw/virtio/virtio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c +index f03c45d..2f1e73b 100644 +--- a/hw/virtio/virtio.c ++++ b/hw/virtio/virtio.c +@@ -377,8 +377,8 @@ void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes, + /* loop over the indirect descriptor table */ + indirect = 1; + max = vring_desc_len(desc_pa, i) / sizeof(VRingDesc); +- num_bufs = i = 0; + desc_pa = vring_desc_addr(desc_pa, i); ++ num_bufs = i = 0; + } + + do { diff --git a/0011-xhci-fix-endpoint-interval-calculation.patch b/0011-xhci-fix-endpoint-interval-calculation.patch new file mode 100644 index 0000000..f408884 --- /dev/null +++ b/0011-xhci-fix-endpoint-interval-calculation.patch @@ -0,0 +1,27 @@ +From c0a5eb81b43e56569cfdb9c86fd78930b2765b96 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Wed, 28 Aug 2013 11:39:02 +0200 +Subject: [PATCH] xhci: fix endpoint interval calculation + +Cc: qemu-stable@nongnu.org +Signed-off-by: Gerd Hoffmann +(cherry picked from commit ca7162782a293f525633e5816470498dd86a51cf) + +Signed-off-by: Michael Roth +--- + hw/usb/hcd-xhci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c +index 58c88b8..3c0ba8e 100644 +--- a/hw/usb/hcd-xhci.c ++++ b/hw/usb/hcd-xhci.c +@@ -1257,7 +1257,7 @@ static void xhci_init_epctx(XHCIEPContext *epctx, + epctx->ring.ccs = ctx[2] & 1; + } + +- epctx->interval = 1 << (ctx[0] >> 16) & 0xff; ++ epctx->interval = 1 << ((ctx[0] >> 16) & 0xff); + } + + static TRBCCode xhci_enable_ep(XHCIState *xhci, unsigned int slotid, diff --git a/0012-Revert-usb-hub-report-status-changes-only-once.patch b/0012-Revert-usb-hub-report-status-changes-only-once.patch new file mode 100644 index 0000000..04842a9 --- /dev/null +++ b/0012-Revert-usb-hub-report-status-changes-only-once.patch @@ -0,0 +1,48 @@ +From c09a4634d945df5d7e1fbc394646e78d7d713c67 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Tue, 27 Aug 2013 17:00:04 +0200 +Subject: [PATCH] Revert "usb-hub: report status changes only once" + +This reverts commit a309ee6e0a256f690760abfba44fceaa52a7c2f3. + +This isn't in line with the usb specification and adds regressions, +win7 fails to drive the usb hub for example. + +Was added because it "solved" the issue of hubs interacting badly +with the xhci host controller. Now with the root cause being fixed +in xhci (commit ) we can revert this one. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Gerd Hoffmann +(cherry picked from commit bdebd6ee81f4d849aa8541c289203e3992450db0) + +Signed-off-by: Michael Roth +--- + hw/usb/dev-hub.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c +index e865a98..4188a3c 100644 +--- a/hw/usb/dev-hub.c ++++ b/hw/usb/dev-hub.c +@@ -33,7 +33,6 @@ typedef struct USBHubPort { + USBPort port; + uint16_t wPortStatus; + uint16_t wPortChange; +- uint16_t wPortChange_reported; + } USBHubPort; + + typedef struct USBHubState { +@@ -468,11 +467,8 @@ static void usb_hub_handle_data(USBDevice *dev, USBPacket *p) + status = 0; + for(i = 0; i < NUM_PORTS; i++) { + port = &s->ports[i]; +- if (port->wPortChange && +- port->wPortChange_reported != port->wPortChange) { ++ if (port->wPortChange) + status |= (1 << (i + 1)); +- } +- port->wPortChange_reported = port->wPortChange; + } + if (status != 0) { + for(i = 0; i < n; i++) { diff --git a/0013-block-expect-errors-from-bdrv_co_is_allocated.patch b/0013-block-expect-errors-from-bdrv_co_is_allocated.patch new file mode 100644 index 0000000..85d0820 --- /dev/null +++ b/0013-block-expect-errors-from-bdrv_co_is_allocated.patch @@ -0,0 +1,149 @@ +From da4e203efa76f2d2ee0a17670c241881963d033d Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Wed, 4 Sep 2013 19:00:25 +0200 +Subject: [PATCH] block: expect errors from bdrv_co_is_allocated + +Some bdrv_is_allocated callers do not expect errors, but the fallback +in qcow2.c might make other callers trip on assertion failures or +infinite loops. + +Fix the callers to always look for errors. + +Cc: qemu-stable@nongnu.org +Reviewed-by: Eric Blake +Signed-off-by: Paolo Bonzini +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit d663640c04f2aab810915c556390211d75457704) + +Conflicts: + + block/cow.c + +*modified to avoid dependency on upstream's e641c1e8 + +Signed-off-by: Michael Roth +--- + block.c | 7 +++++-- + block/cow.c | 6 +++++- + block/qcow2.c | 4 +--- + block/stream.c | 2 +- + qemu-img.c | 16 ++++++++++++++-- + qemu-io-cmds.c | 4 ++++ + 6 files changed, 30 insertions(+), 9 deletions(-) + +diff --git a/block.c b/block.c +index d5ce8d3..8ce8b91 100644 +--- a/block.c ++++ b/block.c +@@ -1803,8 +1803,11 @@ int bdrv_commit(BlockDriverState *bs) + buf = g_malloc(COMMIT_BUF_SECTORS * BDRV_SECTOR_SIZE); + + for (sector = 0; sector < total_sectors; sector += n) { +- if (bdrv_is_allocated(bs, sector, COMMIT_BUF_SECTORS, &n)) { +- ++ ret = bdrv_is_allocated(bs, sector, COMMIT_BUF_SECTORS, &n); ++ if (ret < 0) { ++ goto ro_cleanup; ++ } ++ if (ret) { + if (bdrv_read(bs, sector, buf, n) != 0) { + ret = -EIO; + goto ro_cleanup; +diff --git a/block/cow.c b/block/cow.c +index 1cc2e89..e1b73d6 100644 +--- a/block/cow.c ++++ b/block/cow.c +@@ -189,7 +189,11 @@ static int coroutine_fn cow_read(BlockDriverState *bs, int64_t sector_num, + int ret, n; + + while (nb_sectors > 0) { +- if (bdrv_co_is_allocated(bs, sector_num, nb_sectors, &n)) { ++ ret = bdrv_co_is_allocated(bs, sector_num, nb_sectors, &n); ++ if (ret < 0) { ++ return ret; ++ } ++ if (ret) { + ret = bdrv_pread(bs->file, + s->cow_sectors_offset + sector_num * 512, + buf, n * 512); +diff --git a/block/qcow2.c b/block/qcow2.c +index 3376901..7f7282e 100644 +--- a/block/qcow2.c ++++ b/block/qcow2.c +@@ -648,13 +648,11 @@ static int coroutine_fn qcow2_co_is_allocated(BlockDriverState *bs, + int ret; + + *pnum = nb_sectors; +- /* FIXME We can get errors here, but the bdrv_co_is_allocated interface +- * can't pass them on today */ + qemu_co_mutex_lock(&s->lock); + ret = qcow2_get_cluster_offset(bs, sector_num << 9, pnum, &cluster_offset); + qemu_co_mutex_unlock(&s->lock); + if (ret < 0) { +- *pnum = 0; ++ return ret; + } + + return (cluster_offset != 0) || (ret == QCOW2_CLUSTER_ZERO); +diff --git a/block/stream.c b/block/stream.c +index 7fe9e48..4e8d177 100644 +--- a/block/stream.c ++++ b/block/stream.c +@@ -120,7 +120,7 @@ wait: + if (ret == 1) { + /* Allocated in the top, no need to copy. */ + copy = false; +- } else { ++ } else if (ret >= 0) { + /* Copy if allocated in the intermediate images. Limit to the + * known-unallocated area [sector_num, sector_num+n). */ + ret = bdrv_co_is_allocated_above(bs->backing_hd, base, +diff --git a/qemu-img.c b/qemu-img.c +index b9a848d..b01998b 100644 +--- a/qemu-img.c ++++ b/qemu-img.c +@@ -1485,8 +1485,15 @@ static int img_convert(int argc, char **argv) + are present in both the output's and input's base images (no + need to copy them). */ + if (out_baseimg) { +- if (!bdrv_is_allocated(bs[bs_i], sector_num - bs_offset, +- n, &n1)) { ++ ret = bdrv_is_allocated(bs[bs_i], sector_num - bs_offset, ++ n, &n1); ++ if (ret < 0) { ++ error_report("error while reading metadata for sector " ++ "%" PRId64 ": %s", ++ sector_num - bs_offset, strerror(-ret)); ++ goto out; ++ } ++ if (!ret) { + sector_num += n1; + continue; + } +@@ -2076,6 +2083,11 @@ static int img_rebase(int argc, char **argv) + + /* If the cluster is allocated, we don't need to take action */ + ret = bdrv_is_allocated(bs, sector, n, &n); ++ if (ret < 0) { ++ error_report("error while reading image metadata: %s", ++ strerror(-ret)); ++ goto out; ++ } + if (ret) { + continue; + } +diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c +index ffbcf31..ffe48ad 100644 +--- a/qemu-io-cmds.c ++++ b/qemu-io-cmds.c +@@ -1829,6 +1829,10 @@ static int alloc_f(BlockDriverState *bs, int argc, char **argv) + sector_num = offset >> 9; + while (remaining) { + ret = bdrv_is_allocated(bs, sector_num, remaining, &num); ++ if (ret < 0) { ++ printf("is_allocated failed: %s\n", strerror(-ret)); ++ return 0; ++ } + sector_num += num; + remaining -= num; + if (ret) { diff --git a/0014-target-i386-fix-disassembly-with-PAE-1-PG-0.patch b/0014-target-i386-fix-disassembly-with-PAE-1-PG-0.patch new file mode 100644 index 0000000..1cbc2cd --- /dev/null +++ b/0014-target-i386-fix-disassembly-with-PAE-1-PG-0.patch @@ -0,0 +1,76 @@ +From f9fd82ee939d6ee5bff126b125020021e18ce330 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 30 Aug 2013 11:58:45 +0200 +Subject: [PATCH] target-i386: fix disassembly with PAE=1, PG=0 + +CR4.PAE=1 will not enable paging if CR0.PG=0, but the "if" chain +in x86_cpu_get_phys_page_debug says otherwise. Check CR0.PG +before everything else. + +Fixes "-d in_asm" for a code section at the beginning of OVMF. + +Signed-off-by: Paolo Bonzini +Signed-off-by: Richard Henderson +Reviewed-by: Max Filippov +(cherry picked from commit f2f8560c7a5303065a2a3207ec475dfb3a622a0e) + +Signed-off-by: Michael Roth +--- + target-i386/helper.c | 34 ++++++++++++++++------------------ + 1 file changed, 16 insertions(+), 18 deletions(-) + +diff --git a/target-i386/helper.c b/target-i386/helper.c +index bf3e2ac..7f74e5d 100644 +--- a/target-i386/helper.c ++++ b/target-i386/helper.c +@@ -894,7 +894,10 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) + uint32_t page_offset; + int page_size; + +- if (env->cr[4] & CR4_PAE_MASK) { ++ if (!(env->cr[0] & CR0_PG_MASK)) { ++ pte = addr & env->a20_mask; ++ page_size = 4096; ++ } else if (env->cr[4] & CR4_PAE_MASK) { + target_ulong pdpe_addr; + uint64_t pde, pdpe; + +@@ -952,26 +955,21 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) + } else { + uint32_t pde; + +- if (!(env->cr[0] & CR0_PG_MASK)) { +- pte = addr; +- page_size = 4096; ++ /* page directory entry */ ++ pde_addr = ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & env->a20_mask; ++ pde = ldl_phys(pde_addr); ++ if (!(pde & PG_PRESENT_MASK)) ++ return -1; ++ if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) { ++ pte = pde & ~0x003ff000; /* align to 4MB */ ++ page_size = 4096 * 1024; + } else { + /* page directory entry */ +- pde_addr = ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & env->a20_mask; +- pde = ldl_phys(pde_addr); +- if (!(pde & PG_PRESENT_MASK)) ++ pte_addr = ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & env->a20_mask; ++ pte = ldl_phys(pte_addr); ++ if (!(pte & PG_PRESENT_MASK)) + return -1; +- if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) { +- pte = pde & ~0x003ff000; /* align to 4MB */ +- page_size = 4096 * 1024; +- } else { +- /* page directory entry */ +- pte_addr = ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & env->a20_mask; +- pte = ldl_phys(pte_addr); +- if (!(pte & PG_PRESENT_MASK)) +- return -1; +- page_size = 4096; +- } ++ page_size = 4096; + } + pte = pte & env->a20_mask; + } diff --git a/0015-adlib-sort-offsets-in-portio-registration.patch b/0015-adlib-sort-offsets-in-portio-registration.patch new file mode 100644 index 0000000..a7b6816 --- /dev/null +++ b/0015-adlib-sort-offsets-in-portio-registration.patch @@ -0,0 +1,35 @@ +From 2ffbe03e8bc8f330581e31537190949a9aba80c3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= +Date: Wed, 14 Aug 2013 11:49:04 +0200 +Subject: [PATCH] adlib: sort offsets in portio registration +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This fixes the following assert when -device adlib is used: +ioport.c:240: portio_list_add: Assertion `pio->offset >= off_last' failed. + +Signed-off-by: Hervé Poussineau +Signed-off-by: Michael Tokarev +(cherry picked from commit 2b21fb57af305f17841d79e7e2e02ad1aec3f5ca) + +Signed-off-by: Michael Roth +--- + hw/audio/adlib.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c +index 0421d47..db4a953 100644 +--- a/hw/audio/adlib.c ++++ b/hw/audio/adlib.c +@@ -284,9 +284,9 @@ static void Adlib_fini (AdlibState *s) + } + + static MemoryRegionPortio adlib_portio_list[] = { +- { 0x388, 4, 1, .read = adlib_read, .write = adlib_write, }, + { 0, 4, 1, .read = adlib_read, .write = adlib_write, }, + { 0, 2, 1, .read = adlib_read, .write = adlib_write, }, ++ { 0x388, 4, 1, .read = adlib_read, .write = adlib_write, }, + PORTIO_END_OF_LIST(), + }; + diff --git a/0016-exec-fix-writing-to-MMIO-area-with-non-power-of-two-.patch b/0016-exec-fix-writing-to-MMIO-area-with-non-power-of-two-.patch new file mode 100644 index 0000000..4e60171 --- /dev/null +++ b/0016-exec-fix-writing-to-MMIO-area-with-non-power-of-two-.patch @@ -0,0 +1,37 @@ +From 9fab8e1fe15014a4bd147eeedd2491bcfbba4e59 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Mon, 29 Jul 2013 14:27:39 +0200 +Subject: [PATCH] exec: fix writing to MMIO area with non-power-of-two length + +The problem is introduced by commit 2332616 (exec: Support 64-bit +operations in address_space_rw, 2013-07-08). Before that commit, +memory_access_size would only return 1/2/4. + +Since alignment is already handled above, reduce l to the largest +power of two that is smaller than l. + +Cc: qemu-stable@nongnu.org +Reported-by: Oleksii Shevchuk +Tested-by: Oleksii Shevchuk +Signed-off-by: Paolo Bonzini +(cherry picked from commit 098178f2749a63fbbb1a626dcc7d939d5cb2bde7) + +Signed-off-by: Michael Roth +--- + exec.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/exec.c b/exec.c +index 3ca9381..394f7e2 100644 +--- a/exec.c ++++ b/exec.c +@@ -1928,6 +1928,9 @@ static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr) + if (l > access_size_max) { + l = access_size_max; + } ++ if (l & (l - 1)) { ++ l = 1 << (qemu_fls(l) - 1); ++ } + + return l; + } diff --git a/0017-virtio_pci-fix-level-interrupts-with-irqfd.patch b/0017-virtio_pci-fix-level-interrupts-with-irqfd.patch new file mode 100644 index 0000000..33e4853 --- /dev/null +++ b/0017-virtio_pci-fix-level-interrupts-with-irqfd.patch @@ -0,0 +1,38 @@ +From 1cd7138d492304a76f3b8ae89fc61e05b18205a7 Mon Sep 17 00:00:00 2001 +From: "Michael S. Tsirkin" +Date: Sun, 1 Sep 2013 11:03:45 +0300 +Subject: [PATCH] virtio_pci: fix level interrupts with irqfd + +commit 62c96360ae7f2c7a8b029277fbb7cb082fdef7fd + virtio-pci: fix level interrupts +only helps systems without irqfd: on systems with irqfd support we +passed in flag requesting irqfd even when msix is disabled. + +As a result, for level interrupts we didn't install an fd handler so +unmasking an fd had no effect. + +Fix this up. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 23fe2b3f9e7df8da53ac1bc32c6875254911d7f4) + +Signed-off-by: Michael Roth +--- + hw/virtio/virtio-pci.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c +index d37037e..41b96ce 100644 +--- a/hw/virtio/virtio-pci.c ++++ b/hw/virtio/virtio-pci.c +@@ -799,8 +799,7 @@ static int virtio_pci_set_guest_notifiers(DeviceState *d, int nvqs, bool assign) + break; + } + +- r = virtio_pci_set_guest_notifier(d, n, assign, +- kvm_msi_via_irqfd_enabled()); ++ r = virtio_pci_set_guest_notifier(d, n, assign, with_irqfd); + if (r < 0) { + goto assign_error; + } diff --git a/0018-exec-always-use-MADV_DONTFORK.patch b/0018-exec-always-use-MADV_DONTFORK.patch new file mode 100644 index 0000000..95df5f7 --- /dev/null +++ b/0018-exec-always-use-MADV_DONTFORK.patch @@ -0,0 +1,43 @@ +From 57ea2d21ae1863fd4002b2aea8ea8db8e206d464 Mon Sep 17 00:00:00 2001 +From: Andrea Arcangeli +Date: Thu, 25 Jul 2013 12:11:15 +0200 +Subject: [PATCH] exec: always use MADV_DONTFORK + +MADV_DONTFORK prevents fork to fail with -ENOMEM if the default +overcommit heuristics decides there's too much anonymous virtual +memory allocated. If the KVM secondary MMU is synchronized with MMU +notifiers or not, doesn't make a difference in that regard. + +Secondly it's always more efficient to avoid copying the guest +physical address space in the fork child (so we avoid to mark all the +guest memory readonly in the parent and so we skip the establishment +and teardown of lots of pagetables in the child). + +In the common case we can ignore the error if MADV_DONTFORK is not +available. Leave a second invocation that errors out in the KVM path +if MMU notifiers are missing and KVM is enabled, to abort in such +case. + +Signed-off-by: Andrea Arcangeli +Tested-By: Benoit Canet +Acked-by: Paolo Bonzini +Signed-off-by: Gleb Natapov +(cherry picked from commit 3e469dbfe413c25d48321c3a19ddfae0727dc6e5) + +Signed-off-by: Michael Roth +--- + exec.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/exec.c b/exec.c +index 394f7e2..2ea8f04 100644 +--- a/exec.c ++++ b/exec.c +@@ -1172,6 +1172,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host, + + qemu_ram_setup_dump(new_block->host, size); + qemu_madvise(new_block->host, size, QEMU_MADV_HUGEPAGE); ++ qemu_madvise(new_block->host, size, QEMU_MADV_DONTFORK); + + if (kvm_enabled()) + kvm_setup_guest_memory(new_block->host, size); diff --git a/0019-xhci-reset-port-when-disabling-slot.patch b/0019-xhci-reset-port-when-disabling-slot.patch new file mode 100644 index 0000000..a269bda --- /dev/null +++ b/0019-xhci-reset-port-when-disabling-slot.patch @@ -0,0 +1,26 @@ +From 9dbfbb89b204e098f283aca310e4d6f6651d88f4 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Wed, 28 Aug 2013 11:47:09 +0200 +Subject: [PATCH] xhci: reset port when disabling slot + +Cc: qemu-stable@nongnu.org +Signed-off-by: Gerd Hoffmann +(cherry picked from commit 5c67dd7b4884979a2613a4702ac1ab68b0e6a16e) + +Signed-off-by: Michael Roth +--- + hw/usb/hcd-xhci.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c +index 3c0ba8e..a6f55a1 100644 +--- a/hw/usb/hcd-xhci.c ++++ b/hw/usb/hcd-xhci.c +@@ -2076,6 +2076,7 @@ static TRBCCode xhci_disable_slot(XHCIState *xhci, unsigned int slotid) + + xhci->slots[slotid-1].enabled = 0; + xhci->slots[slotid-1].addressed = 0; ++ xhci->slots[slotid-1].uport = NULL; + return CC_SUCCESS; + } + diff --git a/0020-usb-parallelize-usb3-streams.patch b/0020-usb-parallelize-usb3-streams.patch new file mode 100644 index 0000000..b1b63f4 --- /dev/null +++ b/0020-usb-parallelize-usb3-streams.patch @@ -0,0 +1,52 @@ +From 96b14d0db19b2b80ab3dc35d522671da82101e72 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Tue, 27 Aug 2013 15:25:24 +0200 +Subject: [PATCH] usb: parallelize usb3 streams + +usb3 bulk endpoints with streams are implicitly pipelined now, +so the requests will actually be processed in parallel. Also +allow them to complete out-of-order. + +Fixes stalls in the uas driver. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Gerd Hoffmann +(cherry picked from commit c96c41ed0d38d68a6c8b6f84751afebafeae31be) + +Signed-off-by: Michael Roth +--- + hw/usb/core.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/hw/usb/core.c b/hw/usb/core.c +index 05948ca..31960c2 100644 +--- a/hw/usb/core.c ++++ b/hw/usb/core.c +@@ -403,7 +403,7 @@ void usb_handle_packet(USBDevice *dev, USBPacket *p) + p->ep->halted = false; + } + +- if (QTAILQ_EMPTY(&p->ep->queue) || p->ep->pipeline) { ++ if (QTAILQ_EMPTY(&p->ep->queue) || p->ep->pipeline || p->stream) { + usb_process_one(p); + if (p->status == USB_RET_ASYNC) { + /* hcd drivers cannot handle async for isoc */ +@@ -420,7 +420,8 @@ void usb_handle_packet(USBDevice *dev, USBPacket *p) + * When pipelining is enabled usb-devices must always return async, + * otherwise packets can complete out of order! + */ +- assert(!p->ep->pipeline || QTAILQ_EMPTY(&p->ep->queue)); ++ assert(p->stream || !p->ep->pipeline || ++ QTAILQ_EMPTY(&p->ep->queue)); + if (p->status != USB_RET_NAK) { + usb_packet_set_state(p, USB_PACKET_COMPLETE); + } +@@ -434,7 +435,7 @@ void usb_packet_complete_one(USBDevice *dev, USBPacket *p) + { + USBEndpoint *ep = p->ep; + +- assert(QTAILQ_FIRST(&ep->queue) == p); ++ assert(p->stream || QTAILQ_FIRST(&ep->queue) == p); + assert(p->status != USB_RET_ASYNC && p->status != USB_RET_NAK); + + if (p->status != USB_RET_SUCCESS || diff --git a/0021-w32-Fix-access-to-host-devices-regression.patch b/0021-w32-Fix-access-to-host-devices-regression.patch new file mode 100644 index 0000000..9a0efb8 --- /dev/null +++ b/0021-w32-Fix-access-to-host-devices-regression.patch @@ -0,0 +1,86 @@ +From e8601a4e3102321d054ce3d641c03ebcd0519357 Mon Sep 17 00:00:00 2001 +From: Stefan Weil +Date: Sun, 1 Sep 2013 22:59:25 +0200 +Subject: [PATCH] w32: Fix access to host devices (regression) + +QEMU failed to open host devices like \\.\PhysicalDrive0 (first hard disk) +since some time (commit 8a79380b8ef1b02d2abd705dd026a18863b09020?). + +Those devices use hdev_open which did not use the latest API for options. +This resulted in a fatal runtime error: + + Block protocol 'host_device' doesn't support the option 'filename' + +Duplicate code from raw_open to fix this. + +Cc: qemu-stable@nongnu.org +Reported-by: David Brenner +Signed-off-by: Stefan Weil +Reviewed-by: Kevin Wolf +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 68dc036488dfea170627a55e6ee3dfd7f2c2063e) + +Signed-off-by: Michael Roth +--- + block/raw-win32.c | 36 +++++++++++++++++++++++++++++------- + 1 file changed, 29 insertions(+), 7 deletions(-) + +diff --git a/block/raw-win32.c b/block/raw-win32.c +index 9b5b2af..d2d2d9f 100644 +--- a/block/raw-win32.c ++++ b/block/raw-win32.c +@@ -535,13 +535,29 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags) + { + BDRVRawState *s = bs->opaque; + int access_flags, create_flags; ++ int ret = 0; + DWORD overlapped; + char device_name[64]; +- const char *filename = qdict_get_str(options, "filename"); ++ ++ Error *local_err = NULL; ++ const char *filename; ++ ++ QemuOpts *opts = qemu_opts_create_nofail(&raw_runtime_opts); ++ qemu_opts_absorb_qdict(opts, options, &local_err); ++ if (error_is_set(&local_err)) { ++ qerror_report_err(local_err); ++ error_free(local_err); ++ ret = -EINVAL; ++ goto done; ++ } ++ ++ filename = qemu_opt_get(opts, "filename"); + + if (strstart(filename, "/dev/cdrom", NULL)) { +- if (find_cdrom(device_name, sizeof(device_name)) < 0) +- return -ENOENT; ++ if (find_cdrom(device_name, sizeof(device_name)) < 0) { ++ ret = -ENOENT; ++ goto done; ++ } + filename = device_name; + } else { + /* transform drive letters into device name */ +@@ -564,11 +580,17 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags) + if (s->hfile == INVALID_HANDLE_VALUE) { + int err = GetLastError(); + +- if (err == ERROR_ACCESS_DENIED) +- return -EACCES; +- return -1; ++ if (err == ERROR_ACCESS_DENIED) { ++ ret = -EACCES; ++ } else { ++ ret = -1; ++ } ++ goto done; + } +- return 0; ++ ++done: ++ qemu_opts_del(opts); ++ return ret; + } + + static BlockDriver bdrv_host_device = { diff --git a/0022-memory-Provide-separate-handling-of-unassigned-io-po.patch b/0022-memory-Provide-separate-handling-of-unassigned-io-po.patch new file mode 100644 index 0000000..ff5c789 --- /dev/null +++ b/0022-memory-Provide-separate-handling-of-unassigned-io-po.patch @@ -0,0 +1,78 @@ +From 7ab1044eb1ac2cbc7e65769edf44ced92b85b038 Mon Sep 17 00:00:00 2001 +From: Jan Kiszka +Date: Mon, 2 Sep 2013 18:43:30 +0200 +Subject: [PATCH] memory: Provide separate handling of unassigned io ports + accesses + +Accesses to unassigned io ports shall return -1 on read and be ignored +on write. Ensure these properties via dedicated ops, decoupling us from +the memory core's handling of unassigned accesses. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Jan Kiszka +Signed-off-by: Paolo Bonzini +(cherry picked from commit 3bb28b7208b349e7a1b326e3c6ef9efac1d462bf) + +Signed-off-by: Michael Roth +--- + exec.c | 3 ++- + include/exec/ioport.h | 4 ++++ + ioport.c | 16 ++++++++++++++++ + 3 files changed, 22 insertions(+), 1 deletion(-) + +diff --git a/exec.c b/exec.c +index 2ea8f04..08eecb3 100644 +--- a/exec.c ++++ b/exec.c +@@ -1821,7 +1821,8 @@ static void memory_map_init(void) + address_space_init(&address_space_memory, system_memory, "memory"); + + system_io = g_malloc(sizeof(*system_io)); +- memory_region_init(system_io, NULL, "io", 65536); ++ memory_region_init_io(system_io, NULL, &unassigned_io_ops, NULL, "io", ++ 65536); + address_space_init(&address_space_io, system_io, "I/O"); + + memory_listener_register(&core_memory_listener, &address_space_memory); +diff --git a/include/exec/ioport.h b/include/exec/ioport.h +index bdd4e96..b3848be 100644 +--- a/include/exec/ioport.h ++++ b/include/exec/ioport.h +@@ -45,6 +45,10 @@ typedef struct MemoryRegionPortio { + + #define PORTIO_END_OF_LIST() { } + ++#ifndef CONFIG_USER_ONLY ++extern const MemoryRegionOps unassigned_io_ops; ++#endif ++ + void cpu_outb(pio_addr_t addr, uint8_t val); + void cpu_outw(pio_addr_t addr, uint16_t val); + void cpu_outl(pio_addr_t addr, uint32_t val); +diff --git a/ioport.c b/ioport.c +index 79b7f1a..707cce8 100644 +--- a/ioport.c ++++ b/ioport.c +@@ -44,6 +44,22 @@ typedef struct MemoryRegionPortioList { + MemoryRegionPortio ports[]; + } MemoryRegionPortioList; + ++static uint64_t unassigned_io_read(void *opaque, hwaddr addr, unsigned size) ++{ ++ return -1ULL; ++} ++ ++static void unassigned_io_write(void *opaque, hwaddr addr, uint64_t val, ++ unsigned size) ++{ ++} ++ ++const MemoryRegionOps unassigned_io_ops = { ++ .read = unassigned_io_read, ++ .write = unassigned_io_write, ++ .endianness = DEVICE_NATIVE_ENDIAN, ++}; ++ + void cpu_outb(pio_addr_t addr, uint8_t val) + { + LOG_IOPORT("outb: %04"FMT_pioaddr" %02"PRIx8"\n", addr, val); diff --git a/0023-Revert-memory-Return-1-again-on-reads-from-unsigned-.patch b/0023-Revert-memory-Return-1-again-on-reads-from-unsigned-.patch new file mode 100644 index 0000000..3086e82 --- /dev/null +++ b/0023-Revert-memory-Return-1-again-on-reads-from-unsigned-.patch @@ -0,0 +1,34 @@ +From 2a93d3dd32386c3522cfa2ee60c9e06a298d1f52 Mon Sep 17 00:00:00 2001 +From: Jan Kiszka +Date: Mon, 2 Sep 2013 18:43:31 +0200 +Subject: [PATCH] Revert "memory: Return -1 again on reads from unsigned + regions" + +This reverts commit 9b8c69243585a32d14b9bb9fcd52c37b0b5a1b71. + +The commit was wrong: We only return -1 on invalid accesses, not on +valid but unbacked ones. This broke various corner cases. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Jan Kiszka +Signed-off-by: Paolo Bonzini +(cherry picked from commit 68a7439a150d6b4da99082ab454b9328b151bc25) + +Signed-off-by: Michael Roth +--- + memory.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/memory.c b/memory.c +index 886f838..5a10fd0 100644 +--- a/memory.c ++++ b/memory.c +@@ -872,7 +872,7 @@ static uint64_t unassigned_mem_read(void *opaque, hwaddr addr, + if (current_cpu != NULL) { + cpu_unassigned_access(current_cpu, addr, false, false, 0, size); + } +- return -1ULL; ++ return 0; + } + + static void unassigned_mem_write(void *opaque, hwaddr addr, diff --git a/0024-exec-check-offset_within_address_space-for-register-.patch b/0024-exec-check-offset_within_address_space-for-register-.patch new file mode 100644 index 0000000..590c09b --- /dev/null +++ b/0024-exec-check-offset_within_address_space-for-register-.patch @@ -0,0 +1,40 @@ +From 1110014801d368388bca2ed7c28aa695560c4991 Mon Sep 17 00:00:00 2001 +From: Hu Tao +Date: Thu, 29 Aug 2013 18:21:16 +0800 +Subject: [PATCH] exec: check offset_within_address_space for register subpage +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If offset_within_address_space falls in a page, then we register a +subpage. So check offset_within_address_space rather than +offset_within_region. + +Cc: qemu-stable@nongnu.org +Cc: Paolo Bonzini +Cc: Richard Henderson +Cc: "Andreas Färber" +Cc: Peter Maydell +Cc: Blue Swirl +Signed-off-by: Hu Tao +Signed-off-by: Paolo Bonzini +(cherry picked from commit 88266249701032211c1d7449460d063fbc01bf12) + +Signed-off-by: Michael Roth +--- + exec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/exec.c b/exec.c +index 08eecb3..f6674e5 100644 +--- a/exec.c ++++ b/exec.c +@@ -869,7 +869,7 @@ static void mem_add(MemoryListener *listener, MemoryRegionSection *section) + now = remain; + if (int128_lt(remain.size, page_size)) { + register_subpage(d, &now); +- } else if (remain.offset_within_region & ~TARGET_PAGE_MASK) { ++ } else if (remain.offset_within_address_space & ~TARGET_PAGE_MASK) { + now.size = page_size; + register_subpage(d, &now); + } else { diff --git a/0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch b/0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch new file mode 100644 index 0000000..b96e6e5 --- /dev/null +++ b/0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch @@ -0,0 +1,35 @@ +From a1991d05d37ac9054d772b32d8fac70bc31be81a Mon Sep 17 00:00:00 2001 +From: Aurelien Jarno +Date: Mon, 2 Sep 2013 13:10:34 +0200 +Subject: [PATCH] ne2000: mark I/O as LITTLE_ENDIAN + +Now that the memory subsystem is propagating the endianness correctly, +the ne2000 device should have its I/O ports marked as LITTLE_ENDIAN, as +PCI devices are little endian. + +This makes the ne2000 NIC to work again on PowerPC. + +Cc: qemu-stable@nongnu.org +Cc: Stefan Hajnoczi +Signed-off-by: Aurelien Jarno +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 45d883dcf208160e2db308d1b368beb74f37dc7e) + +Signed-off-by: Michael Roth +--- + hw/net/ne2000.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c +index 31afd28..c961258 100644 +--- a/hw/net/ne2000.c ++++ b/hw/net/ne2000.c +@@ -693,7 +693,7 @@ static void ne2000_write(void *opaque, hwaddr addr, + static const MemoryRegionOps ne2000_ops = { + .read = ne2000_read, + .write = ne2000_write, +- .endianness = DEVICE_NATIVE_ENDIAN, ++ .endianness = DEVICE_LITTLE_ENDIAN, + }; + + /***********************************************************/ diff --git a/0008-ehci-save-device-pointer-in-EHCIState.patch b/0026-ehci-save-device-pointer-in-EHCIState.patch similarity index 95% rename from 0008-ehci-save-device-pointer-in-EHCIState.patch rename to 0026-ehci-save-device-pointer-in-EHCIState.patch index 0168d9c..81eae5c 100644 --- a/0008-ehci-save-device-pointer-in-EHCIState.patch +++ b/0026-ehci-save-device-pointer-in-EHCIState.patch @@ -1,4 +1,4 @@ -From f0679fb95d2c1b9597b83184309e70cc3c3e3b1d Mon Sep 17 00:00:00 2001 +From b6d163fdd8131285a01fe46e6afdba727e4df9ca Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 9 Sep 2013 10:18:17 +0200 Subject: [PATCH] ehci: save device pointer in EHCIState @@ -10,6 +10,8 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1005495 Signed-off-by: Gerd Hoffmann (cherry picked from commit adbecc89731cf3e0ae656d50ea9fa58c589c4bdc) + +Signed-off-by: Michael Roth --- hw/usb/hcd-ehci.c | 7 +++---- hw/usb/hcd-ehci.h | 1 + diff --git a/0007-qxl-fix-local-renderer.patch b/0027-qxl-fix-local-renderer.patch similarity index 95% rename from 0007-qxl-fix-local-renderer.patch rename to 0027-qxl-fix-local-renderer.patch index fa226de..fb9eeaf 100644 --- a/0007-qxl-fix-local-renderer.patch +++ b/0027-qxl-fix-local-renderer.patch @@ -1,4 +1,4 @@ -From 909d4a71878f3568b6c636a07d9f4f2c97a5de12 Mon Sep 17 00:00:00 2001 +From dc0973b5883df7d822b285119691ade8c84dda9c Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Thu, 5 Sep 2013 21:57:19 +0200 Subject: [PATCH] qxl: fix local renderer @@ -19,6 +19,8 @@ https://bugzilla.redhat.com/show_bug.cgi?id=948717 Signed-off-by: Gerd Hoffmann (cherry picked from commit c58c7b959b93b864a27fd6b3646ee1465ab8832b) + +Signed-off-by: Michael Roth --- hw/display/qxl-render.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/0028-pc-Initializing-ram_memory-under-Xen.patch b/0028-pc-Initializing-ram_memory-under-Xen.patch new file mode 100644 index 0000000..4d8c0b7 --- /dev/null +++ b/0028-pc-Initializing-ram_memory-under-Xen.patch @@ -0,0 +1,107 @@ +From 755ec4ca0f92188458ad7ca549a75161cbdcf6ff Mon Sep 17 00:00:00 2001 +From: Anthony PERARD +Date: Mon, 9 Sep 2013 16:15:52 +0000 +Subject: [PATCH] pc: Initializing ram_memory under Xen. + +Signed-off-by: Anthony PERARD +Signed-off-by: Stefano Stabellini +Acked-by: Michael S. Tsirkin +CC: qemu-stable@nongnu.org +(cherry picked from commit 04d7bad8a4fb23e6d9af9d06ce3ddc28a251d94d) + +Signed-off-by: Michael Roth +--- + hw/i386/pc_piix.c | 2 +- + include/hw/xen/xen.h | 4 +--- + xen-all.c | 7 ++++--- + xen-stub.c | 2 +- + 4 files changed, 7 insertions(+), 8 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 6e1e654..3df2ff9 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -93,7 +93,7 @@ static void pc_init1(MemoryRegion *system_memory, + FWCfgState *fw_cfg = NULL; + PcGuestInfo *guest_info; + +- if (xen_enabled() && xen_hvm_init() != 0) { ++ if (xen_enabled() && xen_hvm_init(&ram_memory) != 0) { + fprintf(stderr, "xen hardware virtual machine initialisation failed\n"); + exit(1); + } +diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h +index 6d42dd1..e1f88bf 100644 +--- a/include/hw/xen/xen.h ++++ b/include/hw/xen/xen.h +@@ -37,17 +37,15 @@ void xen_cmos_set_s3_resume(void *opaque, int irq, int level); + qemu_irq *xen_interrupt_controller_init(void); + + int xen_init(void); +-int xen_hvm_init(void); ++int xen_hvm_init(MemoryRegion **ram_memory); + void xenstore_store_pv_console_info(int i, struct CharDriverState *chr); + + #if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY) +-struct MemoryRegion; + void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, + struct MemoryRegion *mr); + void xen_modified_memory(ram_addr_t start, ram_addr_t length); + #endif + +-struct MemoryRegion; + void xen_register_framebuffer(struct MemoryRegion *mr); + + #if defined(CONFIG_XEN) && CONFIG_XEN_CTRL_INTERFACE_VERSION < 400 +diff --git a/xen-all.c b/xen-all.c +index 21246e0..e1d0694 100644 +--- a/xen-all.c ++++ b/xen-all.c +@@ -154,7 +154,7 @@ qemu_irq *xen_interrupt_controller_init(void) + + /* Memory Ops */ + +-static void xen_ram_init(ram_addr_t ram_size) ++static void xen_ram_init(ram_addr_t ram_size, MemoryRegion **ram_memory_p) + { + MemoryRegion *sysmem = get_system_memory(); + ram_addr_t below_4g_mem_size, above_4g_mem_size = 0; +@@ -168,6 +168,7 @@ static void xen_ram_init(ram_addr_t ram_size) + block_len += HVM_BELOW_4G_MMIO_LENGTH; + } + memory_region_init_ram(&ram_memory, NULL, "xen.ram", block_len); ++ *ram_memory_p = &ram_memory; + vmstate_register_ram_global(&ram_memory); + + if (ram_size >= HVM_BELOW_4G_RAM_END) { +@@ -1059,7 +1060,7 @@ static void xen_read_physmap(XenIOState *state) + free(entries); + } + +-int xen_hvm_init(void) ++int xen_hvm_init(MemoryRegion **ram_memory) + { + int i, rc; + unsigned long ioreq_pfn; +@@ -1134,7 +1135,7 @@ int xen_hvm_init(void) + + /* Init RAM management */ + xen_map_cache_init(xen_phys_offset_to_gaddr, state); +- xen_ram_init(ram_size); ++ xen_ram_init(ram_size, ram_memory); + + qemu_add_vm_change_state_handler(xen_hvm_change_state_handler, state); + +diff --git a/xen-stub.c b/xen-stub.c +index 47c8e73..ad189a6 100644 +--- a/xen-stub.c ++++ b/xen-stub.c +@@ -64,7 +64,7 @@ void xen_modified_memory(ram_addr_t start, ram_addr_t length) + { + } + +-int xen_hvm_init(void) ++int xen_hvm_init(MemoryRegion **ram_memory) + { + return 0; + } diff --git a/0029-pc_q35-Initialize-Xen.patch b/0029-pc_q35-Initialize-Xen.patch new file mode 100644 index 0000000..23eb4e4 --- /dev/null +++ b/0029-pc_q35-Initialize-Xen.patch @@ -0,0 +1,31 @@ +From 41900b0857df9bd33e465a6c72d7a3072dc448f4 Mon Sep 17 00:00:00 2001 +From: Anthony PERARD +Date: Mon, 9 Sep 2013 16:15:53 +0000 +Subject: [PATCH] pc_q35: Initialize Xen. + +Signed-off-by: Anthony PERARD +Signed-off-by: Stefano Stabellini +Acked-by: Michael S. Tsirkin +(cherry picked from commit 254c12825f93f405658ca3366cd34f8a8ad23511) + +Signed-off-by: Michael Roth +--- + hw/i386/pc_q35.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 10e770e..dd13130 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -81,6 +81,11 @@ static void pc_q35_init(QEMUMachineInitArgs *args) + DeviceState *icc_bridge; + PcGuestInfo *guest_info; + ++ if (xen_enabled() && xen_hvm_init(&ram_memory) != 0) { ++ fprintf(stderr, "xen hardware virtual machine initialisation failed\n"); ++ exit(1); ++ } ++ + icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE); + object_property_add_child(qdev_get_machine(), "icc-bridge", + OBJECT(icc_bridge), NULL); diff --git a/0002-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch b/0030-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch similarity index 73% rename from 0002-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch rename to 0030-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch index 607826c..17578b2 100644 --- a/0002-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch +++ b/0030-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch @@ -1,6 +1,6 @@ -From f3e59ce7c471d3f0f1f293ecd0ef3e1797ce411f Mon Sep 17 00:00:00 2001 +From 8b4b3a71fd35d67c5c30652a120c0a59dfab7182 Mon Sep 17 00:00:00 2001 From: Cole Robinson -Date: Sat, 31 Aug 2013 18:25:01 -0400 +Date: Sat, 31 Aug 2013 18:36:17 -0400 Subject: [PATCH] qapi-types.py: Fix enum struct sizes on i686 Unlike other list types, enum wasn't adding any padding, which caused @@ -15,7 +15,13 @@ upsets libvirt capabilities probing. Reproducer on i686: https://bugs.launchpad.net/qemu/+bug/1219207 Cc: qemu-stable@nongnu.org -(cherry picked from commit a9d960fb0b1bc104294ab965116a2d53038b4692) +Signed-off-by: Cole Robinson +Reviewed-by: Eric Blake +Tested-by: Richard W.M. Jones +Signed-off-by: Luiz Capitulino +(cherry picked from commit 02dc4bf5684d3fb46786fab2ecff98214b1df9fe) + +Signed-off-by: Michael Roth --- scripts/qapi-types.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/0031-pcnet-pci-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch b/0031-pcnet-pci-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch new file mode 100644 index 0000000..4e57504 --- /dev/null +++ b/0031-pcnet-pci-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch @@ -0,0 +1,45 @@ +From 76f698948781a148d336ff9032159f6c7c9eccd2 Mon Sep 17 00:00:00 2001 +From: Aurelien Jarno +Date: Wed, 28 Aug 2013 14:17:39 +0200 +Subject: [PATCH] pcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN + +Now that the memory subsystem is propagating the endianness correctly, +the pcnet-pci device should have its I/O ports and MMIO memory marked +as LITTLE_ENDIAN, as PCI devices are little endian. + +This makes the pcnet-pci NIC to work again on big endian MIPS Malta +(default NIC). + +Cc: qemu-stable@nongnu.org +Signed-off-by: Aurelien Jarno +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit a26405b350c0d31d5ef53f3b459aeb6eaaf50db0) + +Signed-off-by: Michael Roth +--- + hw/net/pcnet-pci.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c +index 2c2301c..23fc33c 100644 +--- a/hw/net/pcnet-pci.c ++++ b/hw/net/pcnet-pci.c +@@ -134,7 +134,7 @@ static void pcnet_ioport_write(void *opaque, hwaddr addr, + static const MemoryRegionOps pcnet_io_ops = { + .read = pcnet_ioport_read, + .write = pcnet_ioport_write, +- .endianness = DEVICE_NATIVE_ENDIAN, ++ .endianness = DEVICE_LITTLE_ENDIAN, + }; + + static void pcnet_mmio_writeb(void *opaque, hwaddr addr, uint32_t val) +@@ -256,7 +256,7 @@ static const MemoryRegionOps pcnet_mmio_ops = { + .read = { pcnet_mmio_readb, pcnet_mmio_readw, pcnet_mmio_readl }, + .write = { pcnet_mmio_writeb, pcnet_mmio_writew, pcnet_mmio_writel }, + }, +- .endianness = DEVICE_NATIVE_ENDIAN, ++ .endianness = DEVICE_LITTLE_ENDIAN, + }; + + static void pci_physical_memory_write(void *dma_opaque, hwaddr addr, diff --git a/0032-chardev-fix-pty_chr_timer.patch b/0032-chardev-fix-pty_chr_timer.patch new file mode 100644 index 0000000..d318063 --- /dev/null +++ b/0032-chardev-fix-pty_chr_timer.patch @@ -0,0 +1,52 @@ +From 4b5b4721464495fe76fe6e2e033cbb61dce78eef Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Thu, 22 Aug 2013 11:43:58 +0200 +Subject: [PATCH] chardev: fix pty_chr_timer + +pty_chr_timer first calls pty_chr_update_read_handler(), then clears +timer_tag (because it is a one-shot timer). This is the wrong order +though. pty_chr_update_read_handler might re-arm time timer, and the +new timer_tag gets overwitten in that case. + +This leads to crashes when unplugging a pty chardev: pty_chr_close +thinks no timer is running -> timer isn't canceled -> pty_chr_timer gets +called with stale CharDevState -> BOOM. + +This patch fixes the ordering. +Kill the pointless goto while being at it. + +https://bugzilla.redhat.com/show_bug.cgi?id=994414 + +Cc: qemu-stable@nongnu.org +Signed-off-by: Gerd Hoffmann +(cherry picked from commit b0d768c35e08d2057b63e8e77e7a513c447199fa) + +Signed-off-by: Michael Roth +--- + qemu-char.c | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +diff --git a/qemu-char.c b/qemu-char.c +index 1be1cf6..1621fbd 100644 +--- a/qemu-char.c ++++ b/qemu-char.c +@@ -1026,15 +1026,11 @@ static gboolean pty_chr_timer(gpointer opaque) + struct CharDriverState *chr = opaque; + PtyCharDriver *s = chr->opaque; + +- if (s->connected) { +- goto out; +- } +- +- /* Next poll ... */ +- pty_chr_update_read_handler(chr); +- +-out: + s->timer_tag = 0; ++ if (!s->connected) { ++ /* Next poll ... */ ++ pty_chr_update_read_handler(chr); ++ } + return FALSE; + } + diff --git a/0033-kvmvapic-Catch-invalid-ROM-size.patch b/0033-kvmvapic-Catch-invalid-ROM-size.patch new file mode 100644 index 0000000..88f4018 --- /dev/null +++ b/0033-kvmvapic-Catch-invalid-ROM-size.patch @@ -0,0 +1,59 @@ +From 50b31e80525d03ef406a8c9f55ff2ae1655a3b66 Mon Sep 17 00:00:00 2001 +From: Jan Kiszka +Date: Tue, 3 Sep 2013 18:08:50 +0200 +Subject: [PATCH] kvmvapic: Catch invalid ROM size + +If not caught early, a zero-length ROM will cause a NULL-pointer access +later on in patch_hypercalls when allocating a zero-length ROM copy and +trying to read from it. + +CC: qemu-stable@nongnu.org +Signed-off-by: Jan Kiszka +Signed-off-by: Paolo Bonzini +(cherry picked from commit 18e5eec4db96a00907eb588a2b803401637c7f67) + +Signed-off-by: Michael Roth +--- + hw/i386/kvmvapic.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c +index 15beb80..7ac0fe1 100644 +--- a/hw/i386/kvmvapic.c ++++ b/hw/i386/kvmvapic.c +@@ -578,7 +578,7 @@ static int patch_hypercalls(VAPICROMState *s) + * enable write access to the option ROM so that variables can be updated by + * the guest. + */ +-static void vapic_map_rom_writable(VAPICROMState *s) ++static int vapic_map_rom_writable(VAPICROMState *s) + { + hwaddr rom_paddr = s->rom_state_paddr & ROM_BLOCK_MASK; + MemoryRegionSection section; +@@ -599,6 +599,9 @@ static void vapic_map_rom_writable(VAPICROMState *s) + /* read ROM size from RAM region */ + ram = memory_region_get_ram_ptr(section.mr); + rom_size = ram[rom_paddr + 2] * ROM_BLOCK_SIZE; ++ if (rom_size == 0) { ++ return -1; ++ } + s->rom_size = rom_size; + + /* We need to round to avoid creating subpages +@@ -612,11 +615,15 @@ static void vapic_map_rom_writable(VAPICROMState *s) + memory_region_add_subregion_overlap(as, rom_paddr, &s->rom, 1000); + s->rom_mapped_writable = true; + memory_region_unref(section.mr); ++ ++ return 0; + } + + static int vapic_prepare(VAPICROMState *s) + { +- vapic_map_rom_writable(s); ++ if (vapic_map_rom_writable(s) < 0) { ++ return -1; ++ } + + if (patch_hypercalls(s) < 0) { + return -1; diff --git a/0034-kvmvapic-Enter-inactive-state-on-hardware-reset.patch b/0034-kvmvapic-Enter-inactive-state-on-hardware-reset.patch new file mode 100644 index 0000000..0ebb354 --- /dev/null +++ b/0034-kvmvapic-Enter-inactive-state-on-hardware-reset.patch @@ -0,0 +1,34 @@ +From 7ea8a3c12aa49efc8f503a019dd764f8a0add2cb Mon Sep 17 00:00:00 2001 +From: Jan Kiszka +Date: Tue, 3 Sep 2013 18:08:51 +0200 +Subject: [PATCH] kvmvapic: Enter inactive state on hardware reset + +ROM layout may change after reset of devices are hotplugged, so we have +to pick up the physical address again when the ROM is initialized. This +is best achieved by resetting the state to INACTIVE. + +CC: qemu-stable@nongnu.org +Signed-off-by: Jan Kiszka +Signed-off-by: Paolo Bonzini +(cherry picked from commit c056bc3f3464cfae1c94b7dd633d3ec13b13b655) + +Signed-off-by: Michael Roth +--- + hw/i386/kvmvapic.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c +index 7ac0fe1..f2e335d 100644 +--- a/hw/i386/kvmvapic.c ++++ b/hw/i386/kvmvapic.c +@@ -510,9 +510,7 @@ static void vapic_reset(DeviceState *dev) + { + VAPICROMState *s = VAPIC(dev); + +- if (s->state == VAPIC_ACTIVE) { +- s->state = VAPIC_STANDBY; +- } ++ s->state = VAPIC_INACTIVE; + vapic_enable_tpr_reporting(false); + } + diff --git a/0035-kvmvapic-Clear-also-physical-ROM-address-when-enteri.patch b/0035-kvmvapic-Clear-also-physical-ROM-address-when-enteri.patch new file mode 100644 index 0000000..a0d029f --- /dev/null +++ b/0035-kvmvapic-Clear-also-physical-ROM-address-when-enteri.patch @@ -0,0 +1,39 @@ +From 5d2de77798cacf1dadf6a4211972473e057cc6e5 Mon Sep 17 00:00:00 2001 +From: Jan Kiszka +Date: Tue, 3 Sep 2013 18:08:52 +0200 +Subject: [PATCH] kvmvapic: Clear also physical ROM address when entering + INACTIVE state + +To avoid misinterpreting INACTIVE after migration as old qemu-kvm's +STANDBY, also clear rom_state_paddr when going back to this state. + +CC: qemu-stable@nongnu.org +Signed-off-by: Jan Kiszka +Signed-off-by: Paolo Bonzini +(cherry picked from commit 4357930b8a7d2fcff2d8121ec518117428a781e7) + +Signed-off-by: Michael Roth +--- + hw/i386/kvmvapic.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c +index f2e335d..cf6c714 100644 +--- a/hw/i386/kvmvapic.c ++++ b/hw/i386/kvmvapic.c +@@ -511,6 +511,7 @@ static void vapic_reset(DeviceState *dev) + VAPICROMState *s = VAPIC(dev); + + s->state = VAPIC_INACTIVE; ++ s->rom_state_paddr = 0; + vapic_enable_tpr_reporting(false); + } + +@@ -664,6 +665,7 @@ static void vapic_write(void *opaque, hwaddr addr, uint64_t data, + } + if (vapic_prepare(s) < 0) { + s->state = VAPIC_INACTIVE; ++ s->rom_state_paddr = 0; + break; + } + break; diff --git a/0036-tci-Fix-qemu-alpha-on-32-bit-hosts-wrong-assertions.patch b/0036-tci-Fix-qemu-alpha-on-32-bit-hosts-wrong-assertions.patch new file mode 100644 index 0000000..f458952 --- /dev/null +++ b/0036-tci-Fix-qemu-alpha-on-32-bit-hosts-wrong-assertions.patch @@ -0,0 +1,125 @@ +From 5c20c1ffe791ca29840fd9607ea034ea24ad7bdd Mon Sep 17 00:00:00 2001 +From: Stefan Weil +Date: Thu, 12 Sep 2013 20:17:50 +0200 +Subject: [PATCH] tci: Fix qemu-alpha on 32 bit hosts (wrong assertions) + +Debian busybox-static for alpha has a load address of 0x0000000120000000 +which is mapped to 0x0000000020000000 for 32 bit hosts. + +qemu-alpha uses the TCG opcodes qemu_ld32, qemu_ld64, qemu_st32 and +qemu_st64 which all raise the assertion (taddr == host_addr). + +Remove all assertions of this type because they are either wrong or +unnecessary (when sizeof(tcg_target_ulong) >= sizeof(target_ulong)). + +Cc: qemu-stable +Signed-off-by: Stefan Weil +Reviewed-by: Richard Henderson +Signed-off-by: Michael Tokarev +(cherry picked from commit 07ac4dc5db22a31e47b149abdbc5ea99013cf4de) + +Signed-off-by: Michael Roth +--- + tci.c | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/tci.c b/tci.c +index c742c8d..af58576 100644 +--- a/tci.c ++++ b/tci.c +@@ -1085,7 +1085,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + tmp8 = helper_ldb_mmu(env, taddr, tci_read_i(&tb_ptr)); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + tmp8 = *(uint8_t *)(host_addr + GUEST_BASE); + #endif + tci_write_reg8(t0, tmp8); +@@ -1097,7 +1096,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + tmp8 = helper_ldb_mmu(env, taddr, tci_read_i(&tb_ptr)); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + tmp8 = *(uint8_t *)(host_addr + GUEST_BASE); + #endif + tci_write_reg8s(t0, tmp8); +@@ -1109,7 +1107,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + tmp16 = helper_ldw_mmu(env, taddr, tci_read_i(&tb_ptr)); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + tmp16 = tswap16(*(uint16_t *)(host_addr + GUEST_BASE)); + #endif + tci_write_reg16(t0, tmp16); +@@ -1121,7 +1118,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + tmp16 = helper_ldw_mmu(env, taddr, tci_read_i(&tb_ptr)); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + tmp16 = tswap16(*(uint16_t *)(host_addr + GUEST_BASE)); + #endif + tci_write_reg16s(t0, tmp16); +@@ -1134,7 +1130,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + tmp32 = helper_ldl_mmu(env, taddr, tci_read_i(&tb_ptr)); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + tmp32 = tswap32(*(uint32_t *)(host_addr + GUEST_BASE)); + #endif + tci_write_reg32(t0, tmp32); +@@ -1146,7 +1141,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + tmp32 = helper_ldl_mmu(env, taddr, tci_read_i(&tb_ptr)); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + tmp32 = tswap32(*(uint32_t *)(host_addr + GUEST_BASE)); + #endif + tci_write_reg32s(t0, tmp32); +@@ -1159,7 +1153,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + tmp32 = helper_ldl_mmu(env, taddr, tci_read_i(&tb_ptr)); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + tmp32 = tswap32(*(uint32_t *)(host_addr + GUEST_BASE)); + #endif + tci_write_reg32(t0, tmp32); +@@ -1174,7 +1167,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + tmp64 = helper_ldq_mmu(env, taddr, tci_read_i(&tb_ptr)); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + tmp64 = tswap64(*(uint64_t *)(host_addr + GUEST_BASE)); + #endif + tci_write_reg(t0, tmp64); +@@ -1190,7 +1182,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + helper_stb_mmu(env, taddr, t0, t2); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + *(uint8_t *)(host_addr + GUEST_BASE) = t0; + #endif + break; +@@ -1202,7 +1193,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + helper_stw_mmu(env, taddr, t0, t2); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + *(uint16_t *)(host_addr + GUEST_BASE) = tswap16(t0); + #endif + break; +@@ -1214,7 +1204,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + helper_stl_mmu(env, taddr, t0, t2); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + *(uint32_t *)(host_addr + GUEST_BASE) = tswap32(t0); + #endif + break; +@@ -1226,7 +1215,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) + helper_stq_mmu(env, taddr, tmp64, t2); + #else + host_addr = (tcg_target_ulong)taddr; +- assert(taddr == host_addr); + *(uint64_t *)(host_addr + GUEST_BASE) = tswap64(tmp64); + #endif + break; diff --git a/0037-blockdev-do-not-default-cache.no-flush-to-true.patch b/0037-blockdev-do-not-default-cache.no-flush-to-true.patch new file mode 100644 index 0000000..c7fb6c9 --- /dev/null +++ b/0037-blockdev-do-not-default-cache.no-flush-to-true.patch @@ -0,0 +1,33 @@ +From aeab582580fa057dbe646fc3277570af6a8d5ce8 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Thu, 19 Sep 2013 18:48:53 +0200 +Subject: [PATCH] blockdev: do not default cache.no-flush to true + +That's why all my VMs were so fast lately. :) + +This changed in 1.6.0 by mistake in patch 29c4e2b (blockdev: Split up +'cache' option, 2013-07-18). + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 1df6fa4bc6754a170cf511a78e2e6fef84eb5228) + +Signed-off-by: Michael Roth +--- + blockdev.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/blockdev.c b/blockdev.c +index bc7016a..097932c 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -460,7 +460,7 @@ static DriveInfo *blockdev_init(QemuOpts *all_opts, + if (qemu_opt_get_bool(opts, "cache.direct", false)) { + bdrv_flags |= BDRV_O_NOCACHE; + } +- if (qemu_opt_get_bool(opts, "cache.no-flush", true)) { ++ if (qemu_opt_get_bool(opts, "cache.no-flush", false)) { + bdrv_flags |= BDRV_O_NO_FLUSH; + } + diff --git a/0038-virtio-blk-do-not-relay-a-previous-driver-s-WCE-conf.patch b/0038-virtio-blk-do-not-relay-a-previous-driver-s-WCE-conf.patch new file mode 100644 index 0000000..8e85b74 --- /dev/null +++ b/0038-virtio-blk-do-not-relay-a-previous-driver-s-WCE-conf.patch @@ -0,0 +1,111 @@ +From c8adc0db7e76e804692372a06ca02cc5a80b67d5 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 17:31:55 +0200 +Subject: [PATCH] virtio-blk: do not relay a previous driver's WCE + configuration to the current + +The following sequence happens: +- the SeaBIOS virtio-blk driver does not support the WCE feature, which +causes QEMU to disable writeback caching + +- the Linux virtio-blk driver resets the device, finds WCE is available +but writeback caching is disabled; tells block layer to not send cache +flush commands + +- the Linux virtio-blk driver sets the DRIVER_OK bit, which causes +writeback caching to be re-enabled, but the Linux virtio-blk driver does +not know of this side effect and cache flushes remain disabled + +The bug is at the third step. If the guest does know about CONFIG_WCE, +QEMU should ignore the WCE feature's state. The guest will control the +cache mode solely using configuration space. This change makes Linux +do flushes correctly, but Linux will keep SeaBIOS's writethrough mode. + +Hence, whenever the guest is reset, the cache mode of the disk should +be reset to whatever was specified in the "-drive" option. With this +change, the Linux virtio-blk driver finds that writeback caching is +enabled, and tells the block layer to send cache flush commands +appropriately. + +Reported-by: Rusty Russell +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit ef5bc96268ceec64769617dc53b0ac3a20ff351c) + +Signed-off-by: Michael Roth +--- + hw/block/virtio-blk.c | 24 ++++++++++++++++++++++-- + include/hw/virtio/virtio-blk.h | 1 + + 2 files changed, 23 insertions(+), 2 deletions(-) + +diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c +index e2f55cc..49a23c3 100644 +--- a/hw/block/virtio-blk.c ++++ b/hw/block/virtio-blk.c +@@ -460,9 +460,9 @@ static void virtio_blk_dma_restart_cb(void *opaque, int running, + + static void virtio_blk_reset(VirtIODevice *vdev) + { +-#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE + VirtIOBlock *s = VIRTIO_BLK(vdev); + ++#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE + if (s->dataplane) { + virtio_blk_data_plane_stop(s->dataplane); + } +@@ -473,6 +473,7 @@ static void virtio_blk_reset(VirtIODevice *vdev) + * are per-device request lists. + */ + bdrv_drain_all(); ++ bdrv_set_enable_write_cache(s->bs, s->original_wce); + } + + /* coalesce internal state, copy to pci i/o region 0 +@@ -564,7 +565,25 @@ static void virtio_blk_set_status(VirtIODevice *vdev, uint8_t status) + } + + features = vdev->guest_features; +- bdrv_set_enable_write_cache(s->bs, !!(features & (1 << VIRTIO_BLK_F_WCE))); ++ ++ /* A guest that supports VIRTIO_BLK_F_CONFIG_WCE must be able to send ++ * cache flushes. Thus, the "auto writethrough" behavior is never ++ * necessary for guests that support the VIRTIO_BLK_F_CONFIG_WCE feature. ++ * Leaving it enabled would break the following sequence: ++ * ++ * Guest started with "-drive cache=writethrough" ++ * Guest sets status to 0 ++ * Guest sets DRIVER bit in status field ++ * Guest reads host features (WCE=0, CONFIG_WCE=1) ++ * Guest writes guest features (WCE=0, CONFIG_WCE=1) ++ * Guest writes 1 to the WCE configuration field (writeback mode) ++ * Guest sets DRIVER_OK bit in status field ++ * ++ * s->bs would erroneously be placed in writethrough mode. ++ */ ++ if (!(features & (1 << VIRTIO_BLK_F_CONFIG_WCE))) { ++ bdrv_set_enable_write_cache(s->bs, !!(features & (1 << VIRTIO_BLK_F_WCE))); ++ } + } + + static void virtio_blk_save(QEMUFile *f, void *opaque) +@@ -674,6 +693,7 @@ static int virtio_blk_device_init(VirtIODevice *vdev) + } + + blkconf_serial(&blk->conf, &blk->serial); ++ s->original_wce = bdrv_enable_write_cache(blk->conf.bs); + if (blkconf_geometry(&blk->conf, NULL, 65535, 255, 255) < 0) { + return -1; + } +diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h +index b87cf49..41885da 100644 +--- a/include/hw/virtio/virtio-blk.h ++++ b/include/hw/virtio/virtio-blk.h +@@ -123,6 +123,7 @@ typedef struct VirtIOBlock { + BlockConf *conf; + VirtIOBlkConf blk; + unsigned short sector_mask; ++ bool original_wce; + VMChangeStateEntry *change; + #ifdef CONFIG_VIRTIO_BLK_DATA_PLANE + Notifier migration_state_notifier; diff --git a/0039-xhci-emulate-intr-endpoint-intervals-correctly.patch b/0039-xhci-emulate-intr-endpoint-intervals-correctly.patch new file mode 100644 index 0000000..9474f47 --- /dev/null +++ b/0039-xhci-emulate-intr-endpoint-intervals-correctly.patch @@ -0,0 +1,131 @@ +From dc6fbaa8322ca53f46d9a6cc7e2f82de5362ea83 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Wed, 28 Aug 2013 11:38:44 +0200 +Subject: [PATCH] xhci: emulate intr endpoint intervals correctly + +Respect the interval for interrupt endpoints, so we don't finish +transfers as fast as possible but at the rate configured by the guest. + +Fixes guest deadlocks triggered by interrupt storms. + +Cc: +Signed-off-by: Gerd Hoffmann +(cherry picked from commit 4d7a81c06f5f17e019a2d3a18300500bd64f6f40) + +Signed-off-by: Michael Roth +--- + hw/usb/hcd-xhci.c | 44 +++++++++++++++++++++++++++++++++++++------- + 1 file changed, 37 insertions(+), 7 deletions(-) + +diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c +index a6f55a1..8010a6d 100644 +--- a/hw/usb/hcd-xhci.c ++++ b/hw/usb/hcd-xhci.c +@@ -355,6 +355,7 @@ typedef struct XHCITransfer { + unsigned int streamid; + bool in_xfer; + bool iso_xfer; ++ bool timed_xfer; + + unsigned int trb_count; + unsigned int trb_alloced; +@@ -1803,6 +1804,7 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer) + + xfer->in_xfer = bmRequestType & USB_DIR_IN; + xfer->iso_xfer = false; ++ xfer->timed_xfer = false; + + if (xhci_setup_packet(xfer) < 0) { + return -1; +@@ -1818,6 +1820,17 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer) + return 0; + } + ++static void xhci_calc_intr_kick(XHCIState *xhci, XHCITransfer *xfer, ++ XHCIEPContext *epctx, uint64_t mfindex) ++{ ++ uint64_t asap = ((mfindex + epctx->interval - 1) & ++ ~(epctx->interval-1)); ++ uint64_t kick = epctx->mfindex_last + epctx->interval; ++ ++ assert(epctx->interval != 0); ++ xfer->mfindex_kick = MAX(asap, kick); ++} ++ + static void xhci_calc_iso_kick(XHCIState *xhci, XHCITransfer *xfer, + XHCIEPContext *epctx, uint64_t mfindex) + { +@@ -1840,8 +1853,8 @@ static void xhci_calc_iso_kick(XHCIState *xhci, XHCITransfer *xfer, + } + } + +-static void xhci_check_iso_kick(XHCIState *xhci, XHCITransfer *xfer, +- XHCIEPContext *epctx, uint64_t mfindex) ++static void xhci_check_intr_iso_kick(XHCIState *xhci, XHCITransfer *xfer, ++ XHCIEPContext *epctx, uint64_t mfindex) + { + if (xfer->mfindex_kick > mfindex) { + qemu_mod_timer(epctx->kick_timer, qemu_get_clock_ns(vm_clock) + +@@ -1866,18 +1879,30 @@ static int xhci_submit(XHCIState *xhci, XHCITransfer *xfer, XHCIEPContext *epctx + switch(epctx->type) { + case ET_INTR_OUT: + case ET_INTR_IN: ++ xfer->pkts = 0; ++ xfer->iso_xfer = false; ++ xfer->timed_xfer = true; ++ mfindex = xhci_mfindex_get(xhci); ++ xhci_calc_intr_kick(xhci, xfer, epctx, mfindex); ++ xhci_check_intr_iso_kick(xhci, xfer, epctx, mfindex); ++ if (xfer->running_retry) { ++ return -1; ++ } ++ break; + case ET_BULK_OUT: + case ET_BULK_IN: + xfer->pkts = 0; + xfer->iso_xfer = false; ++ xfer->timed_xfer = false; + break; + case ET_ISO_OUT: + case ET_ISO_IN: + xfer->pkts = 1; + xfer->iso_xfer = true; ++ xfer->timed_xfer = true; + mfindex = xhci_mfindex_get(xhci); + xhci_calc_iso_kick(xhci, xfer, epctx, mfindex); +- xhci_check_iso_kick(xhci, xfer, epctx, mfindex); ++ xhci_check_intr_iso_kick(xhci, xfer, epctx, mfindex); + if (xfer->running_retry) { + return -1; + } +@@ -1938,13 +1963,18 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, + + trace_usb_xhci_xfer_retry(xfer); + assert(xfer->running_retry); +- if (xfer->iso_xfer) { +- /* retry delayed iso transfer */ ++ if (xfer->timed_xfer) { ++ /* time to kick the transfer? */ + mfindex = xhci_mfindex_get(xhci); +- xhci_check_iso_kick(xhci, xfer, epctx, mfindex); ++ xhci_check_intr_iso_kick(xhci, xfer, epctx, mfindex); + if (xfer->running_retry) { + return; + } ++ xfer->timed_xfer = 0; ++ xfer->running_retry = 1; ++ } ++ if (xfer->iso_xfer) { ++ /* retry iso transfer */ + if (xhci_setup_packet(xfer) < 0) { + return; + } +@@ -2030,7 +2060,7 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, + epctx->next_xfer = (epctx->next_xfer + 1) % TD_QUEUE; + ep = xfer->packet.ep; + } else { +- if (!xfer->iso_xfer) { ++ if (!xfer->timed_xfer) { + fprintf(stderr, "xhci: error firing data transfer\n"); + } + } diff --git a/0040-iov-avoid-orig_len-may-be-used-unitialized-warning.patch b/0040-iov-avoid-orig_len-may-be-used-unitialized-warning.patch new file mode 100644 index 0000000..c8f386c --- /dev/null +++ b/0040-iov-avoid-orig_len-may-be-used-unitialized-warning.patch @@ -0,0 +1,37 @@ +From b314120afdbab3d29885f47fc83bc55f43765968 Mon Sep 17 00:00:00 2001 +From: Michael Tokarev +Date: Sat, 14 Sep 2013 13:11:36 +0400 +Subject: [PATCH] iov: avoid "orig_len may be used unitialized" warning + +Signed-off-by: Wenchao Xia +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Michael Tokarev +(cherry picked from commit 2be178a475289286db80de5ddd7830e67e112bdd) + +Signed-off-by: Michael Roth +--- + util/iov.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/util/iov.c b/util/iov.c +index f705586..bb46c04 100644 +--- a/util/iov.c ++++ b/util/iov.c +@@ -181,13 +181,11 @@ ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt, + assert(iov[niov].iov_len > tail); + orig_len = iov[niov].iov_len; + iov[niov++].iov_len = tail; +- } +- +- ret = do_send_recv(sockfd, iov, niov, do_send); +- +- /* Undo the changes above before checking for errors */ +- if (tail) { ++ ret = do_send_recv(sockfd, iov, niov, do_send); ++ /* Undo the changes above before checking for errors */ + iov[niov-1].iov_len = orig_len; ++ } else { ++ ret = do_send_recv(sockfd, iov, niov, do_send); + } + if (offset) { + iov[0].iov_base -= offset; diff --git a/0041-tap-Use-numbered-tap-tun-devices-on-all-BSD-OS-s.patch b/0041-tap-Use-numbered-tap-tun-devices-on-all-BSD-OS-s.patch new file mode 100644 index 0000000..67f0fe3 --- /dev/null +++ b/0041-tap-Use-numbered-tap-tun-devices-on-all-BSD-OS-s.patch @@ -0,0 +1,47 @@ +From 6bbb9d8100c90deb4843bfa3cf36e75b843c495b Mon Sep 17 00:00:00 2001 +From: Brad Smith +Date: Sat, 3 Aug 2013 22:20:41 -0400 +Subject: [PATCH] tap: Use numbered tap/tun devices on all *BSD OS's + +The following patch simplifies the *BSD tap/tun code and makes use of numbered +tap/tun interfaces on all *BSD OS's. NetBSD has a patch in their pkgsrc tree +to make use of this feature and DragonFly also supports this as well. + +Signed-off-by: Brad Smith +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit aa4f082f7526d39dac8e2ca64d192d858014ee10) + +Signed-off-by: Michael Roth +--- + net/tap-bsd.c | 11 ----------- + 1 file changed, 11 deletions(-) + +diff --git a/net/tap-bsd.c b/net/tap-bsd.c +index f61d580..90f8a02 100644 +--- a/net/tap-bsd.c ++++ b/net/tap-bsd.c +@@ -44,8 +44,6 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, + struct stat s; + #endif + +-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ +- defined(__OpenBSD__) || defined(__APPLE__) + /* if no ifname is given, always start the search from tap0/tun0. */ + int i; + char dname[100]; +@@ -76,15 +74,6 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, + dname, strerror(errno)); + return -1; + } +-#else +- TFR(fd = open("/dev/tap", O_RDWR)); +- if (fd < 0) { +- fprintf(stderr, +- "warning: could not open /dev/tap: no virtual network emulation: %s\n", +- strerror(errno)); +- return -1; +- } +-#endif + + #ifdef TAPGIFNAME + if (ioctl(fd, TAPGIFNAME, (void *)&ifr) < 0) { diff --git a/0042-rbd-avoid-qemu_rbd_snap_list-memory-leaks.patch b/0042-rbd-avoid-qemu_rbd_snap_list-memory-leaks.patch new file mode 100644 index 0000000..ebbe492 --- /dev/null +++ b/0042-rbd-avoid-qemu_rbd_snap_list-memory-leaks.patch @@ -0,0 +1,43 @@ +From fc06b430942e84a2a69e2a80a6d5b376a8064020 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Wed, 25 Sep 2013 16:00:48 +0200 +Subject: [PATCH] rbd: avoid qemu_rbd_snap_list() memory leaks + +When there are no snapshots qemu_rbd_snap_list() returns 0 and the +snapshot table pointer is NULL. Don't forget to free the snaps buffer +we allocated for librbd rbd_snap_list(). + +When the function succeeds don't forget to free the snaps buffer after +calling rbd_snap_list_end(). + +Cc: qemu-stable@nongnu.org +Signed-off-by: Stefan Hajnoczi +Signed-off-by: Kevin Wolf +(cherry picked from commit 9e6337d0818650362149b734d53edf9489f3acaa) + +Signed-off-by: Michael Roth +--- + block/rbd.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/block/rbd.c b/block/rbd.c +index cb71751..7e7c735 100644 +--- a/block/rbd.c ++++ b/block/rbd.c +@@ -934,7 +934,7 @@ static int qemu_rbd_snap_list(BlockDriverState *bs, + do { + snaps = g_malloc(sizeof(*snaps) * max_snaps); + snap_count = rbd_snap_list(s->image, snaps, &max_snaps); +- if (snap_count < 0) { ++ if (snap_count <= 0) { + g_free(snaps); + } + } while (snap_count == -ERANGE); +@@ -958,6 +958,7 @@ static int qemu_rbd_snap_list(BlockDriverState *bs, + sn_info->vm_clock_nsec = 0; + } + rbd_snap_list_end(snaps); ++ g_free(snaps); + + done: + *psn_tab = sn_tab; diff --git a/0043-vmdk-fix-cluster-size-check-for-flat-extents.patch b/0043-vmdk-fix-cluster-size-check-for-flat-extents.patch new file mode 100644 index 0000000..b8bac4c --- /dev/null +++ b/0043-vmdk-fix-cluster-size-check-for-flat-extents.patch @@ -0,0 +1,64 @@ +From 61fbeb6e81f648d25c2d3ba5f0d663d54abed1c1 Mon Sep 17 00:00:00 2001 +From: Fam Zheng +Date: Mon, 23 Sep 2013 17:18:29 +0800 +Subject: [PATCH] vmdk: fix cluster size check for flat extents + +We use the extent size as cluster size for flat extents (where no L1/L2 +table is allocated so it's safe) reuse sector calculating code with +sparse extents. + +Don't pass in the cluster size for adding flat extent, just set it to +sectors later, then the cluster size checking will not fail. + +The cluster_sectors is changed to int64_t to allow big flat extent. + +Without this, flat extent opening is broken: + + # qemu-img create -f vmdk -o subformat=monolithicFlat /tmp/a.vmdk 100G + Formatting '/tmp/a.vmdk', fmt=vmdk size=107374182400 compat6=off subformat='monolithicFlat' zeroed_grain=off + # qemu-img info /tmp/a.vmdk + image: /tmp/a.vmdk + file format: raw + virtual size: 0 (0 bytes) + disk size: 4.0K + +Signed-off-by: Fam Zheng +Signed-off-by: Kevin Wolf +(cherry picked from commit 301c7d38a0c359b91526391d13617386f3d9bb29) + +Signed-off-by: Michael Roth +--- + block/vmdk.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/block/vmdk.c b/block/vmdk.c +index 346bb5c..258a24f 100644 +--- a/block/vmdk.c ++++ b/block/vmdk.c +@@ -105,7 +105,7 @@ typedef struct VmdkExtent { + uint32_t l2_cache_offsets[L2_CACHE_SIZE]; + uint32_t l2_cache_counts[L2_CACHE_SIZE]; + +- unsigned int cluster_sectors; ++ int64_t cluster_sectors; + } VmdkExtent; + + typedef struct BDRVVmdkState { +@@ -416,7 +416,7 @@ static int vmdk_add_extent(BlockDriverState *bs, + extent->l1_size = l1_size; + extent->l1_entry_sectors = l2_size * cluster_sectors; + extent->l2_size = l2_size; +- extent->cluster_sectors = cluster_sectors; ++ extent->cluster_sectors = flat ? sectors : cluster_sectors; + + if (s->num_extents > 1) { + extent->end_sector = (*(extent - 1)).end_sector + extent->sectors; +@@ -736,7 +736,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs, + VmdkExtent *extent; + + ret = vmdk_add_extent(bs, extent_file, true, sectors, +- 0, 0, 0, 0, sectors, &extent); ++ 0, 0, 0, 0, 0, &extent); + if (ret < 0) { + return ret; + } diff --git a/0044-piix4-disable-io-on-reset.patch b/0044-piix4-disable-io-on-reset.patch new file mode 100644 index 0000000..e37b62b --- /dev/null +++ b/0044-piix4-disable-io-on-reset.patch @@ -0,0 +1,33 @@ +From ae00a27feab0ca12d2a802cfae9ee65ba3d43602 Mon Sep 17 00:00:00 2001 +From: "Michael S. Tsirkin" +Date: Wed, 11 Sep 2013 13:33:31 +0300 +Subject: [PATCH] piix4: disable io on reset + +io base register at 0x40 is cleared on reset, +but io is not disabled until some other event +happens to call pm_io_space_update. + +Invoke pm_io_space_update directly to make this +consistent. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit c046e8c4a26c902ca1b4f5bdf668a2da6bc75f54) + +Signed-off-by: Michael Roth +--- + hw/acpi/piix4.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c +index c885690..3aaf18c 100644 +--- a/hw/acpi/piix4.c ++++ b/hw/acpi/piix4.c +@@ -380,6 +380,7 @@ static void piix4_reset(void *opaque) + /* Mark SMM as already inited (until KVM supports SMM). */ + pci_conf[0x5B] = 0x02; + } ++ pm_io_space_update(s); + piix4_update_hotplug(s); + } + diff --git a/0045-coroutine-add-.-configure-disable-coroutine-pool.patch b/0045-coroutine-add-.-configure-disable-coroutine-pool.patch new file mode 100644 index 0000000..2c416fd --- /dev/null +++ b/0045-coroutine-add-.-configure-disable-coroutine-pool.patch @@ -0,0 +1,163 @@ +From ba20326a937421c50a775907dc9ac726bb9a9b50 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Wed, 11 Sep 2013 16:42:35 +0200 +Subject: [PATCH] coroutine: add ./configure --disable-coroutine-pool + +The 'gthread' coroutine backend was written before the freelist (aka +pool) existed in qemu-coroutine.c. + +This means that every thread is expected to exit when its coroutine +terminates. It is not possible to reuse threads from a pool. + +This patch automatically disables the pool when 'gthread' is used. This +allows the 'gthread' backend to work again (for example, +tests/test-coroutine completes successfully instead of hanging). + +I considered implementing thread reuse but I don't want quirks like CPU +affinity differences due to coroutine threads being recycled. The +'gthread' backend is a reference backend and it's therefore okay to skip +the pool optimization. + +Note this patch also makes it easy to toggle the pool for benchmarking +purposes: + + ./configure --with-coroutine-backend=ucontext \ + --disable-coroutine-pool + +Reported-by: Gabriel Kerneis +Signed-off-by: Stefan Hajnoczi +Reviewed-by: Gabriel Kerneis +Signed-off-by: Kevin Wolf +(cherry picked from commit 70c60c089fdc6bf8a79324e492c13e8c08d55942) + +Signed-off-by: Michael Roth +--- + configure | 24 ++++++++++++++++++++++++ + qemu-coroutine.c | 34 +++++++++++++++++++--------------- + 2 files changed, 43 insertions(+), 15 deletions(-) + +diff --git a/configure b/configure +index 18fa608..4cf672d 100755 +--- a/configure ++++ b/configure +@@ -235,6 +235,7 @@ guest_agent="" + want_tools="yes" + libiscsi="" + coroutine="" ++coroutine_pool="" + seccomp="" + glusterfs="" + glusterfs_discard="no" +@@ -871,6 +872,10 @@ for opt do + ;; + --with-coroutine=*) coroutine="$optarg" + ;; ++ --disable-coroutine-pool) coroutine_pool="no" ++ ;; ++ --enable-coroutine-pool) coroutine_pool="yes" ++ ;; + --disable-docs) docs="no" + ;; + --enable-docs) docs="yes" +@@ -1152,6 +1157,8 @@ echo " --disable-seccomp disable seccomp support" + echo " --enable-seccomp enables seccomp support" + echo " --with-coroutine=BACKEND coroutine backend. Supported options:" + echo " gthread, ucontext, sigaltstack, windows" ++echo " --disable-coroutine-pool disable coroutine freelist (worse performance)" ++echo " --enable-coroutine-pool enable coroutine freelist (better performance)" + echo " --enable-glusterfs enable GlusterFS backend" + echo " --disable-glusterfs disable GlusterFS backend" + echo " --enable-gcov enable test coverage analysis with gcov" +@@ -3240,6 +3247,17 @@ else + esac + fi + ++if test "$coroutine_pool" = ""; then ++ if test "$coroutine" = "gthread"; then ++ coroutine_pool=no ++ else ++ coroutine_pool=yes ++ fi ++fi ++if test "$coroutine" = "gthread" -a "$coroutine_pool" = "yes"; then ++ error_exit "'gthread' coroutine backend does not support pool (use --disable-coroutine-pool)" ++fi ++ + ########################################## + # check if we have open_by_handle_at + +@@ -3605,6 +3623,7 @@ echo "libiscsi support $libiscsi" + echo "build guest agent $guest_agent" + echo "seccomp support $seccomp" + echo "coroutine backend $coroutine" ++echo "coroutine pool $coroutine_pool" + echo "GlusterFS support $glusterfs" + echo "virtio-blk-data-plane $virtio_blk_data_plane" + echo "gcov $gcov_tool" +@@ -3954,6 +3973,11 @@ if test "$rbd" = "yes" ; then + fi + + echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak ++if test "$coroutine_pool" = "yes" ; then ++ echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak ++else ++ echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak ++fi + + if test "$open_by_handle_at" = "yes" ; then + echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak +diff --git a/qemu-coroutine.c b/qemu-coroutine.c +index 423430d..4708521 100644 +--- a/qemu-coroutine.c ++++ b/qemu-coroutine.c +@@ -30,15 +30,17 @@ static unsigned int pool_size; + + Coroutine *qemu_coroutine_create(CoroutineEntry *entry) + { +- Coroutine *co; +- +- qemu_mutex_lock(&pool_lock); +- co = QSLIST_FIRST(&pool); +- if (co) { +- QSLIST_REMOVE_HEAD(&pool, pool_next); +- pool_size--; ++ Coroutine *co = NULL; ++ ++ if (CONFIG_COROUTINE_POOL) { ++ qemu_mutex_lock(&pool_lock); ++ co = QSLIST_FIRST(&pool); ++ if (co) { ++ QSLIST_REMOVE_HEAD(&pool, pool_next); ++ pool_size--; ++ } ++ qemu_mutex_unlock(&pool_lock); + } +- qemu_mutex_unlock(&pool_lock); + + if (!co) { + co = qemu_coroutine_new(); +@@ -51,15 +53,17 @@ Coroutine *qemu_coroutine_create(CoroutineEntry *entry) + + static void coroutine_delete(Coroutine *co) + { +- qemu_mutex_lock(&pool_lock); +- if (pool_size < POOL_MAX_SIZE) { +- QSLIST_INSERT_HEAD(&pool, co, pool_next); +- co->caller = NULL; +- pool_size++; ++ if (CONFIG_COROUTINE_POOL) { ++ qemu_mutex_lock(&pool_lock); ++ if (pool_size < POOL_MAX_SIZE) { ++ QSLIST_INSERT_HEAD(&pool, co, pool_next); ++ co->caller = NULL; ++ pool_size++; ++ qemu_mutex_unlock(&pool_lock); ++ return; ++ } + qemu_mutex_unlock(&pool_lock); +- return; + } +- qemu_mutex_unlock(&pool_lock); + + qemu_coroutine_delete(co); + } diff --git a/0046-qemu-Adjust-qemu-wakeup.patch b/0046-qemu-Adjust-qemu-wakeup.patch new file mode 100644 index 0000000..973119b --- /dev/null +++ b/0046-qemu-Adjust-qemu-wakeup.patch @@ -0,0 +1,123 @@ +From bc05a488b49f903e404323b76ca9b675318393fc Mon Sep 17 00:00:00 2001 +From: "Liu, Jinsong" +Date: Wed, 25 Sep 2013 16:38:29 +0000 +Subject: [PATCH] qemu: Adjust qemu wakeup + +Currently Xen hvm s3 has a bug coming from the difference between +qemu-traditioanl and qemu-xen. For qemu-traditional, the way to +resume from hvm s3 is via 'xl trigger' command. However, for +qemu-xen, the way to resume from hvm s3 inherited from standard +qemu, i.e. via QMP, and it doesn't work under Xen. + +The root cause is, for qemu-xen, 'xl trigger' command didn't reset +devices, while QMP didn't unpause hvm domain though they did qemu +system reset. + +We have two qemu patches and one xl patch to fix Xen hvm s3 bug. +This patch is the qemu patch 1. It adjusts qemu wakeup so that +Xen s3 resume logic (which will be implemented at qemu patch 2) +will be notified after qemu system reset. + +Signed-off-by: Liu Jinsong +Signed-off-by: Stefano Stabellini +Reviewed-by: Paolo Bonzini +Reviewed-by: Anthony PERARD +(cherry picked from commit 4bc78a877252d772b983810a7d2c0be00e9be70e) + +Signed-off-by: Michael Roth +--- + hw/acpi/core.c | 3 ++- + include/sysemu/sysemu.h | 4 +++- + vl.c | 15 +++++++-------- + 3 files changed, 12 insertions(+), 10 deletions(-) + +diff --git a/hw/acpi/core.c b/hw/acpi/core.c +index b07feda..769cfdb 100644 +--- a/hw/acpi/core.c ++++ b/hw/acpi/core.c +@@ -324,12 +324,13 @@ static void acpi_notify_wakeup(Notifier *notifier, void *data) + (ACPI_BITMASK_WAKE_STATUS | ACPI_BITMASK_TIMER_STATUS); + break; + case QEMU_WAKEUP_REASON_OTHER: +- default: + /* ACPI_BITMASK_WAKE_STATUS should be set on resume. + Pretend that resume was caused by power button */ + ar->pm1.evt.sts |= + (ACPI_BITMASK_WAKE_STATUS | ACPI_BITMASK_POWER_BUTTON_STATUS); + break; ++ default: ++ break; + } + } + +diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h +index d7a77b6..1a77c99 100644 +--- a/include/sysemu/sysemu.h ++++ b/include/sysemu/sysemu.h +@@ -39,9 +39,11 @@ int vm_stop(RunState state); + int vm_stop_force_state(RunState state); + + typedef enum WakeupReason { +- QEMU_WAKEUP_REASON_OTHER = 0, ++ /* Always keep QEMU_WAKEUP_REASON_NONE = 0 */ ++ QEMU_WAKEUP_REASON_NONE = 0, + QEMU_WAKEUP_REASON_RTC, + QEMU_WAKEUP_REASON_PMTIMER, ++ QEMU_WAKEUP_REASON_OTHER, + } WakeupReason; + + void qemu_system_reset_request(void); +diff --git a/vl.c b/vl.c +index f422a1c..2160933 100644 +--- a/vl.c ++++ b/vl.c +@@ -1792,14 +1792,14 @@ static pid_t shutdown_pid; + static int powerdown_requested; + static int debug_requested; + static int suspend_requested; +-static int wakeup_requested; ++static WakeupReason wakeup_reason; + static NotifierList powerdown_notifiers = + NOTIFIER_LIST_INITIALIZER(powerdown_notifiers); + static NotifierList suspend_notifiers = + NOTIFIER_LIST_INITIALIZER(suspend_notifiers); + static NotifierList wakeup_notifiers = + NOTIFIER_LIST_INITIALIZER(wakeup_notifiers); +-static uint32_t wakeup_reason_mask = ~0; ++static uint32_t wakeup_reason_mask = ~(1 << QEMU_WAKEUP_REASON_NONE); + static RunState vmstop_requested = RUN_STATE_MAX; + + int qemu_shutdown_requested_get(void) +@@ -1849,11 +1849,9 @@ static int qemu_suspend_requested(void) + return r; + } + +-static int qemu_wakeup_requested(void) ++static WakeupReason qemu_wakeup_requested(void) + { +- int r = wakeup_requested; +- wakeup_requested = 0; +- return r; ++ return wakeup_reason; + } + + static int qemu_powerdown_requested(void) +@@ -1970,8 +1968,7 @@ void qemu_system_wakeup_request(WakeupReason reason) + return; + } + runstate_set(RUN_STATE_RUNNING); +- notifier_list_notify(&wakeup_notifiers, &reason); +- wakeup_requested = 1; ++ wakeup_reason = reason; + qemu_notify_event(); + } + +@@ -2063,6 +2060,8 @@ static bool main_loop_should_exit(void) + pause_all_vcpus(); + cpu_synchronize_all_states(); + qemu_system_reset(VMRESET_SILENT); ++ notifier_list_notify(&wakeup_notifiers, &wakeup_reason); ++ wakeup_reason = QEMU_WAKEUP_REASON_NONE; + resume_all_vcpus(); + monitor_protocol_event(QEVENT_WAKEUP, NULL); + } diff --git a/0047-qemu-Add-qemu-xen-logic-for-Xen-HVM-S3-resume.patch b/0047-qemu-Add-qemu-xen-logic-for-Xen-HVM-S3-resume.patch new file mode 100644 index 0000000..f6e06a5 --- /dev/null +++ b/0047-qemu-Add-qemu-xen-logic-for-Xen-HVM-S3-resume.patch @@ -0,0 +1,53 @@ +From 1b5f7709411a412ec8ce21004a47f51ab6c3f3ad Mon Sep 17 00:00:00 2001 +From: "Liu, Jinsong" +Date: Wed, 25 Sep 2013 16:40:23 +0000 +Subject: [PATCH] qemu: Add qemu xen logic for Xen HVM S3 resume + +This patch is qemu patch 2 to fix Xen HVM S3 bug, adding qemu +xen logic. When qemu wakeup, qemu xen logic is notified and +hypercall to xen hypervisor to unpause domain. + +Signed-off-by: Liu Jinsong +Signed-off-by: Stefano Stabellini +Reviewed-by: Anthony PERARD +(cherry picked from commit 11addd0ab9371af2b6ec028c7fe4e4c4992252fc) + +Signed-off-by: Michael Roth +--- + xen-all.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/xen-all.c b/xen-all.c +index e1d0694..7894ac6 100644 +--- a/xen-all.c ++++ b/xen-all.c +@@ -98,6 +98,7 @@ typedef struct XenIOState { + + Notifier exit; + Notifier suspend; ++ Notifier wakeup; + } XenIOState; + + /* Xen specific function for piix pci */ +@@ -1060,6 +1061,11 @@ static void xen_read_physmap(XenIOState *state) + free(entries); + } + ++static void xen_wakeup_notifier(Notifier *notifier, void *data) ++{ ++ xc_set_hvm_param(xen_xc, xen_domid, HVM_PARAM_ACPI_S_STATE, 0); ++} ++ + int xen_hvm_init(MemoryRegion **ram_memory) + { + int i, rc; +@@ -1089,6 +1095,9 @@ int xen_hvm_init(MemoryRegion **ram_memory) + state->suspend.notify = xen_suspend_notifier; + qemu_register_suspend_notifier(&state->suspend); + ++ state->wakeup.notify = xen_wakeup_notifier; ++ qemu_register_wakeup_notifier(&state->wakeup); ++ + xc_get_hvm_param(xen_xc, xen_domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn); + DPRINTF("shared page at pfn %lx\n", ioreq_pfn); + state->shared_page = xc_map_foreign_range(xen_xc, xen_domid, XC_PAGE_SIZE, diff --git a/0048-scsi-Allocate-SCSITargetReq-r-buf-dynamically.patch b/0048-scsi-Allocate-SCSITargetReq-r-buf-dynamically.patch new file mode 100644 index 0000000..d921981 --- /dev/null +++ b/0048-scsi-Allocate-SCSITargetReq-r-buf-dynamically.patch @@ -0,0 +1,154 @@ +From fdcbe7d587a64dec0db0d3c9a3b230c39efbfeef Mon Sep 17 00:00:00 2001 +From: Asias He +Date: Fri, 13 Sep 2013 14:56:55 +0800 +Subject: [PATCH] scsi: Allocate SCSITargetReq r->buf dynamically + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1007330 +Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=6282465 + +This is the backport of the following commit. The patch is not +sent public since it is a embargoed bug. + + r->buf is hardcoded to 2056 which is (256 + 1) * 8, allowing 256 luns at + most. If more than 256 luns are specified by user, we have buffer + overflow in scsi_target_emulate_report_luns. + + To fix, we allocate the buffer dynamically. + + Signed-off-by: Asias He + +Signed-off-by: Asias He +Signed-off-by: Paolo Bonzini + +*s/&r->buf/r->buf/ due to type change + +Signed-off-by: Michael Roth +--- + hw/scsi/scsi-bus.c | 44 +++++++++++++++++++++++++++++++++----------- + include/hw/scsi/scsi.h | 2 ++ + 2 files changed, 35 insertions(+), 11 deletions(-) + +diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c +index 8fe4f4c..ad26c25 100644 +--- a/hw/scsi/scsi-bus.c ++++ b/hw/scsi/scsi-bus.c +@@ -11,6 +11,8 @@ static char *scsibus_get_dev_path(DeviceState *dev); + static char *scsibus_get_fw_dev_path(DeviceState *dev); + static int scsi_req_parse(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf); + static void scsi_req_dequeue(SCSIRequest *req); ++static uint8_t *scsi_target_alloc_buf(SCSIRequest *req, size_t len); ++static void scsi_target_free_buf(SCSIRequest *req); + + static Property scsi_props[] = { + DEFINE_PROP_UINT32("channel", SCSIDevice, channel, 0), +@@ -317,7 +319,8 @@ typedef struct SCSITargetReq SCSITargetReq; + struct SCSITargetReq { + SCSIRequest req; + int len; +- uint8_t buf[2056]; ++ uint8_t *buf; ++ int buf_len; + }; + + static void store_lun(uint8_t *outbuf, int lun) +@@ -361,14 +364,12 @@ static bool scsi_target_emulate_report_luns(SCSITargetReq *r) + if (!found_lun0) { + n += 8; + } +- len = MIN(n + 8, r->req.cmd.xfer & ~7); +- if (len > sizeof(r->buf)) { +- /* TODO: > 256 LUNs? */ +- return false; +- } + ++ scsi_target_alloc_buf(&r->req, n + 8); ++ ++ len = MIN(n + 8, r->req.cmd.xfer & ~7); + memset(r->buf, 0, len); +- stl_be_p(&r->buf, n); ++ stl_be_p(r->buf, n); + i = found_lun0 ? 8 : 16; + QTAILQ_FOREACH(kid, &r->req.bus->qbus.children, sibling) { + DeviceState *qdev = kid->child; +@@ -387,6 +388,9 @@ static bool scsi_target_emulate_report_luns(SCSITargetReq *r) + static bool scsi_target_emulate_inquiry(SCSITargetReq *r) + { + assert(r->req.dev->lun != r->req.lun); ++ ++ scsi_target_alloc_buf(&r->req, SCSI_INQUIRY_LEN); ++ + if (r->req.cmd.buf[1] & 0x2) { + /* Command support data - optional, not implemented */ + return false; +@@ -411,7 +415,7 @@ static bool scsi_target_emulate_inquiry(SCSITargetReq *r) + return false; + } + /* done with EVPD */ +- assert(r->len < sizeof(r->buf)); ++ assert(r->len < r->buf_len); + r->len = MIN(r->req.cmd.xfer, r->len); + return true; + } +@@ -455,8 +459,8 @@ static int32_t scsi_target_send_command(SCSIRequest *req, uint8_t *buf) + } + break; + case REQUEST_SENSE: +- r->len = scsi_device_get_sense(r->req.dev, r->buf, +- MIN(req->cmd.xfer, sizeof r->buf), ++ scsi_target_alloc_buf(&r->req, SCSI_SENSE_LEN); ++ r->len = scsi_device_get_sense(r->req.dev, r->buf, r->buf_len, + (req->cmd.buf[1] & 1) == 0); + if (r->req.dev->sense_is_ua) { + scsi_device_unit_attention_reported(req->dev); +@@ -501,11 +505,29 @@ static uint8_t *scsi_target_get_buf(SCSIRequest *req) + return r->buf; + } + ++static uint8_t *scsi_target_alloc_buf(SCSIRequest *req, size_t len) ++{ ++ SCSITargetReq *r = DO_UPCAST(SCSITargetReq, req, req); ++ ++ r->buf = g_malloc(len); ++ r->buf_len = len; ++ ++ return r->buf; ++} ++ ++static void scsi_target_free_buf(SCSIRequest *req) ++{ ++ SCSITargetReq *r = DO_UPCAST(SCSITargetReq, req, req); ++ ++ g_free(r->buf); ++} ++ + static const struct SCSIReqOps reqops_target_command = { + .size = sizeof(SCSITargetReq), + .send_command = scsi_target_send_command, + .read_data = scsi_target_read_data, + .get_buf = scsi_target_get_buf, ++ .free_req = scsi_target_free_buf, + }; + + +@@ -1365,7 +1387,7 @@ int scsi_build_sense(uint8_t *in_buf, int in_len, + buf[7] = 10; + buf[12] = sense.asc; + buf[13] = sense.ascq; +- return MIN(len, 18); ++ return MIN(len, SCSI_SENSE_LEN); + } else { + /* Return descriptor format sense buffer */ + buf[0] = 0x72; +diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h +index 8786531..18cb694 100644 +--- a/include/hw/scsi/scsi.h ++++ b/include/hw/scsi/scsi.h +@@ -9,6 +9,8 @@ + #define MAX_SCSI_DEVS 255 + + #define SCSI_CMD_BUF_SIZE 16 ++#define SCSI_SENSE_LEN 18 ++#define SCSI_INQUIRY_LEN 36 + + typedef struct SCSIBus SCSIBus; + typedef struct SCSIBusInfo SCSIBusInfo; diff --git a/0049-Update-VERSION-for-1.6.1-release.patch b/0049-Update-VERSION-for-1.6.1-release.patch new file mode 100644 index 0000000..30bfee2 --- /dev/null +++ b/0049-Update-VERSION-for-1.6.1-release.patch @@ -0,0 +1,17 @@ +From 62ecc3a0e3c77a4944c92a02dd7fae2ab1f2290d Mon Sep 17 00:00:00 2001 +From: Michael Roth +Date: Fri, 4 Oct 2013 10:21:43 -0500 +Subject: [PATCH] Update VERSION for 1.6.1 release + +Signed-off-by: Michael Roth +--- + VERSION | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/VERSION b/VERSION +index dc1e644..9c6d629 100644 +--- a/VERSION ++++ b/VERSION +@@ -1 +1 @@ +-1.6.0 ++1.6.1 diff --git a/0001-Fix-migration-from-qemu-kvm.patch b/0101-Fix-migration-from-qemu-kvm.patch similarity index 98% rename from 0001-Fix-migration-from-qemu-kvm.patch rename to 0101-Fix-migration-from-qemu-kvm.patch index 4db56ab..a263329 100644 --- a/0001-Fix-migration-from-qemu-kvm.patch +++ b/0101-Fix-migration-from-qemu-kvm.patch @@ -1,4 +1,4 @@ -From 846f71f534a6a026793eacb0c620f54eb30540a8 Mon Sep 17 00:00:00 2001 +From 2196426a9b081cb99f4bdefb854aaa206bdd0392 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 16 Aug 2013 12:14:51 -0400 Subject: [PATCH] Fix migration from qemu-kvm @@ -17,7 +17,7 @@ video memory bits. 4 files changed, 74 insertions(+), 11 deletions(-) diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c -index c885690..e6c4c8b 100644 +index 3aaf18c..6fbe57c 100644 --- a/hw/acpi/piix4.c +++ b/hw/acpi/piix4.c @@ -289,7 +289,13 @@ static int acpi_load_old(QEMUFile *f, void *opaque, int version_id) @@ -76,7 +76,7 @@ index c537057..7ef3eff 100644 }; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c -index 6e1e654..4fd5b6d 100644 +index 3df2ff9..28216ee 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -377,6 +377,24 @@ static QEMUMachine pc_i440fx_machine_v1_4 = { diff --git a/0003-isapc-disable-kvmvapic.patch b/0102-isapc-disable-kvmvapic.patch similarity index 91% rename from 0003-isapc-disable-kvmvapic.patch rename to 0102-isapc-disable-kvmvapic.patch index 1fd2899..4adf992 100644 --- a/0003-isapc-disable-kvmvapic.patch +++ b/0102-isapc-disable-kvmvapic.patch @@ -1,4 +1,4 @@ -From 56cee96f3c71ffee457d8fbdf427c47824a12e05 Mon Sep 17 00:00:00 2001 +From 85a924af30f31a4f701ee6f18d84dd27aa02f47b Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 13 Aug 2013 00:02:18 +0200 Subject: [PATCH] isapc: disable kvmvapic @@ -18,7 +18,7 @@ Signed-off-by: Cole Robinson 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c -index 4fd5b6d..462d991 100644 +index 28216ee..2f2cb4d 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -795,7 +795,11 @@ static QEMUMachine isapc_machine = { diff --git a/0004-pci-do-not-export-pci_bus_reset.patch b/0103-pci-do-not-export-pci_bus_reset.patch similarity index 97% rename from 0004-pci-do-not-export-pci_bus_reset.patch rename to 0103-pci-do-not-export-pci_bus_reset.patch index a7fb21d..21c6cef 100644 --- a/0004-pci-do-not-export-pci_bus_reset.patch +++ b/0103-pci-do-not-export-pci_bus_reset.patch @@ -1,4 +1,4 @@ -From b8decc166db51601a6ad6f1df1752e9a9dc4544c Mon Sep 17 00:00:00 2001 +From 07873f45017c04994496d8dc3f7acb60358bba49 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 2 May 2013 11:38:37 +0200 Subject: [PATCH] pci: do not export pci_bus_reset diff --git a/0005-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch b/0104-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch similarity index 98% rename from 0005-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch rename to 0104-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch index a418e80..8580f62 100644 --- a/0005-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch +++ b/0104-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch @@ -1,4 +1,4 @@ -From 7dbd6881f10537bf586f1eedf5a3bda2e50174ca Mon Sep 17 00:00:00 2001 +From cf09bc533d82f2b16d1e9f4888c1afd977ca256d Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 2 May 2013 11:38:38 +0200 Subject: [PATCH] qdev: allow both pre- and post-order vists in qdev walking diff --git a/0006-qdev-switch-reset-to-post-order.patch b/0105-qdev-switch-reset-to-post-order.patch similarity index 98% rename from 0006-qdev-switch-reset-to-post-order.patch rename to 0105-qdev-switch-reset-to-post-order.patch index 4679fc5..2f533e5 100644 --- a/0006-qdev-switch-reset-to-post-order.patch +++ b/0105-qdev-switch-reset-to-post-order.patch @@ -1,4 +1,4 @@ -From 59164410b2f021d53be2ce45630647e952ccf9c2 Mon Sep 17 00:00:00 2001 +From 41a2077cea8ce006dbef885bcb0778af05a0b159 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 2 May 2013 11:38:39 +0200 Subject: [PATCH] qdev: switch reset to post-order diff --git a/0106-virtio-bus-remove-vdev-field.patch b/0106-virtio-bus-remove-vdev-field.patch new file mode 100644 index 0000000..617326f --- /dev/null +++ b/0106-virtio-bus-remove-vdev-field.patch @@ -0,0 +1,251 @@ +From ed35f9edcc420b4f8c1f909bc7cfb002a54f437b Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 16:57:50 +0200 +Subject: [PATCH] virtio-bus: remove vdev field + +The vdev field is complicated to synchronize. Just access the +BusState's list of children. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +--- + hw/virtio/virtio-bus.c | 67 ++++++++++++++++++++++++------------------ + hw/virtio/virtio-mmio.c | 9 +++--- + hw/virtio/virtio-pci.c | 2 +- + include/hw/virtio/virtio-bus.h | 16 +++++++--- + 4 files changed, 57 insertions(+), 37 deletions(-) + +diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c +index 6849a01..669ce38 100644 +--- a/hw/virtio/virtio-bus.c ++++ b/hw/virtio/virtio-bus.c +@@ -46,8 +46,6 @@ int virtio_bus_plug_device(VirtIODevice *vdev) + VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(bus); + DPRINTF("%s: plug device.\n", qbus->name); + +- bus->vdev = vdev; +- + if (klass->device_plugged != NULL) { + klass->device_plugged(qbus->parent); + } +@@ -58,75 +56,84 @@ int virtio_bus_plug_device(VirtIODevice *vdev) + /* Reset the virtio_bus */ + void virtio_bus_reset(VirtioBusState *bus) + { ++ VirtIODevice *vdev = virtio_bus_get_device(bus); ++ + DPRINTF("%s: reset device.\n", qbus->name); +- if (bus->vdev != NULL) { +- virtio_reset(bus->vdev); ++ if (vdev != NULL) { ++ virtio_reset(vdev); + } + } + + /* Destroy the VirtIODevice */ + void virtio_bus_destroy_device(VirtioBusState *bus) + { +- DeviceState *qdev; + BusState *qbus = BUS(bus); + VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(bus); ++ VirtIODevice *vdev = virtio_bus_get_device(bus); ++ + DPRINTF("%s: remove device.\n", qbus->name); + +- if (bus->vdev != NULL) { ++ if (vdev != NULL) { + if (klass->device_unplug != NULL) { + klass->device_unplug(qbus->parent); + } +- qdev = DEVICE(bus->vdev); +- qdev_free(qdev); +- bus->vdev = NULL; ++ qdev_free(DEVICE(vdev)); + } + } + + /* Get the device id of the plugged device. */ + uint16_t virtio_bus_get_vdev_id(VirtioBusState *bus) + { +- assert(bus->vdev != NULL); +- return bus->vdev->device_id; ++ VirtIODevice *vdev = virtio_bus_get_device(bus); ++ assert(vdev != NULL); ++ return vdev->device_id; + } + + /* Get the config_len field of the plugged device. */ + size_t virtio_bus_get_vdev_config_len(VirtioBusState *bus) + { +- assert(bus->vdev != NULL); +- return bus->vdev->config_len; ++ VirtIODevice *vdev = virtio_bus_get_device(bus); ++ assert(vdev != NULL); ++ return vdev->config_len; + } + + /* Get the features of the plugged device. */ + uint32_t virtio_bus_get_vdev_features(VirtioBusState *bus, + uint32_t requested_features) + { ++ VirtIODevice *vdev = virtio_bus_get_device(bus); + VirtioDeviceClass *k; +- assert(bus->vdev != NULL); +- k = VIRTIO_DEVICE_GET_CLASS(bus->vdev); ++ ++ assert(vdev != NULL); ++ k = VIRTIO_DEVICE_GET_CLASS(vdev); + assert(k->get_features != NULL); +- return k->get_features(bus->vdev, requested_features); ++ return k->get_features(vdev, requested_features); + } + + /* Set the features of the plugged device. */ + void virtio_bus_set_vdev_features(VirtioBusState *bus, + uint32_t requested_features) + { ++ VirtIODevice *vdev = virtio_bus_get_device(bus); + VirtioDeviceClass *k; +- assert(bus->vdev != NULL); +- k = VIRTIO_DEVICE_GET_CLASS(bus->vdev); ++ ++ assert(vdev != NULL); ++ k = VIRTIO_DEVICE_GET_CLASS(vdev); + if (k->set_features != NULL) { +- k->set_features(bus->vdev, requested_features); ++ k->set_features(vdev, requested_features); + } + } + + /* Get bad features of the plugged device. */ + uint32_t virtio_bus_get_vdev_bad_features(VirtioBusState *bus) + { ++ VirtIODevice *vdev = virtio_bus_get_device(bus); + VirtioDeviceClass *k; +- assert(bus->vdev != NULL); +- k = VIRTIO_DEVICE_GET_CLASS(bus->vdev); ++ ++ assert(vdev != NULL); ++ k = VIRTIO_DEVICE_GET_CLASS(vdev); + if (k->bad_features != NULL) { +- return k->bad_features(bus->vdev); ++ return k->bad_features(vdev); + } else { + return 0; + } +@@ -135,22 +142,26 @@ uint32_t virtio_bus_get_vdev_bad_features(VirtioBusState *bus) + /* Get config of the plugged device. */ + void virtio_bus_get_vdev_config(VirtioBusState *bus, uint8_t *config) + { ++ VirtIODevice *vdev = virtio_bus_get_device(bus); + VirtioDeviceClass *k; +- assert(bus->vdev != NULL); +- k = VIRTIO_DEVICE_GET_CLASS(bus->vdev); ++ ++ assert(vdev != NULL); ++ k = VIRTIO_DEVICE_GET_CLASS(vdev); + if (k->get_config != NULL) { +- k->get_config(bus->vdev, config); ++ k->get_config(vdev, config); + } + } + + /* Set config of the plugged device. */ + void virtio_bus_set_vdev_config(VirtioBusState *bus, uint8_t *config) + { ++ VirtIODevice *vdev = virtio_bus_get_device(bus); + VirtioDeviceClass *k; +- assert(bus->vdev != NULL); +- k = VIRTIO_DEVICE_GET_CLASS(bus->vdev); ++ ++ assert(vdev != NULL); ++ k = VIRTIO_DEVICE_GET_CLASS(vdev); + if (k->set_config != NULL) { +- k->set_config(bus->vdev, config); ++ k->set_config(vdev, config); + } + } + +diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c +index 4bd2953..8f7b764 100644 +--- a/hw/virtio/virtio-mmio.c ++++ b/hw/virtio/virtio-mmio.c +@@ -94,7 +94,7 @@ static void virtio_mmio_bus_new(VirtioBusState *bus, VirtIOMMIOProxy *dev); + static uint64_t virtio_mmio_read(void *opaque, hwaddr offset, unsigned size) + { + VirtIOMMIOProxy *proxy = (VirtIOMMIOProxy *)opaque; +- VirtIODevice *vdev = proxy->bus.vdev; ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + + DPRINTF("virtio_mmio_read offset 0x%x\n", (int)offset); + +@@ -184,7 +184,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value, + unsigned size) + { + VirtIOMMIOProxy *proxy = (VirtIOMMIOProxy *)opaque; +- VirtIODevice *vdev = proxy->bus.vdev; ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + + DPRINTF("virtio_mmio_write offset 0x%x value 0x%" PRIx64 "\n", + (int)offset, value); +@@ -297,12 +297,13 @@ static const MemoryRegionOps virtio_mem_ops = { + static void virtio_mmio_update_irq(DeviceState *opaque, uint16_t vector) + { + VirtIOMMIOProxy *proxy = VIRTIO_MMIO(opaque); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + int level; + +- if (!proxy->bus.vdev) { ++ if (!vdev) { + return; + } +- level = (proxy->bus.vdev->isr != 0); ++ level = (vdev->isr != 0); + DPRINTF("virtio_mmio setting IRQ %d\n", level); + qemu_set_irq(proxy->irq, level); + } +diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c +index 41b96ce..55617a6 100644 +--- a/hw/virtio/virtio-pci.c ++++ b/hw/virtio/virtio-pci.c +@@ -942,7 +942,7 @@ static void virtio_pci_device_plugged(DeviceState *d) + uint8_t *config; + uint32_t size; + +- proxy->vdev = bus->vdev; ++ proxy->vdev = virtio_bus_get_device(bus); + + config = proxy->pci_dev.config; + if (proxy->class_code) { +diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h +index 9217f85..ba0f86a 100644 +--- a/include/hw/virtio/virtio-bus.h ++++ b/include/hw/virtio/virtio-bus.h +@@ -72,10 +72,6 @@ typedef struct VirtioBusClass { + + struct VirtioBusState { + BusState parent_obj; +- /* +- * Only one VirtIODevice can be plugged on the bus. +- */ +- VirtIODevice *vdev; + }; + + int virtio_bus_plug_device(VirtIODevice *vdev); +@@ -98,4 +94,16 @@ void virtio_bus_get_vdev_config(VirtioBusState *bus, uint8_t *config); + /* Set config of the plugged device. */ + void virtio_bus_set_vdev_config(VirtioBusState *bus, uint8_t *config); + ++static inline VirtIODevice *virtio_bus_get_device(VirtioBusState *bus) ++{ ++ BusState *qbus = &bus->parent_obj; ++ BusChild *kid = QTAILQ_FIRST(&qbus->children); ++ DeviceState *qdev = kid ? kid->child : NULL; ++ ++ /* This is used on the data path, the cast is guaranteed ++ * to succeed by the qdev machinery. ++ */ ++ return (VirtIODevice *)qdev; ++} ++ + #endif /* VIRTIO_BUS_H */ diff --git a/0107-virtio-pci-remove-vdev-field.patch b/0107-virtio-pci-remove-vdev-field.patch new file mode 100644 index 0000000..f8000e7 --- /dev/null +++ b/0107-virtio-pci-remove-vdev-field.patch @@ -0,0 +1,447 @@ +From 1d388b4fda2c4c9d00dc6ae91aaf35eb9fc04c26 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 16:57:51 +0200 +Subject: [PATCH] virtio-pci: remove vdev field + +The vdev field is complicated to synchronize. Just access the +BusState's list of children. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +--- + hw/s390x/virtio-ccw.h | 1 - + hw/virtio/virtio-pci.c | 107 +++++++++++++++++++++++++++++-------------------- + hw/virtio/virtio-pci.h | 1 - + 3 files changed, 63 insertions(+), 46 deletions(-) + +diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h +index 96d6f5d..00932c7 100644 +--- a/hw/s390x/virtio-ccw.h ++++ b/hw/s390x/virtio-ccw.h +@@ -77,7 +77,6 @@ typedef struct VirtIOCCWDeviceClass { + struct VirtioCcwDevice { + DeviceState parent_obj; + SubchDev *sch; +- VirtIODevice *vdev; + char *bus_id; + uint32_t host_features[VIRTIO_CCW_FEATURE_SIZE]; + VirtioBusState bus; +diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c +index 55617a6..6fd6d6d 100644 +--- a/hw/virtio/virtio-pci.c ++++ b/hw/virtio/virtio-pci.c +@@ -112,31 +112,39 @@ static inline VirtIOPCIProxy *to_virtio_pci_proxy_fast(DeviceState *d) + static void virtio_pci_notify(DeviceState *d, uint16_t vector) + { + VirtIOPCIProxy *proxy = to_virtio_pci_proxy_fast(d); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); ++ + if (msix_enabled(&proxy->pci_dev)) + msix_notify(&proxy->pci_dev, vector); + else +- qemu_set_irq(proxy->pci_dev.irq[0], proxy->vdev->isr & 1); ++ qemu_set_irq(proxy->pci_dev.irq[0], vdev->isr & 1); + } + + static void virtio_pci_save_config(DeviceState *d, QEMUFile *f) + { + VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); ++ + pci_device_save(&proxy->pci_dev, f); + msix_save(&proxy->pci_dev, f); + if (msix_present(&proxy->pci_dev)) +- qemu_put_be16(f, proxy->vdev->config_vector); ++ qemu_put_be16(f, vdev->config_vector); + } + + static void virtio_pci_save_queue(DeviceState *d, int n, QEMUFile *f) + { + VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); ++ + if (msix_present(&proxy->pci_dev)) +- qemu_put_be16(f, virtio_queue_vector(proxy->vdev, n)); ++ qemu_put_be16(f, virtio_queue_vector(vdev, n)); + } + + static int virtio_pci_load_config(DeviceState *d, QEMUFile *f) + { + VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); ++ + int ret; + ret = pci_device_load(&proxy->pci_dev, f); + if (ret) { +@@ -145,12 +153,12 @@ static int virtio_pci_load_config(DeviceState *d, QEMUFile *f) + msix_unuse_all_vectors(&proxy->pci_dev); + msix_load(&proxy->pci_dev, f); + if (msix_present(&proxy->pci_dev)) { +- qemu_get_be16s(f, &proxy->vdev->config_vector); ++ qemu_get_be16s(f, &vdev->config_vector); + } else { +- proxy->vdev->config_vector = VIRTIO_NO_VECTOR; ++ vdev->config_vector = VIRTIO_NO_VECTOR; + } +- if (proxy->vdev->config_vector != VIRTIO_NO_VECTOR) { +- return msix_vector_use(&proxy->pci_dev, proxy->vdev->config_vector); ++ if (vdev->config_vector != VIRTIO_NO_VECTOR) { ++ return msix_vector_use(&proxy->pci_dev, vdev->config_vector); + } + return 0; + } +@@ -158,13 +166,15 @@ static int virtio_pci_load_config(DeviceState *d, QEMUFile *f) + static int virtio_pci_load_queue(DeviceState *d, int n, QEMUFile *f) + { + VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); ++ + uint16_t vector; + if (msix_present(&proxy->pci_dev)) { + qemu_get_be16s(f, &vector); + } else { + vector = VIRTIO_NO_VECTOR; + } +- virtio_queue_set_vector(proxy->vdev, n, vector); ++ virtio_queue_set_vector(vdev, n, vector); + if (vector != VIRTIO_NO_VECTOR) { + return msix_vector_use(&proxy->pci_dev, vector); + } +@@ -174,7 +184,8 @@ static int virtio_pci_load_queue(DeviceState *d, int n, QEMUFile *f) + static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy, + int n, bool assign, bool set_handler) + { +- VirtQueue *vq = virtio_get_queue(proxy->vdev, n); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); ++ VirtQueue *vq = virtio_get_queue(vdev, n); + EventNotifier *notifier = virtio_queue_get_host_notifier(vq); + int r = 0; + +@@ -199,6 +210,7 @@ static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy, + + static void virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy) + { ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + int n, r; + + if (!(proxy->flags & VIRTIO_PCI_FLAG_USE_IOEVENTFD) || +@@ -208,7 +220,7 @@ static void virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy) + } + + for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) { +- if (!virtio_queue_get_num(proxy->vdev, n)) { ++ if (!virtio_queue_get_num(vdev, n)) { + continue; + } + +@@ -222,7 +234,7 @@ static void virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy) + + assign_error: + while (--n >= 0) { +- if (!virtio_queue_get_num(proxy->vdev, n)) { ++ if (!virtio_queue_get_num(vdev, n)) { + continue; + } + +@@ -235,6 +247,7 @@ assign_error: + + static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy) + { ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + int r; + int n; + +@@ -243,7 +256,7 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy) + } + + for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) { +- if (!virtio_queue_get_num(proxy->vdev, n)) { ++ if (!virtio_queue_get_num(vdev, n)) { + continue; + } + +@@ -256,7 +269,7 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy) + static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) + { + VirtIOPCIProxy *proxy = opaque; +- VirtIODevice *vdev = proxy->vdev; ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + hwaddr pa; + + switch (addr) { +@@ -271,7 +284,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) + pa = (hwaddr)val << VIRTIO_PCI_QUEUE_ADDR_SHIFT; + if (pa == 0) { + virtio_pci_stop_ioeventfd(proxy); +- virtio_reset(proxy->vdev); ++ virtio_reset(vdev); + msix_unuse_all_vectors(&proxy->pci_dev); + } + else +@@ -298,7 +311,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) + } + + if (vdev->status == 0) { +- virtio_reset(proxy->vdev); ++ virtio_reset(vdev); + msix_unuse_all_vectors(&proxy->pci_dev); + } + +@@ -334,7 +347,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) + + static uint32_t virtio_ioport_read(VirtIOPCIProxy *proxy, uint32_t addr) + { +- VirtIODevice *vdev = proxy->vdev; ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + uint32_t ret = 0xFFFFFFFF; + + switch (addr) { +@@ -380,6 +393,7 @@ static uint64_t virtio_pci_config_read(void *opaque, hwaddr addr, + unsigned size) + { + VirtIOPCIProxy *proxy = opaque; ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + uint32_t config = VIRTIO_PCI_CONFIG(&proxy->pci_dev); + uint64_t val = 0; + if (addr < config) { +@@ -389,16 +403,16 @@ static uint64_t virtio_pci_config_read(void *opaque, hwaddr addr, + + switch (size) { + case 1: +- val = virtio_config_readb(proxy->vdev, addr); ++ val = virtio_config_readb(vdev, addr); + break; + case 2: +- val = virtio_config_readw(proxy->vdev, addr); ++ val = virtio_config_readw(vdev, addr); + if (virtio_is_big_endian()) { + val = bswap16(val); + } + break; + case 4: +- val = virtio_config_readl(proxy->vdev, addr); ++ val = virtio_config_readl(vdev, addr); + if (virtio_is_big_endian()) { + val = bswap32(val); + } +@@ -412,6 +426,7 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr, + { + VirtIOPCIProxy *proxy = opaque; + uint32_t config = VIRTIO_PCI_CONFIG(&proxy->pci_dev); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + if (addr < config) { + virtio_ioport_write(proxy, addr, val); + return; +@@ -423,19 +438,19 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr, + */ + switch (size) { + case 1: +- virtio_config_writeb(proxy->vdev, addr, val); ++ virtio_config_writeb(vdev, addr, val); + break; + case 2: + if (virtio_is_big_endian()) { + val = bswap16(val); + } +- virtio_config_writew(proxy->vdev, addr, val); ++ virtio_config_writew(vdev, addr, val); + break; + case 4: + if (virtio_is_big_endian()) { + val = bswap32(val); + } +- virtio_config_writel(proxy->vdev, addr, val); ++ virtio_config_writel(vdev, addr, val); + break; + } + } +@@ -454,6 +469,7 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, + uint32_t val, int len) + { + VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + + pci_default_write_config(pci_dev, address, val, len); + +@@ -461,8 +477,7 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, + !(pci_dev->config[PCI_COMMAND] & PCI_COMMAND_MASTER) && + !(proxy->flags & VIRTIO_PCI_FLAG_BUS_MASTER_BUG)) { + virtio_pci_stop_ioeventfd(proxy); +- virtio_set_status(proxy->vdev, +- proxy->vdev->status & ~VIRTIO_CONFIG_S_DRIVER_OK); ++ virtio_set_status(vdev, vdev->status & ~VIRTIO_CONFIG_S_DRIVER_OK); + } + } + +@@ -505,7 +520,8 @@ static int kvm_virtio_pci_irqfd_use(VirtIOPCIProxy *proxy, + unsigned int vector) + { + VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector]; +- VirtQueue *vq = virtio_get_queue(proxy->vdev, queue_no); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); ++ VirtQueue *vq = virtio_get_queue(vdev, queue_no); + EventNotifier *n = virtio_queue_get_guest_notifier(vq); + int ret; + ret = kvm_irqchip_add_irqfd_notifier(kvm_state, n, irqfd->virq); +@@ -516,7 +532,8 @@ static void kvm_virtio_pci_irqfd_release(VirtIOPCIProxy *proxy, + unsigned int queue_no, + unsigned int vector) + { +- VirtQueue *vq = virtio_get_queue(proxy->vdev, queue_no); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); ++ VirtQueue *vq = virtio_get_queue(vdev, queue_no); + EventNotifier *n = virtio_queue_get_guest_notifier(vq); + VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector]; + int ret; +@@ -528,7 +545,7 @@ static void kvm_virtio_pci_irqfd_release(VirtIOPCIProxy *proxy, + static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *proxy, int nvqs) + { + PCIDevice *dev = &proxy->pci_dev; +- VirtIODevice *vdev = proxy->vdev; ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); + unsigned int vector; + int ret, queue_no; +@@ -577,7 +594,7 @@ undo: + static void kvm_virtio_pci_vector_release(VirtIOPCIProxy *proxy, int nvqs) + { + PCIDevice *dev = &proxy->pci_dev; +- VirtIODevice *vdev = proxy->vdev; ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + unsigned int vector; + int queue_no; + VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); +@@ -605,8 +622,9 @@ static int virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy, + unsigned int vector, + MSIMessage msg) + { +- VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(proxy->vdev); +- VirtQueue *vq = virtio_get_queue(proxy->vdev, queue_no); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); ++ VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); ++ VirtQueue *vq = virtio_get_queue(vdev, queue_no); + EventNotifier *n = virtio_queue_get_guest_notifier(vq); + VirtIOIRQFD *irqfd; + int ret = 0; +@@ -625,10 +643,10 @@ static int virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy, + * Otherwise, set it up now. + */ + if (k->guest_notifier_mask) { +- k->guest_notifier_mask(proxy->vdev, queue_no, false); ++ k->guest_notifier_mask(vdev, queue_no, false); + /* Test after unmasking to avoid losing events. */ + if (k->guest_notifier_pending && +- k->guest_notifier_pending(proxy->vdev, queue_no)) { ++ k->guest_notifier_pending(vdev, queue_no)) { + event_notifier_set(n); + } + } else { +@@ -641,13 +659,14 @@ static void virtio_pci_vq_vector_mask(VirtIOPCIProxy *proxy, + unsigned int queue_no, + unsigned int vector) + { +- VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(proxy->vdev); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); ++ VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); + + /* If guest supports masking, keep irqfd but mask it. + * Otherwise, clean it up now. + */ + if (k->guest_notifier_mask) { +- k->guest_notifier_mask(proxy->vdev, queue_no, true); ++ k->guest_notifier_mask(vdev, queue_no, true); + } else { + kvm_virtio_pci_irqfd_release(proxy, queue_no, vector); + } +@@ -657,7 +676,7 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, unsigned vector, + MSIMessage msg) + { + VirtIOPCIProxy *proxy = container_of(dev, VirtIOPCIProxy, pci_dev); +- VirtIODevice *vdev = proxy->vdev; ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + int ret, queue_no; + + for (queue_no = 0; queue_no < proxy->nvqs_with_notifiers; queue_no++) { +@@ -687,7 +706,7 @@ undo: + static void virtio_pci_vector_mask(PCIDevice *dev, unsigned vector) + { + VirtIOPCIProxy *proxy = container_of(dev, VirtIOPCIProxy, pci_dev); +- VirtIODevice *vdev = proxy->vdev; ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + int queue_no; + + for (queue_no = 0; queue_no < proxy->nvqs_with_notifiers; queue_no++) { +@@ -706,7 +725,7 @@ static void virtio_pci_vector_poll(PCIDevice *dev, + unsigned int vector_end) + { + VirtIOPCIProxy *proxy = container_of(dev, VirtIOPCIProxy, pci_dev); +- VirtIODevice *vdev = proxy->vdev; ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); + int queue_no; + unsigned int vector; +@@ -738,8 +757,9 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign, + bool with_irqfd) + { + VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d); +- VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(proxy->vdev); +- VirtQueue *vq = virtio_get_queue(proxy->vdev, n); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); ++ VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(vdev); ++ VirtQueue *vq = virtio_get_queue(vdev, n); + EventNotifier *notifier = virtio_queue_get_guest_notifier(vq); + + if (assign) { +@@ -754,7 +774,7 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign, + } + + if (!msix_enabled(&proxy->pci_dev) && vdc->guest_notifier_mask) { +- vdc->guest_notifier_mask(proxy->vdev, n, !assign); ++ vdc->guest_notifier_mask(vdev, n, !assign); + } + + return 0; +@@ -769,7 +789,7 @@ static bool virtio_pci_query_guest_notifiers(DeviceState *d) + static int virtio_pci_set_guest_notifiers(DeviceState *d, int nvqs, bool assign) + { + VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d); +- VirtIODevice *vdev = proxy->vdev; ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); + int r, n; + bool with_irqfd = msix_enabled(&proxy->pci_dev) && +@@ -863,11 +883,12 @@ static int virtio_pci_set_host_notifier(DeviceState *d, int n, bool assign) + static void virtio_pci_vmstate_change(DeviceState *d, bool running) + { + VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d); ++ VirtIODevice *vdev = virtio_bus_get_device(&proxy->bus); + + if (running) { + /* Try to find out if the guest has bus master disabled, but is + in ready state. Then we have a buggy guest OS. */ +- if ((proxy->vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) && ++ if ((vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) && + !(proxy->pci_dev.config[PCI_COMMAND] & PCI_COMMAND_MASTER)) { + proxy->flags |= VIRTIO_PCI_FLAG_BUS_MASTER_BUG; + } +@@ -942,8 +963,6 @@ static void virtio_pci_device_plugged(DeviceState *d) + uint8_t *config; + uint32_t size; + +- proxy->vdev = virtio_bus_get_device(bus); +- + config = proxy->pci_dev.config; + if (proxy->class_code) { + pci_config_set_class(config, proxy->class_code); +diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h +index 917bcc5..dc332ae 100644 +--- a/hw/virtio/virtio-pci.h ++++ b/hw/virtio/virtio-pci.h +@@ -82,7 +82,6 @@ typedef struct VirtioPCIClass { + + struct VirtIOPCIProxy { + PCIDevice pci_dev; +- VirtIODevice *vdev; + MemoryRegion bar; + uint32_t flags; + uint32_t class_code; diff --git a/0108-virtio-ccw-remove-vdev-field.patch b/0108-virtio-ccw-remove-vdev-field.patch new file mode 100644 index 0000000..d0c8d62 --- /dev/null +++ b/0108-virtio-ccw-remove-vdev-field.patch @@ -0,0 +1,293 @@ +From a9b1f1aeba8167ae90aecea9b8ca223faf33ae90 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 16:57:52 +0200 +Subject: [PATCH] virtio-ccw: remove vdev field + +The vdev field is complicated to synchronize. Just access the +BusState's list of children. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +--- + hw/s390x/virtio-ccw.c | 80 ++++++++++++++++++++++++++++----------------------- + 1 file changed, 44 insertions(+), 36 deletions(-) + +diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c +index 8835bd4..0fc7387 100644 +--- a/hw/s390x/virtio-ccw.c ++++ b/hw/s390x/virtio-ccw.c +@@ -56,9 +56,10 @@ static const TypeInfo virtual_css_bus_info = { + VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch) + { + VirtIODevice *vdev = NULL; ++ VirtioCcwDevice *dev = sch->driver_data; + +- if (sch->driver_data) { +- vdev = ((VirtioCcwDevice *)sch->driver_data)->vdev; ++ if (dev) { ++ vdev = virtio_bus_get_device(&dev->bus); + } + return vdev; + } +@@ -66,7 +67,8 @@ VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch) + static int virtio_ccw_set_guest2host_notifier(VirtioCcwDevice *dev, int n, + bool assign, bool set_handler) + { +- VirtQueue *vq = virtio_get_queue(dev->vdev, n); ++ VirtIODevice *vdev = virtio_bus_get_device(&dev->bus); ++ VirtQueue *vq = virtio_get_queue(vdev, n); + EventNotifier *notifier = virtio_queue_get_host_notifier(vq); + int r = 0; + SubchDev *sch = dev->sch; +@@ -96,6 +98,7 @@ static int virtio_ccw_set_guest2host_notifier(VirtioCcwDevice *dev, int n, + + static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) + { ++ VirtIODevice *vdev; + int n, r; + + if (!(dev->flags & VIRTIO_CCW_FLAG_USE_IOEVENTFD) || +@@ -103,8 +106,9 @@ static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) + dev->ioeventfd_started) { + return; + } ++ vdev = virtio_bus_get_device(&dev->bus); + for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) { +- if (!virtio_queue_get_num(dev->vdev, n)) { ++ if (!virtio_queue_get_num(vdev, n)) { + continue; + } + r = virtio_ccw_set_guest2host_notifier(dev, n, true, true); +@@ -117,7 +121,7 @@ static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) + + assign_error: + while (--n >= 0) { +- if (!virtio_queue_get_num(dev->vdev, n)) { ++ if (!virtio_queue_get_num(vdev, n)) { + continue; + } + r = virtio_ccw_set_guest2host_notifier(dev, n, false, false); +@@ -131,13 +135,15 @@ static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) + + static void virtio_ccw_stop_ioeventfd(VirtioCcwDevice *dev) + { ++ VirtIODevice *vdev; + int n, r; + + if (!dev->ioeventfd_started) { + return; + } ++ vdev = virtio_bus_get_device(&dev->bus); + for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) { +- if (!virtio_queue_get_num(dev->vdev, n)) { ++ if (!virtio_queue_get_num(vdev, n)) { + continue; + } + r = virtio_ccw_set_guest2host_notifier(dev, n, false, false); +@@ -188,7 +194,7 @@ typedef struct VirtioFeatDesc { + static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t addr, uint32_t align, + uint16_t index, uint16_t num) + { +- VirtioCcwDevice *dev = sch->driver_data; ++ VirtIODevice *vdev = virtio_ccw_get_vdev(sch); + + if (index > VIRTIO_PCI_QUEUE_MAX) { + return -EINVAL; +@@ -199,23 +205,23 @@ static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t addr, uint32_t align, + return -EINVAL; + } + +- if (!dev) { ++ if (!vdev) { + return -EINVAL; + } + +- virtio_queue_set_addr(dev->vdev, index, addr); ++ virtio_queue_set_addr(vdev, index, addr); + if (!addr) { +- virtio_queue_set_vector(dev->vdev, index, 0); ++ virtio_queue_set_vector(vdev, index, 0); + } else { + /* Fail if we don't have a big enough queue. */ + /* TODO: Add interface to handle vring.num changing */ +- if (virtio_queue_get_num(dev->vdev, index) > num) { ++ if (virtio_queue_get_num(vdev, index) > num) { + return -EINVAL; + } +- virtio_queue_set_vector(dev->vdev, index, index); ++ virtio_queue_set_vector(vdev, index, index); + } + /* tell notify handler in case of config change */ +- dev->vdev->config_vector = VIRTIO_PCI_QUEUE_MAX; ++ vdev->config_vector = VIRTIO_PCI_QUEUE_MAX; + return 0; + } + +@@ -229,6 +235,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) + hwaddr indicators; + VqConfigBlock vq_config; + VirtioCcwDevice *dev = sch->driver_data; ++ VirtIODevice *vdev = virtio_bus_get_device(&dev->bus); + bool check_len; + int len; + hwaddr hw_len; +@@ -271,7 +278,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) + break; + case CCW_CMD_VDEV_RESET: + virtio_ccw_stop_ioeventfd(dev); +- virtio_reset(dev->vdev); ++ virtio_reset(vdev); + ret = 0; + break; + case CCW_CMD_READ_FEAT: +@@ -318,7 +325,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) + features.features = ldl_le_phys(ccw.cda); + if (features.index < ARRAY_SIZE(dev->host_features)) { + virtio_bus_set_vdev_features(&dev->bus, features.features); +- dev->vdev->guest_features = features.features; ++ vdev->guest_features = features.features; + } else { + /* + * If the guest supports more feature bits, assert that it +@@ -336,30 +343,30 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) + break; + case CCW_CMD_READ_CONF: + if (check_len) { +- if (ccw.count > dev->vdev->config_len) { ++ if (ccw.count > vdev->config_len) { + ret = -EINVAL; + break; + } + } +- len = MIN(ccw.count, dev->vdev->config_len); ++ len = MIN(ccw.count, vdev->config_len); + if (!ccw.cda) { + ret = -EFAULT; + } else { +- virtio_bus_get_vdev_config(&dev->bus, dev->vdev->config); ++ virtio_bus_get_vdev_config(&dev->bus, vdev->config); + /* XXX config space endianness */ +- cpu_physical_memory_write(ccw.cda, dev->vdev->config, len); ++ cpu_physical_memory_write(ccw.cda, vdev->config, len); + sch->curr_status.scsw.count = ccw.count - len; + ret = 0; + } + break; + case CCW_CMD_WRITE_CONF: + if (check_len) { +- if (ccw.count > dev->vdev->config_len) { ++ if (ccw.count > vdev->config_len) { + ret = -EINVAL; + break; + } + } +- len = MIN(ccw.count, dev->vdev->config_len); ++ len = MIN(ccw.count, vdev->config_len); + hw_len = len; + if (!ccw.cda) { + ret = -EFAULT; +@@ -370,9 +377,9 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) + } else { + len = hw_len; + /* XXX config space endianness */ +- memcpy(dev->vdev->config, config, len); ++ memcpy(vdev->config, config, len); + cpu_physical_memory_unmap(config, hw_len, 0, hw_len); +- virtio_bus_set_vdev_config(&dev->bus, dev->vdev->config); ++ virtio_bus_set_vdev_config(&dev->bus, vdev->config); + sch->curr_status.scsw.count = ccw.count - len; + ret = 0; + } +@@ -396,9 +403,9 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) + if (!(status & VIRTIO_CONFIG_S_DRIVER_OK)) { + virtio_ccw_stop_ioeventfd(dev); + } +- virtio_set_status(dev->vdev, status); +- if (dev->vdev->status == 0) { +- virtio_reset(dev->vdev); ++ virtio_set_status(vdev, status); ++ if (vdev->status == 0) { ++ virtio_reset(vdev); + } + if (status & VIRTIO_CONFIG_S_DRIVER_OK) { + virtio_ccw_start_ioeventfd(dev); +@@ -462,7 +469,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) + ret = -EFAULT; + } else { + vq_config.index = lduw_phys(ccw.cda); +- vq_config.num_max = virtio_queue_get_num(dev->vdev, ++ vq_config.num_max = virtio_queue_get_num(vdev, + vq_config.index); + stw_phys(ccw.cda + sizeof(vq_config.index), vq_config.num_max); + sch->curr_status.scsw.count = ccw.count - sizeof(vq_config); +@@ -494,7 +501,6 @@ static int virtio_ccw_device_init(VirtioCcwDevice *dev, VirtIODevice *vdev) + sch->driver_data = dev; + dev->sch = sch; + +- dev->vdev = vdev; + dev->indicators = 0; + + /* Initialize subchannel structure. */ +@@ -607,7 +613,7 @@ static int virtio_ccw_device_init(VirtioCcwDevice *dev, VirtIODevice *vdev) + memset(&sch->id, 0, sizeof(SenseId)); + sch->id.reserved = 0xff; + sch->id.cu_type = VIRTIO_CCW_CU_TYPE; +- sch->id.cu_model = dev->vdev->device_id; ++ sch->id.cu_model = vdev->device_id; + + /* Only the first 32 feature bits are used. */ + dev->host_features[0] = virtio_bus_get_vdev_features(&dev->bus, +@@ -891,9 +897,10 @@ static unsigned virtio_ccw_get_features(DeviceState *d) + static void virtio_ccw_reset(DeviceState *d) + { + VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d); ++ VirtIODevice *vdev = virtio_bus_get_device(&dev->bus); + + virtio_ccw_stop_ioeventfd(dev); +- virtio_reset(dev->vdev); ++ virtio_reset(vdev); + css_reset_sch(dev->sch); + dev->indicators = 0; + dev->indicators2 = 0; +@@ -933,9 +940,10 @@ static int virtio_ccw_set_host_notifier(DeviceState *d, int n, bool assign) + static int virtio_ccw_set_guest_notifier(VirtioCcwDevice *dev, int n, + bool assign, bool with_irqfd) + { +- VirtQueue *vq = virtio_get_queue(dev->vdev, n); ++ VirtIODevice *vdev = virtio_bus_get_device(&dev->bus); ++ VirtQueue *vq = virtio_get_queue(vdev, n); + EventNotifier *notifier = virtio_queue_get_guest_notifier(vq); +- VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(dev->vdev); ++ VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); + + if (assign) { + int r = event_notifier_init(notifier, 0); +@@ -951,16 +959,16 @@ static int virtio_ccw_set_guest_notifier(VirtioCcwDevice *dev, int n, + * land in qemu (and only the irq fd) in this code. + */ + if (k->guest_notifier_mask) { +- k->guest_notifier_mask(dev->vdev, n, false); ++ k->guest_notifier_mask(vdev, n, false); + } + /* get lost events and re-inject */ + if (k->guest_notifier_pending && +- k->guest_notifier_pending(dev->vdev, n)) { ++ k->guest_notifier_pending(vdev, n)) { + event_notifier_set(notifier); + } + } else { + if (k->guest_notifier_mask) { +- k->guest_notifier_mask(dev->vdev, n, true); ++ k->guest_notifier_mask(vdev, n, true); + } + virtio_queue_set_guest_notifier_fd_handler(vq, false, with_irqfd); + event_notifier_cleanup(notifier); +@@ -972,7 +980,7 @@ static int virtio_ccw_set_guest_notifiers(DeviceState *d, int nvqs, + bool assigned) + { + VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d); +- VirtIODevice *vdev = dev->vdev; ++ VirtIODevice *vdev = virtio_bus_get_device(&dev->bus); + int r, n; + + for (n = 0; n < nvqs; n++) { diff --git a/0109-virtio-bus-cleanup-plug-unplug-interface.patch b/0109-virtio-bus-cleanup-plug-unplug-interface.patch new file mode 100644 index 0000000..b8a91f4 --- /dev/null +++ b/0109-virtio-bus-cleanup-plug-unplug-interface.patch @@ -0,0 +1,148 @@ +From fe02fcc2b929e6a678ec783cb80890b79b7dca78 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 16:57:53 +0200 +Subject: [PATCH] virtio-bus: cleanup plug/unplug interface + +Right now we have these pairs: + +- virtio_bus_plug_device/virtio_bus_destroy_device. The first + takes a VirtIODevice, the second takes a VirtioBusState + +- device_plugged/device_unplug callbacks in the VirtioBusClass + (here it's just the naming that is inconsistent) + +- virtio_bus_destroy_device is not called by anyone (and since + it calls qdev_free, it would be called by the proxies---but + then the callback is useless since the proxies can do whatever + they want before calling virtio_bus_destroy_device) + +And there is a k->init but no k->exit, hence virtio_device_exit is +overwritten by subclasses (except virtio-9p). This cleans it up by: + +- renaming the device_unplug callback to device_unplugged + +- renaming virtio_bus_plug_device to virtio_bus_device_plugged, + matching the callback name + +- renaming virtio_bus_destroy_device to virtio_bus_device_unplugged, + removing the qdev_free, making it take a VirtIODevice and calling it + from virtio_device_exit + +- adding a k->exit callback + +virtio_device_exit is still overwritten, the next patches will fix that. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +--- + hw/virtio/virtio-bus.c | 18 +++++++++--------- + hw/virtio/virtio.c | 7 ++++++- + include/hw/virtio/virtio-bus.h | 6 +++--- + include/hw/virtio/virtio.h | 1 + + 4 files changed, 19 insertions(+), 13 deletions(-) + +diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c +index 669ce38..7aed6a4 100644 +--- a/hw/virtio/virtio-bus.c ++++ b/hw/virtio/virtio-bus.c +@@ -37,8 +37,8 @@ do { printf("virtio_bus: " fmt , ## __VA_ARGS__); } while (0) + #define DPRINTF(fmt, ...) do { } while (0) + #endif + +-/* Plug the VirtIODevice */ +-int virtio_bus_plug_device(VirtIODevice *vdev) ++/* A VirtIODevice is being plugged */ ++int virtio_bus_device_plugged(VirtIODevice *vdev) + { + DeviceState *qdev = DEVICE(vdev); + BusState *qbus = BUS(qdev_get_parent_bus(qdev)); +@@ -64,20 +64,20 @@ void virtio_bus_reset(VirtioBusState *bus) + } + } + +-/* Destroy the VirtIODevice */ +-void virtio_bus_destroy_device(VirtioBusState *bus) ++/* A VirtIODevice is being unplugged */ ++void virtio_bus_device_unplugged(VirtIODevice *vdev) + { +- BusState *qbus = BUS(bus); ++ DeviceState *qdev = DEVICE(vdev); ++ BusState *qbus = BUS(qdev_get_parent_bus(qdev)); ++ VirtioBusState *bus = VIRTIO_BUS(qbus); + VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(bus); +- VirtIODevice *vdev = virtio_bus_get_device(bus); + + DPRINTF("%s: remove device.\n", qbus->name); + + if (vdev != NULL) { +- if (klass->device_unplug != NULL) { +- klass->device_unplug(qbus->parent); ++ if (klass->device_unplugged != NULL) { ++ klass->device_unplugged(qbus->parent); + } +- qdev_free(DEVICE(vdev)); + } + } + +diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c +index 2f1e73b..965b2c0 100644 +--- a/hw/virtio/virtio.c ++++ b/hw/virtio/virtio.c +@@ -1158,14 +1158,19 @@ static int virtio_device_init(DeviceState *qdev) + if (k->init(vdev) < 0) { + return -1; + } +- virtio_bus_plug_device(vdev); ++ virtio_bus_device_plugged(vdev); + return 0; + } + + static int virtio_device_exit(DeviceState *qdev) + { + VirtIODevice *vdev = VIRTIO_DEVICE(qdev); ++ VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(qdev); + ++ virtio_bus_device_unplugged(vdev); ++ if (k->exit) { ++ k->exit(vdev); ++ } + if (vdev->bus_name) { + g_free(vdev->bus_name); + vdev->bus_name = NULL; +diff --git a/include/hw/virtio/virtio-bus.h b/include/hw/virtio/virtio-bus.h +index ba0f86a..0756545 100644 +--- a/include/hw/virtio/virtio-bus.h ++++ b/include/hw/virtio/virtio-bus.h +@@ -61,7 +61,7 @@ typedef struct VirtioBusClass { + * transport independent exit function. + * This is called by virtio-bus just before the device is unplugged. + */ +- void (*device_unplug)(DeviceState *d); ++ void (*device_unplugged)(DeviceState *d); + /* + * Does the transport have variable vring alignment? + * (ie can it ever call virtio_queue_set_align()?) +@@ -74,9 +74,9 @@ struct VirtioBusState { + BusState parent_obj; + }; + +-int virtio_bus_plug_device(VirtIODevice *vdev); ++int virtio_bus_device_plugged(VirtIODevice *vdev); + void virtio_bus_reset(VirtioBusState *bus); +-void virtio_bus_destroy_device(VirtioBusState *bus); ++void virtio_bus_device_unplugged(VirtIODevice *bus); + /* Get the device id of the plugged device. */ + uint16_t virtio_bus_get_vdev_id(VirtioBusState *bus); + /* Get the config_len field of the plugged device. */ +diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h +index a90522d..59756c2 100644 +--- a/include/hw/virtio/virtio.h ++++ b/include/hw/virtio/virtio.h +@@ -127,6 +127,7 @@ typedef struct VirtioDeviceClass { + /* This is what a VirtioDevice must implement */ + DeviceClass parent; + int (*init)(VirtIODevice *vdev); ++ void (*exit)(VirtIODevice *vdev); + uint32_t (*get_features)(VirtIODevice *vdev, uint32_t requested_features); + uint32_t (*bad_features)(VirtIODevice *vdev); + void (*set_features)(VirtIODevice *vdev, uint32_t val); diff --git a/0110-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch b/0110-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch new file mode 100644 index 0000000..57c2353 --- /dev/null +++ b/0110-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch @@ -0,0 +1,53 @@ +From aa75555e6fb5cae0e495cb5f7d9f3511ad5ac6ce Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 16:57:54 +0200 +Subject: [PATCH] virtio-blk: switch exit callback to VirtioDeviceClass + +This ensures hot-unplug is handled properly by the proxy. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +--- + hw/block/virtio-blk.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c +index 49a23c3..aa37cc9 100644 +--- a/hw/block/virtio-blk.c ++++ b/hw/block/virtio-blk.c +@@ -729,20 +729,18 @@ static int virtio_blk_device_init(VirtIODevice *vdev) + return 0; + } + +-static int virtio_blk_device_exit(DeviceState *dev) ++static void virtio_blk_device_exit(VirtIODevice *vdev) + { +- VirtIODevice *vdev = VIRTIO_DEVICE(dev); +- VirtIOBlock *s = VIRTIO_BLK(dev); ++ VirtIOBlock *s = VIRTIO_BLK(vdev); + #ifdef CONFIG_VIRTIO_BLK_DATA_PLANE + remove_migration_state_change_notifier(&s->migration_state_notifier); + virtio_blk_data_plane_destroy(s->dataplane); + s->dataplane = NULL; + #endif + qemu_del_vm_change_state_handler(s->change); +- unregister_savevm(dev, "virtio-blk", s); ++ unregister_savevm(DEVICE(vdev), "virtio-blk", s); + blockdev_mark_auto_del(s->bs); + virtio_cleanup(vdev); +- return 0; + } + + static Property virtio_blk_properties[] = { +@@ -754,10 +752,10 @@ static void virtio_blk_class_init(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); + VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); +- dc->exit = virtio_blk_device_exit; + dc->props = virtio_blk_properties; + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + vdc->init = virtio_blk_device_init; ++ vdc->exit = virtio_blk_device_exit; + vdc->get_config = virtio_blk_update_config; + vdc->set_config = virtio_blk_set_config; + vdc->get_features = virtio_blk_get_features; diff --git a/0111-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch b/0111-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch new file mode 100644 index 0000000..86e48e4 --- /dev/null +++ b/0111-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch @@ -0,0 +1,53 @@ +From 811b51426d9e7819e6498d4dad0d6ac744a8e5d0 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 16:57:55 +0200 +Subject: [PATCH] virtio-serial: switch exit callback to VirtioDeviceClass + +This ensures hot-unplug is handled properly by the proxy. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +--- + hw/char/virtio-serial-bus.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c +index da417c7..57dd070 100644 +--- a/hw/char/virtio-serial-bus.c ++++ b/hw/char/virtio-serial-bus.c +@@ -987,12 +987,11 @@ static const TypeInfo virtio_serial_port_type_info = { + .class_init = virtio_serial_port_class_init, + }; + +-static int virtio_serial_device_exit(DeviceState *dev) ++static void virtio_serial_device_exit(VirtIODevice *vdev) + { +- VirtIOSerial *vser = VIRTIO_SERIAL(dev); +- VirtIODevice *vdev = VIRTIO_DEVICE(dev); ++ VirtIOSerial *vser = VIRTIO_SERIAL(vdev); + +- unregister_savevm(dev, "virtio-console", vser); ++ unregister_savevm(DEVICE(vdev), "virtio-console", vser); + + g_free(vser->ivqs); + g_free(vser->ovqs); +@@ -1004,7 +1003,6 @@ static int virtio_serial_device_exit(DeviceState *dev) + g_free(vser->post_load); + } + virtio_cleanup(vdev); +- return 0; + } + + static Property virtio_serial_properties[] = { +@@ -1016,10 +1014,10 @@ static void virtio_serial_class_init(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); + VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); +- dc->exit = virtio_serial_device_exit; + dc->props = virtio_serial_properties; + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); + vdc->init = virtio_serial_device_init; ++ vdc->exit = virtio_serial_device_exit; + vdc->get_features = get_features; + vdc->get_config = get_config; + vdc->set_config = set_config; diff --git a/0112-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch b/0112-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch new file mode 100644 index 0000000..4bd6ede --- /dev/null +++ b/0112-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch @@ -0,0 +1,58 @@ +From 1582699fb9f748f9f91b015ef311f93bf5a95f5d Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 16:57:56 +0200 +Subject: [PATCH] virtio-net: switch exit callback to VirtioDeviceClass + +This ensures hot-unplug is handled properly by the proxy. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +--- + hw/net/virtio-net.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c +index aa1880c..46a4d8c 100644 +--- a/hw/net/virtio-net.c ++++ b/hw/net/virtio-net.c +@@ -1568,16 +1568,15 @@ static int virtio_net_device_init(VirtIODevice *vdev) + return 0; + } + +-static int virtio_net_device_exit(DeviceState *qdev) ++static void virtio_net_device_exit(VirtIODevice *vdev) + { +- VirtIONet *n = VIRTIO_NET(qdev); +- VirtIODevice *vdev = VIRTIO_DEVICE(qdev); ++ VirtIONet *n = VIRTIO_NET(vdev); + int i; + + /* This will stop vhost backend if appropriate. */ + virtio_net_set_status(vdev, 0); + +- unregister_savevm(qdev, "virtio-net", n); ++ unregister_savevm(DEVICE(vdev), "virtio-net", n); + + if (n->netclient_name) { + g_free(n->netclient_name); +@@ -1608,8 +1607,6 @@ static int virtio_net_device_exit(DeviceState *qdev) + g_free(n->vqs); + qemu_del_nic(n->nic); + virtio_cleanup(vdev); +- +- return 0; + } + + static void virtio_net_instance_init(Object *obj) +@@ -1636,10 +1633,10 @@ static void virtio_net_class_init(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); + VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); +- dc->exit = virtio_net_device_exit; + dc->props = virtio_net_properties; + set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); + vdc->init = virtio_net_device_init; ++ vdc->exit = virtio_net_device_exit; + vdc->get_config = virtio_net_get_config; + vdc->set_config = virtio_net_set_config; + vdc->get_features = virtio_net_get_features; diff --git a/0113-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch b/0113-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch new file mode 100644 index 0000000..e654a87 --- /dev/null +++ b/0113-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch @@ -0,0 +1,112 @@ +From df750f462929ba85a61dbdd6a4020cb4b2ee68d0 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 16:57:57 +0200 +Subject: [PATCH] virtio-scsi: switch exit callback to VirtioDeviceClass + +This ensures hot-unplug is handled properly by the proxy. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +--- + hw/scsi/vhost-scsi.c | 11 +++++------ + hw/scsi/virtio-scsi.c | 15 +++++++-------- + include/hw/virtio/virtio-scsi.h | 2 +- + 3 files changed, 13 insertions(+), 15 deletions(-) + +diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c +index 9e770fb..5e3cc61 100644 +--- a/hw/scsi/vhost-scsi.c ++++ b/hw/scsi/vhost-scsi.c +@@ -240,11 +240,10 @@ static int vhost_scsi_init(VirtIODevice *vdev) + return 0; + } + +-static int vhost_scsi_exit(DeviceState *qdev) ++static void vhost_scsi_exit(VirtIODevice *vdev) + { +- VirtIODevice *vdev = VIRTIO_DEVICE(qdev); +- VHostSCSI *s = VHOST_SCSI(qdev); +- VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(qdev); ++ VHostSCSI *s = VHOST_SCSI(vdev); ++ VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(vdev); + + migrate_del_blocker(s->migration_blocker); + error_free(s->migration_blocker); +@@ -253,7 +252,7 @@ static int vhost_scsi_exit(DeviceState *qdev) + vhost_scsi_set_status(vdev, 0); + + g_free(s->dev.vqs); +- return virtio_scsi_common_exit(vs); ++ virtio_scsi_common_exit(vs); + } + + static Property vhost_scsi_properties[] = { +@@ -265,10 +264,10 @@ static void vhost_scsi_class_init(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); + VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); +- dc->exit = vhost_scsi_exit; + dc->props = vhost_scsi_properties; + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + vdc->init = vhost_scsi_init; ++ vdc->exit = vhost_scsi_exit; + vdc->get_features = vhost_scsi_get_features; + vdc->set_config = vhost_scsi_set_config; + vdc->set_status = vhost_scsi_set_status; +diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c +index 05da56b..5545993 100644 +--- a/hw/scsi/virtio-scsi.c ++++ b/hw/scsi/virtio-scsi.c +@@ -643,22 +643,21 @@ static int virtio_scsi_device_init(VirtIODevice *vdev) + return 0; + } + +-int virtio_scsi_common_exit(VirtIOSCSICommon *vs) ++void virtio_scsi_common_exit(VirtIOSCSICommon *vs) + { + VirtIODevice *vdev = VIRTIO_DEVICE(vs); + + g_free(vs->cmd_vqs); + virtio_cleanup(vdev); +- return 0; + } + +-static int virtio_scsi_device_exit(DeviceState *qdev) ++static void virtio_scsi_device_exit(VirtIODevice *vdev) + { +- VirtIOSCSI *s = VIRTIO_SCSI(qdev); +- VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(qdev); ++ VirtIOSCSI *s = VIRTIO_SCSI(vdev); ++ VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(vdev); + +- unregister_savevm(qdev, "virtio-scsi", s); +- return virtio_scsi_common_exit(vs); ++ unregister_savevm(DEVICE(vdev), "virtio-scsi", s); ++ virtio_scsi_common_exit(vs); + } + + static Property virtio_scsi_properties[] = { +@@ -679,10 +678,10 @@ static void virtio_scsi_class_init(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); + VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); +- dc->exit = virtio_scsi_device_exit; + dc->props = virtio_scsi_properties; + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + vdc->init = virtio_scsi_device_init; ++ vdc->exit = virtio_scsi_device_exit; + vdc->set_config = virtio_scsi_set_config; + vdc->get_features = virtio_scsi_get_features; + vdc->reset = virtio_scsi_reset; +diff --git a/include/hw/virtio/virtio-scsi.h b/include/hw/virtio/virtio-scsi.h +index 9a98540..206c61d 100644 +--- a/include/hw/virtio/virtio-scsi.h ++++ b/include/hw/virtio/virtio-scsi.h +@@ -187,6 +187,6 @@ typedef struct { + VIRTIO_SCSI_F_CHANGE, true) + + int virtio_scsi_common_init(VirtIOSCSICommon *vs); +-int virtio_scsi_common_exit(VirtIOSCSICommon *vs); ++void virtio_scsi_common_exit(VirtIOSCSICommon *vs); + + #endif /* _QEMU_VIRTIO_SCSI_H */ diff --git a/0114-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch b/0114-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch new file mode 100644 index 0000000..5c921d1 --- /dev/null +++ b/0114-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch @@ -0,0 +1,49 @@ +From d42ac36363ef9e3d3963c2c31fa7122492dbaf0e Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 16:57:58 +0200 +Subject: [PATCH] virtio-balloon: switch exit callback to VirtioDeviceClass + +This ensures hot-unplug is handled properly by the proxy. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +--- + hw/virtio/virtio-balloon.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c +index aac7f83..c23facb 100644 +--- a/hw/virtio/virtio-balloon.c ++++ b/hw/virtio/virtio-balloon.c +@@ -370,16 +370,14 @@ static int virtio_balloon_device_init(VirtIODevice *vdev) + return 0; + } + +-static int virtio_balloon_device_exit(DeviceState *qdev) ++static void virtio_balloon_device_exit(VirtIODevice *vdev) + { +- VirtIOBalloon *s = VIRTIO_BALLOON(qdev); +- VirtIODevice *vdev = VIRTIO_DEVICE(qdev); ++ VirtIOBalloon *s = VIRTIO_BALLOON(vdev); + + balloon_stats_destroy_timer(s); + qemu_remove_balloon_handler(s); +- unregister_savevm(qdev, "virtio-balloon", s); ++ unregister_savevm(DEVICE(vdev), "virtio-balloon", s); + virtio_cleanup(vdev); +- return 0; + } + + static Property virtio_balloon_properties[] = { +@@ -390,10 +388,10 @@ static void virtio_balloon_class_init(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); + VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); +- dc->exit = virtio_balloon_device_exit; + dc->props = virtio_balloon_properties; + set_bit(DEVICE_CATEGORY_MISC, dc->categories); + vdc->init = virtio_balloon_device_init; ++ vdc->exit = virtio_balloon_device_exit; + vdc->get_config = virtio_balloon_get_config; + vdc->set_config = virtio_balloon_set_config; + vdc->get_features = virtio_balloon_get_features; diff --git a/0115-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch b/0115-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch new file mode 100644 index 0000000..6c54e1b --- /dev/null +++ b/0115-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch @@ -0,0 +1,49 @@ +From 2bb10b85ffa655f91a4777da4f7a5534ee4c266c Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 16:57:59 +0200 +Subject: [PATCH] virtio-rng: switch exit callback to VirtioDeviceClass + +This ensures hot-unplug is handled properly by the proxy. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +--- + hw/virtio/virtio-rng.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c +index bac8421..6895146 100644 +--- a/hw/virtio/virtio-rng.c ++++ b/hw/virtio/virtio-rng.c +@@ -184,16 +184,14 @@ static int virtio_rng_device_init(VirtIODevice *vdev) + return 0; + } + +-static int virtio_rng_device_exit(DeviceState *qdev) ++static void virtio_rng_device_exit(VirtIODevice *vdev) + { +- VirtIORNG *vrng = VIRTIO_RNG(qdev); +- VirtIODevice *vdev = VIRTIO_DEVICE(qdev); ++ VirtIORNG *vrng = VIRTIO_RNG(vdev); + + qemu_del_timer(vrng->rate_limit_timer); + qemu_free_timer(vrng->rate_limit_timer); +- unregister_savevm(qdev, "virtio-rng", vrng); ++ unregister_savevm(DEVICE(vdev), "virtio-rng", vrng); + virtio_cleanup(vdev); +- return 0; + } + + static Property virtio_rng_properties[] = { +@@ -205,10 +203,10 @@ static void virtio_rng_class_init(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); + VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); +- dc->exit = virtio_rng_device_exit; + dc->props = virtio_rng_properties; + set_bit(DEVICE_CATEGORY_MISC, dc->categories); + vdc->init = virtio_rng_device_init; ++ vdc->exit = virtio_rng_device_exit; + vdc->get_features = get_features; + } + diff --git a/0116-virtio-pci-add-device_unplugged-callback.patch b/0116-virtio-pci-add-device_unplugged-callback.patch new file mode 100644 index 0000000..e96fc3b --- /dev/null +++ b/0116-virtio-pci-add-device_unplugged-callback.patch @@ -0,0 +1,59 @@ +From cb2282d55ee34d04a67d74111d69ab098f765680 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 20 Sep 2013 16:58:00 +0200 +Subject: [PATCH] virtio-pci: add device_unplugged callback + +This fixes a crash in hot-unplug of virtio-pci devices behind a PCIe +switch. The crash happens because the ioeventfd is still set whent the +child is destroyed (destruction happens in postorder). Then the proxy +tries to unset to ioeventfd, but the virtqueue structure that holds the +EventNotifier has been trashed in the meanwhile. kvm_set_ioeventfd_pio +does not expect failure and aborts. + +The fix is simply to move parts of uninitialization to a new +device_unplugged callback, which is called before the child is destroyed. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Paolo Bonzini +--- + hw/virtio/virtio-pci.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c +index 6fd6d6d..242ec3e 100644 +--- a/hw/virtio/virtio-pci.c ++++ b/hw/virtio/virtio-pci.c +@@ -1000,6 +1000,15 @@ static void virtio_pci_device_plugged(DeviceState *d) + proxy->host_features); + } + ++static void virtio_pci_device_unplugged(DeviceState *d) ++{ ++ PCIDevice *pci_dev = PCI_DEVICE(d); ++ VirtIOPCIProxy *proxy = VIRTIO_PCI(d); ++ ++ virtio_pci_stop_ioeventfd(proxy); ++ msix_uninit_exclusive_bar(pci_dev); ++} ++ + static int virtio_pci_init(PCIDevice *pci_dev) + { + VirtIOPCIProxy *dev = VIRTIO_PCI(pci_dev); +@@ -1014,9 +1023,7 @@ static int virtio_pci_init(PCIDevice *pci_dev) + static void virtio_pci_exit(PCIDevice *pci_dev) + { + VirtIOPCIProxy *proxy = VIRTIO_PCI(pci_dev); +- virtio_pci_stop_ioeventfd(proxy); + memory_region_destroy(&proxy->bar); +- msix_uninit_exclusive_bar(pci_dev); + } + + static void virtio_pci_reset(DeviceState *qdev) +@@ -1550,6 +1557,7 @@ static void virtio_pci_bus_class_init(ObjectClass *klass, void *data) + k->set_guest_notifiers = virtio_pci_set_guest_notifiers; + k->vmstate_change = virtio_pci_vmstate_change; + k->device_plugged = virtio_pci_device_plugged; ++ k->device_unplugged = virtio_pci_device_unplugged; + } + + static const TypeInfo virtio_pci_bus_info = { diff --git a/0201-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch b/0201-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch new file mode 100644 index 0000000..b31f925 --- /dev/null +++ b/0201-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch @@ -0,0 +1,81 @@ +From 411a7e4ad457f7f3c9f1d02ef9f726ce13a35f08 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Fri, 6 Sep 2013 12:32:25 +0200 +Subject: [PATCH] qcow2: Pass discard type to qcow2_discard_clusters() + +The function will be used internally instead of only being called for +guest discard requests. + +Signed-off-by: Kevin Wolf +--- + block/qcow2-cluster.c | 8 ++++---- + block/qcow2.c | 2 +- + block/qcow2.h | 2 +- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c +index cca76d4..8c3185d 100644 +--- a/block/qcow2-cluster.c ++++ b/block/qcow2-cluster.c +@@ -1317,7 +1317,7 @@ int qcow2_decompress_cluster(BlockDriverState *bs, uint64_t cluster_offset) + * clusters. + */ + static int discard_single_l2(BlockDriverState *bs, uint64_t offset, +- unsigned int nb_clusters) ++ unsigned int nb_clusters, enum qcow2_discard_type type) + { + BDRVQcowState *s = bs->opaque; + uint64_t *l2_table; +@@ -1346,7 +1346,7 @@ static int discard_single_l2(BlockDriverState *bs, uint64_t offset, + l2_table[l2_index + i] = cpu_to_be64(0); + + /* Then decrease the refcount */ +- qcow2_free_any_clusters(bs, old_offset, 1, QCOW2_DISCARD_REQUEST); ++ qcow2_free_any_clusters(bs, old_offset, 1, type); + } + + ret = qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table); +@@ -1358,7 +1358,7 @@ static int discard_single_l2(BlockDriverState *bs, uint64_t offset, + } + + int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset, +- int nb_sectors) ++ int nb_sectors, enum qcow2_discard_type type) + { + BDRVQcowState *s = bs->opaque; + uint64_t end_offset; +@@ -1381,7 +1381,7 @@ int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset, + + /* Each L2 table is handled by its own loop iteration */ + while (nb_clusters > 0) { +- ret = discard_single_l2(bs, offset, nb_clusters); ++ ret = discard_single_l2(bs, offset, nb_clusters, type); + if (ret < 0) { + goto fail; + } +diff --git a/block/qcow2.c b/block/qcow2.c +index 7f7282e..16e45a0 100644 +--- a/block/qcow2.c ++++ b/block/qcow2.c +@@ -1506,7 +1506,7 @@ static coroutine_fn int qcow2_co_discard(BlockDriverState *bs, + + qemu_co_mutex_lock(&s->lock); + ret = qcow2_discard_clusters(bs, sector_num << BDRV_SECTOR_BITS, +- nb_sectors); ++ nb_sectors, QCOW2_DISCARD_REQUEST); + qemu_co_mutex_unlock(&s->lock); + return ret; + } +diff --git a/block/qcow2.h b/block/qcow2.h +index dba9771..52cf193 100644 +--- a/block/qcow2.h ++++ b/block/qcow2.h +@@ -405,7 +405,7 @@ uint64_t qcow2_alloc_compressed_cluster_offset(BlockDriverState *bs, + + int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m); + int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset, +- int nb_sectors); ++ int nb_sectors, enum qcow2_discard_type type); + int qcow2_zero_clusters(BlockDriverState *bs, uint64_t offset, int nb_sectors); + + /* qcow2-snapshot.c functions */ diff --git a/0202-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch b/0202-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch new file mode 100644 index 0000000..cb0e92c --- /dev/null +++ b/0202-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch @@ -0,0 +1,73 @@ +From 16d78f7cd9e1455ebb0599706ba5badfa3ee4fdc Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Fri, 6 Sep 2013 12:32:26 +0200 +Subject: [PATCH] qcow2: Discard VM state in active L1 after creating snapshot + +During savevm, the VM state is written to the active L1 of the image and +then a snapshot is taken. After that, the VM state isn't needed any more +in the active L1 and should be discarded. This is implemented by this +patch. + +The impact of not discarding the VM state is that a snapshot can never +become smaller than any previous snapshot (because it would be padded +with old VM state), and more importantly that future savevm operations +cause unnecessary COWs (with associated flushes), which makes subsequent +snapshots much slower. + +Signed-off-by: Kevin Wolf +--- + block/qcow2-snapshot.c | 7 +++++++ + block/qcow2.c | 5 ----- + block/qcow2.h | 5 +++++ + 3 files changed, 12 insertions(+), 5 deletions(-) + +diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c +index 0caac90..ae33b45 100644 +--- a/block/qcow2-snapshot.c ++++ b/block/qcow2-snapshot.c +@@ -401,6 +401,13 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info) + + g_free(old_snapshot_list); + ++ /* The VM state isn't needed any more in the active L1 table; in fact, it ++ * hurts by causing expensive COW for the next snapshot. */ ++ qcow2_discard_clusters(bs, qcow2_vm_state_offset(s), ++ align_offset(sn->vm_state_size, s->cluster_size) ++ >> BDRV_SECTOR_BITS, ++ QCOW2_DISCARD_NEVER); ++ + #ifdef DEBUG_ALLOC + { + BdrvCheckResult result = {0}; +diff --git a/block/qcow2.c b/block/qcow2.c +index 16e45a0..f63c2cb 100644 +--- a/block/qcow2.c ++++ b/block/qcow2.c +@@ -1666,11 +1666,6 @@ static coroutine_fn int qcow2_co_flush_to_os(BlockDriverState *bs) + return 0; + } + +-static int64_t qcow2_vm_state_offset(BDRVQcowState *s) +-{ +- return (int64_t)s->l1_vm_state_index << (s->cluster_bits + s->l2_bits); +-} +- + static int qcow2_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) + { + BDRVQcowState *s = bs->opaque; +diff --git a/block/qcow2.h b/block/qcow2.h +index 52cf193..da61d18 100644 +--- a/block/qcow2.h ++++ b/block/qcow2.h +@@ -324,6 +324,11 @@ static inline int64_t align_offset(int64_t offset, int n) + return offset; + } + ++static inline int64_t qcow2_vm_state_offset(BDRVQcowState *s) ++{ ++ return (int64_t)s->l1_vm_state_index << (s->cluster_bits + s->l2_bits); ++} ++ + static inline int qcow2_get_cluster_type(uint64_t l2_entry) + { + if (l2_entry & QCOW_OFLAG_COMPRESSED) { diff --git a/0203-hw-9pfs-Fix-errno-value-for-xattr-functions.patch b/0203-hw-9pfs-Fix-errno-value-for-xattr-functions.patch new file mode 100644 index 0000000..cd7b42f --- /dev/null +++ b/0203-hw-9pfs-Fix-errno-value-for-xattr-functions.patch @@ -0,0 +1,68 @@ +From 6f7e1d2bddb5a0a1c65f6f02467460d6edbcc901 Mon Sep 17 00:00:00 2001 +From: "Daniel P. Berrange" +Date: Tue, 1 Oct 2013 12:28:17 +0100 +Subject: [PATCH] hw/9pfs: Fix errno value for xattr functions + +If there is no operation driver for the xattr type the +functions return '-1' and set errno to '-EOPNOTSUPP'. +When the calling code sets 'ret = -errno' this turns +into a large positive number. + +In Linux 3.11, the kernel has switched to using 9p +version 9p2000.L, instead of 9p2000.u, which enables +support for xattr operations. This on its own is harmless, +but for another change which makes it request the xattr +with a name 'security.capability'. + +The result is that the guest sees a succesful return +of 95 bytes of data, instead of a failure with errno +set to 95. Since the kernel expects a maximum of 20 +bytes for an xattr return this gets translated to the +unexpected errno ERANGE. + +This all means that when running a binary off a 9p fs +in 3.11 kernels you get a fun result of: + + # ./date + sh: ./date: Numerical result out of range + +The only workaround is to pass 'version=9p2000.u' when +mounting the 9p fs in the guest, to disable all use of +xattrs. + +Signed-off-by: Daniel P. Berrange +--- + hw/9pfs/virtio-9p-xattr.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/hw/9pfs/virtio-9p-xattr.c b/hw/9pfs/virtio-9p-xattr.c +index 90ae565..3fae557 100644 +--- a/hw/9pfs/virtio-9p-xattr.c ++++ b/hw/9pfs/virtio-9p-xattr.c +@@ -36,7 +36,7 @@ ssize_t v9fs_get_xattr(FsContext *ctx, const char *path, + if (xops) { + return xops->getxattr(ctx, path, name, value, size); + } +- errno = -EOPNOTSUPP; ++ errno = EOPNOTSUPP; + return -1; + } + +@@ -123,7 +123,7 @@ int v9fs_set_xattr(FsContext *ctx, const char *path, const char *name, + if (xops) { + return xops->setxattr(ctx, path, name, value, size, flags); + } +- errno = -EOPNOTSUPP; ++ errno = EOPNOTSUPP; + return -1; + + } +@@ -135,7 +135,7 @@ int v9fs_remove_xattr(FsContext *ctx, + if (xops) { + return xops->removexattr(ctx, path, name); + } +- errno = -EOPNOTSUPP; ++ errno = EOPNOTSUPP; + return -1; + + } diff --git a/qemu.spec b/qemu.spec index 11201f2..4e0ceee 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,7 +139,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.6.0 -Release: 8%{?dist} +Release: 9%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -180,24 +180,88 @@ Source12: bridge.conf # qemu-kvm back compat wrapper Source13: qemu-kvm.sh +# Rebase to pending 1.6.1 stable +Patch0001: 0001-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch +Patch0002: 0002-gdbstub-Fix-gdb_register_coprocessor-register-counti.patch +Patch0003: 0003-target-ppc-fix-bit-extraction-for-FPBF-and-FPL.patch +Patch0004: 0004-rdma-silly-ipv6-bugfix.patch +Patch0005: 0005-scripts-qapi.py-Avoid-syntax-not-supported-by-Python.patch +Patch0006: 0006-usb-dev-hid-Modified-usb-tablet-category-from-Misc-t.patch +Patch0007: 0007-scsi-Fix-scsi_bus_legacy_add_drive-scsi-generic-with.patch +Patch0008: 0008-pc-fix-regression-for-64-bit-PCI-memory.patch +Patch0009: 0009-pseries-Fix-stalls-on-hypervisor-virtual-console.patch +Patch0010: 0010-virtio-virtqueue_get_avail_bytes-fix-desc_pa-when-lo.patch +Patch0011: 0011-xhci-fix-endpoint-interval-calculation.patch +Patch0012: 0012-Revert-usb-hub-report-status-changes-only-once.patch +Patch0013: 0013-block-expect-errors-from-bdrv_co_is_allocated.patch +Patch0014: 0014-target-i386-fix-disassembly-with-PAE-1-PG-0.patch +Patch0015: 0015-adlib-sort-offsets-in-portio-registration.patch +Patch0016: 0016-exec-fix-writing-to-MMIO-area-with-non-power-of-two-.patch +Patch0017: 0017-virtio_pci-fix-level-interrupts-with-irqfd.patch +Patch0018: 0018-exec-always-use-MADV_DONTFORK.patch +Patch0019: 0019-xhci-reset-port-when-disabling-slot.patch +Patch0020: 0020-usb-parallelize-usb3-streams.patch +Patch0021: 0021-w32-Fix-access-to-host-devices-regression.patch +Patch0022: 0022-memory-Provide-separate-handling-of-unassigned-io-po.patch +Patch0023: 0023-Revert-memory-Return-1-again-on-reads-from-unsigned-.patch +Patch0024: 0024-exec-check-offset_within_address_space-for-register-.patch +Patch0025: 0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch +Patch0026: 0026-ehci-save-device-pointer-in-EHCIState.patch +Patch0027: 0027-qxl-fix-local-renderer.patch +Patch0028: 0028-pc-Initializing-ram_memory-under-Xen.patch +Patch0029: 0029-pc_q35-Initialize-Xen.patch +Patch0030: 0030-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch +Patch0031: 0031-pcnet-pci-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch +Patch0032: 0032-chardev-fix-pty_chr_timer.patch +Patch0033: 0033-kvmvapic-Catch-invalid-ROM-size.patch +Patch0034: 0034-kvmvapic-Enter-inactive-state-on-hardware-reset.patch +Patch0035: 0035-kvmvapic-Clear-also-physical-ROM-address-when-enteri.patch +Patch0036: 0036-tci-Fix-qemu-alpha-on-32-bit-hosts-wrong-assertions.patch +Patch0037: 0037-blockdev-do-not-default-cache.no-flush-to-true.patch +Patch0038: 0038-virtio-blk-do-not-relay-a-previous-driver-s-WCE-conf.patch +Patch0039: 0039-xhci-emulate-intr-endpoint-intervals-correctly.patch +Patch0040: 0040-iov-avoid-orig_len-may-be-used-unitialized-warning.patch +Patch0041: 0041-tap-Use-numbered-tap-tun-devices-on-all-BSD-OS-s.patch +Patch0042: 0042-rbd-avoid-qemu_rbd_snap_list-memory-leaks.patch +Patch0043: 0043-vmdk-fix-cluster-size-check-for-flat-extents.patch +Patch0044: 0044-piix4-disable-io-on-reset.patch +Patch0045: 0045-coroutine-add-.-configure-disable-coroutine-pool.patch +Patch0046: 0046-qemu-Adjust-qemu-wakeup.patch +Patch0047: 0047-qemu-Add-qemu-xen-logic-for-Xen-HVM-S3-resume.patch +Patch0048: 0048-scsi-Allocate-SCSITargetReq-r-buf-dynamically.patch +Patch0049: 0049-Update-VERSION-for-1.6.1-release.patch + # qemu-kvm migration compat (not for upstream, drop by Fedora 21?) -Patch0001: 0001-Fix-migration-from-qemu-kvm.patch -# Fix qmp capabilities calls on i686 (bz #1003162) -# Patch posted upstream -Patch0002: 0002-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch +Patch0101: 0101-Fix-migration-from-qemu-kvm.patch # Fix crash with -M isapc -cpu Haswell (bz #986790) -Patch0003: 0003-isapc-disable-kvmvapic.patch +Patch0102: 0102-isapc-disable-kvmvapic.patch # Fix crash in lsi_soft_reset (bz #1000947) # Patches posted upstream -Patch0004: 0004-pci-do-not-export-pci_bus_reset.patch -Patch0005: 0005-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch -Patch0006: 0006-qdev-switch-reset-to-post-order.patch -# Fix -vga qxl with -display vnc (bz #948717) +Patch0103: 0103-pci-do-not-export-pci_bus_reset.patch +Patch0104: 0104-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch +Patch0105: 0105-qdev-switch-reset-to-post-order.patch +# CVE-2013-4377: Fix crash when unplugging virtio devices (bz #1012633, +# bz #1012641) +# Patches posted upstream +Patch0106: 0106-virtio-bus-remove-vdev-field.patch +Patch0107: 0107-virtio-pci-remove-vdev-field.patch +Patch0108: 0108-virtio-ccw-remove-vdev-field.patch +Patch0109: 0109-virtio-bus-cleanup-plug-unplug-interface.patch +Patch0110: 0110-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch +Patch0111: 0111-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch +Patch0112: 0112-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch +Patch0113: 0113-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch +Patch0114: 0114-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch +Patch0115: 0115-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch +Patch0116: 0116-virtio-pci-add-device_unplugged-callback.patch + +# Fix 'new snapshot' slowness after the first snap (bz #988436) +# Patches queued for upstream +Patch0201: 0201-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch +Patch0202: 0202-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch +# Fix 9pfs xattrs on kernel 3.11 (bz #1013676) # Patch posted upstream -Patch0007: 0007-qxl-fix-local-renderer.patch -# Fix USB crash when installing reactos (bz #1005495) -# Patch posted upstream -Patch0008: 0008-ehci-save-device-pointer-in-EHCIState.patch +Patch0203: 0203-hw-9pfs-Fix-errno-value-for-xattr-functions.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -710,24 +774,88 @@ CAC emulation development files. %prep %setup -q -# qemu-kvm migration compat (not for upstream, drop by Fedora 21?) +# Rebase to pending 1.6.1 stable %patch0001 -p1 -# Fix qmp capabilities calls on i686 (bz #1003162) -# Patch posted upstream %patch0002 -p1 -# Fix crash with -M isapc -cpu Haswell (bz #986790) %patch0003 -p1 -# Fix crash in lsi_soft_reset (bz #1000947) -# Patches posted upstream %patch0004 -p1 %patch0005 -p1 %patch0006 -p1 -# Fix -vga qxl with -display vnc (bz #948717) -# Patch posted upstream %patch0007 -p1 -# Fix USB crash when installing reactos (bz #1005495) -# Patch posted upstream %patch0008 -p1 +%patch0009 -p1 +%patch0010 -p1 +%patch0011 -p1 +%patch0012 -p1 +%patch0013 -p1 +%patch0014 -p1 +%patch0015 -p1 +%patch0016 -p1 +%patch0017 -p1 +%patch0018 -p1 +%patch0019 -p1 +%patch0020 -p1 +%patch0021 -p1 +%patch0022 -p1 +%patch0023 -p1 +%patch0024 -p1 +%patch0025 -p1 +%patch0026 -p1 +%patch0027 -p1 +%patch0028 -p1 +%patch0029 -p1 +%patch0030 -p1 +%patch0031 -p1 +%patch0032 -p1 +%patch0033 -p1 +%patch0034 -p1 +%patch0035 -p1 +%patch0036 -p1 +%patch0037 -p1 +%patch0038 -p1 +%patch0039 -p1 +%patch0040 -p1 +%patch0041 -p1 +%patch0042 -p1 +%patch0043 -p1 +%patch0044 -p1 +%patch0045 -p1 +%patch0046 -p1 +%patch0047 -p1 +%patch0048 -p1 +%patch0049 -p1 + +# qemu-kvm migration compat (not for upstream, drop by Fedora 21?) +%patch0101 -p1 +# Fix crash with -M isapc -cpu Haswell (bz #986790) +%patch0102 -p1 +# Fix crash in lsi_soft_reset (bz #1000947) +# Patches posted upstream +%patch0103 -p1 +%patch0104 -p1 +%patch0105 -p1 +# CVE-2013-4377: Fix crash when unplugging virtio devices (bz #1012633, +# bz #1012641) +# Patches posted upstream +%patch0106 -p1 +%patch0107 -p1 +%patch0108 -p1 +%patch0109 -p1 +%patch0110 -p1 +%patch0111 -p1 +%patch0112 -p1 +%patch0113 -p1 +%patch0114 -p1 +%patch0115 -p1 +%patch0116 -p1 + +# Fix 'new snapshot' slowness after the first snap (bz #988436) +# Patches queued for upstream +%patch0201 -p1 +%patch0202 -p1 +# Fix 9pfs xattrs on kernel 3.11 (bz #1013676) +# Patch posted upstream +%patch0203 -p1 %build @@ -1436,6 +1564,15 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Sun Oct 06 2013 Cole Robinson - 2:1.6.0-9 +- Rebase to pending 1.6.1 stable +- CVE-2013-4377: Fix crash when unplugging virtio devices (bz #1012633, bz + #1012641) +- Fix 'new snapshot' slowness after the first snap (bz #988436) +- Fix 9pfs xattrs on kernel 3.11 (bz #1013676) +- CVE-2013-4344: buffer overflow in scsi_target_emulate_report_luns (bz + #1015274, bz #1007330) + * Tue Sep 24 2013 Cole Robinson - 2:1.6.0-8 - Fix -vga qxl with -display vnc (bz #948717) - Fix USB crash when installing reactos (bz #1005495) From 0c698d13b99148604541f399741a04497912c80b Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 9 Oct 2013 13:38:07 -0400 Subject: [PATCH 31/45] Fix migration from qemu <= 1.5 --- 0204-Fix-pc-migration-from-qemu-1.5.patch | 202 ++++++++++++++++++++++ qemu.spec | 11 +- 2 files changed, 212 insertions(+), 1 deletion(-) create mode 100644 0204-Fix-pc-migration-from-qemu-1.5.patch diff --git a/0204-Fix-pc-migration-from-qemu-1.5.patch b/0204-Fix-pc-migration-from-qemu-1.5.patch new file mode 100644 index 0000000..ee21194 --- /dev/null +++ b/0204-Fix-pc-migration-from-qemu-1.5.patch @@ -0,0 +1,202 @@ +From 16f89cbf7737626a0ab24a5b0fd7ce4ab940f5a2 Mon Sep 17 00:00:00 2001 +From: Cole Robinson +Date: Mon, 7 Oct 2013 16:32:24 -0400 +Subject: [PATCH] Fix pc migration from qemu <= 1.5 + +The following commit introduced a migration incompatibility: + +commit 568f0690fd9aa4d39d84b04c1a5dbb53a915c3fe +Author: David Gibson +Date: Thu Jun 6 18:48:49 2013 +1000 + + pci: Replace pci_find_domain() with more general pci_root_bus_path() + +The issue is that i440fx savevm idstr went from 0000:00:00.0/I440FX to +0000:00.0/I440FX. Unfortunately we are stuck with the breakage for +1.6 machine types. + +Add a compat property to maintain the busted idstr for the 1.6 machine +types, but revert to the old style format for 1.7+, and <= 1.5. + +Tested with migration from qemu 1.5, qemu 1.6, and qemu.git. + +Cc: qemu-stable@nongnu.org +--- + hw/i386/pc_piix.c | 11 +++++++++++ + hw/i386/pc_q35.c | 11 +++++++++++ + hw/pci-host/piix.c | 9 ++++++++- + hw/pci-host/q35.c | 10 ++++++++-- + include/hw/i386/pc.h | 20 ++++++++++++++++++++ + include/hw/pci-host/q35.h | 1 + + 6 files changed, 59 insertions(+), 3 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 2f2cb4d..10866f5 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -341,6 +341,13 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args) + } + #endif + ++#define PC_I440FX_MACHINE_OPTIONS \ ++ PC_DEFAULT_MACHINE_OPTIONS, \ ++ .desc = "Standard PC (i440FX + PIIX, 1996)", \ ++ .hot_add_cpu = pc_hot_add_cpu ++ ++#define PC_I440FX_1_6_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS ++ + static QEMUMachine pc_i440fx_machine_v1_6 = { + .name = "pc-i440fx-1.6", + .alias = "pc", +@@ -349,6 +356,10 @@ static QEMUMachine pc_i440fx_machine_v1_6 = { + .hot_add_cpu = pc_hot_add_cpu, + .max_cpus = 255, + .is_default = 1, ++ .compat_props = (GlobalProperty[]) { ++ PC_COMPAT_1_6, ++ { /* end of list */ } ++ }, + DEFAULT_MACHINE_OPTIONS, + }; + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index dd13130..4998ed3 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -243,6 +243,13 @@ static void pc_q35_init_1_4(QEMUMachineInitArgs *args) + pc_q35_init(args); + } + ++#define PC_Q35_MACHINE_OPTIONS \ ++ PC_DEFAULT_MACHINE_OPTIONS, \ ++ .desc = "Standard PC (Q35 + ICH9, 2009)", \ ++ .hot_add_cpu = pc_hot_add_cpu ++ ++#define PC_Q35_1_6_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS ++ + static QEMUMachine pc_q35_machine_v1_6 = { + .name = "pc-q35-1.6", + .alias = "q35", +@@ -250,6 +257,10 @@ static QEMUMachine pc_q35_machine_v1_6 = { + .init = pc_q35_init_1_6, + .hot_add_cpu = pc_hot_add_cpu, + .max_cpus = 255, ++ .compat_props = (GlobalProperty[]) { ++ PC_COMPAT_1_6, ++ { /* end of list */ } ++ }, + DEFAULT_MACHINE_OPTIONS, + }; + +diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c +index 221d82b..967f949 100644 +--- a/hw/pci-host/piix.c ++++ b/hw/pci-host/piix.c +@@ -48,6 +48,7 @@ typedef struct I440FXState { + PCIHostState parent_obj; + PcPciInfo pci_info; + uint64_t pci_hole64_size; ++ uint32_t short_root_bus; + } I440FXState; + + #define PIIX_NUM_PIC_IRQS 16 /* i8259 * 2 */ +@@ -706,13 +707,19 @@ static const TypeInfo i440fx_info = { + static const char *i440fx_pcihost_root_bus_path(PCIHostState *host_bridge, + PCIBus *rootbus) + { ++ I440FXState *s = I440FX_PCI_HOST_BRIDGE(host_bridge); ++ + /* For backwards compat with old device paths */ +- return "0000"; ++ if (s->short_root_bus) { ++ return "0000"; ++ } ++ return "0000:00"; + } + + static Property i440fx_props[] = { + DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, I440FXState, + pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE), ++ DEFINE_PROP_UINT32("short_root_bus", I440FXState, short_root_bus, 0), + DEFINE_PROP_END_OF_LIST(), + }; + +diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c +index 4febd24..f762053 100644 +--- a/hw/pci-host/q35.c ++++ b/hw/pci-host/q35.c +@@ -61,8 +61,13 @@ static void q35_host_realize(DeviceState *dev, Error **errp) + static const char *q35_host_root_bus_path(PCIHostState *host_bridge, + PCIBus *rootbus) + { +- /* For backwards compat with old device paths */ +- return "0000"; ++ Q35PCIHost *s = Q35_HOST_DEVICE(host_bridge); ++ ++ /* For backwards compat with old device paths */ ++ if (s->mch.short_root_bus) { ++ return "0000"; ++ } ++ return "0000:00"; + } + + static void q35_host_get_pci_hole_start(Object *obj, Visitor *v, +@@ -108,6 +113,7 @@ static Property mch_props[] = { + MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT), + DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35PCIHost, + mch.pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE), ++ DEFINE_PROP_UINT32("short_root_bus", Q35PCIHost, mch.short_root_bus, 0), + DEFINE_PROP_END_OF_LIST(), + }; + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 475ba9e..a0bbdd9 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -225,7 +225,19 @@ void pvpanic_init(ISABus *bus); + + int e820_add_entry(uint64_t, uint64_t, uint32_t); + ++#define PC_COMPAT_1_6 \ ++ {\ ++ .driver = "i440FX-pcihost",\ ++ .property = "short_root_bus",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = "mch",\ ++ .property = "short_root_bus",\ ++ .value = stringify(1),\ ++ } ++ + #define PC_COMPAT_1_5 \ ++ PC_COMPAT_1_6, \ + {\ + .driver = "Conroe-" TYPE_X86_CPU,\ + .property = "model",\ +@@ -258,6 +270,14 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t); + .driver = TYPE_X86_CPU,\ + .property = "pmu",\ + .value = "on",\ ++ },{\ ++ .driver = "i440FX-pcihost",\ ++ .property = "short_root_bus",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "mch",\ ++ .property = "short_root_bus",\ ++ .value = stringify(0),\ + } + + #define PC_COMPAT_1_4 \ +diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h +index 6eb7ab6..95a3cc2 100644 +--- a/include/hw/pci-host/q35.h ++++ b/include/hw/pci-host/q35.h +@@ -61,6 +61,7 @@ typedef struct MCHPCIState { + ram_addr_t above_4g_mem_size; + uint64_t pci_hole64_size; + PcGuestInfo *guest_info; ++ uint32_t short_root_bus; + } MCHPCIState; + + typedef struct Q35PCIHost { diff --git a/qemu.spec b/qemu.spec index 4e0ceee..0560b00 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,7 +139,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.6.0 -Release: 9%{?dist} +Release: 10%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -262,6 +262,9 @@ Patch0202: 0202-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch # Fix 9pfs xattrs on kernel 3.11 (bz #1013676) # Patch posted upstream Patch0203: 0203-hw-9pfs-Fix-errno-value-for-xattr-functions.patch +# Fix migration from qemu <= 1.5 +# Patch posted upstream +Patch0204: 0204-Fix-pc-migration-from-qemu-1.5.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -856,6 +859,9 @@ CAC emulation development files. # Fix 9pfs xattrs on kernel 3.11 (bz #1013676) # Patch posted upstream %patch0203 -p1 +# Fix migration from qemu <= 1.5 +# Patch posted upstream +%patch0204 -p1 %build @@ -1564,6 +1570,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Wed Oct 09 2013 Cole Robinson - 2:1.6.0-10 +- Fix migration from qemu <= 1.5 + * Sun Oct 06 2013 Cole Robinson - 2:1.6.0-9 - Rebase to pending 1.6.1 stable - CVE-2013-4377: Fix crash when unplugging virtio devices (bz #1012633, bz From acbc4a5d3aa65e9bed90486afbe056a5ca275911 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 5 Nov 2013 19:42:39 -0500 Subject: [PATCH 32/45] Reduce CPU usage when audio is playing (bz #1017644) Base on qemu 1.6.1 tarball ksmtuned: Fix matching qemu w/o set_process_name (bz #1012604) ksmtuned: Fix committed_memory when no qemu running (bz #1012610) Make sure bridge helper is setuid (bz #1017660) --- .gitignore | 1 + ... => 0001-Fix-migration-from-qemu-kvm.patch | 0 ...v_drain_all-works-during-bdrv_delete.patch | 36 ---- ...register_coprocessor-register-counti.patch | 96 --------- ...patch => 0002-isapc-disable-kvmvapic.patch | 0 ...0003-pci-do-not-export-pci_bus_reset.patch | 0 ...-fix-bit-extraction-for-FPBF-and-FPL.patch | 40 ---- ...pre-and-post-order-vists-in-qdev-wal.patch | 0 0004-rdma-silly-ipv6-bugfix.patch | 37 ---- ...0005-qdev-switch-reset-to-post-order.patch | 0 ...Avoid-syntax-not-supported-by-Python.patch | 32 --- ...fied-usb-tablet-category-from-Misc-t.patch | 35 ---- ...=> 0006-virtio-bus-remove-vdev-field.patch | 0 ...s_legacy_add_drive-scsi-generic-with.patch | 49 ----- ...=> 0007-virtio-pci-remove-vdev-field.patch | 0 ...fix-regression-for-64-bit-PCI-memory.patch | 116 ----------- ...=> 0008-virtio-ccw-remove-vdev-field.patch | 0 ...stalls-on-hypervisor-virtual-console.patch | 45 ----- ...io-bus-cleanup-plug-unplug-interface.patch | 0 ...h-exit-callback-to-VirtioDeviceClass.patch | 0 ..._get_avail_bytes-fix-desc_pa-when-lo.patch | 41 ---- ...itch-exit-callback-to-VirtioDeviceCl.patch | 0 ...ci-fix-endpoint-interval-calculation.patch | 27 --- ...-hub-report-status-changes-only-once.patch | 48 ----- ...h-exit-callback-to-VirtioDeviceClass.patch | 0 ...ect-errors-from-bdrv_co_is_allocated.patch | 149 -------------- ...ch-exit-callback-to-VirtioDeviceClas.patch | 0 ...i386-fix-disassembly-with-PAE-1-PG-0.patch | 76 -------- ...witch-exit-callback-to-VirtioDeviceC.patch | 0 ...-sort-offsets-in-portio-registration.patch | 35 ---- ...h-exit-callback-to-VirtioDeviceClass.patch | 0 ...-to-MMIO-area-with-non-power-of-two-.patch | 37 ---- ...io-pci-add-device_unplugged-callback.patch | 0 ..._pci-fix-level-interrupts-with-irqfd.patch | 38 ---- 0018-exec-always-use-MADV_DONTFORK.patch | 43 ----- ...-xhci-reset-port-when-disabling-slot.patch | 26 --- 0020-usb-parallelize-usb3-streams.patch | 52 ----- ...ix-access-to-host-devices-regression.patch | 86 --------- ...eparate-handling-of-unassigned-io-po.patch | 78 -------- ...turn-1-again-on-reads-from-unsigned-.patch | 34 ---- ...t_within_address_space-for-register-.patch | 40 ---- 0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch | 35 ---- ...hci-save-device-pointer-in-EHCIState.patch | 67 ------- 0027-qxl-fix-local-renderer.patch | 67 ------- ...pc-Initializing-ram_memory-under-Xen.patch | 107 ---------- 0029-pc_q35-Initialize-Xen.patch | 31 --- ...pes.py-Fix-enum-struct-sizes-on-i686.patch | 44 ----- ...i-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch | 45 ----- 0032-chardev-fix-pty_chr_timer.patch | 52 ----- 0033-kvmvapic-Catch-invalid-ROM-size.patch | 59 ------ ...ter-inactive-state-on-hardware-reset.patch | 34 ---- ...lso-physical-ROM-address-when-enteri.patch | 39 ---- ...pha-on-32-bit-hosts-wrong-assertions.patch | 125 ------------ ...o-not-default-cache.no-flush-to-true.patch | 33 ---- ...t-relay-a-previous-driver-s-WCE-conf.patch | 111 ----------- ...te-intr-endpoint-intervals-correctly.patch | 131 ------------- ..._len-may-be-used-unitialized-warning.patch | 37 ---- ...ered-tap-tun-devices-on-all-BSD-OS-s.patch | 47 ----- ...void-qemu_rbd_snap_list-memory-leaks.patch | 43 ----- ...-cluster-size-check-for-flat-extents.patch | 64 ------ 0044-piix4-disable-io-on-reset.patch | 33 ---- ...d-.-configure-disable-coroutine-pool.patch | 163 ---------------- 0046-qemu-Adjust-qemu-wakeup.patch | 123 ------------ ...qemu-xen-logic-for-Xen-HVM-S3-resume.patch | 53 ----- ...cate-SCSITargetReq-r-buf-dynamically.patch | 154 --------------- 0049-Update-VERSION-for-1.6.1-release.patch | 17 -- ...scard-type-to-qcow2_discard_clusters.patch | 0 ...-state-in-active-L1-after-creating-s.patch | 0 ...-Fix-errno-value-for-xattr-functions.patch | 0 ... 0104-Fix-pc-migration-from-qemu-1.5.patch | 9 +- ..._AUDIO_TIMER_PERIOD-instead-of-wakin.patch | 42 ++++ ksmtuned | 4 +- qemu.spec | 182 +++++------------- sources | 2 +- 74 files changed, 96 insertions(+), 3154 deletions(-) rename 0101-Fix-migration-from-qemu-kvm.patch => 0001-Fix-migration-from-qemu-kvm.patch (100%) delete mode 100644 0001-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch delete mode 100644 0002-gdbstub-Fix-gdb_register_coprocessor-register-counti.patch rename 0102-isapc-disable-kvmvapic.patch => 0002-isapc-disable-kvmvapic.patch (100%) rename 0103-pci-do-not-export-pci_bus_reset.patch => 0003-pci-do-not-export-pci_bus_reset.patch (100%) delete mode 100644 0003-target-ppc-fix-bit-extraction-for-FPBF-and-FPL.patch rename 0104-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch => 0004-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch (100%) delete mode 100644 0004-rdma-silly-ipv6-bugfix.patch rename 0105-qdev-switch-reset-to-post-order.patch => 0005-qdev-switch-reset-to-post-order.patch (100%) delete mode 100644 0005-scripts-qapi.py-Avoid-syntax-not-supported-by-Python.patch delete mode 100644 0006-usb-dev-hid-Modified-usb-tablet-category-from-Misc-t.patch rename 0106-virtio-bus-remove-vdev-field.patch => 0006-virtio-bus-remove-vdev-field.patch (100%) delete mode 100644 0007-scsi-Fix-scsi_bus_legacy_add_drive-scsi-generic-with.patch rename 0107-virtio-pci-remove-vdev-field.patch => 0007-virtio-pci-remove-vdev-field.patch (100%) delete mode 100644 0008-pc-fix-regression-for-64-bit-PCI-memory.patch rename 0108-virtio-ccw-remove-vdev-field.patch => 0008-virtio-ccw-remove-vdev-field.patch (100%) delete mode 100644 0009-pseries-Fix-stalls-on-hypervisor-virtual-console.patch rename 0109-virtio-bus-cleanup-plug-unplug-interface.patch => 0009-virtio-bus-cleanup-plug-unplug-interface.patch (100%) rename 0110-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch => 0010-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch (100%) delete mode 100644 0010-virtio-virtqueue_get_avail_bytes-fix-desc_pa-when-lo.patch rename 0111-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch => 0011-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch (100%) delete mode 100644 0011-xhci-fix-endpoint-interval-calculation.patch delete mode 100644 0012-Revert-usb-hub-report-status-changes-only-once.patch rename 0112-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch => 0012-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch (100%) delete mode 100644 0013-block-expect-errors-from-bdrv_co_is_allocated.patch rename 0113-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch => 0013-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch (100%) delete mode 100644 0014-target-i386-fix-disassembly-with-PAE-1-PG-0.patch rename 0114-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch => 0014-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch (100%) delete mode 100644 0015-adlib-sort-offsets-in-portio-registration.patch rename 0115-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch => 0015-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch (100%) delete mode 100644 0016-exec-fix-writing-to-MMIO-area-with-non-power-of-two-.patch rename 0116-virtio-pci-add-device_unplugged-callback.patch => 0016-virtio-pci-add-device_unplugged-callback.patch (100%) delete mode 100644 0017-virtio_pci-fix-level-interrupts-with-irqfd.patch delete mode 100644 0018-exec-always-use-MADV_DONTFORK.patch delete mode 100644 0019-xhci-reset-port-when-disabling-slot.patch delete mode 100644 0020-usb-parallelize-usb3-streams.patch delete mode 100644 0021-w32-Fix-access-to-host-devices-regression.patch delete mode 100644 0022-memory-Provide-separate-handling-of-unassigned-io-po.patch delete mode 100644 0023-Revert-memory-Return-1-again-on-reads-from-unsigned-.patch delete mode 100644 0024-exec-check-offset_within_address_space-for-register-.patch delete mode 100644 0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch delete mode 100644 0026-ehci-save-device-pointer-in-EHCIState.patch delete mode 100644 0027-qxl-fix-local-renderer.patch delete mode 100644 0028-pc-Initializing-ram_memory-under-Xen.patch delete mode 100644 0029-pc_q35-Initialize-Xen.patch delete mode 100644 0030-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch delete mode 100644 0031-pcnet-pci-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch delete mode 100644 0032-chardev-fix-pty_chr_timer.patch delete mode 100644 0033-kvmvapic-Catch-invalid-ROM-size.patch delete mode 100644 0034-kvmvapic-Enter-inactive-state-on-hardware-reset.patch delete mode 100644 0035-kvmvapic-Clear-also-physical-ROM-address-when-enteri.patch delete mode 100644 0036-tci-Fix-qemu-alpha-on-32-bit-hosts-wrong-assertions.patch delete mode 100644 0037-blockdev-do-not-default-cache.no-flush-to-true.patch delete mode 100644 0038-virtio-blk-do-not-relay-a-previous-driver-s-WCE-conf.patch delete mode 100644 0039-xhci-emulate-intr-endpoint-intervals-correctly.patch delete mode 100644 0040-iov-avoid-orig_len-may-be-used-unitialized-warning.patch delete mode 100644 0041-tap-Use-numbered-tap-tun-devices-on-all-BSD-OS-s.patch delete mode 100644 0042-rbd-avoid-qemu_rbd_snap_list-memory-leaks.patch delete mode 100644 0043-vmdk-fix-cluster-size-check-for-flat-extents.patch delete mode 100644 0044-piix4-disable-io-on-reset.patch delete mode 100644 0045-coroutine-add-.-configure-disable-coroutine-pool.patch delete mode 100644 0046-qemu-Adjust-qemu-wakeup.patch delete mode 100644 0047-qemu-Add-qemu-xen-logic-for-Xen-HVM-S3-resume.patch delete mode 100644 0048-scsi-Allocate-SCSITargetReq-r-buf-dynamically.patch delete mode 100644 0049-Update-VERSION-for-1.6.1-release.patch rename 0201-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch => 0101-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch (100%) rename 0202-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch => 0102-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch (100%) rename 0203-hw-9pfs-Fix-errno-value-for-xattr-functions.patch => 0103-hw-9pfs-Fix-errno-value-for-xattr-functions.patch (100%) rename 0204-Fix-pc-migration-from-qemu-1.5.patch => 0104-Fix-pc-migration-from-qemu-1.5.patch (96%) create mode 100644 0105-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch diff --git a/.gitignore b/.gitignore index 1ac9888..a119815 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,4 @@ qemu-kvm-0.13.0-25fdf4a.tar.gz /qemu-1.5.1.tar.bz2 /qemu-1.5.2.tar.bz2 /qemu-1.6.0.tar.bz2 +/qemu-1.6.1.tar.bz2 diff --git a/0101-Fix-migration-from-qemu-kvm.patch b/0001-Fix-migration-from-qemu-kvm.patch similarity index 100% rename from 0101-Fix-migration-from-qemu-kvm.patch rename to 0001-Fix-migration-from-qemu-kvm.patch diff --git a/0001-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch b/0001-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch deleted file mode 100644 index 7268607..0000000 --- a/0001-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 670599a08c052f6ef841743731a8f06d4b50ec99 Mon Sep 17 00:00:00 2001 -From: Stefan Hajnoczi -Date: Thu, 27 Jun 2013 15:32:26 +0200 -Subject: [PATCH] block: ensure bdrv_drain_all() works during bdrv_delete() - -In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close() -so that the device is still seen by bdrv_drain_all() when iterating -bdrv_states. - -Cc: qemu-stable@nongnu.org -Signed-off-by: Stefan Hajnoczi -(cherry picked from commit e1b5c52e04d04bb93546c6e37e8884889d047cb1) - -Signed-off-by: Michael Roth ---- - block.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/block.c b/block.c -index 01b66d8..d5ce8d3 100644 ---- a/block.c -+++ b/block.c -@@ -1606,11 +1606,11 @@ void bdrv_delete(BlockDriverState *bs) - assert(!bs->job); - assert(!bs->in_use); - -+ bdrv_close(bs); -+ - /* remove from list, if necessary */ - bdrv_make_anon(bs); - -- bdrv_close(bs); -- - g_free(bs); - } - diff --git a/0002-gdbstub-Fix-gdb_register_coprocessor-register-counti.patch b/0002-gdbstub-Fix-gdb_register_coprocessor-register-counti.patch deleted file mode 100644 index 46cb0d9..0000000 --- a/0002-gdbstub-Fix-gdb_register_coprocessor-register-counti.patch +++ /dev/null @@ -1,96 +0,0 @@ -From c0c080c5d1ce6c236ba8ab5db3a17043c665d0f6 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Andreas=20F=C3=A4rber?= -Date: Mon, 12 Aug 2013 18:09:47 +0200 -Subject: [PATCH] gdbstub: Fix gdb_register_coprocessor() register counting -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Commit a0e372f0c49ac01faeaeb73a6e8f50e8ac615f34 reorganized the register -counting for GDB. While it seems correct not to let the total number of -registers skyrocket in an SMP scenario through a static variable, the -distinction between total register count and 'g' packet register count -(last_reg vs. num_g_regs) got lost among the way. - -Fix this by introducing CPUState::gdb_num_g_regs and using that in -gdb_handle_packet(). - -Reported-by: Aneesh Kumar K.V -Cc: qemu-stable@nongnu.org (stable-1.6) -Tested-by: Aneesh Kumar K.V -Tested-by: Max Filippov -Tested-by: Peter Maydell -Signed-off-by: Andreas Färber -(cherry picked from commit 35143f0164e6933a85c7c2b8a89a040d881a9151) - -Signed-off-by: Michael Roth ---- - gdbstub.c | 6 ++++-- - include/qom/cpu.h | 2 ++ - qom/cpu.c | 2 +- - 3 files changed, 7 insertions(+), 3 deletions(-) - -diff --git a/gdbstub.c b/gdbstub.c -index 1af25a6..9d067d6 100644 ---- a/gdbstub.c -+++ b/gdbstub.c -@@ -621,6 +621,8 @@ void gdb_register_coprocessor(CPUState *cpu, - if (g_pos != s->base_reg) { - fprintf(stderr, "Error: Bad gdb register numbering for '%s'\n" - "Expected %d got %d\n", xml, g_pos, s->base_reg); -+ } else { -+ cpu->gdb_num_g_regs = cpu->gdb_num_regs; - } - } - } -@@ -902,7 +904,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) - case 'g': - cpu_synchronize_state(s->g_cpu); - len = 0; -- for (addr = 0; addr < s->g_cpu->gdb_num_regs; addr++) { -+ for (addr = 0; addr < s->g_cpu->gdb_num_g_regs; addr++) { - reg_size = gdb_read_register(s->g_cpu, mem_buf + len, addr); - len += reg_size; - } -@@ -914,7 +916,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) - registers = mem_buf; - len = strlen(p) / 2; - hextomem((uint8_t *)registers, p, len); -- for (addr = 0; addr < s->g_cpu->gdb_num_regs && len > 0; addr++) { -+ for (addr = 0; addr < s->g_cpu->gdb_num_g_regs && len > 0; addr++) { - reg_size = gdb_write_register(s->g_cpu, registers, addr); - len -= reg_size; - registers += reg_size; -diff --git a/include/qom/cpu.h b/include/qom/cpu.h -index 0d6e95c..3e49936 100644 ---- a/include/qom/cpu.h -+++ b/include/qom/cpu.h -@@ -152,6 +152,7 @@ struct kvm_run; - * @current_tb: Currently executing TB. - * @gdb_regs: Additional GDB registers. - * @gdb_num_regs: Number of total registers accessible to GDB. -+ * @gdb_num_g_regs: Number of registers in GDB 'g' packets. - * @next_cpu: Next CPU sharing TB cache. - * @kvm_fd: vCPU file descriptor for KVM. - * -@@ -188,6 +189,7 @@ struct CPUState { - struct TranslationBlock *current_tb; - struct GDBRegisterState *gdb_regs; - int gdb_num_regs; -+ int gdb_num_g_regs; - CPUState *next_cpu; - - int kvm_fd; -diff --git a/qom/cpu.c b/qom/cpu.c -index aa95108..e71e57b 100644 ---- a/qom/cpu.c -+++ b/qom/cpu.c -@@ -240,7 +240,7 @@ static void cpu_common_initfn(Object *obj) - CPUState *cpu = CPU(obj); - CPUClass *cc = CPU_GET_CLASS(obj); - -- cpu->gdb_num_regs = cc->gdb_num_core_regs; -+ cpu->gdb_num_regs = cpu->gdb_num_g_regs = cc->gdb_num_core_regs; - } - - static int64_t cpu_common_get_arch_id(CPUState *cpu) diff --git a/0102-isapc-disable-kvmvapic.patch b/0002-isapc-disable-kvmvapic.patch similarity index 100% rename from 0102-isapc-disable-kvmvapic.patch rename to 0002-isapc-disable-kvmvapic.patch diff --git a/0103-pci-do-not-export-pci_bus_reset.patch b/0003-pci-do-not-export-pci_bus_reset.patch similarity index 100% rename from 0103-pci-do-not-export-pci_bus_reset.patch rename to 0003-pci-do-not-export-pci_bus_reset.patch diff --git a/0003-target-ppc-fix-bit-extraction-for-FPBF-and-FPL.patch b/0003-target-ppc-fix-bit-extraction-for-FPBF-and-FPL.patch deleted file mode 100644 index faf651b..0000000 --- a/0003-target-ppc-fix-bit-extraction-for-FPBF-and-FPL.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 52f99b02e5ff1004fb3b41846d2c34f190127456 Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Thu, 15 Aug 2013 13:32:38 +0200 -Subject: [PATCH] target-ppc: fix bit extraction for FPBF and FPL - -Bit extraction for the FP BF and L field of the MTFSFI and MTFSF -instructions is wrong and doesn't match the reference manual (which -explain the bit number in big endian format). It has been broken in -commit 7d08d85645def18eac2a9d672c1868a35e0bcf79. - -This patch fixes this, which in turn fixes the problem reported by -Khem Raj about the floor() function of libm. - -Reported-by: Khem Raj -Signed-off-by: Aurelien Jarno -CC: qemu-stable@nongnu.org (1.6) -Signed-off-by: Alexander Graf -(cherry picked from commit 779f659021d1754117bce1aab9370dc22f37ae07) - -Signed-off-by: Michael Roth ---- - target-ppc/translate.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/target-ppc/translate.c b/target-ppc/translate.c -index f07d70d..41f4048 100644 ---- a/target-ppc/translate.c -+++ b/target-ppc/translate.c -@@ -428,9 +428,9 @@ EXTRACT_HELPER(CRM, 12, 8); - EXTRACT_HELPER(SR, 16, 4); - - /* mtfsf/mtfsfi */ --EXTRACT_HELPER(FPBF, 19, 3); -+EXTRACT_HELPER(FPBF, 23, 3); - EXTRACT_HELPER(FPIMM, 12, 4); --EXTRACT_HELPER(FPL, 21, 1); -+EXTRACT_HELPER(FPL, 25, 1); - EXTRACT_HELPER(FPFLM, 17, 8); - EXTRACT_HELPER(FPW, 16, 1); - diff --git a/0104-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch b/0004-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch similarity index 100% rename from 0104-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch rename to 0004-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch diff --git a/0004-rdma-silly-ipv6-bugfix.patch b/0004-rdma-silly-ipv6-bugfix.patch deleted file mode 100644 index 6ee6865..0000000 --- a/0004-rdma-silly-ipv6-bugfix.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 260790645e95891cb264c2d657648f43401ac915 Mon Sep 17 00:00:00 2001 -From: "Michael R. Hines" -Date: Sun, 18 Aug 2013 22:27:08 -0400 -Subject: [PATCH] rdma: silly ipv6 bugfix - -My bad - but it's very important for us to warn the user that -IPv6 is broken on RoCE in linux right now, until linux releases -a fixed version. - -Signed-off-by: Michael R. Hines -Signed-off-by: Michael Tokarev -(cherry picked from commit c89aa2f1851b08c3efa8a1070c0a6b9a36e1227f) - -Signed-off-by: Michael Roth ---- - migration-rdma.c | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/migration-rdma.c b/migration-rdma.c -index 3d1266f..f5e75d6 100644 ---- a/migration-rdma.c -+++ b/migration-rdma.c -@@ -920,9 +920,11 @@ static int qemu_rdma_resolve_host(RDMAContext *rdma, Error **errp) - ret = rdma_resolve_addr(rdma->cm_id, NULL, e->ai_dst_addr, - RDMA_RESOLVE_TIMEOUT_MS); - if (!ret) { -- ret = qemu_rdma_broken_ipv6_kernel(errp, rdma->cm_id->verbs); -- if (ret) { -- continue; -+ if (e->ai_family == AF_INET6) { -+ ret = qemu_rdma_broken_ipv6_kernel(errp, rdma->cm_id->verbs); -+ if (ret) { -+ continue; -+ } - } - goto route; - } diff --git a/0105-qdev-switch-reset-to-post-order.patch b/0005-qdev-switch-reset-to-post-order.patch similarity index 100% rename from 0105-qdev-switch-reset-to-post-order.patch rename to 0005-qdev-switch-reset-to-post-order.patch diff --git a/0005-scripts-qapi.py-Avoid-syntax-not-supported-by-Python.patch b/0005-scripts-qapi.py-Avoid-syntax-not-supported-by-Python.patch deleted file mode 100644 index 292328e..0000000 --- a/0005-scripts-qapi.py-Avoid-syntax-not-supported-by-Python.patch +++ /dev/null @@ -1,32 +0,0 @@ -From d6dcfd69f8b2aa2cad79486bbadef7d51f7f4e7d Mon Sep 17 00:00:00 2001 -From: Peter Maydell -Date: Tue, 20 Aug 2013 15:50:15 +0100 -Subject: [PATCH] scripts/qapi.py: Avoid syntax not supported by Python 2.4 - -The Python "except Foo as x" syntax was only introduced in -Python 2.6, but we aim to support Python 2.4 and later. -Use the old-style "except Foo, x" syntax instead, thus -fixing configure/compile on systems with older Python. - -Signed-off-by: Peter Maydell -Signed-off-by: Luiz Capitulino -(cherry picked from commit 21e0043bada1a24ae2ba6cd0051e104c0cbf9634) - -Signed-off-by: Michael Roth ---- - scripts/qapi.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/qapi.py b/scripts/qapi.py -index 0ebea94..1069310 100644 ---- a/scripts/qapi.py -+++ b/scripts/qapi.py -@@ -161,7 +161,7 @@ class QAPISchema: - def parse_schema(fp): - try: - schema = QAPISchema(fp) -- except QAPISchemaError as e: -+ except QAPISchemaError, e: - print >>sys.stderr, e - exit(1) - diff --git a/0006-usb-dev-hid-Modified-usb-tablet-category-from-Misc-t.patch b/0006-usb-dev-hid-Modified-usb-tablet-category-from-Misc-t.patch deleted file mode 100644 index ed4a84b..0000000 --- a/0006-usb-dev-hid-Modified-usb-tablet-category-from-Misc-t.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 11b0ab70a58e3e6c06dc1fd1ea318b1c5806d955 Mon Sep 17 00:00:00 2001 -From: Marcel Apfelbaum -Date: Thu, 22 Aug 2013 20:11:36 +0300 -Subject: [PATCH] usb/dev-hid: Modified usb-tablet category from Misc to Input -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -usb-tablet device was wrongly assigned to Misc category - -Reported-by: Markus Armbruster -Cc: qemu-stable@nongnu.org -Signed-off-by: Marcel Apfelbaum -Reviewed-by: Andreas Färber -Signed-off-by: Gerd Hoffmann -(cherry picked from commit 31efd2e883018b4c079ad082105bc161fbb3fef8) - -Signed-off-by: Michael Roth ---- - hw/usb/dev-hid.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/usb/dev-hid.c b/hw/usb/dev-hid.c -index 66c6331..5956720 100644 ---- a/hw/usb/dev-hid.c -+++ b/hw/usb/dev-hid.c -@@ -658,7 +658,7 @@ static void usb_tablet_class_initfn(ObjectClass *klass, void *data) - uc->product_desc = "QEMU USB Tablet"; - dc->vmsd = &vmstate_usb_ptr; - dc->props = usb_tablet_properties; -- set_bit(DEVICE_CATEGORY_MISC, dc->categories); -+ set_bit(DEVICE_CATEGORY_INPUT, dc->categories); - } - - static const TypeInfo usb_tablet_info = { diff --git a/0106-virtio-bus-remove-vdev-field.patch b/0006-virtio-bus-remove-vdev-field.patch similarity index 100% rename from 0106-virtio-bus-remove-vdev-field.patch rename to 0006-virtio-bus-remove-vdev-field.patch diff --git a/0007-scsi-Fix-scsi_bus_legacy_add_drive-scsi-generic-with.patch b/0007-scsi-Fix-scsi_bus_legacy_add_drive-scsi-generic-with.patch deleted file mode 100644 index 868951b..0000000 --- a/0007-scsi-Fix-scsi_bus_legacy_add_drive-scsi-generic-with.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 964e0d4ec52ea7400ccc69de69b05ac913bbfff8 Mon Sep 17 00:00:00 2001 -From: Markus Armbruster -Date: Fri, 23 Aug 2013 18:01:58 +0200 -Subject: [PATCH] scsi: Fix scsi_bus_legacy_add_drive() scsi-generic with - serial -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -scsi_bus_legacy_add_drive() creates either a scsi-disk or a -scsi-generic device. It sets property "serial" to argument serial -unless null. Crashes with scsi-generic, because it doesn't have such -the property. - -Only usb_msd_initfn_storage() passes non-null serial. Reproducer: - - $ qemu-system-x86_64 -nodefaults -display none -S -usb \ - -drive if=none,file=/dev/sg1,id=usb-drv0 \ - -device usb-storage,id=usb-msd0,drive=usb-drv0,serial=123 - qemu-system-x86_64: -device usb-storage,id=usb-msd0,drive=usb-drv0,serial=123: Property '.serial' not found - Aborted (core dumped) - -Fix by handling exactly like "removable": set the property only when -it exists. - -Cc: qemu-stable@nongnu.org -Reviewed-by: Andreas Färber -Signed-off-by: Markus Armbruster -Signed-off-by: Paolo Bonzini -(cherry picked from commit c24e7517ee4a98e90eee5f0f07708a1fa12326b3) - -Signed-off-by: Michael Roth ---- - hw/scsi/scsi-bus.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c -index fbf9173..8fe4f4c 100644 ---- a/hw/scsi/scsi-bus.c -+++ b/hw/scsi/scsi-bus.c -@@ -224,7 +224,7 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockDriverState *bdrv, - if (object_property_find(OBJECT(dev), "removable", NULL)) { - qdev_prop_set_bit(dev, "removable", removable); - } -- if (serial) { -+ if (serial && object_property_find(OBJECT(dev), "serial", NULL)) { - qdev_prop_set_string(dev, "serial", serial); - } - if (qdev_prop_set_drive(dev, "drive", bdrv) < 0) { diff --git a/0107-virtio-pci-remove-vdev-field.patch b/0007-virtio-pci-remove-vdev-field.patch similarity index 100% rename from 0107-virtio-pci-remove-vdev-field.patch rename to 0007-virtio-pci-remove-vdev-field.patch diff --git a/0008-pc-fix-regression-for-64-bit-PCI-memory.patch b/0008-pc-fix-regression-for-64-bit-PCI-memory.patch deleted file mode 100644 index c2a1152..0000000 --- a/0008-pc-fix-regression-for-64-bit-PCI-memory.patch +++ /dev/null @@ -1,116 +0,0 @@ -From a73c74f63aa8f977ece88c97280a03ea9b1ca395 Mon Sep 17 00:00:00 2001 -From: "Michael S. Tsirkin" -Date: Tue, 27 Aug 2013 08:37:26 +0300 -Subject: [PATCH] pc: fix regression for 64 bit PCI memory - -commit 398489018183d613306ab022653552247d93919f - pc: limit 64 bit hole to 2G by default -introduced a way for management to control -the window allocated to the 64 bit PCI hole. - -This is useful, but existing management tools do not know how to set -this property. As a result, e.g. specifying a large ivshmem device with -size > 4G is broken by default. For example this configuration no -longer works: - --device ivshmem,size=4294967296,chardev=cfoo --chardev socket,path=/tmp/sock,id=cfoo,server,nowait - -Fix this by detecting that hole size was not specified -and defaulting to the backwards-compatible value of 1 << 62. - -Cc: qemu-stable@nongnu.org -Cc: Igor Mammedov -Signed-off-by: Michael S. Tsirkin -(cherry picked from commit 1466cef32dd5e7ef3c6477e96d85d92302ad02e3) - -Signed-off-by: Michael Roth ---- - hw/pci-host/piix.c | 9 ++++++--- - hw/pci-host/q35.c | 8 +++++--- - include/hw/i386/pc.h | 11 ++++++++++- - 3 files changed, 21 insertions(+), 7 deletions(-) - -diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c -index dc1718f..221d82b 100644 ---- a/hw/pci-host/piix.c -+++ b/hw/pci-host/piix.c -@@ -320,6 +320,7 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, - PCII440FXState *f; - unsigned i; - I440FXState *i440fx; -+ uint64_t pci_hole64_size; - - dev = qdev_create(NULL, TYPE_I440FX_PCI_HOST_BRIDGE); - s = PCI_HOST_BRIDGE(dev); -@@ -351,13 +352,15 @@ PCIBus *i440fx_init(PCII440FXState **pi440fx_state, - pci_hole_start, pci_hole_size); - memory_region_add_subregion(f->system_memory, pci_hole_start, &f->pci_hole); - -+ pci_hole64_size = pci_host_get_hole64_size(i440fx->pci_hole64_size); -+ - pc_init_pci64_hole(&i440fx->pci_info, 0x100000000ULL + above_4g_mem_size, -- i440fx->pci_hole64_size); -+ pci_hole64_size); - memory_region_init_alias(&f->pci_hole_64bit, OBJECT(d), "pci-hole64", - f->pci_address_space, - i440fx->pci_info.w64.begin, -- i440fx->pci_hole64_size); -- if (i440fx->pci_hole64_size) { -+ pci_hole64_size); -+ if (pci_hole64_size) { - memory_region_add_subregion(f->system_memory, - i440fx->pci_info.w64.begin, - &f->pci_hole_64bit); -diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c -index 12314d8..4febd24 100644 ---- a/hw/pci-host/q35.c -+++ b/hw/pci-host/q35.c -@@ -320,6 +320,7 @@ static int mch_init(PCIDevice *d) - { - int i; - MCHPCIState *mch = MCH_PCI_DEVICE(d); -+ uint64_t pci_hole64_size; - - /* setup pci memory regions */ - memory_region_init_alias(&mch->pci_hole, OBJECT(mch), "pci-hole", -@@ -329,13 +330,14 @@ static int mch_init(PCIDevice *d) - memory_region_add_subregion(mch->system_memory, mch->below_4g_mem_size, - &mch->pci_hole); - -+ pci_hole64_size = pci_host_get_hole64_size(mch->pci_hole64_size); - pc_init_pci64_hole(&mch->pci_info, 0x100000000ULL + mch->above_4g_mem_size, -- mch->pci_hole64_size); -+ pci_hole64_size); - memory_region_init_alias(&mch->pci_hole_64bit, OBJECT(mch), "pci-hole64", - mch->pci_address_space, - mch->pci_info.w64.begin, -- mch->pci_hole64_size); -- if (mch->pci_hole64_size) { -+ pci_hole64_size); -+ if (pci_hole64_size) { - memory_region_add_subregion(mch->system_memory, - mch->pci_info.w64.begin, - &mch->pci_hole_64bit); -diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h -index f79d478..475ba9e 100644 ---- a/include/hw/i386/pc.h -+++ b/include/hw/i386/pc.h -@@ -106,7 +106,16 @@ PcGuestInfo *pc_guest_info_init(ram_addr_t below_4g_mem_size, - #define PCI_HOST_PROP_PCI_HOLE64_START "pci-hole64-start" - #define PCI_HOST_PROP_PCI_HOLE64_END "pci-hole64-end" - #define PCI_HOST_PROP_PCI_HOLE64_SIZE "pci-hole64-size" --#define DEFAULT_PCI_HOLE64_SIZE (1ULL << 31) -+#define DEFAULT_PCI_HOLE64_SIZE (~0x0ULL) -+ -+static inline uint64_t pci_host_get_hole64_size(uint64_t pci_hole64_size) -+{ -+ if (pci_hole64_size == DEFAULT_PCI_HOLE64_SIZE) { -+ return 1ULL << 62; -+ } else { -+ return pci_hole64_size; -+ } -+} - - void pc_init_pci64_hole(PcPciInfo *pci_info, uint64_t pci_hole64_start, - uint64_t pci_hole64_size); diff --git a/0108-virtio-ccw-remove-vdev-field.patch b/0008-virtio-ccw-remove-vdev-field.patch similarity index 100% rename from 0108-virtio-ccw-remove-vdev-field.patch rename to 0008-virtio-ccw-remove-vdev-field.patch diff --git a/0009-pseries-Fix-stalls-on-hypervisor-virtual-console.patch b/0009-pseries-Fix-stalls-on-hypervisor-virtual-console.patch deleted file mode 100644 index 28878e7..0000000 --- a/0009-pseries-Fix-stalls-on-hypervisor-virtual-console.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 3fe494efc5eb107c4c90e96df3e6131f9960f4b9 Mon Sep 17 00:00:00 2001 -From: Anton Blanchard -Date: Tue, 13 Aug 2013 14:10:04 +1000 -Subject: [PATCH] pseries: Fix stalls on hypervisor virtual console - -A number of users are reporting stalls when using the pseries -hypervisor virtual console. - -A simple test case is to paste 15 or 17 characters at a time -into the console. Pasting 15 characters at a time works fine -but pasting 17 characters hangs for a random amount of time. -Other activity (network, qemu monitor etc) unblocks it. - -If qemu-char tries to send more than 16 characters at once, -vty_can_receive returns false. At this point we have to -wait for the guest to consume that output. Everything is good -so far. - -The problem occurs when the the guest does consume the output. -We need to signal back to the qemu-char layer that we are -ready for more input. Without this we block until something -else kicks us (eg network activity). - -Signed-off-by: Anton Blanchard -Signed-off-by: Alexander Graf -(cherry picked from commit 7770b6f78a2d655e03852a5de238f5926c92be6a) - -Signed-off-by: Michael Roth ---- - hw/char/spapr_vty.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c -index a799721..9c2aef8 100644 ---- a/hw/char/spapr_vty.c -+++ b/hw/char/spapr_vty.c -@@ -47,6 +47,8 @@ static int vty_getchars(VIOsPAPRDevice *sdev, uint8_t *buf, int max) - buf[n++] = dev->buf[dev->out++ % VTERM_BUFSIZE]; - } - -+ qemu_chr_accept_input(dev->chardev); -+ - return n; - } - diff --git a/0109-virtio-bus-cleanup-plug-unplug-interface.patch b/0009-virtio-bus-cleanup-plug-unplug-interface.patch similarity index 100% rename from 0109-virtio-bus-cleanup-plug-unplug-interface.patch rename to 0009-virtio-bus-cleanup-plug-unplug-interface.patch diff --git a/0110-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch b/0010-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch similarity index 100% rename from 0110-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch rename to 0010-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch diff --git a/0010-virtio-virtqueue_get_avail_bytes-fix-desc_pa-when-lo.patch b/0010-virtio-virtqueue_get_avail_bytes-fix-desc_pa-when-lo.patch deleted file mode 100644 index ed450ab..0000000 --- a/0010-virtio-virtqueue_get_avail_bytes-fix-desc_pa-when-lo.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 358bb0daa1ce332a18cc996fcd078a3989f77d36 Mon Sep 17 00:00:00 2001 -From: yinyin -Date: Thu, 22 Aug 2013 14:47:16 +0800 -Subject: [PATCH] virtio: virtqueue_get_avail_bytes: fix desc_pa when loop over - the indirect descriptor table - -virtqueue_get_avail_bytes: when found a indirect desc, we need loop over it. - /* loop over the indirect descriptor table */ - indirect = 1; - max = vring_desc_len(desc_pa, i) / sizeof(VRingDesc); - num_bufs = i = 0; - desc_pa = vring_desc_addr(desc_pa, i); -But, It init i to 0, then use i to update desc_pa. so we will always get: -desc_pa = vring_desc_addr(desc_pa, 0); -the last two line should swap. - -Cc: qemu-stable@nongnu.org -Signed-off-by: Yin Yin -Reviewed-by: Stefan Hajnoczi -Signed-off-by: Michael S. Tsirkin -(cherry picked from commit 1ae2757c6c4525c9b42f408c86818f843bad7418) - -Signed-off-by: Michael Roth ---- - hw/virtio/virtio.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c -index f03c45d..2f1e73b 100644 ---- a/hw/virtio/virtio.c -+++ b/hw/virtio/virtio.c -@@ -377,8 +377,8 @@ void virtqueue_get_avail_bytes(VirtQueue *vq, unsigned int *in_bytes, - /* loop over the indirect descriptor table */ - indirect = 1; - max = vring_desc_len(desc_pa, i) / sizeof(VRingDesc); -- num_bufs = i = 0; - desc_pa = vring_desc_addr(desc_pa, i); -+ num_bufs = i = 0; - } - - do { diff --git a/0111-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch b/0011-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch similarity index 100% rename from 0111-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch rename to 0011-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch diff --git a/0011-xhci-fix-endpoint-interval-calculation.patch b/0011-xhci-fix-endpoint-interval-calculation.patch deleted file mode 100644 index f408884..0000000 --- a/0011-xhci-fix-endpoint-interval-calculation.patch +++ /dev/null @@ -1,27 +0,0 @@ -From c0a5eb81b43e56569cfdb9c86fd78930b2765b96 Mon Sep 17 00:00:00 2001 -From: Gerd Hoffmann -Date: Wed, 28 Aug 2013 11:39:02 +0200 -Subject: [PATCH] xhci: fix endpoint interval calculation - -Cc: qemu-stable@nongnu.org -Signed-off-by: Gerd Hoffmann -(cherry picked from commit ca7162782a293f525633e5816470498dd86a51cf) - -Signed-off-by: Michael Roth ---- - hw/usb/hcd-xhci.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c -index 58c88b8..3c0ba8e 100644 ---- a/hw/usb/hcd-xhci.c -+++ b/hw/usb/hcd-xhci.c -@@ -1257,7 +1257,7 @@ static void xhci_init_epctx(XHCIEPContext *epctx, - epctx->ring.ccs = ctx[2] & 1; - } - -- epctx->interval = 1 << (ctx[0] >> 16) & 0xff; -+ epctx->interval = 1 << ((ctx[0] >> 16) & 0xff); - } - - static TRBCCode xhci_enable_ep(XHCIState *xhci, unsigned int slotid, diff --git a/0012-Revert-usb-hub-report-status-changes-only-once.patch b/0012-Revert-usb-hub-report-status-changes-only-once.patch deleted file mode 100644 index 04842a9..0000000 --- a/0012-Revert-usb-hub-report-status-changes-only-once.patch +++ /dev/null @@ -1,48 +0,0 @@ -From c09a4634d945df5d7e1fbc394646e78d7d713c67 Mon Sep 17 00:00:00 2001 -From: Gerd Hoffmann -Date: Tue, 27 Aug 2013 17:00:04 +0200 -Subject: [PATCH] Revert "usb-hub: report status changes only once" - -This reverts commit a309ee6e0a256f690760abfba44fceaa52a7c2f3. - -This isn't in line with the usb specification and adds regressions, -win7 fails to drive the usb hub for example. - -Was added because it "solved" the issue of hubs interacting badly -with the xhci host controller. Now with the root cause being fixed -in xhci (commit ) we can revert this one. - -Cc: qemu-stable@nongnu.org -Signed-off-by: Gerd Hoffmann -(cherry picked from commit bdebd6ee81f4d849aa8541c289203e3992450db0) - -Signed-off-by: Michael Roth ---- - hw/usb/dev-hub.c | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) - -diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c -index e865a98..4188a3c 100644 ---- a/hw/usb/dev-hub.c -+++ b/hw/usb/dev-hub.c -@@ -33,7 +33,6 @@ typedef struct USBHubPort { - USBPort port; - uint16_t wPortStatus; - uint16_t wPortChange; -- uint16_t wPortChange_reported; - } USBHubPort; - - typedef struct USBHubState { -@@ -468,11 +467,8 @@ static void usb_hub_handle_data(USBDevice *dev, USBPacket *p) - status = 0; - for(i = 0; i < NUM_PORTS; i++) { - port = &s->ports[i]; -- if (port->wPortChange && -- port->wPortChange_reported != port->wPortChange) { -+ if (port->wPortChange) - status |= (1 << (i + 1)); -- } -- port->wPortChange_reported = port->wPortChange; - } - if (status != 0) { - for(i = 0; i < n; i++) { diff --git a/0112-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch b/0012-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch similarity index 100% rename from 0112-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch rename to 0012-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch diff --git a/0013-block-expect-errors-from-bdrv_co_is_allocated.patch b/0013-block-expect-errors-from-bdrv_co_is_allocated.patch deleted file mode 100644 index 85d0820..0000000 --- a/0013-block-expect-errors-from-bdrv_co_is_allocated.patch +++ /dev/null @@ -1,149 +0,0 @@ -From da4e203efa76f2d2ee0a17670c241881963d033d Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Wed, 4 Sep 2013 19:00:25 +0200 -Subject: [PATCH] block: expect errors from bdrv_co_is_allocated - -Some bdrv_is_allocated callers do not expect errors, but the fallback -in qcow2.c might make other callers trip on assertion failures or -infinite loops. - -Fix the callers to always look for errors. - -Cc: qemu-stable@nongnu.org -Reviewed-by: Eric Blake -Signed-off-by: Paolo Bonzini -Signed-off-by: Stefan Hajnoczi -(cherry picked from commit d663640c04f2aab810915c556390211d75457704) - -Conflicts: - - block/cow.c - -*modified to avoid dependency on upstream's e641c1e8 - -Signed-off-by: Michael Roth ---- - block.c | 7 +++++-- - block/cow.c | 6 +++++- - block/qcow2.c | 4 +--- - block/stream.c | 2 +- - qemu-img.c | 16 ++++++++++++++-- - qemu-io-cmds.c | 4 ++++ - 6 files changed, 30 insertions(+), 9 deletions(-) - -diff --git a/block.c b/block.c -index d5ce8d3..8ce8b91 100644 ---- a/block.c -+++ b/block.c -@@ -1803,8 +1803,11 @@ int bdrv_commit(BlockDriverState *bs) - buf = g_malloc(COMMIT_BUF_SECTORS * BDRV_SECTOR_SIZE); - - for (sector = 0; sector < total_sectors; sector += n) { -- if (bdrv_is_allocated(bs, sector, COMMIT_BUF_SECTORS, &n)) { -- -+ ret = bdrv_is_allocated(bs, sector, COMMIT_BUF_SECTORS, &n); -+ if (ret < 0) { -+ goto ro_cleanup; -+ } -+ if (ret) { - if (bdrv_read(bs, sector, buf, n) != 0) { - ret = -EIO; - goto ro_cleanup; -diff --git a/block/cow.c b/block/cow.c -index 1cc2e89..e1b73d6 100644 ---- a/block/cow.c -+++ b/block/cow.c -@@ -189,7 +189,11 @@ static int coroutine_fn cow_read(BlockDriverState *bs, int64_t sector_num, - int ret, n; - - while (nb_sectors > 0) { -- if (bdrv_co_is_allocated(bs, sector_num, nb_sectors, &n)) { -+ ret = bdrv_co_is_allocated(bs, sector_num, nb_sectors, &n); -+ if (ret < 0) { -+ return ret; -+ } -+ if (ret) { - ret = bdrv_pread(bs->file, - s->cow_sectors_offset + sector_num * 512, - buf, n * 512); -diff --git a/block/qcow2.c b/block/qcow2.c -index 3376901..7f7282e 100644 ---- a/block/qcow2.c -+++ b/block/qcow2.c -@@ -648,13 +648,11 @@ static int coroutine_fn qcow2_co_is_allocated(BlockDriverState *bs, - int ret; - - *pnum = nb_sectors; -- /* FIXME We can get errors here, but the bdrv_co_is_allocated interface -- * can't pass them on today */ - qemu_co_mutex_lock(&s->lock); - ret = qcow2_get_cluster_offset(bs, sector_num << 9, pnum, &cluster_offset); - qemu_co_mutex_unlock(&s->lock); - if (ret < 0) { -- *pnum = 0; -+ return ret; - } - - return (cluster_offset != 0) || (ret == QCOW2_CLUSTER_ZERO); -diff --git a/block/stream.c b/block/stream.c -index 7fe9e48..4e8d177 100644 ---- a/block/stream.c -+++ b/block/stream.c -@@ -120,7 +120,7 @@ wait: - if (ret == 1) { - /* Allocated in the top, no need to copy. */ - copy = false; -- } else { -+ } else if (ret >= 0) { - /* Copy if allocated in the intermediate images. Limit to the - * known-unallocated area [sector_num, sector_num+n). */ - ret = bdrv_co_is_allocated_above(bs->backing_hd, base, -diff --git a/qemu-img.c b/qemu-img.c -index b9a848d..b01998b 100644 ---- a/qemu-img.c -+++ b/qemu-img.c -@@ -1485,8 +1485,15 @@ static int img_convert(int argc, char **argv) - are present in both the output's and input's base images (no - need to copy them). */ - if (out_baseimg) { -- if (!bdrv_is_allocated(bs[bs_i], sector_num - bs_offset, -- n, &n1)) { -+ ret = bdrv_is_allocated(bs[bs_i], sector_num - bs_offset, -+ n, &n1); -+ if (ret < 0) { -+ error_report("error while reading metadata for sector " -+ "%" PRId64 ": %s", -+ sector_num - bs_offset, strerror(-ret)); -+ goto out; -+ } -+ if (!ret) { - sector_num += n1; - continue; - } -@@ -2076,6 +2083,11 @@ static int img_rebase(int argc, char **argv) - - /* If the cluster is allocated, we don't need to take action */ - ret = bdrv_is_allocated(bs, sector, n, &n); -+ if (ret < 0) { -+ error_report("error while reading image metadata: %s", -+ strerror(-ret)); -+ goto out; -+ } - if (ret) { - continue; - } -diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c -index ffbcf31..ffe48ad 100644 ---- a/qemu-io-cmds.c -+++ b/qemu-io-cmds.c -@@ -1829,6 +1829,10 @@ static int alloc_f(BlockDriverState *bs, int argc, char **argv) - sector_num = offset >> 9; - while (remaining) { - ret = bdrv_is_allocated(bs, sector_num, remaining, &num); -+ if (ret < 0) { -+ printf("is_allocated failed: %s\n", strerror(-ret)); -+ return 0; -+ } - sector_num += num; - remaining -= num; - if (ret) { diff --git a/0113-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch b/0013-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch similarity index 100% rename from 0113-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch rename to 0013-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch diff --git a/0014-target-i386-fix-disassembly-with-PAE-1-PG-0.patch b/0014-target-i386-fix-disassembly-with-PAE-1-PG-0.patch deleted file mode 100644 index 1cbc2cd..0000000 --- a/0014-target-i386-fix-disassembly-with-PAE-1-PG-0.patch +++ /dev/null @@ -1,76 +0,0 @@ -From f9fd82ee939d6ee5bff126b125020021e18ce330 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Fri, 30 Aug 2013 11:58:45 +0200 -Subject: [PATCH] target-i386: fix disassembly with PAE=1, PG=0 - -CR4.PAE=1 will not enable paging if CR0.PG=0, but the "if" chain -in x86_cpu_get_phys_page_debug says otherwise. Check CR0.PG -before everything else. - -Fixes "-d in_asm" for a code section at the beginning of OVMF. - -Signed-off-by: Paolo Bonzini -Signed-off-by: Richard Henderson -Reviewed-by: Max Filippov -(cherry picked from commit f2f8560c7a5303065a2a3207ec475dfb3a622a0e) - -Signed-off-by: Michael Roth ---- - target-i386/helper.c | 34 ++++++++++++++++------------------ - 1 file changed, 16 insertions(+), 18 deletions(-) - -diff --git a/target-i386/helper.c b/target-i386/helper.c -index bf3e2ac..7f74e5d 100644 ---- a/target-i386/helper.c -+++ b/target-i386/helper.c -@@ -894,7 +894,10 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) - uint32_t page_offset; - int page_size; - -- if (env->cr[4] & CR4_PAE_MASK) { -+ if (!(env->cr[0] & CR0_PG_MASK)) { -+ pte = addr & env->a20_mask; -+ page_size = 4096; -+ } else if (env->cr[4] & CR4_PAE_MASK) { - target_ulong pdpe_addr; - uint64_t pde, pdpe; - -@@ -952,26 +955,21 @@ hwaddr x86_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) - } else { - uint32_t pde; - -- if (!(env->cr[0] & CR0_PG_MASK)) { -- pte = addr; -- page_size = 4096; -+ /* page directory entry */ -+ pde_addr = ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & env->a20_mask; -+ pde = ldl_phys(pde_addr); -+ if (!(pde & PG_PRESENT_MASK)) -+ return -1; -+ if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) { -+ pte = pde & ~0x003ff000; /* align to 4MB */ -+ page_size = 4096 * 1024; - } else { - /* page directory entry */ -- pde_addr = ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & env->a20_mask; -- pde = ldl_phys(pde_addr); -- if (!(pde & PG_PRESENT_MASK)) -+ pte_addr = ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & env->a20_mask; -+ pte = ldl_phys(pte_addr); -+ if (!(pte & PG_PRESENT_MASK)) - return -1; -- if ((pde & PG_PSE_MASK) && (env->cr[4] & CR4_PSE_MASK)) { -- pte = pde & ~0x003ff000; /* align to 4MB */ -- page_size = 4096 * 1024; -- } else { -- /* page directory entry */ -- pte_addr = ((pde & ~0xfff) + ((addr >> 10) & 0xffc)) & env->a20_mask; -- pte = ldl_phys(pte_addr); -- if (!(pte & PG_PRESENT_MASK)) -- return -1; -- page_size = 4096; -- } -+ page_size = 4096; - } - pte = pte & env->a20_mask; - } diff --git a/0114-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch b/0014-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch similarity index 100% rename from 0114-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch rename to 0014-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch diff --git a/0015-adlib-sort-offsets-in-portio-registration.patch b/0015-adlib-sort-offsets-in-portio-registration.patch deleted file mode 100644 index a7b6816..0000000 --- a/0015-adlib-sort-offsets-in-portio-registration.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 2ffbe03e8bc8f330581e31537190949a9aba80c3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= -Date: Wed, 14 Aug 2013 11:49:04 +0200 -Subject: [PATCH] adlib: sort offsets in portio registration -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This fixes the following assert when -device adlib is used: -ioport.c:240: portio_list_add: Assertion `pio->offset >= off_last' failed. - -Signed-off-by: Hervé Poussineau -Signed-off-by: Michael Tokarev -(cherry picked from commit 2b21fb57af305f17841d79e7e2e02ad1aec3f5ca) - -Signed-off-by: Michael Roth ---- - hw/audio/adlib.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/audio/adlib.c b/hw/audio/adlib.c -index 0421d47..db4a953 100644 ---- a/hw/audio/adlib.c -+++ b/hw/audio/adlib.c -@@ -284,9 +284,9 @@ static void Adlib_fini (AdlibState *s) - } - - static MemoryRegionPortio adlib_portio_list[] = { -- { 0x388, 4, 1, .read = adlib_read, .write = adlib_write, }, - { 0, 4, 1, .read = adlib_read, .write = adlib_write, }, - { 0, 2, 1, .read = adlib_read, .write = adlib_write, }, -+ { 0x388, 4, 1, .read = adlib_read, .write = adlib_write, }, - PORTIO_END_OF_LIST(), - }; - diff --git a/0115-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch b/0015-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch similarity index 100% rename from 0115-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch rename to 0015-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch diff --git a/0016-exec-fix-writing-to-MMIO-area-with-non-power-of-two-.patch b/0016-exec-fix-writing-to-MMIO-area-with-non-power-of-two-.patch deleted file mode 100644 index 4e60171..0000000 --- a/0016-exec-fix-writing-to-MMIO-area-with-non-power-of-two-.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 9fab8e1fe15014a4bd147eeedd2491bcfbba4e59 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Mon, 29 Jul 2013 14:27:39 +0200 -Subject: [PATCH] exec: fix writing to MMIO area with non-power-of-two length - -The problem is introduced by commit 2332616 (exec: Support 64-bit -operations in address_space_rw, 2013-07-08). Before that commit, -memory_access_size would only return 1/2/4. - -Since alignment is already handled above, reduce l to the largest -power of two that is smaller than l. - -Cc: qemu-stable@nongnu.org -Reported-by: Oleksii Shevchuk -Tested-by: Oleksii Shevchuk -Signed-off-by: Paolo Bonzini -(cherry picked from commit 098178f2749a63fbbb1a626dcc7d939d5cb2bde7) - -Signed-off-by: Michael Roth ---- - exec.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/exec.c b/exec.c -index 3ca9381..394f7e2 100644 ---- a/exec.c -+++ b/exec.c -@@ -1928,6 +1928,9 @@ static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr) - if (l > access_size_max) { - l = access_size_max; - } -+ if (l & (l - 1)) { -+ l = 1 << (qemu_fls(l) - 1); -+ } - - return l; - } diff --git a/0116-virtio-pci-add-device_unplugged-callback.patch b/0016-virtio-pci-add-device_unplugged-callback.patch similarity index 100% rename from 0116-virtio-pci-add-device_unplugged-callback.patch rename to 0016-virtio-pci-add-device_unplugged-callback.patch diff --git a/0017-virtio_pci-fix-level-interrupts-with-irqfd.patch b/0017-virtio_pci-fix-level-interrupts-with-irqfd.patch deleted file mode 100644 index 33e4853..0000000 --- a/0017-virtio_pci-fix-level-interrupts-with-irqfd.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 1cd7138d492304a76f3b8ae89fc61e05b18205a7 Mon Sep 17 00:00:00 2001 -From: "Michael S. Tsirkin" -Date: Sun, 1 Sep 2013 11:03:45 +0300 -Subject: [PATCH] virtio_pci: fix level interrupts with irqfd - -commit 62c96360ae7f2c7a8b029277fbb7cb082fdef7fd - virtio-pci: fix level interrupts -only helps systems without irqfd: on systems with irqfd support we -passed in flag requesting irqfd even when msix is disabled. - -As a result, for level interrupts we didn't install an fd handler so -unmasking an fd had no effect. - -Fix this up. - -Cc: qemu-stable@nongnu.org -Signed-off-by: Michael S. Tsirkin -(cherry picked from commit 23fe2b3f9e7df8da53ac1bc32c6875254911d7f4) - -Signed-off-by: Michael Roth ---- - hw/virtio/virtio-pci.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c -index d37037e..41b96ce 100644 ---- a/hw/virtio/virtio-pci.c -+++ b/hw/virtio/virtio-pci.c -@@ -799,8 +799,7 @@ static int virtio_pci_set_guest_notifiers(DeviceState *d, int nvqs, bool assign) - break; - } - -- r = virtio_pci_set_guest_notifier(d, n, assign, -- kvm_msi_via_irqfd_enabled()); -+ r = virtio_pci_set_guest_notifier(d, n, assign, with_irqfd); - if (r < 0) { - goto assign_error; - } diff --git a/0018-exec-always-use-MADV_DONTFORK.patch b/0018-exec-always-use-MADV_DONTFORK.patch deleted file mode 100644 index 95df5f7..0000000 --- a/0018-exec-always-use-MADV_DONTFORK.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 57ea2d21ae1863fd4002b2aea8ea8db8e206d464 Mon Sep 17 00:00:00 2001 -From: Andrea Arcangeli -Date: Thu, 25 Jul 2013 12:11:15 +0200 -Subject: [PATCH] exec: always use MADV_DONTFORK - -MADV_DONTFORK prevents fork to fail with -ENOMEM if the default -overcommit heuristics decides there's too much anonymous virtual -memory allocated. If the KVM secondary MMU is synchronized with MMU -notifiers or not, doesn't make a difference in that regard. - -Secondly it's always more efficient to avoid copying the guest -physical address space in the fork child (so we avoid to mark all the -guest memory readonly in the parent and so we skip the establishment -and teardown of lots of pagetables in the child). - -In the common case we can ignore the error if MADV_DONTFORK is not -available. Leave a second invocation that errors out in the KVM path -if MMU notifiers are missing and KVM is enabled, to abort in such -case. - -Signed-off-by: Andrea Arcangeli -Tested-By: Benoit Canet -Acked-by: Paolo Bonzini -Signed-off-by: Gleb Natapov -(cherry picked from commit 3e469dbfe413c25d48321c3a19ddfae0727dc6e5) - -Signed-off-by: Michael Roth ---- - exec.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/exec.c b/exec.c -index 394f7e2..2ea8f04 100644 ---- a/exec.c -+++ b/exec.c -@@ -1172,6 +1172,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host, - - qemu_ram_setup_dump(new_block->host, size); - qemu_madvise(new_block->host, size, QEMU_MADV_HUGEPAGE); -+ qemu_madvise(new_block->host, size, QEMU_MADV_DONTFORK); - - if (kvm_enabled()) - kvm_setup_guest_memory(new_block->host, size); diff --git a/0019-xhci-reset-port-when-disabling-slot.patch b/0019-xhci-reset-port-when-disabling-slot.patch deleted file mode 100644 index a269bda..0000000 --- a/0019-xhci-reset-port-when-disabling-slot.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 9dbfbb89b204e098f283aca310e4d6f6651d88f4 Mon Sep 17 00:00:00 2001 -From: Gerd Hoffmann -Date: Wed, 28 Aug 2013 11:47:09 +0200 -Subject: [PATCH] xhci: reset port when disabling slot - -Cc: qemu-stable@nongnu.org -Signed-off-by: Gerd Hoffmann -(cherry picked from commit 5c67dd7b4884979a2613a4702ac1ab68b0e6a16e) - -Signed-off-by: Michael Roth ---- - hw/usb/hcd-xhci.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c -index 3c0ba8e..a6f55a1 100644 ---- a/hw/usb/hcd-xhci.c -+++ b/hw/usb/hcd-xhci.c -@@ -2076,6 +2076,7 @@ static TRBCCode xhci_disable_slot(XHCIState *xhci, unsigned int slotid) - - xhci->slots[slotid-1].enabled = 0; - xhci->slots[slotid-1].addressed = 0; -+ xhci->slots[slotid-1].uport = NULL; - return CC_SUCCESS; - } - diff --git a/0020-usb-parallelize-usb3-streams.patch b/0020-usb-parallelize-usb3-streams.patch deleted file mode 100644 index b1b63f4..0000000 --- a/0020-usb-parallelize-usb3-streams.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 96b14d0db19b2b80ab3dc35d522671da82101e72 Mon Sep 17 00:00:00 2001 -From: Gerd Hoffmann -Date: Tue, 27 Aug 2013 15:25:24 +0200 -Subject: [PATCH] usb: parallelize usb3 streams - -usb3 bulk endpoints with streams are implicitly pipelined now, -so the requests will actually be processed in parallel. Also -allow them to complete out-of-order. - -Fixes stalls in the uas driver. - -Cc: qemu-stable@nongnu.org -Signed-off-by: Gerd Hoffmann -(cherry picked from commit c96c41ed0d38d68a6c8b6f84751afebafeae31be) - -Signed-off-by: Michael Roth ---- - hw/usb/core.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/hw/usb/core.c b/hw/usb/core.c -index 05948ca..31960c2 100644 ---- a/hw/usb/core.c -+++ b/hw/usb/core.c -@@ -403,7 +403,7 @@ void usb_handle_packet(USBDevice *dev, USBPacket *p) - p->ep->halted = false; - } - -- if (QTAILQ_EMPTY(&p->ep->queue) || p->ep->pipeline) { -+ if (QTAILQ_EMPTY(&p->ep->queue) || p->ep->pipeline || p->stream) { - usb_process_one(p); - if (p->status == USB_RET_ASYNC) { - /* hcd drivers cannot handle async for isoc */ -@@ -420,7 +420,8 @@ void usb_handle_packet(USBDevice *dev, USBPacket *p) - * When pipelining is enabled usb-devices must always return async, - * otherwise packets can complete out of order! - */ -- assert(!p->ep->pipeline || QTAILQ_EMPTY(&p->ep->queue)); -+ assert(p->stream || !p->ep->pipeline || -+ QTAILQ_EMPTY(&p->ep->queue)); - if (p->status != USB_RET_NAK) { - usb_packet_set_state(p, USB_PACKET_COMPLETE); - } -@@ -434,7 +435,7 @@ void usb_packet_complete_one(USBDevice *dev, USBPacket *p) - { - USBEndpoint *ep = p->ep; - -- assert(QTAILQ_FIRST(&ep->queue) == p); -+ assert(p->stream || QTAILQ_FIRST(&ep->queue) == p); - assert(p->status != USB_RET_ASYNC && p->status != USB_RET_NAK); - - if (p->status != USB_RET_SUCCESS || diff --git a/0021-w32-Fix-access-to-host-devices-regression.patch b/0021-w32-Fix-access-to-host-devices-regression.patch deleted file mode 100644 index 9a0efb8..0000000 --- a/0021-w32-Fix-access-to-host-devices-regression.patch +++ /dev/null @@ -1,86 +0,0 @@ -From e8601a4e3102321d054ce3d641c03ebcd0519357 Mon Sep 17 00:00:00 2001 -From: Stefan Weil -Date: Sun, 1 Sep 2013 22:59:25 +0200 -Subject: [PATCH] w32: Fix access to host devices (regression) - -QEMU failed to open host devices like \\.\PhysicalDrive0 (first hard disk) -since some time (commit 8a79380b8ef1b02d2abd705dd026a18863b09020?). - -Those devices use hdev_open which did not use the latest API for options. -This resulted in a fatal runtime error: - - Block protocol 'host_device' doesn't support the option 'filename' - -Duplicate code from raw_open to fix this. - -Cc: qemu-stable@nongnu.org -Reported-by: David Brenner -Signed-off-by: Stefan Weil -Reviewed-by: Kevin Wolf -Signed-off-by: Stefan Hajnoczi -(cherry picked from commit 68dc036488dfea170627a55e6ee3dfd7f2c2063e) - -Signed-off-by: Michael Roth ---- - block/raw-win32.c | 36 +++++++++++++++++++++++++++++------- - 1 file changed, 29 insertions(+), 7 deletions(-) - -diff --git a/block/raw-win32.c b/block/raw-win32.c -index 9b5b2af..d2d2d9f 100644 ---- a/block/raw-win32.c -+++ b/block/raw-win32.c -@@ -535,13 +535,29 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags) - { - BDRVRawState *s = bs->opaque; - int access_flags, create_flags; -+ int ret = 0; - DWORD overlapped; - char device_name[64]; -- const char *filename = qdict_get_str(options, "filename"); -+ -+ Error *local_err = NULL; -+ const char *filename; -+ -+ QemuOpts *opts = qemu_opts_create_nofail(&raw_runtime_opts); -+ qemu_opts_absorb_qdict(opts, options, &local_err); -+ if (error_is_set(&local_err)) { -+ qerror_report_err(local_err); -+ error_free(local_err); -+ ret = -EINVAL; -+ goto done; -+ } -+ -+ filename = qemu_opt_get(opts, "filename"); - - if (strstart(filename, "/dev/cdrom", NULL)) { -- if (find_cdrom(device_name, sizeof(device_name)) < 0) -- return -ENOENT; -+ if (find_cdrom(device_name, sizeof(device_name)) < 0) { -+ ret = -ENOENT; -+ goto done; -+ } - filename = device_name; - } else { - /* transform drive letters into device name */ -@@ -564,11 +580,17 @@ static int hdev_open(BlockDriverState *bs, QDict *options, int flags) - if (s->hfile == INVALID_HANDLE_VALUE) { - int err = GetLastError(); - -- if (err == ERROR_ACCESS_DENIED) -- return -EACCES; -- return -1; -+ if (err == ERROR_ACCESS_DENIED) { -+ ret = -EACCES; -+ } else { -+ ret = -1; -+ } -+ goto done; - } -- return 0; -+ -+done: -+ qemu_opts_del(opts); -+ return ret; - } - - static BlockDriver bdrv_host_device = { diff --git a/0022-memory-Provide-separate-handling-of-unassigned-io-po.patch b/0022-memory-Provide-separate-handling-of-unassigned-io-po.patch deleted file mode 100644 index ff5c789..0000000 --- a/0022-memory-Provide-separate-handling-of-unassigned-io-po.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 7ab1044eb1ac2cbc7e65769edf44ced92b85b038 Mon Sep 17 00:00:00 2001 -From: Jan Kiszka -Date: Mon, 2 Sep 2013 18:43:30 +0200 -Subject: [PATCH] memory: Provide separate handling of unassigned io ports - accesses - -Accesses to unassigned io ports shall return -1 on read and be ignored -on write. Ensure these properties via dedicated ops, decoupling us from -the memory core's handling of unassigned accesses. - -Cc: qemu-stable@nongnu.org -Signed-off-by: Jan Kiszka -Signed-off-by: Paolo Bonzini -(cherry picked from commit 3bb28b7208b349e7a1b326e3c6ef9efac1d462bf) - -Signed-off-by: Michael Roth ---- - exec.c | 3 ++- - include/exec/ioport.h | 4 ++++ - ioport.c | 16 ++++++++++++++++ - 3 files changed, 22 insertions(+), 1 deletion(-) - -diff --git a/exec.c b/exec.c -index 2ea8f04..08eecb3 100644 ---- a/exec.c -+++ b/exec.c -@@ -1821,7 +1821,8 @@ static void memory_map_init(void) - address_space_init(&address_space_memory, system_memory, "memory"); - - system_io = g_malloc(sizeof(*system_io)); -- memory_region_init(system_io, NULL, "io", 65536); -+ memory_region_init_io(system_io, NULL, &unassigned_io_ops, NULL, "io", -+ 65536); - address_space_init(&address_space_io, system_io, "I/O"); - - memory_listener_register(&core_memory_listener, &address_space_memory); -diff --git a/include/exec/ioport.h b/include/exec/ioport.h -index bdd4e96..b3848be 100644 ---- a/include/exec/ioport.h -+++ b/include/exec/ioport.h -@@ -45,6 +45,10 @@ typedef struct MemoryRegionPortio { - - #define PORTIO_END_OF_LIST() { } - -+#ifndef CONFIG_USER_ONLY -+extern const MemoryRegionOps unassigned_io_ops; -+#endif -+ - void cpu_outb(pio_addr_t addr, uint8_t val); - void cpu_outw(pio_addr_t addr, uint16_t val); - void cpu_outl(pio_addr_t addr, uint32_t val); -diff --git a/ioport.c b/ioport.c -index 79b7f1a..707cce8 100644 ---- a/ioport.c -+++ b/ioport.c -@@ -44,6 +44,22 @@ typedef struct MemoryRegionPortioList { - MemoryRegionPortio ports[]; - } MemoryRegionPortioList; - -+static uint64_t unassigned_io_read(void *opaque, hwaddr addr, unsigned size) -+{ -+ return -1ULL; -+} -+ -+static void unassigned_io_write(void *opaque, hwaddr addr, uint64_t val, -+ unsigned size) -+{ -+} -+ -+const MemoryRegionOps unassigned_io_ops = { -+ .read = unassigned_io_read, -+ .write = unassigned_io_write, -+ .endianness = DEVICE_NATIVE_ENDIAN, -+}; -+ - void cpu_outb(pio_addr_t addr, uint8_t val) - { - LOG_IOPORT("outb: %04"FMT_pioaddr" %02"PRIx8"\n", addr, val); diff --git a/0023-Revert-memory-Return-1-again-on-reads-from-unsigned-.patch b/0023-Revert-memory-Return-1-again-on-reads-from-unsigned-.patch deleted file mode 100644 index 3086e82..0000000 --- a/0023-Revert-memory-Return-1-again-on-reads-from-unsigned-.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 2a93d3dd32386c3522cfa2ee60c9e06a298d1f52 Mon Sep 17 00:00:00 2001 -From: Jan Kiszka -Date: Mon, 2 Sep 2013 18:43:31 +0200 -Subject: [PATCH] Revert "memory: Return -1 again on reads from unsigned - regions" - -This reverts commit 9b8c69243585a32d14b9bb9fcd52c37b0b5a1b71. - -The commit was wrong: We only return -1 on invalid accesses, not on -valid but unbacked ones. This broke various corner cases. - -Cc: qemu-stable@nongnu.org -Signed-off-by: Jan Kiszka -Signed-off-by: Paolo Bonzini -(cherry picked from commit 68a7439a150d6b4da99082ab454b9328b151bc25) - -Signed-off-by: Michael Roth ---- - memory.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/memory.c b/memory.c -index 886f838..5a10fd0 100644 ---- a/memory.c -+++ b/memory.c -@@ -872,7 +872,7 @@ static uint64_t unassigned_mem_read(void *opaque, hwaddr addr, - if (current_cpu != NULL) { - cpu_unassigned_access(current_cpu, addr, false, false, 0, size); - } -- return -1ULL; -+ return 0; - } - - static void unassigned_mem_write(void *opaque, hwaddr addr, diff --git a/0024-exec-check-offset_within_address_space-for-register-.patch b/0024-exec-check-offset_within_address_space-for-register-.patch deleted file mode 100644 index 590c09b..0000000 --- a/0024-exec-check-offset_within_address_space-for-register-.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 1110014801d368388bca2ed7c28aa695560c4991 Mon Sep 17 00:00:00 2001 -From: Hu Tao -Date: Thu, 29 Aug 2013 18:21:16 +0800 -Subject: [PATCH] exec: check offset_within_address_space for register subpage -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If offset_within_address_space falls in a page, then we register a -subpage. So check offset_within_address_space rather than -offset_within_region. - -Cc: qemu-stable@nongnu.org -Cc: Paolo Bonzini -Cc: Richard Henderson -Cc: "Andreas Färber" -Cc: Peter Maydell -Cc: Blue Swirl -Signed-off-by: Hu Tao -Signed-off-by: Paolo Bonzini -(cherry picked from commit 88266249701032211c1d7449460d063fbc01bf12) - -Signed-off-by: Michael Roth ---- - exec.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/exec.c b/exec.c -index 08eecb3..f6674e5 100644 ---- a/exec.c -+++ b/exec.c -@@ -869,7 +869,7 @@ static void mem_add(MemoryListener *listener, MemoryRegionSection *section) - now = remain; - if (int128_lt(remain.size, page_size)) { - register_subpage(d, &now); -- } else if (remain.offset_within_region & ~TARGET_PAGE_MASK) { -+ } else if (remain.offset_within_address_space & ~TARGET_PAGE_MASK) { - now.size = page_size; - register_subpage(d, &now); - } else { diff --git a/0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch b/0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch deleted file mode 100644 index b96e6e5..0000000 --- a/0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch +++ /dev/null @@ -1,35 +0,0 @@ -From a1991d05d37ac9054d772b32d8fac70bc31be81a Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Mon, 2 Sep 2013 13:10:34 +0200 -Subject: [PATCH] ne2000: mark I/O as LITTLE_ENDIAN - -Now that the memory subsystem is propagating the endianness correctly, -the ne2000 device should have its I/O ports marked as LITTLE_ENDIAN, as -PCI devices are little endian. - -This makes the ne2000 NIC to work again on PowerPC. - -Cc: qemu-stable@nongnu.org -Cc: Stefan Hajnoczi -Signed-off-by: Aurelien Jarno -Signed-off-by: Stefan Hajnoczi -(cherry picked from commit 45d883dcf208160e2db308d1b368beb74f37dc7e) - -Signed-off-by: Michael Roth ---- - hw/net/ne2000.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c -index 31afd28..c961258 100644 ---- a/hw/net/ne2000.c -+++ b/hw/net/ne2000.c -@@ -693,7 +693,7 @@ static void ne2000_write(void *opaque, hwaddr addr, - static const MemoryRegionOps ne2000_ops = { - .read = ne2000_read, - .write = ne2000_write, -- .endianness = DEVICE_NATIVE_ENDIAN, -+ .endianness = DEVICE_LITTLE_ENDIAN, - }; - - /***********************************************************/ diff --git a/0026-ehci-save-device-pointer-in-EHCIState.patch b/0026-ehci-save-device-pointer-in-EHCIState.patch deleted file mode 100644 index 81eae5c..0000000 --- a/0026-ehci-save-device-pointer-in-EHCIState.patch +++ /dev/null @@ -1,67 +0,0 @@ -From b6d163fdd8131285a01fe46e6afdba727e4df9ca Mon Sep 17 00:00:00 2001 -From: Gerd Hoffmann -Date: Mon, 9 Sep 2013 10:18:17 +0200 -Subject: [PATCH] ehci: save device pointer in EHCIState - -We'll need a pointer to the actual pci/sysbus device, -stick a pointer to it into the EHCIState struct. - -https://bugzilla.redhat.com/show_bug.cgi?id=1005495 - -Signed-off-by: Gerd Hoffmann -(cherry picked from commit adbecc89731cf3e0ae656d50ea9fa58c589c4bdc) - -Signed-off-by: Michael Roth ---- - hw/usb/hcd-ehci.c | 7 +++---- - hw/usb/hcd-ehci.h | 1 + - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c -index 010a0d0..e9fb20c 100644 ---- a/hw/usb/hcd-ehci.c -+++ b/hw/usb/hcd-ehci.c -@@ -1241,13 +1241,11 @@ static int ehci_init_transfer(EHCIPacket *p) - { - uint32_t cpage, offset, bytes, plen; - dma_addr_t page; -- USBBus *bus = &p->queue->ehci->bus; -- BusState *qbus = BUS(bus); - - cpage = get_field(p->qtd.token, QTD_TOKEN_CPAGE); - bytes = get_field(p->qtd.token, QTD_TOKEN_TBYTES); - offset = p->qtd.bufptr[0] & ~QTD_BUFPTR_MASK; -- qemu_sglist_init(&p->sgl, qbus->parent, 5, p->queue->ehci->as); -+ qemu_sglist_init(&p->sgl, p->queue->ehci->device, 5, p->queue->ehci->as); - - while (bytes > 0) { - if (cpage > 4) { -@@ -1486,7 +1484,7 @@ static int ehci_process_itd(EHCIState *ehci, - return -1; - } - -- qemu_sglist_init(&ehci->isgl, DEVICE(ehci), 2, ehci->as); -+ qemu_sglist_init(&ehci->isgl, ehci->device, 2, ehci->as); - if (off + len > 4096) { - /* transfer crosses page border */ - uint32_t len2 = off + len - 4096; -@@ -2529,6 +2527,7 @@ void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp) - - s->frame_timer = qemu_new_timer_ns(vm_clock, ehci_frame_timer, s); - s->async_bh = qemu_bh_new(ehci_frame_timer, s); -+ s->device = dev; - - qemu_register_reset(ehci_reset, s); - qemu_add_vm_change_state_handler(usb_ehci_vm_state_change, s); -diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h -index 15a28e8..065c9fa 100644 ---- a/hw/usb/hcd-ehci.h -+++ b/hw/usb/hcd-ehci.h -@@ -255,6 +255,7 @@ typedef QTAILQ_HEAD(EHCIQueueHead, EHCIQueue) EHCIQueueHead; - - struct EHCIState { - USBBus bus; -+ DeviceState *device; - qemu_irq irq; - MemoryRegion mem; - AddressSpace *as; diff --git a/0027-qxl-fix-local-renderer.patch b/0027-qxl-fix-local-renderer.patch deleted file mode 100644 index fb9eeaf..0000000 --- a/0027-qxl-fix-local-renderer.patch +++ /dev/null @@ -1,67 +0,0 @@ -From dc0973b5883df7d822b285119691ade8c84dda9c Mon Sep 17 00:00:00 2001 -From: Gerd Hoffmann -Date: Thu, 5 Sep 2013 21:57:19 +0200 -Subject: [PATCH] qxl: fix local renderer - -The local spice renderer assumes the primary surface is located at the -start of the "ram" bar. This used to be a requirement in qxl hardware -revision 1. In revision 2+ this is relaxed. Nevertheless guest drivers -continued to use the traditional location, for historical and backward -compatibility reasons. The qxl kms driver doesn't though as it depends -on qxl revision 4+ anyway. - -Result is that local rendering is hosed for recent linux guests, you'll -get pixel garbage with non-spice ui (gtk, sdl, vnc) and when doing -screendumps. Fix that by doing a proper mapping of the guest-specified -memory location. - -https://bugzilla.redhat.com/show_bug.cgi?id=948717 - -Signed-off-by: Gerd Hoffmann -(cherry picked from commit c58c7b959b93b864a27fd6b3646ee1465ab8832b) - -Signed-off-by: Michael Roth ---- - hw/display/qxl-render.c | 15 ++++++++++----- - 1 file changed, 10 insertions(+), 5 deletions(-) - -diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c -index 269b1a7..d34b0c4 100644 ---- a/hw/display/qxl-render.c -+++ b/hw/display/qxl-render.c -@@ -31,10 +31,6 @@ static void qxl_blit(PCIQXLDevice *qxl, QXLRect *rect) - if (is_buffer_shared(surface)) { - return; - } -- if (!qxl->guest_primary.data) { -- trace_qxl_render_blit_guest_primary_initialized(); -- qxl->guest_primary.data = memory_region_get_ram_ptr(&qxl->vga.vram); -- } - trace_qxl_render_blit(qxl->guest_primary.qxl_stride, - rect->left, rect->right, rect->top, rect->bottom); - src = qxl->guest_primary.data; -@@ -104,7 +100,12 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) - - if (qxl->guest_primary.resized) { - qxl->guest_primary.resized = 0; -- qxl->guest_primary.data = memory_region_get_ram_ptr(&qxl->vga.vram); -+ qxl->guest_primary.data = qxl_phys2virt(qxl, -+ qxl->guest_primary.surface.mem, -+ MEMSLOT_GROUP_GUEST); -+ if (!qxl->guest_primary.data) { -+ return; -+ } - qxl_set_rect_to_surface(qxl, &qxl->dirty[0]); - qxl->num_dirty_rects = 1; - trace_qxl_render_guest_primary_resized( -@@ -128,6 +129,10 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) - } - dpy_gfx_replace_surface(vga->con, surface); - } -+ -+ if (!qxl->guest_primary.data) { -+ return; -+ } - for (i = 0; i < qxl->num_dirty_rects; i++) { - if (qemu_spice_rect_is_empty(qxl->dirty+i)) { - break; diff --git a/0028-pc-Initializing-ram_memory-under-Xen.patch b/0028-pc-Initializing-ram_memory-under-Xen.patch deleted file mode 100644 index 4d8c0b7..0000000 --- a/0028-pc-Initializing-ram_memory-under-Xen.patch +++ /dev/null @@ -1,107 +0,0 @@ -From 755ec4ca0f92188458ad7ca549a75161cbdcf6ff Mon Sep 17 00:00:00 2001 -From: Anthony PERARD -Date: Mon, 9 Sep 2013 16:15:52 +0000 -Subject: [PATCH] pc: Initializing ram_memory under Xen. - -Signed-off-by: Anthony PERARD -Signed-off-by: Stefano Stabellini -Acked-by: Michael S. Tsirkin -CC: qemu-stable@nongnu.org -(cherry picked from commit 04d7bad8a4fb23e6d9af9d06ce3ddc28a251d94d) - -Signed-off-by: Michael Roth ---- - hw/i386/pc_piix.c | 2 +- - include/hw/xen/xen.h | 4 +--- - xen-all.c | 7 ++++--- - xen-stub.c | 2 +- - 4 files changed, 7 insertions(+), 8 deletions(-) - -diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c -index 6e1e654..3df2ff9 100644 ---- a/hw/i386/pc_piix.c -+++ b/hw/i386/pc_piix.c -@@ -93,7 +93,7 @@ static void pc_init1(MemoryRegion *system_memory, - FWCfgState *fw_cfg = NULL; - PcGuestInfo *guest_info; - -- if (xen_enabled() && xen_hvm_init() != 0) { -+ if (xen_enabled() && xen_hvm_init(&ram_memory) != 0) { - fprintf(stderr, "xen hardware virtual machine initialisation failed\n"); - exit(1); - } -diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h -index 6d42dd1..e1f88bf 100644 ---- a/include/hw/xen/xen.h -+++ b/include/hw/xen/xen.h -@@ -37,17 +37,15 @@ void xen_cmos_set_s3_resume(void *opaque, int irq, int level); - qemu_irq *xen_interrupt_controller_init(void); - - int xen_init(void); --int xen_hvm_init(void); -+int xen_hvm_init(MemoryRegion **ram_memory); - void xenstore_store_pv_console_info(int i, struct CharDriverState *chr); - - #if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY) --struct MemoryRegion; - void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, - struct MemoryRegion *mr); - void xen_modified_memory(ram_addr_t start, ram_addr_t length); - #endif - --struct MemoryRegion; - void xen_register_framebuffer(struct MemoryRegion *mr); - - #if defined(CONFIG_XEN) && CONFIG_XEN_CTRL_INTERFACE_VERSION < 400 -diff --git a/xen-all.c b/xen-all.c -index 21246e0..e1d0694 100644 ---- a/xen-all.c -+++ b/xen-all.c -@@ -154,7 +154,7 @@ qemu_irq *xen_interrupt_controller_init(void) - - /* Memory Ops */ - --static void xen_ram_init(ram_addr_t ram_size) -+static void xen_ram_init(ram_addr_t ram_size, MemoryRegion **ram_memory_p) - { - MemoryRegion *sysmem = get_system_memory(); - ram_addr_t below_4g_mem_size, above_4g_mem_size = 0; -@@ -168,6 +168,7 @@ static void xen_ram_init(ram_addr_t ram_size) - block_len += HVM_BELOW_4G_MMIO_LENGTH; - } - memory_region_init_ram(&ram_memory, NULL, "xen.ram", block_len); -+ *ram_memory_p = &ram_memory; - vmstate_register_ram_global(&ram_memory); - - if (ram_size >= HVM_BELOW_4G_RAM_END) { -@@ -1059,7 +1060,7 @@ static void xen_read_physmap(XenIOState *state) - free(entries); - } - --int xen_hvm_init(void) -+int xen_hvm_init(MemoryRegion **ram_memory) - { - int i, rc; - unsigned long ioreq_pfn; -@@ -1134,7 +1135,7 @@ int xen_hvm_init(void) - - /* Init RAM management */ - xen_map_cache_init(xen_phys_offset_to_gaddr, state); -- xen_ram_init(ram_size); -+ xen_ram_init(ram_size, ram_memory); - - qemu_add_vm_change_state_handler(xen_hvm_change_state_handler, state); - -diff --git a/xen-stub.c b/xen-stub.c -index 47c8e73..ad189a6 100644 ---- a/xen-stub.c -+++ b/xen-stub.c -@@ -64,7 +64,7 @@ void xen_modified_memory(ram_addr_t start, ram_addr_t length) - { - } - --int xen_hvm_init(void) -+int xen_hvm_init(MemoryRegion **ram_memory) - { - return 0; - } diff --git a/0029-pc_q35-Initialize-Xen.patch b/0029-pc_q35-Initialize-Xen.patch deleted file mode 100644 index 23eb4e4..0000000 --- a/0029-pc_q35-Initialize-Xen.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 41900b0857df9bd33e465a6c72d7a3072dc448f4 Mon Sep 17 00:00:00 2001 -From: Anthony PERARD -Date: Mon, 9 Sep 2013 16:15:53 +0000 -Subject: [PATCH] pc_q35: Initialize Xen. - -Signed-off-by: Anthony PERARD -Signed-off-by: Stefano Stabellini -Acked-by: Michael S. Tsirkin -(cherry picked from commit 254c12825f93f405658ca3366cd34f8a8ad23511) - -Signed-off-by: Michael Roth ---- - hw/i386/pc_q35.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c -index 10e770e..dd13130 100644 ---- a/hw/i386/pc_q35.c -+++ b/hw/i386/pc_q35.c -@@ -81,6 +81,11 @@ static void pc_q35_init(QEMUMachineInitArgs *args) - DeviceState *icc_bridge; - PcGuestInfo *guest_info; - -+ if (xen_enabled() && xen_hvm_init(&ram_memory) != 0) { -+ fprintf(stderr, "xen hardware virtual machine initialisation failed\n"); -+ exit(1); -+ } -+ - icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE); - object_property_add_child(qdev_get_machine(), "icc-bridge", - OBJECT(icc_bridge), NULL); diff --git a/0030-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch b/0030-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch deleted file mode 100644 index 17578b2..0000000 --- a/0030-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 8b4b3a71fd35d67c5c30652a120c0a59dfab7182 Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Sat, 31 Aug 2013 18:36:17 -0400 -Subject: [PATCH] qapi-types.py: Fix enum struct sizes on i686 - -Unlike other list types, enum wasn't adding any padding, which caused -a mismatch between the generated struct size and GenericList struct -size. More details in a678e26cbe89f7a27cbce794c2c2784571ee9d21 - -This crashed qemu if calling qmp query-tpm-types for example, which -upsets libvirt capabilities probing. Reproducer on i686: - -(sleep 5; printf '{"execute":"qmp_capabilities"}\n{"execute":"query-tpm-types"}\n') | ./i386-softmmu/qemu-system-i386 -S -nodefaults -nographic -M none -qmp stdio - -https://bugs.launchpad.net/qemu/+bug/1219207 - -Cc: qemu-stable@nongnu.org -Signed-off-by: Cole Robinson -Reviewed-by: Eric Blake -Tested-by: Richard W.M. Jones -Signed-off-by: Luiz Capitulino -(cherry picked from commit 02dc4bf5684d3fb46786fab2ecff98214b1df9fe) - -Signed-off-by: Michael Roth ---- - scripts/qapi-types.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py -index 5ee46ea..5d31b06 100644 ---- a/scripts/qapi-types.py -+++ b/scripts/qapi-types.py -@@ -51,7 +51,10 @@ def generate_fwd_enum_struct(name, members): - return mcgen(''' - typedef struct %(name)sList - { -- %(name)s value; -+ union { -+ %(name)s value; -+ uint64_t padding; -+ }; - struct %(name)sList *next; - } %(name)sList; - ''', diff --git a/0031-pcnet-pci-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch b/0031-pcnet-pci-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch deleted file mode 100644 index 4e57504..0000000 --- a/0031-pcnet-pci-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 76f698948781a148d336ff9032159f6c7c9eccd2 Mon Sep 17 00:00:00 2001 -From: Aurelien Jarno -Date: Wed, 28 Aug 2013 14:17:39 +0200 -Subject: [PATCH] pcnet-pci: mark I/O and MMIO as LITTLE_ENDIAN - -Now that the memory subsystem is propagating the endianness correctly, -the pcnet-pci device should have its I/O ports and MMIO memory marked -as LITTLE_ENDIAN, as PCI devices are little endian. - -This makes the pcnet-pci NIC to work again on big endian MIPS Malta -(default NIC). - -Cc: qemu-stable@nongnu.org -Signed-off-by: Aurelien Jarno -Reviewed-by: Stefan Hajnoczi -Signed-off-by: Stefan Hajnoczi -(cherry picked from commit a26405b350c0d31d5ef53f3b459aeb6eaaf50db0) - -Signed-off-by: Michael Roth ---- - hw/net/pcnet-pci.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c -index 2c2301c..23fc33c 100644 ---- a/hw/net/pcnet-pci.c -+++ b/hw/net/pcnet-pci.c -@@ -134,7 +134,7 @@ static void pcnet_ioport_write(void *opaque, hwaddr addr, - static const MemoryRegionOps pcnet_io_ops = { - .read = pcnet_ioport_read, - .write = pcnet_ioport_write, -- .endianness = DEVICE_NATIVE_ENDIAN, -+ .endianness = DEVICE_LITTLE_ENDIAN, - }; - - static void pcnet_mmio_writeb(void *opaque, hwaddr addr, uint32_t val) -@@ -256,7 +256,7 @@ static const MemoryRegionOps pcnet_mmio_ops = { - .read = { pcnet_mmio_readb, pcnet_mmio_readw, pcnet_mmio_readl }, - .write = { pcnet_mmio_writeb, pcnet_mmio_writew, pcnet_mmio_writel }, - }, -- .endianness = DEVICE_NATIVE_ENDIAN, -+ .endianness = DEVICE_LITTLE_ENDIAN, - }; - - static void pci_physical_memory_write(void *dma_opaque, hwaddr addr, diff --git a/0032-chardev-fix-pty_chr_timer.patch b/0032-chardev-fix-pty_chr_timer.patch deleted file mode 100644 index d318063..0000000 --- a/0032-chardev-fix-pty_chr_timer.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 4b5b4721464495fe76fe6e2e033cbb61dce78eef Mon Sep 17 00:00:00 2001 -From: Gerd Hoffmann -Date: Thu, 22 Aug 2013 11:43:58 +0200 -Subject: [PATCH] chardev: fix pty_chr_timer - -pty_chr_timer first calls pty_chr_update_read_handler(), then clears -timer_tag (because it is a one-shot timer). This is the wrong order -though. pty_chr_update_read_handler might re-arm time timer, and the -new timer_tag gets overwitten in that case. - -This leads to crashes when unplugging a pty chardev: pty_chr_close -thinks no timer is running -> timer isn't canceled -> pty_chr_timer gets -called with stale CharDevState -> BOOM. - -This patch fixes the ordering. -Kill the pointless goto while being at it. - -https://bugzilla.redhat.com/show_bug.cgi?id=994414 - -Cc: qemu-stable@nongnu.org -Signed-off-by: Gerd Hoffmann -(cherry picked from commit b0d768c35e08d2057b63e8e77e7a513c447199fa) - -Signed-off-by: Michael Roth ---- - qemu-char.c | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) - -diff --git a/qemu-char.c b/qemu-char.c -index 1be1cf6..1621fbd 100644 ---- a/qemu-char.c -+++ b/qemu-char.c -@@ -1026,15 +1026,11 @@ static gboolean pty_chr_timer(gpointer opaque) - struct CharDriverState *chr = opaque; - PtyCharDriver *s = chr->opaque; - -- if (s->connected) { -- goto out; -- } -- -- /* Next poll ... */ -- pty_chr_update_read_handler(chr); -- --out: - s->timer_tag = 0; -+ if (!s->connected) { -+ /* Next poll ... */ -+ pty_chr_update_read_handler(chr); -+ } - return FALSE; - } - diff --git a/0033-kvmvapic-Catch-invalid-ROM-size.patch b/0033-kvmvapic-Catch-invalid-ROM-size.patch deleted file mode 100644 index 88f4018..0000000 --- a/0033-kvmvapic-Catch-invalid-ROM-size.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 50b31e80525d03ef406a8c9f55ff2ae1655a3b66 Mon Sep 17 00:00:00 2001 -From: Jan Kiszka -Date: Tue, 3 Sep 2013 18:08:50 +0200 -Subject: [PATCH] kvmvapic: Catch invalid ROM size - -If not caught early, a zero-length ROM will cause a NULL-pointer access -later on in patch_hypercalls when allocating a zero-length ROM copy and -trying to read from it. - -CC: qemu-stable@nongnu.org -Signed-off-by: Jan Kiszka -Signed-off-by: Paolo Bonzini -(cherry picked from commit 18e5eec4db96a00907eb588a2b803401637c7f67) - -Signed-off-by: Michael Roth ---- - hw/i386/kvmvapic.c | 11 +++++++++-- - 1 file changed, 9 insertions(+), 2 deletions(-) - -diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c -index 15beb80..7ac0fe1 100644 ---- a/hw/i386/kvmvapic.c -+++ b/hw/i386/kvmvapic.c -@@ -578,7 +578,7 @@ static int patch_hypercalls(VAPICROMState *s) - * enable write access to the option ROM so that variables can be updated by - * the guest. - */ --static void vapic_map_rom_writable(VAPICROMState *s) -+static int vapic_map_rom_writable(VAPICROMState *s) - { - hwaddr rom_paddr = s->rom_state_paddr & ROM_BLOCK_MASK; - MemoryRegionSection section; -@@ -599,6 +599,9 @@ static void vapic_map_rom_writable(VAPICROMState *s) - /* read ROM size from RAM region */ - ram = memory_region_get_ram_ptr(section.mr); - rom_size = ram[rom_paddr + 2] * ROM_BLOCK_SIZE; -+ if (rom_size == 0) { -+ return -1; -+ } - s->rom_size = rom_size; - - /* We need to round to avoid creating subpages -@@ -612,11 +615,15 @@ static void vapic_map_rom_writable(VAPICROMState *s) - memory_region_add_subregion_overlap(as, rom_paddr, &s->rom, 1000); - s->rom_mapped_writable = true; - memory_region_unref(section.mr); -+ -+ return 0; - } - - static int vapic_prepare(VAPICROMState *s) - { -- vapic_map_rom_writable(s); -+ if (vapic_map_rom_writable(s) < 0) { -+ return -1; -+ } - - if (patch_hypercalls(s) < 0) { - return -1; diff --git a/0034-kvmvapic-Enter-inactive-state-on-hardware-reset.patch b/0034-kvmvapic-Enter-inactive-state-on-hardware-reset.patch deleted file mode 100644 index 0ebb354..0000000 --- a/0034-kvmvapic-Enter-inactive-state-on-hardware-reset.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 7ea8a3c12aa49efc8f503a019dd764f8a0add2cb Mon Sep 17 00:00:00 2001 -From: Jan Kiszka -Date: Tue, 3 Sep 2013 18:08:51 +0200 -Subject: [PATCH] kvmvapic: Enter inactive state on hardware reset - -ROM layout may change after reset of devices are hotplugged, so we have -to pick up the physical address again when the ROM is initialized. This -is best achieved by resetting the state to INACTIVE. - -CC: qemu-stable@nongnu.org -Signed-off-by: Jan Kiszka -Signed-off-by: Paolo Bonzini -(cherry picked from commit c056bc3f3464cfae1c94b7dd633d3ec13b13b655) - -Signed-off-by: Michael Roth ---- - hw/i386/kvmvapic.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c -index 7ac0fe1..f2e335d 100644 ---- a/hw/i386/kvmvapic.c -+++ b/hw/i386/kvmvapic.c -@@ -510,9 +510,7 @@ static void vapic_reset(DeviceState *dev) - { - VAPICROMState *s = VAPIC(dev); - -- if (s->state == VAPIC_ACTIVE) { -- s->state = VAPIC_STANDBY; -- } -+ s->state = VAPIC_INACTIVE; - vapic_enable_tpr_reporting(false); - } - diff --git a/0035-kvmvapic-Clear-also-physical-ROM-address-when-enteri.patch b/0035-kvmvapic-Clear-also-physical-ROM-address-when-enteri.patch deleted file mode 100644 index a0d029f..0000000 --- a/0035-kvmvapic-Clear-also-physical-ROM-address-when-enteri.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 5d2de77798cacf1dadf6a4211972473e057cc6e5 Mon Sep 17 00:00:00 2001 -From: Jan Kiszka -Date: Tue, 3 Sep 2013 18:08:52 +0200 -Subject: [PATCH] kvmvapic: Clear also physical ROM address when entering - INACTIVE state - -To avoid misinterpreting INACTIVE after migration as old qemu-kvm's -STANDBY, also clear rom_state_paddr when going back to this state. - -CC: qemu-stable@nongnu.org -Signed-off-by: Jan Kiszka -Signed-off-by: Paolo Bonzini -(cherry picked from commit 4357930b8a7d2fcff2d8121ec518117428a781e7) - -Signed-off-by: Michael Roth ---- - hw/i386/kvmvapic.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c -index f2e335d..cf6c714 100644 ---- a/hw/i386/kvmvapic.c -+++ b/hw/i386/kvmvapic.c -@@ -511,6 +511,7 @@ static void vapic_reset(DeviceState *dev) - VAPICROMState *s = VAPIC(dev); - - s->state = VAPIC_INACTIVE; -+ s->rom_state_paddr = 0; - vapic_enable_tpr_reporting(false); - } - -@@ -664,6 +665,7 @@ static void vapic_write(void *opaque, hwaddr addr, uint64_t data, - } - if (vapic_prepare(s) < 0) { - s->state = VAPIC_INACTIVE; -+ s->rom_state_paddr = 0; - break; - } - break; diff --git a/0036-tci-Fix-qemu-alpha-on-32-bit-hosts-wrong-assertions.patch b/0036-tci-Fix-qemu-alpha-on-32-bit-hosts-wrong-assertions.patch deleted file mode 100644 index f458952..0000000 --- a/0036-tci-Fix-qemu-alpha-on-32-bit-hosts-wrong-assertions.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 5c20c1ffe791ca29840fd9607ea034ea24ad7bdd Mon Sep 17 00:00:00 2001 -From: Stefan Weil -Date: Thu, 12 Sep 2013 20:17:50 +0200 -Subject: [PATCH] tci: Fix qemu-alpha on 32 bit hosts (wrong assertions) - -Debian busybox-static for alpha has a load address of 0x0000000120000000 -which is mapped to 0x0000000020000000 for 32 bit hosts. - -qemu-alpha uses the TCG opcodes qemu_ld32, qemu_ld64, qemu_st32 and -qemu_st64 which all raise the assertion (taddr == host_addr). - -Remove all assertions of this type because they are either wrong or -unnecessary (when sizeof(tcg_target_ulong) >= sizeof(target_ulong)). - -Cc: qemu-stable -Signed-off-by: Stefan Weil -Reviewed-by: Richard Henderson -Signed-off-by: Michael Tokarev -(cherry picked from commit 07ac4dc5db22a31e47b149abdbc5ea99013cf4de) - -Signed-off-by: Michael Roth ---- - tci.c | 12 ------------ - 1 file changed, 12 deletions(-) - -diff --git a/tci.c b/tci.c -index c742c8d..af58576 100644 ---- a/tci.c -+++ b/tci.c -@@ -1085,7 +1085,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - tmp8 = helper_ldb_mmu(env, taddr, tci_read_i(&tb_ptr)); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - tmp8 = *(uint8_t *)(host_addr + GUEST_BASE); - #endif - tci_write_reg8(t0, tmp8); -@@ -1097,7 +1096,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - tmp8 = helper_ldb_mmu(env, taddr, tci_read_i(&tb_ptr)); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - tmp8 = *(uint8_t *)(host_addr + GUEST_BASE); - #endif - tci_write_reg8s(t0, tmp8); -@@ -1109,7 +1107,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - tmp16 = helper_ldw_mmu(env, taddr, tci_read_i(&tb_ptr)); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - tmp16 = tswap16(*(uint16_t *)(host_addr + GUEST_BASE)); - #endif - tci_write_reg16(t0, tmp16); -@@ -1121,7 +1118,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - tmp16 = helper_ldw_mmu(env, taddr, tci_read_i(&tb_ptr)); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - tmp16 = tswap16(*(uint16_t *)(host_addr + GUEST_BASE)); - #endif - tci_write_reg16s(t0, tmp16); -@@ -1134,7 +1130,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - tmp32 = helper_ldl_mmu(env, taddr, tci_read_i(&tb_ptr)); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - tmp32 = tswap32(*(uint32_t *)(host_addr + GUEST_BASE)); - #endif - tci_write_reg32(t0, tmp32); -@@ -1146,7 +1141,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - tmp32 = helper_ldl_mmu(env, taddr, tci_read_i(&tb_ptr)); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - tmp32 = tswap32(*(uint32_t *)(host_addr + GUEST_BASE)); - #endif - tci_write_reg32s(t0, tmp32); -@@ -1159,7 +1153,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - tmp32 = helper_ldl_mmu(env, taddr, tci_read_i(&tb_ptr)); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - tmp32 = tswap32(*(uint32_t *)(host_addr + GUEST_BASE)); - #endif - tci_write_reg32(t0, tmp32); -@@ -1174,7 +1167,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - tmp64 = helper_ldq_mmu(env, taddr, tci_read_i(&tb_ptr)); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - tmp64 = tswap64(*(uint64_t *)(host_addr + GUEST_BASE)); - #endif - tci_write_reg(t0, tmp64); -@@ -1190,7 +1182,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - helper_stb_mmu(env, taddr, t0, t2); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - *(uint8_t *)(host_addr + GUEST_BASE) = t0; - #endif - break; -@@ -1202,7 +1193,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - helper_stw_mmu(env, taddr, t0, t2); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - *(uint16_t *)(host_addr + GUEST_BASE) = tswap16(t0); - #endif - break; -@@ -1214,7 +1204,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - helper_stl_mmu(env, taddr, t0, t2); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - *(uint32_t *)(host_addr + GUEST_BASE) = tswap32(t0); - #endif - break; -@@ -1226,7 +1215,6 @@ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr) - helper_stq_mmu(env, taddr, tmp64, t2); - #else - host_addr = (tcg_target_ulong)taddr; -- assert(taddr == host_addr); - *(uint64_t *)(host_addr + GUEST_BASE) = tswap64(tmp64); - #endif - break; diff --git a/0037-blockdev-do-not-default-cache.no-flush-to-true.patch b/0037-blockdev-do-not-default-cache.no-flush-to-true.patch deleted file mode 100644 index c7fb6c9..0000000 --- a/0037-blockdev-do-not-default-cache.no-flush-to-true.patch +++ /dev/null @@ -1,33 +0,0 @@ -From aeab582580fa057dbe646fc3277570af6a8d5ce8 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Thu, 19 Sep 2013 18:48:53 +0200 -Subject: [PATCH] blockdev: do not default cache.no-flush to true - -That's why all my VMs were so fast lately. :) - -This changed in 1.6.0 by mistake in patch 29c4e2b (blockdev: Split up -'cache' option, 2013-07-18). - -Cc: qemu-stable@nongnu.org -Signed-off-by: Paolo Bonzini -Signed-off-by: Stefan Hajnoczi -(cherry picked from commit 1df6fa4bc6754a170cf511a78e2e6fef84eb5228) - -Signed-off-by: Michael Roth ---- - blockdev.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/blockdev.c b/blockdev.c -index bc7016a..097932c 100644 ---- a/blockdev.c -+++ b/blockdev.c -@@ -460,7 +460,7 @@ static DriveInfo *blockdev_init(QemuOpts *all_opts, - if (qemu_opt_get_bool(opts, "cache.direct", false)) { - bdrv_flags |= BDRV_O_NOCACHE; - } -- if (qemu_opt_get_bool(opts, "cache.no-flush", true)) { -+ if (qemu_opt_get_bool(opts, "cache.no-flush", false)) { - bdrv_flags |= BDRV_O_NO_FLUSH; - } - diff --git a/0038-virtio-blk-do-not-relay-a-previous-driver-s-WCE-conf.patch b/0038-virtio-blk-do-not-relay-a-previous-driver-s-WCE-conf.patch deleted file mode 100644 index 8e85b74..0000000 --- a/0038-virtio-blk-do-not-relay-a-previous-driver-s-WCE-conf.patch +++ /dev/null @@ -1,111 +0,0 @@ -From c8adc0db7e76e804692372a06ca02cc5a80b67d5 Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Fri, 20 Sep 2013 17:31:55 +0200 -Subject: [PATCH] virtio-blk: do not relay a previous driver's WCE - configuration to the current - -The following sequence happens: -- the SeaBIOS virtio-blk driver does not support the WCE feature, which -causes QEMU to disable writeback caching - -- the Linux virtio-blk driver resets the device, finds WCE is available -but writeback caching is disabled; tells block layer to not send cache -flush commands - -- the Linux virtio-blk driver sets the DRIVER_OK bit, which causes -writeback caching to be re-enabled, but the Linux virtio-blk driver does -not know of this side effect and cache flushes remain disabled - -The bug is at the third step. If the guest does know about CONFIG_WCE, -QEMU should ignore the WCE feature's state. The guest will control the -cache mode solely using configuration space. This change makes Linux -do flushes correctly, but Linux will keep SeaBIOS's writethrough mode. - -Hence, whenever the guest is reset, the cache mode of the disk should -be reset to whatever was specified in the "-drive" option. With this -change, the Linux virtio-blk driver finds that writeback caching is -enabled, and tells the block layer to send cache flush commands -appropriately. - -Reported-by: Rusty Russell -Signed-off-by: Stefan Hajnoczi -(cherry picked from commit ef5bc96268ceec64769617dc53b0ac3a20ff351c) - -Signed-off-by: Michael Roth ---- - hw/block/virtio-blk.c | 24 ++++++++++++++++++++++-- - include/hw/virtio/virtio-blk.h | 1 + - 2 files changed, 23 insertions(+), 2 deletions(-) - -diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c -index e2f55cc..49a23c3 100644 ---- a/hw/block/virtio-blk.c -+++ b/hw/block/virtio-blk.c -@@ -460,9 +460,9 @@ static void virtio_blk_dma_restart_cb(void *opaque, int running, - - static void virtio_blk_reset(VirtIODevice *vdev) - { --#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE - VirtIOBlock *s = VIRTIO_BLK(vdev); - -+#ifdef CONFIG_VIRTIO_BLK_DATA_PLANE - if (s->dataplane) { - virtio_blk_data_plane_stop(s->dataplane); - } -@@ -473,6 +473,7 @@ static void virtio_blk_reset(VirtIODevice *vdev) - * are per-device request lists. - */ - bdrv_drain_all(); -+ bdrv_set_enable_write_cache(s->bs, s->original_wce); - } - - /* coalesce internal state, copy to pci i/o region 0 -@@ -564,7 +565,25 @@ static void virtio_blk_set_status(VirtIODevice *vdev, uint8_t status) - } - - features = vdev->guest_features; -- bdrv_set_enable_write_cache(s->bs, !!(features & (1 << VIRTIO_BLK_F_WCE))); -+ -+ /* A guest that supports VIRTIO_BLK_F_CONFIG_WCE must be able to send -+ * cache flushes. Thus, the "auto writethrough" behavior is never -+ * necessary for guests that support the VIRTIO_BLK_F_CONFIG_WCE feature. -+ * Leaving it enabled would break the following sequence: -+ * -+ * Guest started with "-drive cache=writethrough" -+ * Guest sets status to 0 -+ * Guest sets DRIVER bit in status field -+ * Guest reads host features (WCE=0, CONFIG_WCE=1) -+ * Guest writes guest features (WCE=0, CONFIG_WCE=1) -+ * Guest writes 1 to the WCE configuration field (writeback mode) -+ * Guest sets DRIVER_OK bit in status field -+ * -+ * s->bs would erroneously be placed in writethrough mode. -+ */ -+ if (!(features & (1 << VIRTIO_BLK_F_CONFIG_WCE))) { -+ bdrv_set_enable_write_cache(s->bs, !!(features & (1 << VIRTIO_BLK_F_WCE))); -+ } - } - - static void virtio_blk_save(QEMUFile *f, void *opaque) -@@ -674,6 +693,7 @@ static int virtio_blk_device_init(VirtIODevice *vdev) - } - - blkconf_serial(&blk->conf, &blk->serial); -+ s->original_wce = bdrv_enable_write_cache(blk->conf.bs); - if (blkconf_geometry(&blk->conf, NULL, 65535, 255, 255) < 0) { - return -1; - } -diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h -index b87cf49..41885da 100644 ---- a/include/hw/virtio/virtio-blk.h -+++ b/include/hw/virtio/virtio-blk.h -@@ -123,6 +123,7 @@ typedef struct VirtIOBlock { - BlockConf *conf; - VirtIOBlkConf blk; - unsigned short sector_mask; -+ bool original_wce; - VMChangeStateEntry *change; - #ifdef CONFIG_VIRTIO_BLK_DATA_PLANE - Notifier migration_state_notifier; diff --git a/0039-xhci-emulate-intr-endpoint-intervals-correctly.patch b/0039-xhci-emulate-intr-endpoint-intervals-correctly.patch deleted file mode 100644 index 9474f47..0000000 --- a/0039-xhci-emulate-intr-endpoint-intervals-correctly.patch +++ /dev/null @@ -1,131 +0,0 @@ -From dc6fbaa8322ca53f46d9a6cc7e2f82de5362ea83 Mon Sep 17 00:00:00 2001 -From: Gerd Hoffmann -Date: Wed, 28 Aug 2013 11:38:44 +0200 -Subject: [PATCH] xhci: emulate intr endpoint intervals correctly - -Respect the interval for interrupt endpoints, so we don't finish -transfers as fast as possible but at the rate configured by the guest. - -Fixes guest deadlocks triggered by interrupt storms. - -Cc: -Signed-off-by: Gerd Hoffmann -(cherry picked from commit 4d7a81c06f5f17e019a2d3a18300500bd64f6f40) - -Signed-off-by: Michael Roth ---- - hw/usb/hcd-xhci.c | 44 +++++++++++++++++++++++++++++++++++++------- - 1 file changed, 37 insertions(+), 7 deletions(-) - -diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c -index a6f55a1..8010a6d 100644 ---- a/hw/usb/hcd-xhci.c -+++ b/hw/usb/hcd-xhci.c -@@ -355,6 +355,7 @@ typedef struct XHCITransfer { - unsigned int streamid; - bool in_xfer; - bool iso_xfer; -+ bool timed_xfer; - - unsigned int trb_count; - unsigned int trb_alloced; -@@ -1803,6 +1804,7 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer) - - xfer->in_xfer = bmRequestType & USB_DIR_IN; - xfer->iso_xfer = false; -+ xfer->timed_xfer = false; - - if (xhci_setup_packet(xfer) < 0) { - return -1; -@@ -1818,6 +1820,17 @@ static int xhci_fire_ctl_transfer(XHCIState *xhci, XHCITransfer *xfer) - return 0; - } - -+static void xhci_calc_intr_kick(XHCIState *xhci, XHCITransfer *xfer, -+ XHCIEPContext *epctx, uint64_t mfindex) -+{ -+ uint64_t asap = ((mfindex + epctx->interval - 1) & -+ ~(epctx->interval-1)); -+ uint64_t kick = epctx->mfindex_last + epctx->interval; -+ -+ assert(epctx->interval != 0); -+ xfer->mfindex_kick = MAX(asap, kick); -+} -+ - static void xhci_calc_iso_kick(XHCIState *xhci, XHCITransfer *xfer, - XHCIEPContext *epctx, uint64_t mfindex) - { -@@ -1840,8 +1853,8 @@ static void xhci_calc_iso_kick(XHCIState *xhci, XHCITransfer *xfer, - } - } - --static void xhci_check_iso_kick(XHCIState *xhci, XHCITransfer *xfer, -- XHCIEPContext *epctx, uint64_t mfindex) -+static void xhci_check_intr_iso_kick(XHCIState *xhci, XHCITransfer *xfer, -+ XHCIEPContext *epctx, uint64_t mfindex) - { - if (xfer->mfindex_kick > mfindex) { - qemu_mod_timer(epctx->kick_timer, qemu_get_clock_ns(vm_clock) + -@@ -1866,18 +1879,30 @@ static int xhci_submit(XHCIState *xhci, XHCITransfer *xfer, XHCIEPContext *epctx - switch(epctx->type) { - case ET_INTR_OUT: - case ET_INTR_IN: -+ xfer->pkts = 0; -+ xfer->iso_xfer = false; -+ xfer->timed_xfer = true; -+ mfindex = xhci_mfindex_get(xhci); -+ xhci_calc_intr_kick(xhci, xfer, epctx, mfindex); -+ xhci_check_intr_iso_kick(xhci, xfer, epctx, mfindex); -+ if (xfer->running_retry) { -+ return -1; -+ } -+ break; - case ET_BULK_OUT: - case ET_BULK_IN: - xfer->pkts = 0; - xfer->iso_xfer = false; -+ xfer->timed_xfer = false; - break; - case ET_ISO_OUT: - case ET_ISO_IN: - xfer->pkts = 1; - xfer->iso_xfer = true; -+ xfer->timed_xfer = true; - mfindex = xhci_mfindex_get(xhci); - xhci_calc_iso_kick(xhci, xfer, epctx, mfindex); -- xhci_check_iso_kick(xhci, xfer, epctx, mfindex); -+ xhci_check_intr_iso_kick(xhci, xfer, epctx, mfindex); - if (xfer->running_retry) { - return -1; - } -@@ -1938,13 +1963,18 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, - - trace_usb_xhci_xfer_retry(xfer); - assert(xfer->running_retry); -- if (xfer->iso_xfer) { -- /* retry delayed iso transfer */ -+ if (xfer->timed_xfer) { -+ /* time to kick the transfer? */ - mfindex = xhci_mfindex_get(xhci); -- xhci_check_iso_kick(xhci, xfer, epctx, mfindex); -+ xhci_check_intr_iso_kick(xhci, xfer, epctx, mfindex); - if (xfer->running_retry) { - return; - } -+ xfer->timed_xfer = 0; -+ xfer->running_retry = 1; -+ } -+ if (xfer->iso_xfer) { -+ /* retry iso transfer */ - if (xhci_setup_packet(xfer) < 0) { - return; - } -@@ -2030,7 +2060,7 @@ static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid, - epctx->next_xfer = (epctx->next_xfer + 1) % TD_QUEUE; - ep = xfer->packet.ep; - } else { -- if (!xfer->iso_xfer) { -+ if (!xfer->timed_xfer) { - fprintf(stderr, "xhci: error firing data transfer\n"); - } - } diff --git a/0040-iov-avoid-orig_len-may-be-used-unitialized-warning.patch b/0040-iov-avoid-orig_len-may-be-used-unitialized-warning.patch deleted file mode 100644 index c8f386c..0000000 --- a/0040-iov-avoid-orig_len-may-be-used-unitialized-warning.patch +++ /dev/null @@ -1,37 +0,0 @@ -From b314120afdbab3d29885f47fc83bc55f43765968 Mon Sep 17 00:00:00 2001 -From: Michael Tokarev -Date: Sat, 14 Sep 2013 13:11:36 +0400 -Subject: [PATCH] iov: avoid "orig_len may be used unitialized" warning - -Signed-off-by: Wenchao Xia -Reviewed-by: Stefan Hajnoczi -Signed-off-by: Michael Tokarev -(cherry picked from commit 2be178a475289286db80de5ddd7830e67e112bdd) - -Signed-off-by: Michael Roth ---- - util/iov.c | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - -diff --git a/util/iov.c b/util/iov.c -index f705586..bb46c04 100644 ---- a/util/iov.c -+++ b/util/iov.c -@@ -181,13 +181,11 @@ ssize_t iov_send_recv(int sockfd, struct iovec *iov, unsigned iov_cnt, - assert(iov[niov].iov_len > tail); - orig_len = iov[niov].iov_len; - iov[niov++].iov_len = tail; -- } -- -- ret = do_send_recv(sockfd, iov, niov, do_send); -- -- /* Undo the changes above before checking for errors */ -- if (tail) { -+ ret = do_send_recv(sockfd, iov, niov, do_send); -+ /* Undo the changes above before checking for errors */ - iov[niov-1].iov_len = orig_len; -+ } else { -+ ret = do_send_recv(sockfd, iov, niov, do_send); - } - if (offset) { - iov[0].iov_base -= offset; diff --git a/0041-tap-Use-numbered-tap-tun-devices-on-all-BSD-OS-s.patch b/0041-tap-Use-numbered-tap-tun-devices-on-all-BSD-OS-s.patch deleted file mode 100644 index 67f0fe3..0000000 --- a/0041-tap-Use-numbered-tap-tun-devices-on-all-BSD-OS-s.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 6bbb9d8100c90deb4843bfa3cf36e75b843c495b Mon Sep 17 00:00:00 2001 -From: Brad Smith -Date: Sat, 3 Aug 2013 22:20:41 -0400 -Subject: [PATCH] tap: Use numbered tap/tun devices on all *BSD OS's - -The following patch simplifies the *BSD tap/tun code and makes use of numbered -tap/tun interfaces on all *BSD OS's. NetBSD has a patch in their pkgsrc tree -to make use of this feature and DragonFly also supports this as well. - -Signed-off-by: Brad Smith -Signed-off-by: Stefan Hajnoczi -(cherry picked from commit aa4f082f7526d39dac8e2ca64d192d858014ee10) - -Signed-off-by: Michael Roth ---- - net/tap-bsd.c | 11 ----------- - 1 file changed, 11 deletions(-) - -diff --git a/net/tap-bsd.c b/net/tap-bsd.c -index f61d580..90f8a02 100644 ---- a/net/tap-bsd.c -+++ b/net/tap-bsd.c -@@ -44,8 +44,6 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, - struct stat s; - #endif - --#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \ -- defined(__OpenBSD__) || defined(__APPLE__) - /* if no ifname is given, always start the search from tap0/tun0. */ - int i; - char dname[100]; -@@ -76,15 +74,6 @@ int tap_open(char *ifname, int ifname_size, int *vnet_hdr, - dname, strerror(errno)); - return -1; - } --#else -- TFR(fd = open("/dev/tap", O_RDWR)); -- if (fd < 0) { -- fprintf(stderr, -- "warning: could not open /dev/tap: no virtual network emulation: %s\n", -- strerror(errno)); -- return -1; -- } --#endif - - #ifdef TAPGIFNAME - if (ioctl(fd, TAPGIFNAME, (void *)&ifr) < 0) { diff --git a/0042-rbd-avoid-qemu_rbd_snap_list-memory-leaks.patch b/0042-rbd-avoid-qemu_rbd_snap_list-memory-leaks.patch deleted file mode 100644 index ebbe492..0000000 --- a/0042-rbd-avoid-qemu_rbd_snap_list-memory-leaks.patch +++ /dev/null @@ -1,43 +0,0 @@ -From fc06b430942e84a2a69e2a80a6d5b376a8064020 Mon Sep 17 00:00:00 2001 -From: Stefan Hajnoczi -Date: Wed, 25 Sep 2013 16:00:48 +0200 -Subject: [PATCH] rbd: avoid qemu_rbd_snap_list() memory leaks - -When there are no snapshots qemu_rbd_snap_list() returns 0 and the -snapshot table pointer is NULL. Don't forget to free the snaps buffer -we allocated for librbd rbd_snap_list(). - -When the function succeeds don't forget to free the snaps buffer after -calling rbd_snap_list_end(). - -Cc: qemu-stable@nongnu.org -Signed-off-by: Stefan Hajnoczi -Signed-off-by: Kevin Wolf -(cherry picked from commit 9e6337d0818650362149b734d53edf9489f3acaa) - -Signed-off-by: Michael Roth ---- - block/rbd.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/block/rbd.c b/block/rbd.c -index cb71751..7e7c735 100644 ---- a/block/rbd.c -+++ b/block/rbd.c -@@ -934,7 +934,7 @@ static int qemu_rbd_snap_list(BlockDriverState *bs, - do { - snaps = g_malloc(sizeof(*snaps) * max_snaps); - snap_count = rbd_snap_list(s->image, snaps, &max_snaps); -- if (snap_count < 0) { -+ if (snap_count <= 0) { - g_free(snaps); - } - } while (snap_count == -ERANGE); -@@ -958,6 +958,7 @@ static int qemu_rbd_snap_list(BlockDriverState *bs, - sn_info->vm_clock_nsec = 0; - } - rbd_snap_list_end(snaps); -+ g_free(snaps); - - done: - *psn_tab = sn_tab; diff --git a/0043-vmdk-fix-cluster-size-check-for-flat-extents.patch b/0043-vmdk-fix-cluster-size-check-for-flat-extents.patch deleted file mode 100644 index b8bac4c..0000000 --- a/0043-vmdk-fix-cluster-size-check-for-flat-extents.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 61fbeb6e81f648d25c2d3ba5f0d663d54abed1c1 Mon Sep 17 00:00:00 2001 -From: Fam Zheng -Date: Mon, 23 Sep 2013 17:18:29 +0800 -Subject: [PATCH] vmdk: fix cluster size check for flat extents - -We use the extent size as cluster size for flat extents (where no L1/L2 -table is allocated so it's safe) reuse sector calculating code with -sparse extents. - -Don't pass in the cluster size for adding flat extent, just set it to -sectors later, then the cluster size checking will not fail. - -The cluster_sectors is changed to int64_t to allow big flat extent. - -Without this, flat extent opening is broken: - - # qemu-img create -f vmdk -o subformat=monolithicFlat /tmp/a.vmdk 100G - Formatting '/tmp/a.vmdk', fmt=vmdk size=107374182400 compat6=off subformat='monolithicFlat' zeroed_grain=off - # qemu-img info /tmp/a.vmdk - image: /tmp/a.vmdk - file format: raw - virtual size: 0 (0 bytes) - disk size: 4.0K - -Signed-off-by: Fam Zheng -Signed-off-by: Kevin Wolf -(cherry picked from commit 301c7d38a0c359b91526391d13617386f3d9bb29) - -Signed-off-by: Michael Roth ---- - block/vmdk.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/block/vmdk.c b/block/vmdk.c -index 346bb5c..258a24f 100644 ---- a/block/vmdk.c -+++ b/block/vmdk.c -@@ -105,7 +105,7 @@ typedef struct VmdkExtent { - uint32_t l2_cache_offsets[L2_CACHE_SIZE]; - uint32_t l2_cache_counts[L2_CACHE_SIZE]; - -- unsigned int cluster_sectors; -+ int64_t cluster_sectors; - } VmdkExtent; - - typedef struct BDRVVmdkState { -@@ -416,7 +416,7 @@ static int vmdk_add_extent(BlockDriverState *bs, - extent->l1_size = l1_size; - extent->l1_entry_sectors = l2_size * cluster_sectors; - extent->l2_size = l2_size; -- extent->cluster_sectors = cluster_sectors; -+ extent->cluster_sectors = flat ? sectors : cluster_sectors; - - if (s->num_extents > 1) { - extent->end_sector = (*(extent - 1)).end_sector + extent->sectors; -@@ -736,7 +736,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs, - VmdkExtent *extent; - - ret = vmdk_add_extent(bs, extent_file, true, sectors, -- 0, 0, 0, 0, sectors, &extent); -+ 0, 0, 0, 0, 0, &extent); - if (ret < 0) { - return ret; - } diff --git a/0044-piix4-disable-io-on-reset.patch b/0044-piix4-disable-io-on-reset.patch deleted file mode 100644 index e37b62b..0000000 --- a/0044-piix4-disable-io-on-reset.patch +++ /dev/null @@ -1,33 +0,0 @@ -From ae00a27feab0ca12d2a802cfae9ee65ba3d43602 Mon Sep 17 00:00:00 2001 -From: "Michael S. Tsirkin" -Date: Wed, 11 Sep 2013 13:33:31 +0300 -Subject: [PATCH] piix4: disable io on reset - -io base register at 0x40 is cleared on reset, -but io is not disabled until some other event -happens to call pm_io_space_update. - -Invoke pm_io_space_update directly to make this -consistent. - -Cc: qemu-stable@nongnu.org -Signed-off-by: Michael S. Tsirkin -(cherry picked from commit c046e8c4a26c902ca1b4f5bdf668a2da6bc75f54) - -Signed-off-by: Michael Roth ---- - hw/acpi/piix4.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c -index c885690..3aaf18c 100644 ---- a/hw/acpi/piix4.c -+++ b/hw/acpi/piix4.c -@@ -380,6 +380,7 @@ static void piix4_reset(void *opaque) - /* Mark SMM as already inited (until KVM supports SMM). */ - pci_conf[0x5B] = 0x02; - } -+ pm_io_space_update(s); - piix4_update_hotplug(s); - } - diff --git a/0045-coroutine-add-.-configure-disable-coroutine-pool.patch b/0045-coroutine-add-.-configure-disable-coroutine-pool.patch deleted file mode 100644 index 2c416fd..0000000 --- a/0045-coroutine-add-.-configure-disable-coroutine-pool.patch +++ /dev/null @@ -1,163 +0,0 @@ -From ba20326a937421c50a775907dc9ac726bb9a9b50 Mon Sep 17 00:00:00 2001 -From: Stefan Hajnoczi -Date: Wed, 11 Sep 2013 16:42:35 +0200 -Subject: [PATCH] coroutine: add ./configure --disable-coroutine-pool - -The 'gthread' coroutine backend was written before the freelist (aka -pool) existed in qemu-coroutine.c. - -This means that every thread is expected to exit when its coroutine -terminates. It is not possible to reuse threads from a pool. - -This patch automatically disables the pool when 'gthread' is used. This -allows the 'gthread' backend to work again (for example, -tests/test-coroutine completes successfully instead of hanging). - -I considered implementing thread reuse but I don't want quirks like CPU -affinity differences due to coroutine threads being recycled. The -'gthread' backend is a reference backend and it's therefore okay to skip -the pool optimization. - -Note this patch also makes it easy to toggle the pool for benchmarking -purposes: - - ./configure --with-coroutine-backend=ucontext \ - --disable-coroutine-pool - -Reported-by: Gabriel Kerneis -Signed-off-by: Stefan Hajnoczi -Reviewed-by: Gabriel Kerneis -Signed-off-by: Kevin Wolf -(cherry picked from commit 70c60c089fdc6bf8a79324e492c13e8c08d55942) - -Signed-off-by: Michael Roth ---- - configure | 24 ++++++++++++++++++++++++ - qemu-coroutine.c | 34 +++++++++++++++++++--------------- - 2 files changed, 43 insertions(+), 15 deletions(-) - -diff --git a/configure b/configure -index 18fa608..4cf672d 100755 ---- a/configure -+++ b/configure -@@ -235,6 +235,7 @@ guest_agent="" - want_tools="yes" - libiscsi="" - coroutine="" -+coroutine_pool="" - seccomp="" - glusterfs="" - glusterfs_discard="no" -@@ -871,6 +872,10 @@ for opt do - ;; - --with-coroutine=*) coroutine="$optarg" - ;; -+ --disable-coroutine-pool) coroutine_pool="no" -+ ;; -+ --enable-coroutine-pool) coroutine_pool="yes" -+ ;; - --disable-docs) docs="no" - ;; - --enable-docs) docs="yes" -@@ -1152,6 +1157,8 @@ echo " --disable-seccomp disable seccomp support" - echo " --enable-seccomp enables seccomp support" - echo " --with-coroutine=BACKEND coroutine backend. Supported options:" - echo " gthread, ucontext, sigaltstack, windows" -+echo " --disable-coroutine-pool disable coroutine freelist (worse performance)" -+echo " --enable-coroutine-pool enable coroutine freelist (better performance)" - echo " --enable-glusterfs enable GlusterFS backend" - echo " --disable-glusterfs disable GlusterFS backend" - echo " --enable-gcov enable test coverage analysis with gcov" -@@ -3240,6 +3247,17 @@ else - esac - fi - -+if test "$coroutine_pool" = ""; then -+ if test "$coroutine" = "gthread"; then -+ coroutine_pool=no -+ else -+ coroutine_pool=yes -+ fi -+fi -+if test "$coroutine" = "gthread" -a "$coroutine_pool" = "yes"; then -+ error_exit "'gthread' coroutine backend does not support pool (use --disable-coroutine-pool)" -+fi -+ - ########################################## - # check if we have open_by_handle_at - -@@ -3605,6 +3623,7 @@ echo "libiscsi support $libiscsi" - echo "build guest agent $guest_agent" - echo "seccomp support $seccomp" - echo "coroutine backend $coroutine" -+echo "coroutine pool $coroutine_pool" - echo "GlusterFS support $glusterfs" - echo "virtio-blk-data-plane $virtio_blk_data_plane" - echo "gcov $gcov_tool" -@@ -3954,6 +3973,11 @@ if test "$rbd" = "yes" ; then - fi - - echo "CONFIG_COROUTINE_BACKEND=$coroutine" >> $config_host_mak -+if test "$coroutine_pool" = "yes" ; then -+ echo "CONFIG_COROUTINE_POOL=1" >> $config_host_mak -+else -+ echo "CONFIG_COROUTINE_POOL=0" >> $config_host_mak -+fi - - if test "$open_by_handle_at" = "yes" ; then - echo "CONFIG_OPEN_BY_HANDLE=y" >> $config_host_mak -diff --git a/qemu-coroutine.c b/qemu-coroutine.c -index 423430d..4708521 100644 ---- a/qemu-coroutine.c -+++ b/qemu-coroutine.c -@@ -30,15 +30,17 @@ static unsigned int pool_size; - - Coroutine *qemu_coroutine_create(CoroutineEntry *entry) - { -- Coroutine *co; -- -- qemu_mutex_lock(&pool_lock); -- co = QSLIST_FIRST(&pool); -- if (co) { -- QSLIST_REMOVE_HEAD(&pool, pool_next); -- pool_size--; -+ Coroutine *co = NULL; -+ -+ if (CONFIG_COROUTINE_POOL) { -+ qemu_mutex_lock(&pool_lock); -+ co = QSLIST_FIRST(&pool); -+ if (co) { -+ QSLIST_REMOVE_HEAD(&pool, pool_next); -+ pool_size--; -+ } -+ qemu_mutex_unlock(&pool_lock); - } -- qemu_mutex_unlock(&pool_lock); - - if (!co) { - co = qemu_coroutine_new(); -@@ -51,15 +53,17 @@ Coroutine *qemu_coroutine_create(CoroutineEntry *entry) - - static void coroutine_delete(Coroutine *co) - { -- qemu_mutex_lock(&pool_lock); -- if (pool_size < POOL_MAX_SIZE) { -- QSLIST_INSERT_HEAD(&pool, co, pool_next); -- co->caller = NULL; -- pool_size++; -+ if (CONFIG_COROUTINE_POOL) { -+ qemu_mutex_lock(&pool_lock); -+ if (pool_size < POOL_MAX_SIZE) { -+ QSLIST_INSERT_HEAD(&pool, co, pool_next); -+ co->caller = NULL; -+ pool_size++; -+ qemu_mutex_unlock(&pool_lock); -+ return; -+ } - qemu_mutex_unlock(&pool_lock); -- return; - } -- qemu_mutex_unlock(&pool_lock); - - qemu_coroutine_delete(co); - } diff --git a/0046-qemu-Adjust-qemu-wakeup.patch b/0046-qemu-Adjust-qemu-wakeup.patch deleted file mode 100644 index 973119b..0000000 --- a/0046-qemu-Adjust-qemu-wakeup.patch +++ /dev/null @@ -1,123 +0,0 @@ -From bc05a488b49f903e404323b76ca9b675318393fc Mon Sep 17 00:00:00 2001 -From: "Liu, Jinsong" -Date: Wed, 25 Sep 2013 16:38:29 +0000 -Subject: [PATCH] qemu: Adjust qemu wakeup - -Currently Xen hvm s3 has a bug coming from the difference between -qemu-traditioanl and qemu-xen. For qemu-traditional, the way to -resume from hvm s3 is via 'xl trigger' command. However, for -qemu-xen, the way to resume from hvm s3 inherited from standard -qemu, i.e. via QMP, and it doesn't work under Xen. - -The root cause is, for qemu-xen, 'xl trigger' command didn't reset -devices, while QMP didn't unpause hvm domain though they did qemu -system reset. - -We have two qemu patches and one xl patch to fix Xen hvm s3 bug. -This patch is the qemu patch 1. It adjusts qemu wakeup so that -Xen s3 resume logic (which will be implemented at qemu patch 2) -will be notified after qemu system reset. - -Signed-off-by: Liu Jinsong -Signed-off-by: Stefano Stabellini -Reviewed-by: Paolo Bonzini -Reviewed-by: Anthony PERARD -(cherry picked from commit 4bc78a877252d772b983810a7d2c0be00e9be70e) - -Signed-off-by: Michael Roth ---- - hw/acpi/core.c | 3 ++- - include/sysemu/sysemu.h | 4 +++- - vl.c | 15 +++++++-------- - 3 files changed, 12 insertions(+), 10 deletions(-) - -diff --git a/hw/acpi/core.c b/hw/acpi/core.c -index b07feda..769cfdb 100644 ---- a/hw/acpi/core.c -+++ b/hw/acpi/core.c -@@ -324,12 +324,13 @@ static void acpi_notify_wakeup(Notifier *notifier, void *data) - (ACPI_BITMASK_WAKE_STATUS | ACPI_BITMASK_TIMER_STATUS); - break; - case QEMU_WAKEUP_REASON_OTHER: -- default: - /* ACPI_BITMASK_WAKE_STATUS should be set on resume. - Pretend that resume was caused by power button */ - ar->pm1.evt.sts |= - (ACPI_BITMASK_WAKE_STATUS | ACPI_BITMASK_POWER_BUTTON_STATUS); - break; -+ default: -+ break; - } - } - -diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h -index d7a77b6..1a77c99 100644 ---- a/include/sysemu/sysemu.h -+++ b/include/sysemu/sysemu.h -@@ -39,9 +39,11 @@ int vm_stop(RunState state); - int vm_stop_force_state(RunState state); - - typedef enum WakeupReason { -- QEMU_WAKEUP_REASON_OTHER = 0, -+ /* Always keep QEMU_WAKEUP_REASON_NONE = 0 */ -+ QEMU_WAKEUP_REASON_NONE = 0, - QEMU_WAKEUP_REASON_RTC, - QEMU_WAKEUP_REASON_PMTIMER, -+ QEMU_WAKEUP_REASON_OTHER, - } WakeupReason; - - void qemu_system_reset_request(void); -diff --git a/vl.c b/vl.c -index f422a1c..2160933 100644 ---- a/vl.c -+++ b/vl.c -@@ -1792,14 +1792,14 @@ static pid_t shutdown_pid; - static int powerdown_requested; - static int debug_requested; - static int suspend_requested; --static int wakeup_requested; -+static WakeupReason wakeup_reason; - static NotifierList powerdown_notifiers = - NOTIFIER_LIST_INITIALIZER(powerdown_notifiers); - static NotifierList suspend_notifiers = - NOTIFIER_LIST_INITIALIZER(suspend_notifiers); - static NotifierList wakeup_notifiers = - NOTIFIER_LIST_INITIALIZER(wakeup_notifiers); --static uint32_t wakeup_reason_mask = ~0; -+static uint32_t wakeup_reason_mask = ~(1 << QEMU_WAKEUP_REASON_NONE); - static RunState vmstop_requested = RUN_STATE_MAX; - - int qemu_shutdown_requested_get(void) -@@ -1849,11 +1849,9 @@ static int qemu_suspend_requested(void) - return r; - } - --static int qemu_wakeup_requested(void) -+static WakeupReason qemu_wakeup_requested(void) - { -- int r = wakeup_requested; -- wakeup_requested = 0; -- return r; -+ return wakeup_reason; - } - - static int qemu_powerdown_requested(void) -@@ -1970,8 +1968,7 @@ void qemu_system_wakeup_request(WakeupReason reason) - return; - } - runstate_set(RUN_STATE_RUNNING); -- notifier_list_notify(&wakeup_notifiers, &reason); -- wakeup_requested = 1; -+ wakeup_reason = reason; - qemu_notify_event(); - } - -@@ -2063,6 +2060,8 @@ static bool main_loop_should_exit(void) - pause_all_vcpus(); - cpu_synchronize_all_states(); - qemu_system_reset(VMRESET_SILENT); -+ notifier_list_notify(&wakeup_notifiers, &wakeup_reason); -+ wakeup_reason = QEMU_WAKEUP_REASON_NONE; - resume_all_vcpus(); - monitor_protocol_event(QEVENT_WAKEUP, NULL); - } diff --git a/0047-qemu-Add-qemu-xen-logic-for-Xen-HVM-S3-resume.patch b/0047-qemu-Add-qemu-xen-logic-for-Xen-HVM-S3-resume.patch deleted file mode 100644 index f6e06a5..0000000 --- a/0047-qemu-Add-qemu-xen-logic-for-Xen-HVM-S3-resume.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 1b5f7709411a412ec8ce21004a47f51ab6c3f3ad Mon Sep 17 00:00:00 2001 -From: "Liu, Jinsong" -Date: Wed, 25 Sep 2013 16:40:23 +0000 -Subject: [PATCH] qemu: Add qemu xen logic for Xen HVM S3 resume - -This patch is qemu patch 2 to fix Xen HVM S3 bug, adding qemu -xen logic. When qemu wakeup, qemu xen logic is notified and -hypercall to xen hypervisor to unpause domain. - -Signed-off-by: Liu Jinsong -Signed-off-by: Stefano Stabellini -Reviewed-by: Anthony PERARD -(cherry picked from commit 11addd0ab9371af2b6ec028c7fe4e4c4992252fc) - -Signed-off-by: Michael Roth ---- - xen-all.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/xen-all.c b/xen-all.c -index e1d0694..7894ac6 100644 ---- a/xen-all.c -+++ b/xen-all.c -@@ -98,6 +98,7 @@ typedef struct XenIOState { - - Notifier exit; - Notifier suspend; -+ Notifier wakeup; - } XenIOState; - - /* Xen specific function for piix pci */ -@@ -1060,6 +1061,11 @@ static void xen_read_physmap(XenIOState *state) - free(entries); - } - -+static void xen_wakeup_notifier(Notifier *notifier, void *data) -+{ -+ xc_set_hvm_param(xen_xc, xen_domid, HVM_PARAM_ACPI_S_STATE, 0); -+} -+ - int xen_hvm_init(MemoryRegion **ram_memory) - { - int i, rc; -@@ -1089,6 +1095,9 @@ int xen_hvm_init(MemoryRegion **ram_memory) - state->suspend.notify = xen_suspend_notifier; - qemu_register_suspend_notifier(&state->suspend); - -+ state->wakeup.notify = xen_wakeup_notifier; -+ qemu_register_wakeup_notifier(&state->wakeup); -+ - xc_get_hvm_param(xen_xc, xen_domid, HVM_PARAM_IOREQ_PFN, &ioreq_pfn); - DPRINTF("shared page at pfn %lx\n", ioreq_pfn); - state->shared_page = xc_map_foreign_range(xen_xc, xen_domid, XC_PAGE_SIZE, diff --git a/0048-scsi-Allocate-SCSITargetReq-r-buf-dynamically.patch b/0048-scsi-Allocate-SCSITargetReq-r-buf-dynamically.patch deleted file mode 100644 index d921981..0000000 --- a/0048-scsi-Allocate-SCSITargetReq-r-buf-dynamically.patch +++ /dev/null @@ -1,154 +0,0 @@ -From fdcbe7d587a64dec0db0d3c9a3b230c39efbfeef Mon Sep 17 00:00:00 2001 -From: Asias He -Date: Fri, 13 Sep 2013 14:56:55 +0800 -Subject: [PATCH] scsi: Allocate SCSITargetReq r->buf dynamically - -BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1007330 -Brew: https://brewweb.devel.redhat.com/taskinfo?taskID=6282465 - -This is the backport of the following commit. The patch is not -sent public since it is a embargoed bug. - - r->buf is hardcoded to 2056 which is (256 + 1) * 8, allowing 256 luns at - most. If more than 256 luns are specified by user, we have buffer - overflow in scsi_target_emulate_report_luns. - - To fix, we allocate the buffer dynamically. - - Signed-off-by: Asias He - -Signed-off-by: Asias He -Signed-off-by: Paolo Bonzini - -*s/&r->buf/r->buf/ due to type change - -Signed-off-by: Michael Roth ---- - hw/scsi/scsi-bus.c | 44 +++++++++++++++++++++++++++++++++----------- - include/hw/scsi/scsi.h | 2 ++ - 2 files changed, 35 insertions(+), 11 deletions(-) - -diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c -index 8fe4f4c..ad26c25 100644 ---- a/hw/scsi/scsi-bus.c -+++ b/hw/scsi/scsi-bus.c -@@ -11,6 +11,8 @@ static char *scsibus_get_dev_path(DeviceState *dev); - static char *scsibus_get_fw_dev_path(DeviceState *dev); - static int scsi_req_parse(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf); - static void scsi_req_dequeue(SCSIRequest *req); -+static uint8_t *scsi_target_alloc_buf(SCSIRequest *req, size_t len); -+static void scsi_target_free_buf(SCSIRequest *req); - - static Property scsi_props[] = { - DEFINE_PROP_UINT32("channel", SCSIDevice, channel, 0), -@@ -317,7 +319,8 @@ typedef struct SCSITargetReq SCSITargetReq; - struct SCSITargetReq { - SCSIRequest req; - int len; -- uint8_t buf[2056]; -+ uint8_t *buf; -+ int buf_len; - }; - - static void store_lun(uint8_t *outbuf, int lun) -@@ -361,14 +364,12 @@ static bool scsi_target_emulate_report_luns(SCSITargetReq *r) - if (!found_lun0) { - n += 8; - } -- len = MIN(n + 8, r->req.cmd.xfer & ~7); -- if (len > sizeof(r->buf)) { -- /* TODO: > 256 LUNs? */ -- return false; -- } - -+ scsi_target_alloc_buf(&r->req, n + 8); -+ -+ len = MIN(n + 8, r->req.cmd.xfer & ~7); - memset(r->buf, 0, len); -- stl_be_p(&r->buf, n); -+ stl_be_p(r->buf, n); - i = found_lun0 ? 8 : 16; - QTAILQ_FOREACH(kid, &r->req.bus->qbus.children, sibling) { - DeviceState *qdev = kid->child; -@@ -387,6 +388,9 @@ static bool scsi_target_emulate_report_luns(SCSITargetReq *r) - static bool scsi_target_emulate_inquiry(SCSITargetReq *r) - { - assert(r->req.dev->lun != r->req.lun); -+ -+ scsi_target_alloc_buf(&r->req, SCSI_INQUIRY_LEN); -+ - if (r->req.cmd.buf[1] & 0x2) { - /* Command support data - optional, not implemented */ - return false; -@@ -411,7 +415,7 @@ static bool scsi_target_emulate_inquiry(SCSITargetReq *r) - return false; - } - /* done with EVPD */ -- assert(r->len < sizeof(r->buf)); -+ assert(r->len < r->buf_len); - r->len = MIN(r->req.cmd.xfer, r->len); - return true; - } -@@ -455,8 +459,8 @@ static int32_t scsi_target_send_command(SCSIRequest *req, uint8_t *buf) - } - break; - case REQUEST_SENSE: -- r->len = scsi_device_get_sense(r->req.dev, r->buf, -- MIN(req->cmd.xfer, sizeof r->buf), -+ scsi_target_alloc_buf(&r->req, SCSI_SENSE_LEN); -+ r->len = scsi_device_get_sense(r->req.dev, r->buf, r->buf_len, - (req->cmd.buf[1] & 1) == 0); - if (r->req.dev->sense_is_ua) { - scsi_device_unit_attention_reported(req->dev); -@@ -501,11 +505,29 @@ static uint8_t *scsi_target_get_buf(SCSIRequest *req) - return r->buf; - } - -+static uint8_t *scsi_target_alloc_buf(SCSIRequest *req, size_t len) -+{ -+ SCSITargetReq *r = DO_UPCAST(SCSITargetReq, req, req); -+ -+ r->buf = g_malloc(len); -+ r->buf_len = len; -+ -+ return r->buf; -+} -+ -+static void scsi_target_free_buf(SCSIRequest *req) -+{ -+ SCSITargetReq *r = DO_UPCAST(SCSITargetReq, req, req); -+ -+ g_free(r->buf); -+} -+ - static const struct SCSIReqOps reqops_target_command = { - .size = sizeof(SCSITargetReq), - .send_command = scsi_target_send_command, - .read_data = scsi_target_read_data, - .get_buf = scsi_target_get_buf, -+ .free_req = scsi_target_free_buf, - }; - - -@@ -1365,7 +1387,7 @@ int scsi_build_sense(uint8_t *in_buf, int in_len, - buf[7] = 10; - buf[12] = sense.asc; - buf[13] = sense.ascq; -- return MIN(len, 18); -+ return MIN(len, SCSI_SENSE_LEN); - } else { - /* Return descriptor format sense buffer */ - buf[0] = 0x72; -diff --git a/include/hw/scsi/scsi.h b/include/hw/scsi/scsi.h -index 8786531..18cb694 100644 ---- a/include/hw/scsi/scsi.h -+++ b/include/hw/scsi/scsi.h -@@ -9,6 +9,8 @@ - #define MAX_SCSI_DEVS 255 - - #define SCSI_CMD_BUF_SIZE 16 -+#define SCSI_SENSE_LEN 18 -+#define SCSI_INQUIRY_LEN 36 - - typedef struct SCSIBus SCSIBus; - typedef struct SCSIBusInfo SCSIBusInfo; diff --git a/0049-Update-VERSION-for-1.6.1-release.patch b/0049-Update-VERSION-for-1.6.1-release.patch deleted file mode 100644 index 30bfee2..0000000 --- a/0049-Update-VERSION-for-1.6.1-release.patch +++ /dev/null @@ -1,17 +0,0 @@ -From 62ecc3a0e3c77a4944c92a02dd7fae2ab1f2290d Mon Sep 17 00:00:00 2001 -From: Michael Roth -Date: Fri, 4 Oct 2013 10:21:43 -0500 -Subject: [PATCH] Update VERSION for 1.6.1 release - -Signed-off-by: Michael Roth ---- - VERSION | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/VERSION b/VERSION -index dc1e644..9c6d629 100644 ---- a/VERSION -+++ b/VERSION -@@ -1 +1 @@ --1.6.0 -+1.6.1 diff --git a/0201-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch b/0101-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch similarity index 100% rename from 0201-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch rename to 0101-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch diff --git a/0202-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch b/0102-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch similarity index 100% rename from 0202-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch rename to 0102-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch diff --git a/0203-hw-9pfs-Fix-errno-value-for-xattr-functions.patch b/0103-hw-9pfs-Fix-errno-value-for-xattr-functions.patch similarity index 100% rename from 0203-hw-9pfs-Fix-errno-value-for-xattr-functions.patch rename to 0103-hw-9pfs-Fix-errno-value-for-xattr-functions.patch diff --git a/0204-Fix-pc-migration-from-qemu-1.5.patch b/0104-Fix-pc-migration-from-qemu-1.5.patch similarity index 96% rename from 0204-Fix-pc-migration-from-qemu-1.5.patch rename to 0104-Fix-pc-migration-from-qemu-1.5.patch index ee21194..022b66c 100644 --- a/0204-Fix-pc-migration-from-qemu-1.5.patch +++ b/0104-Fix-pc-migration-from-qemu-1.5.patch @@ -1,4 +1,4 @@ -From 16f89cbf7737626a0ab24a5b0fd7ce4ab940f5a2 Mon Sep 17 00:00:00 2001 +From 042c76790b1168766332b1aafa4429c265d35ed0 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 7 Oct 2013 16:32:24 -0400 Subject: [PATCH] Fix pc migration from qemu <= 1.5 @@ -21,6 +21,7 @@ types, but revert to the old style format for 1.7+, and <= 1.5. Tested with migration from qemu 1.5, qemu 1.6, and qemu.git. Cc: qemu-stable@nongnu.org +Signed-off-by: Cole Robinson --- hw/i386/pc_piix.c | 11 +++++++++++ hw/i386/pc_q35.c | 11 +++++++++++ @@ -150,7 +151,7 @@ index 4febd24..f762053 100644 }; diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h -index 475ba9e..a0bbdd9 100644 +index 475ba9e..6e2b839 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -225,7 +225,19 @@ void pvpanic_init(ISABus *bus); @@ -163,7 +164,7 @@ index 475ba9e..a0bbdd9 100644 + .property = "short_root_bus",\ + .value = stringify(1),\ + },{\ -+ .driver = "mch",\ ++ .driver = "q35-pcihost",\ + .property = "short_root_bus",\ + .value = stringify(1),\ + } @@ -182,7 +183,7 @@ index 475ba9e..a0bbdd9 100644 + .property = "short_root_bus",\ + .value = stringify(0),\ + },{\ -+ .driver = "mch",\ ++ .driver = "q35-pcihost",\ + .property = "short_root_bus",\ + .value = stringify(0),\ } diff --git a/0105-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch b/0105-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch new file mode 100644 index 0000000..30cfa3d --- /dev/null +++ b/0105-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch @@ -0,0 +1,42 @@ +From 6b7ac46a461482c06c5ccdf54815e94205bc7d95 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 9 Oct 2013 21:33:44 +0200 +Subject: [PATCH] audio: honor QEMU_AUDIO_TIMER_PERIOD instead of waking up + every *nano* second + +Now that we no longer have MIN_REARM_TIMER_NS a bug in the audio subsys has +clearly shown it self by trying to make a timer fire every nano second. + +Note we have a similar problem in 1.6, 1.5 and older but there +MIN_REARM_TIMER_NS limits the wakeups caused by audio being active to +4000 times / second. This still causes a host cpu load of 50 % for simply +playing audio, where as with this patch git master is at 13%, so we should +backport this to 1.5 and 1.6 too. + +Note this will not apply to 1.5 and 1.6 as is. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Hans de Goede +Signed-off-by: Gerd Hoffmann +(cherry picked from commit b4350deed67b95651896ddb60cf9f765093a4848) + +Conflicts: + audio/audio.c +--- + audio/audio.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/audio/audio.c b/audio/audio.c +index 02bb886..f9b3e95 100644 +--- a/audio/audio.c ++++ b/audio/audio.c +@@ -1124,7 +1124,8 @@ static int audio_is_timer_needed (void) + static void audio_reset_timer (AudioState *s) + { + if (audio_is_timer_needed ()) { +- qemu_mod_timer (s->ts, qemu_get_clock_ns (vm_clock) + 1); ++ qemu_mod_timer (s->ts, ++ qemu_get_clock_ns (vm_clock) + conf.period.ticks); + } + else { + qemu_del_timer (s->ts); diff --git a/ksmtuned b/ksmtuned index c96507c..7bc5743 100644 --- a/ksmtuned +++ b/ksmtuned @@ -71,10 +71,10 @@ KSMCTL () { committed_memory () { # calculate how much memory is committed to running qemu processes local pidlist - pidlist=$(pgrep -d ' ' -- '^qemu(-kvm|:.{1,11})$') + pidlist=$(pgrep -d ' ' -- '^qemu(-(kvm|system-.+)|:.{1,11})$') if [ -n "$pidlist" ]; then ps -p "$pidlist" -o rsz= - fi | awk '{ sum += $1 }; END { print sum }' + fi | awk '{ sum += $1 }; END { print 0+sum }' } free_memory () { diff --git a/qemu.spec b/qemu.spec index 0560b00..18937f1 100644 --- a/qemu.spec +++ b/qemu.spec @@ -138,8 +138,8 @@ Summary: QEMU is a FAST! processor emulator Name: qemu -Version: 1.6.0 -Release: 10%{?dist} +Version: 1.6.1 +Release: 1%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -180,91 +180,42 @@ Source12: bridge.conf # qemu-kvm back compat wrapper Source13: qemu-kvm.sh -# Rebase to pending 1.6.1 stable -Patch0001: 0001-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch -Patch0002: 0002-gdbstub-Fix-gdb_register_coprocessor-register-counti.patch -Patch0003: 0003-target-ppc-fix-bit-extraction-for-FPBF-and-FPL.patch -Patch0004: 0004-rdma-silly-ipv6-bugfix.patch -Patch0005: 0005-scripts-qapi.py-Avoid-syntax-not-supported-by-Python.patch -Patch0006: 0006-usb-dev-hid-Modified-usb-tablet-category-from-Misc-t.patch -Patch0007: 0007-scsi-Fix-scsi_bus_legacy_add_drive-scsi-generic-with.patch -Patch0008: 0008-pc-fix-regression-for-64-bit-PCI-memory.patch -Patch0009: 0009-pseries-Fix-stalls-on-hypervisor-virtual-console.patch -Patch0010: 0010-virtio-virtqueue_get_avail_bytes-fix-desc_pa-when-lo.patch -Patch0011: 0011-xhci-fix-endpoint-interval-calculation.patch -Patch0012: 0012-Revert-usb-hub-report-status-changes-only-once.patch -Patch0013: 0013-block-expect-errors-from-bdrv_co_is_allocated.patch -Patch0014: 0014-target-i386-fix-disassembly-with-PAE-1-PG-0.patch -Patch0015: 0015-adlib-sort-offsets-in-portio-registration.patch -Patch0016: 0016-exec-fix-writing-to-MMIO-area-with-non-power-of-two-.patch -Patch0017: 0017-virtio_pci-fix-level-interrupts-with-irqfd.patch -Patch0018: 0018-exec-always-use-MADV_DONTFORK.patch -Patch0019: 0019-xhci-reset-port-when-disabling-slot.patch -Patch0020: 0020-usb-parallelize-usb3-streams.patch -Patch0021: 0021-w32-Fix-access-to-host-devices-regression.patch -Patch0022: 0022-memory-Provide-separate-handling-of-unassigned-io-po.patch -Patch0023: 0023-Revert-memory-Return-1-again-on-reads-from-unsigned-.patch -Patch0024: 0024-exec-check-offset_within_address_space-for-register-.patch -Patch0025: 0025-ne2000-mark-I-O-as-LITTLE_ENDIAN.patch -Patch0026: 0026-ehci-save-device-pointer-in-EHCIState.patch -Patch0027: 0027-qxl-fix-local-renderer.patch -Patch0028: 0028-pc-Initializing-ram_memory-under-Xen.patch -Patch0029: 0029-pc_q35-Initialize-Xen.patch -Patch0030: 0030-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch -Patch0031: 0031-pcnet-pci-mark-I-O-and-MMIO-as-LITTLE_ENDIAN.patch -Patch0032: 0032-chardev-fix-pty_chr_timer.patch -Patch0033: 0033-kvmvapic-Catch-invalid-ROM-size.patch -Patch0034: 0034-kvmvapic-Enter-inactive-state-on-hardware-reset.patch -Patch0035: 0035-kvmvapic-Clear-also-physical-ROM-address-when-enteri.patch -Patch0036: 0036-tci-Fix-qemu-alpha-on-32-bit-hosts-wrong-assertions.patch -Patch0037: 0037-blockdev-do-not-default-cache.no-flush-to-true.patch -Patch0038: 0038-virtio-blk-do-not-relay-a-previous-driver-s-WCE-conf.patch -Patch0039: 0039-xhci-emulate-intr-endpoint-intervals-correctly.patch -Patch0040: 0040-iov-avoid-orig_len-may-be-used-unitialized-warning.patch -Patch0041: 0041-tap-Use-numbered-tap-tun-devices-on-all-BSD-OS-s.patch -Patch0042: 0042-rbd-avoid-qemu_rbd_snap_list-memory-leaks.patch -Patch0043: 0043-vmdk-fix-cluster-size-check-for-flat-extents.patch -Patch0044: 0044-piix4-disable-io-on-reset.patch -Patch0045: 0045-coroutine-add-.-configure-disable-coroutine-pool.patch -Patch0046: 0046-qemu-Adjust-qemu-wakeup.patch -Patch0047: 0047-qemu-Add-qemu-xen-logic-for-Xen-HVM-S3-resume.patch -Patch0048: 0048-scsi-Allocate-SCSITargetReq-r-buf-dynamically.patch -Patch0049: 0049-Update-VERSION-for-1.6.1-release.patch - # qemu-kvm migration compat (not for upstream, drop by Fedora 21?) -Patch0101: 0101-Fix-migration-from-qemu-kvm.patch +Patch0001: 0001-Fix-migration-from-qemu-kvm.patch # Fix crash with -M isapc -cpu Haswell (bz #986790) -Patch0102: 0102-isapc-disable-kvmvapic.patch +Patch0002: 0002-isapc-disable-kvmvapic.patch # Fix crash in lsi_soft_reset (bz #1000947) # Patches posted upstream -Patch0103: 0103-pci-do-not-export-pci_bus_reset.patch -Patch0104: 0104-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch -Patch0105: 0105-qdev-switch-reset-to-post-order.patch +Patch0003: 0003-pci-do-not-export-pci_bus_reset.patch +Patch0004: 0004-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch +Patch0005: 0005-qdev-switch-reset-to-post-order.patch # CVE-2013-4377: Fix crash when unplugging virtio devices (bz #1012633, # bz #1012641) # Patches posted upstream -Patch0106: 0106-virtio-bus-remove-vdev-field.patch -Patch0107: 0107-virtio-pci-remove-vdev-field.patch -Patch0108: 0108-virtio-ccw-remove-vdev-field.patch -Patch0109: 0109-virtio-bus-cleanup-plug-unplug-interface.patch -Patch0110: 0110-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch -Patch0111: 0111-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch -Patch0112: 0112-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch -Patch0113: 0113-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch -Patch0114: 0114-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch -Patch0115: 0115-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch -Patch0116: 0116-virtio-pci-add-device_unplugged-callback.patch +Patch0006: 0006-virtio-bus-remove-vdev-field.patch +Patch0007: 0007-virtio-pci-remove-vdev-field.patch +Patch0008: 0008-virtio-ccw-remove-vdev-field.patch +Patch0009: 0009-virtio-bus-cleanup-plug-unplug-interface.patch +Patch0010: 0010-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch +Patch0011: 0011-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch +Patch0012: 0012-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch +Patch0013: 0013-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch +Patch0014: 0014-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch +Patch0015: 0015-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch +Patch0016: 0016-virtio-pci-add-device_unplugged-callback.patch # Fix 'new snapshot' slowness after the first snap (bz #988436) # Patches queued for upstream -Patch0201: 0201-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch -Patch0202: 0202-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch +Patch0101: 0101-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch +Patch0102: 0102-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch # Fix 9pfs xattrs on kernel 3.11 (bz #1013676) # Patch posted upstream -Patch0203: 0203-hw-9pfs-Fix-errno-value-for-xattr-functions.patch +Patch0103: 0103-hw-9pfs-Fix-errno-value-for-xattr-functions.patch # Fix migration from qemu <= 1.5 # Patch posted upstream -Patch0204: 0204-Fix-pc-migration-from-qemu-1.5.patch +Patch0104: 0104-Fix-pc-migration-from-qemu-1.5.patch +# Reduce CPU usage when audio is playing (bz #1017644) +Patch0105: 0105-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -777,12 +728,18 @@ CAC emulation development files. %prep %setup -q -# Rebase to pending 1.6.1 stable +# qemu-kvm migration compat (not for upstream, drop by Fedora 21?) %patch0001 -p1 +# Fix crash with -M isapc -cpu Haswell (bz #986790) %patch0002 -p1 +# Fix crash in lsi_soft_reset (bz #1000947) +# Patches posted upstream %patch0003 -p1 %patch0004 -p1 %patch0005 -p1 +# CVE-2013-4377: Fix crash when unplugging virtio devices (bz #1012633, +# bz #1012641) +# Patches posted upstream %patch0006 -p1 %patch0007 -p1 %patch0008 -p1 @@ -794,74 +751,19 @@ CAC emulation development files. %patch0014 -p1 %patch0015 -p1 %patch0016 -p1 -%patch0017 -p1 -%patch0018 -p1 -%patch0019 -p1 -%patch0020 -p1 -%patch0021 -p1 -%patch0022 -p1 -%patch0023 -p1 -%patch0024 -p1 -%patch0025 -p1 -%patch0026 -p1 -%patch0027 -p1 -%patch0028 -p1 -%patch0029 -p1 -%patch0030 -p1 -%patch0031 -p1 -%patch0032 -p1 -%patch0033 -p1 -%patch0034 -p1 -%patch0035 -p1 -%patch0036 -p1 -%patch0037 -p1 -%patch0038 -p1 -%patch0039 -p1 -%patch0040 -p1 -%patch0041 -p1 -%patch0042 -p1 -%patch0043 -p1 -%patch0044 -p1 -%patch0045 -p1 -%patch0046 -p1 -%patch0047 -p1 -%patch0048 -p1 -%patch0049 -p1 - -# qemu-kvm migration compat (not for upstream, drop by Fedora 21?) -%patch0101 -p1 -# Fix crash with -M isapc -cpu Haswell (bz #986790) -%patch0102 -p1 -# Fix crash in lsi_soft_reset (bz #1000947) -# Patches posted upstream -%patch0103 -p1 -%patch0104 -p1 -%patch0105 -p1 -# CVE-2013-4377: Fix crash when unplugging virtio devices (bz #1012633, -# bz #1012641) -# Patches posted upstream -%patch0106 -p1 -%patch0107 -p1 -%patch0108 -p1 -%patch0109 -p1 -%patch0110 -p1 -%patch0111 -p1 -%patch0112 -p1 -%patch0113 -p1 -%patch0114 -p1 -%patch0115 -p1 -%patch0116 -p1 # Fix 'new snapshot' slowness after the first snap (bz #988436) # Patches queued for upstream -%patch0201 -p1 -%patch0202 -p1 +%patch0101 -p1 +%patch0102 -p1 # Fix 9pfs xattrs on kernel 3.11 (bz #1013676) # Patch posted upstream -%patch0203 -p1 +%patch0103 -p1 # Fix migration from qemu <= 1.5 # Patch posted upstream -%patch0204 -p1 +%patch0104 -p1 +# Reduce CPU usage when audio is playing (bz #1017644) +%patch0105 -p1 %build @@ -1127,7 +1029,6 @@ install -m 0644 %{SOURCE11} $RPM_BUILD_ROOT%{_udevdir} # Install rules to use the bridge helper with libvirt's virbr0 install -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/qemu -chmod u+s $RPM_BUILD_ROOT%{_libexecdir}/qemu-bridge-helper find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -f find $RPM_BUILD_ROOT -name "libcacard.so*" -exec chmod +x \{\} \; @@ -1243,7 +1144,7 @@ getent passwd qemu >/dev/null || \ %{_mandir}/man1/qemu.1* %{_mandir}/man1/virtfs-proxy-helper.1* %{_bindir}/virtfs-proxy-helper -%{_libexecdir}/qemu-bridge-helper +%attr(4755, root, root) %{_libexecdir}/qemu-bridge-helper %config(noreplace) %{_sysconfdir}/sasl2/qemu.conf %dir %{_sysconfdir}/qemu %config(noreplace) %{_sysconfdir}/qemu/bridge.conf @@ -1570,6 +1471,13 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Nov 05 2013 Cole Robinson - 2:1.6.1-1 +- Reduce CPU usage when audio is playing (bz #1017644) +- Base on qemu 1.6.1 tarball +- ksmtuned: Fix matching qemu w/o set_process_name (bz #1012604) +- ksmtuned: Fix committed_memory when no qemu running (bz #1012610) +- Make sure bridge helper is setuid (bz #1017660) + * Wed Oct 09 2013 Cole Robinson - 2:1.6.0-10 - Fix migration from qemu <= 1.5 diff --git a/sources b/sources index 4936b74..06f99b4 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -f3f39308472d629aca57a255a0c91ba9 qemu-1.6.0.tar.bz2 +3a897d722457c5a895cd6ac79a28fda0 qemu-1.6.1.tar.bz2 From 4b57421a2c4a7b538a18f8c6dcc1bb7d05dd0f91 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sun, 17 Nov 2013 17:32:44 -0500 Subject: [PATCH 33/45] Fix drive discard options via libvirt (bz #1029953) Fix process exit with -sandbox on (bz #1027421) --- ...local-QemuOptsLists-for-drive-option.patch | 181 ++++++++++++++++++ ...ine-tuning-whitelist-by-adding-times.patch | 28 +++ qemu.spec | 16 +- 3 files changed, 224 insertions(+), 1 deletion(-) create mode 100644 0106-qmp-access-the-local-QemuOptsLists-for-drive-option.patch create mode 100644 0107-seccomp-fine-tuning-whitelist-by-adding-times.patch diff --git a/0106-qmp-access-the-local-QemuOptsLists-for-drive-option.patch b/0106-qmp-access-the-local-QemuOptsLists-for-drive-option.patch new file mode 100644 index 0000000..7ffa62a --- /dev/null +++ b/0106-qmp-access-the-local-QemuOptsLists-for-drive-option.patch @@ -0,0 +1,181 @@ +From dd733d7097c126ee3b8ee8a0f4c38b8ccac76504 Mon Sep 17 00:00:00 2001 +From: Amos Kong +Date: Fri, 15 Nov 2013 18:53:14 +0100 +Subject: [PATCH] qmp: access the local QemuOptsLists for drive option + +Currently we have three QemuOptsList (qemu_common_drive_opts, +qemu_legacy_drive_opts, and qemu_drive_opts), only qemu_drive_opts +is added to vm_config_groups[]. + +This patch changes query-command-line-options to access three local +QemuOptsLists for drive option, and merge the description items +together. + +Signed-off-by: Amos Kong +Signed-off-by: Kevin Wolf +--- + blockdev.c | 1 - + include/qemu/config-file.h | 1 + + include/sysemu/sysemu.h | 1 + + util/qemu-config.c | 77 +++++++++++++++++++++++++++++++++++++++++++++- + vl.c | 2 ++ + 5 files changed, 80 insertions(+), 2 deletions(-) + +diff --git a/blockdev.c b/blockdev.c +index 097932c..1a6892e 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -45,7 +45,6 @@ + #include "sysemu/arch_init.h" + + static QTAILQ_HEAD(drivelist, DriveInfo) drives = QTAILQ_HEAD_INITIALIZER(drives); +-extern QemuOptsList qemu_common_drive_opts; + extern QemuOptsList qemu_old_drive_opts; + + static const char *const if_name[IF_COUNT] = { +diff --git a/include/qemu/config-file.h b/include/qemu/config-file.h +index ad4a9e5..508428f 100644 +--- a/include/qemu/config-file.h ++++ b/include/qemu/config-file.h +@@ -8,6 +8,7 @@ + QemuOptsList *qemu_find_opts(const char *group); + QemuOptsList *qemu_find_opts_err(const char *group, Error **errp); + void qemu_add_opts(QemuOptsList *list); ++void qemu_add_drive_opts(QemuOptsList *list); + int qemu_set_option(const char *str); + int qemu_global_option(const char *str); + void qemu_add_globals(void); +diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h +index 1a77c99..4962cef 100644 +--- a/include/sysemu/sysemu.h ++++ b/include/sysemu/sysemu.h +@@ -190,6 +190,7 @@ QemuOpts *qemu_get_machine_opts(void); + + bool usb_enabled(bool default_usb); + ++extern QemuOptsList qemu_common_drive_opts; + extern QemuOptsList qemu_drive_opts; + extern QemuOptsList qemu_chardev_opts; + extern QemuOptsList qemu_device_opts; +diff --git a/util/qemu-config.c b/util/qemu-config.c +index a59568d..04da942 100644 +--- a/util/qemu-config.c ++++ b/util/qemu-config.c +@@ -8,6 +8,7 @@ + #include "qmp-commands.h" + + static QemuOptsList *vm_config_groups[32]; ++static QemuOptsList *drive_config_groups[4]; + + static QemuOptsList *find_list(QemuOptsList **lists, const char *group, + Error **errp) +@@ -77,6 +78,59 @@ static CommandLineParameterInfoList *query_option_descs(const QemuOptDesc *desc) + return param_list; + } + ++/* remove repeated entry from the info list */ ++static void cleanup_infolist(CommandLineParameterInfoList *head) ++{ ++ CommandLineParameterInfoList *pre_entry, *cur, *del_entry; ++ ++ cur = head; ++ while (cur->next) { ++ pre_entry = head; ++ while (pre_entry != cur->next) { ++ if (!strcmp(pre_entry->value->name, cur->next->value->name)) { ++ del_entry = cur->next; ++ cur->next = cur->next->next; ++ g_free(del_entry); ++ break; ++ } ++ pre_entry = pre_entry->next; ++ } ++ cur = cur->next; ++ } ++} ++ ++/* merge the description items of two parameter infolists */ ++static void connect_infolist(CommandLineParameterInfoList *head, ++ CommandLineParameterInfoList *new) ++{ ++ CommandLineParameterInfoList *cur; ++ ++ cur = head; ++ while (cur->next) { ++ cur = cur->next; ++ } ++ cur->next = new; ++} ++ ++/* access all the local QemuOptsLists for drive option */ ++static CommandLineParameterInfoList *get_drive_infolist(void) ++{ ++ CommandLineParameterInfoList *head = NULL, *cur; ++ int i; ++ ++ for (i = 0; drive_config_groups[i] != NULL; i++) { ++ if (!head) { ++ head = query_option_descs(drive_config_groups[i]->desc); ++ } else { ++ cur = query_option_descs(drive_config_groups[i]->desc); ++ connect_infolist(head, cur); ++ } ++ } ++ cleanup_infolist(head); ++ ++ return head; ++} ++ + CommandLineOptionInfoList *qmp_query_command_line_options(bool has_option, + const char *option, + Error **errp) +@@ -89,7 +143,12 @@ CommandLineOptionInfoList *qmp_query_command_line_options(bool has_option, + if (!has_option || !strcmp(option, vm_config_groups[i]->name)) { + info = g_malloc0(sizeof(*info)); + info->option = g_strdup(vm_config_groups[i]->name); +- info->parameters = query_option_descs(vm_config_groups[i]->desc); ++ if (!strcmp("drive", vm_config_groups[i]->name)) { ++ info->parameters = get_drive_infolist(); ++ } else { ++ info->parameters = ++ query_option_descs(vm_config_groups[i]->desc); ++ } + entry = g_malloc0(sizeof(*entry)); + entry->value = info; + entry->next = conf_list; +@@ -109,6 +168,22 @@ QemuOptsList *qemu_find_opts_err(const char *group, Error **errp) + return find_list(vm_config_groups, group, errp); + } + ++void qemu_add_drive_opts(QemuOptsList *list) ++{ ++ int entries, i; ++ ++ entries = ARRAY_SIZE(drive_config_groups); ++ entries--; /* keep list NULL terminated */ ++ for (i = 0; i < entries; i++) { ++ if (drive_config_groups[i] == NULL) { ++ drive_config_groups[i] = list; ++ return; ++ } ++ } ++ fprintf(stderr, "ran out of space in drive_config_groups"); ++ abort(); ++} ++ + void qemu_add_opts(QemuOptsList *list) + { + int entries, i; +diff --git a/vl.c b/vl.c +index 2160933..63ecf16 100644 +--- a/vl.c ++++ b/vl.c +@@ -2942,6 +2942,8 @@ int main(int argc, char **argv, char **envp) + module_call_init(MODULE_INIT_QOM); + + qemu_add_opts(&qemu_drive_opts); ++ qemu_add_drive_opts(&qemu_common_drive_opts); ++ qemu_add_drive_opts(&qemu_drive_opts); + qemu_add_opts(&qemu_chardev_opts); + qemu_add_opts(&qemu_device_opts); + qemu_add_opts(&qemu_netdev_opts); diff --git a/0107-seccomp-fine-tuning-whitelist-by-adding-times.patch b/0107-seccomp-fine-tuning-whitelist-by-adding-times.patch new file mode 100644 index 0000000..6818b37 --- /dev/null +++ b/0107-seccomp-fine-tuning-whitelist-by-adding-times.patch @@ -0,0 +1,28 @@ +From aafda3de0ce3589fa69472bd4a1782c65c8c7ade Mon Sep 17 00:00:00 2001 +From: Eduardo Otubo +Date: Tue, 24 Sep 2013 14:50:44 -0300 +Subject: [PATCH] seccomp: fine tuning whitelist by adding times() + +This was causing Qemu process to hang when using -sandbox on as +discribed on RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1004175 + +Signed-off-by: Eduardo Otubo +Tested-by: Paul Moore +Acked-by: Paul Moore +(cherry picked from commit c236f4519c9838801798f3705c17dce9ab9e3b9d) +--- + qemu-seccomp.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/qemu-seccomp.c b/qemu-seccomp.c +index 37d38f8..69cee44 100644 +--- a/qemu-seccomp.c ++++ b/qemu-seccomp.c +@@ -90,6 +90,7 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { + { SCMP_SYS(getuid), 245 }, + { SCMP_SYS(geteuid), 245 }, + { SCMP_SYS(timer_create), 245 }, ++ { SCMP_SYS(times), 245 }, + { SCMP_SYS(exit), 245 }, + { SCMP_SYS(clock_gettime), 245 }, + { SCMP_SYS(time), 245 }, diff --git a/qemu.spec b/qemu.spec index 18937f1..1c04dab 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,7 +139,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.6.1 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -216,6 +216,11 @@ Patch0103: 0103-hw-9pfs-Fix-errno-value-for-xattr-functions.patch Patch0104: 0104-Fix-pc-migration-from-qemu-1.5.patch # Reduce CPU usage when audio is playing (bz #1017644) Patch0105: 0105-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch +# Fix drive discard options via libvirt (bz #1029953) +# Patch queued upstream +Patch0106: 0106-qmp-access-the-local-QemuOptsLists-for-drive-option.patch +# Fix process exit with -sandbox on (bz #1027421) +Patch0107: 0107-seccomp-fine-tuning-whitelist-by-adding-times.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -764,6 +769,11 @@ CAC emulation development files. %patch0104 -p1 # Reduce CPU usage when audio is playing (bz #1017644) %patch0105 -p1 +# Fix drive discard options via libvirt (bz #1029953) +# Patch queued upstream +%patch0106 -p1 +# Fix process exit with -sandbox on (bz #1027421) +%patch0107 -p1 %build @@ -1471,6 +1481,10 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Sun Nov 17 2013 Cole Robinson - 2:1.6.1-2 +- Fix drive discard options via libvirt (bz #1029953) +- Fix process exit with -sandbox on (bz #1027421) + * Tue Nov 05 2013 Cole Robinson - 2:1.6.1-1 - Reduce CPU usage when audio is playing (bz #1017644) - Base on qemu 1.6.1 tarball From 45bdef1ab085de92c576c86cfb7a7b4c5620adea Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 20 Nov 2013 18:32:50 -0500 Subject: [PATCH 34/45] Update to qemu-1.7.0-rc1 --- .gitignore | 1 + 0001-Fix-migration-from-qemu-kvm.patch | 212 ------------------ ...0001-pci-do-not-export-pci_bus_reset.patch | 10 +- 0002-isapc-disable-kvmvapic.patch | 36 --- ...pre-and-post-order-vists-in-qdev-wal.patch | 10 +- ...0003-qdev-switch-reset-to-post-order.patch | 10 +- ...=> 0004-virtio-bus-remove-vdev-field.patch | 35 ++- ...=> 0005-virtio-pci-remove-vdev-field.patch | 78 +++---- ...=> 0006-virtio-ccw-remove-vdev-field.patch | 46 ++-- ...io-bus-cleanup-plug-unplug-interface.patch | 6 +- ...h-exit-callback-to-VirtioDeviceClass.patch | 8 +- ...itch-exit-callback-to-VirtioDeviceCl.patch | 4 +- ...h-exit-callback-to-VirtioDeviceClass.patch | 10 +- ...ch-exit-callback-to-VirtioDeviceClas.patch | 8 +- ...witch-exit-callback-to-VirtioDeviceC.patch | 4 +- ...h-exit-callback-to-VirtioDeviceClass.patch | 12 +- ...io-pci-add-device_unplugged-callback.patch | 10 +- ...scard-type-to-qcow2_discard_clusters.patch | 81 ------- ...-state-in-active-L1-after-creating-s.patch | 73 ------ ...-Fix-errno-value-for-xattr-functions.patch | 68 ------ 0104-Fix-pc-migration-from-qemu-1.5.patch | 203 ----------------- ..._AUDIO_TIMER_PERIOD-instead-of-wakin.patch | 42 ---- ...local-QemuOptsLists-for-drive-option.patch | 181 --------------- ...ine-tuning-whitelist-by-adding-times.patch | 28 --- qemu.spec | 100 +++------ sources | 2 +- 26 files changed, 156 insertions(+), 1122 deletions(-) delete mode 100644 0001-Fix-migration-from-qemu-kvm.patch rename 0003-pci-do-not-export-pci_bus_reset.patch => 0001-pci-do-not-export-pci_bus_reset.patch (91%) delete mode 100644 0002-isapc-disable-kvmvapic.patch rename 0004-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch => 0002-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch (94%) rename 0005-qdev-switch-reset-to-post-order.patch => 0003-qdev-switch-reset-to-post-order.patch (95%) rename 0006-virtio-bus-remove-vdev-field.patch => 0004-virtio-bus-remove-vdev-field.patch (88%) rename 0007-virtio-pci-remove-vdev-field.patch => 0005-virtio-pci-remove-vdev-field.patch (86%) rename 0008-virtio-ccw-remove-vdev-field.patch => 0006-virtio-ccw-remove-vdev-field.patch (87%) rename 0009-virtio-bus-cleanup-plug-unplug-interface.patch => 0007-virtio-bus-cleanup-plug-unplug-interface.patch (97%) rename 0010-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch => 0008-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch (88%) rename 0011-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch => 0009-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch (95%) rename 0012-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch => 0010-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch (85%) rename 0013-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch => 0011-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch (94%) rename 0014-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch => 0012-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch (94%) rename 0015-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch => 0013-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch (81%) rename 0016-virtio-pci-add-device_unplugged-callback.patch => 0014-virtio-pci-add-device_unplugged-callback.patch (87%) delete mode 100644 0101-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch delete mode 100644 0102-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch delete mode 100644 0103-hw-9pfs-Fix-errno-value-for-xattr-functions.patch delete mode 100644 0104-Fix-pc-migration-from-qemu-1.5.patch delete mode 100644 0105-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch delete mode 100644 0106-qmp-access-the-local-QemuOptsLists-for-drive-option.patch delete mode 100644 0107-seccomp-fine-tuning-whitelist-by-adding-times.patch diff --git a/.gitignore b/.gitignore index a119815..8938ae8 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ qemu-kvm-0.13.0-25fdf4a.tar.gz /qemu-1.5.2.tar.bz2 /qemu-1.6.0.tar.bz2 /qemu-1.6.1.tar.bz2 +/qemu-1.7.0-rc1.tar.bz2 diff --git a/0001-Fix-migration-from-qemu-kvm.patch b/0001-Fix-migration-from-qemu-kvm.patch deleted file mode 100644 index a263329..0000000 --- a/0001-Fix-migration-from-qemu-kvm.patch +++ /dev/null @@ -1,212 +0,0 @@ -From 2196426a9b081cb99f4bdefb854aaa206bdd0392 Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Fri, 16 Aug 2013 12:14:51 -0400 -Subject: [PATCH] Fix migration from qemu-kvm - -Details are in the code comments for each change. Just lumped this together -to ease patch maintenance. - -Everything except the video memory bits can likely be dropped by Fedora 21 -time frame. Need to figure out if there's anything to upstream for the -video memory bits. ---- - hw/acpi/piix4.c | 8 ++++++- - hw/display/qxl.c | 9 ++++---- - hw/i386/pc_piix.c | 61 +++++++++++++++++++++++++++++++++++++++++++++---- - hw/timer/i8254_common.c | 7 +++++- - 4 files changed, 74 insertions(+), 11 deletions(-) - -diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c -index 3aaf18c..6fbe57c 100644 ---- a/hw/acpi/piix4.c -+++ b/hw/acpi/piix4.c -@@ -289,7 +289,13 @@ static int acpi_load_old(QEMUFile *f, void *opaque, int version_id) - static const VMStateDescription vmstate_acpi = { - .name = "piix4_pm", - .version_id = 3, -- .minimum_version_id = 3, -+ /* -+ * qemu-kvm 1.2 uses qemu.git version 3 format, but advertised as 2. -+ * This allows incoming migration from qemu-kvm, but breaks incoming -+ * migration from qemu < 1.3. -+ */ -+ //minimum_version_id = 3, -+ .minimum_version_id = 2, - .minimum_version_id_old = 1, - .load_state_old = acpi_load_old, - .post_load = vmstate_acpi_post_load, -diff --git a/hw/display/qxl.c b/hw/display/qxl.c -index c537057..7ef3eff 100644 ---- a/hw/display/qxl.c -+++ b/hw/display/qxl.c -@@ -307,16 +307,14 @@ static inline uint32_t msb_mask(uint32_t val) - return mask; - } - --static ram_addr_t qxl_rom_size(void) -+static void check_qxl_rom_size(PCIQXLDevice *d) - { - uint32_t required_rom_size = sizeof(QXLRom) + sizeof(QXLModes) + - sizeof(qxl_modes); -- uint32_t rom_size = 8192; /* two pages */ - - required_rom_size = MAX(required_rom_size, TARGET_PAGE_SIZE); - required_rom_size = msb_mask(required_rom_size * 2 - 1); -- assert(required_rom_size <= rom_size); -- return rom_size; -+ assert(required_rom_size <= d->rom_size); - } - - static void init_qxl_rom(PCIQXLDevice *d) -@@ -1981,7 +1979,7 @@ static int qxl_init_common(PCIQXLDevice *qxl) - pci_set_byte(&config[PCI_REVISION_ID], pci_device_rev); - pci_set_byte(&config[PCI_INTERRUPT_PIN], 1); - -- qxl->rom_size = qxl_rom_size(); -+ check_qxl_rom_size(qxl); - memory_region_init_ram(&qxl->rom_bar, OBJECT(qxl), "qxl.vrom", - qxl->rom_size); - vmstate_register_ram(&qxl->rom_bar, &qxl->pci.qdev); -@@ -2309,6 +2307,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), -+ DEFINE_PROP_UINT32("rom_size", PCIQXLDevice, rom_size, 8192), - DEFINE_PROP_END_OF_LIST(), - }; - -diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c -index 3df2ff9..28216ee 100644 ---- a/hw/i386/pc_piix.c -+++ b/hw/i386/pc_piix.c -@@ -377,6 +377,24 @@ static QEMUMachine pc_i440fx_machine_v1_4 = { - DEFAULT_MACHINE_OPTIONS, - }; - -+/* -+ * Commit 038c1879a00153b14bce113315b693e8c2944fa9 changed the qxl rom -+ * size to 8192, which fixes incoming migration from qemu 1.0. However -+ * from qemu 1.2 and 1.3 had rom size 16384, so incoming migration -+ * from those versions is now broken. -+ * -+ * Add a rom_size compat property. 1.2 and 1.3 get 16384, everything -+ * else is 8192. -+ * -+ * This isn't actually fool proof, since rom_size can be dependent on -+ * the version of spice qemu is built against: -+ * -+ * 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. -+ */ -+ - #define PC_COMPAT_1_3 \ - PC_COMPAT_1_4, \ - {\ -@@ -395,8 +413,17 @@ 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 = { - .name = "pc-1.3", - .desc = "Standard PC", -@@ -409,6 +436,19 @@ static QEMUMachine pc_machine_v1_3 = { - DEFAULT_MACHINE_OPTIONS, - }; - -+ -+/* -+ * https://lists.gnu.org/archive/html/qemu-devel/2013-01/msg02540.html -+ * -+ * qemu-kvm defaulted to vgamem=16MB since at least 0.15, while qemu used -+ * 8MB. For qemu 1.2, the default was changed to 16MB for all devices -+ * except cirrus. -+ * -+ * 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. -+ */ -+ - #define PC_COMPAT_1_2 \ - PC_COMPAT_1_3,\ - {\ -@@ -432,6 +472,10 @@ static QEMUMachine pc_machine_v1_3 = { - .property = "revision",\ - .value = stringify(3),\ - },{\ -+ .driver = "cirrus-vga",\ -+ .property = "vgamem_mb",\ -+ .value = stringify(16),\ -+ },{\ - .driver = "VGA",\ - .property = "mmio",\ - .value = "off",\ -@@ -462,25 +506,34 @@ static QEMUMachine pc_machine_v1_2 = { - },{\ - .driver = "VGA",\ - .property = "vgamem_mb",\ -- .value = stringify(8),\ -+ .value = stringify(16),\ - },{\ - .driver = "vmware-svga",\ - .property = "vgamem_mb",\ -- .value = stringify(8),\ -+ .value = stringify(16),\ - },{\ - .driver = "qxl-vga",\ - .property = "vgamem_mb",\ -- .value = stringify(8),\ -+ .value = stringify(16),\ - },{\ - .driver = "qxl",\ - .property = "vgamem_mb",\ -- .value = stringify(8),\ -+ .value = stringify(16),\ - },{\ - .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 = { - .name = "pc-1.1", - .desc = "Standard PC", -diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c -index 4e5bf0b..cbc00a0 100644 ---- a/hw/timer/i8254_common.c -+++ b/hw/timer/i8254_common.c -@@ -267,7 +267,12 @@ static const VMStateDescription vmstate_pit_common = { - .pre_save = pit_dispatch_pre_save, - .post_load = pit_dispatch_post_load, - .fields = (VMStateField[]) { -- VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3), -+ /* qemu-kvm version_id=2 had 'flags' here which is equivalent -+ * This fixes incoming migration from qemu-kvm 1.0, but breaks -+ * incoming migration from qemu < 1.1 -+ */ -+ //VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3), -+ VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), - VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2, - vmstate_pit_channel, PITChannelState), - VMSTATE_INT64(channels[0].next_transition_time, diff --git a/0003-pci-do-not-export-pci_bus_reset.patch b/0001-pci-do-not-export-pci_bus_reset.patch similarity index 91% rename from 0003-pci-do-not-export-pci_bus_reset.patch rename to 0001-pci-do-not-export-pci_bus_reset.patch index 21c6cef..dc5ffbf 100644 --- a/0003-pci-do-not-export-pci_bus_reset.patch +++ b/0001-pci-do-not-export-pci_bus_reset.patch @@ -1,4 +1,4 @@ -From 07873f45017c04994496d8dc3f7acb60358bba49 Mon Sep 17 00:00:00 2001 +From 68c3010699db0e83c7bb2ac469527d6a7a36dfa4 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 2 May 2013 11:38:37 +0200 Subject: [PATCH] pci: do not export pci_bus_reset @@ -19,7 +19,7 @@ Signed-off-by: Paolo Bonzini 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c -index 4c004f5..0389375 100644 +index ed32059..ab73b4c 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -210,8 +210,9 @@ void pci_device_reset(PCIDevice *dev) @@ -46,7 +46,7 @@ index 4c004f5..0389375 100644 /* topology traverse is done by pci_bus_reset(). Tell qbus/qdev walker not to traverse the tree */ diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c -index a90671d..5d0e5ff 100644 +index 290abab..41d8755 100644 --- a/hw/pci/pci_bridge.c +++ b/hw/pci/pci_bridge.c @@ -268,7 +268,7 @@ void pci_bridge_write_config(PCIDevice *d, @@ -59,10 +59,10 @@ index a90671d..5d0e5ff 100644 } diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h -index ccec2ba..32f1419 100644 +index b783e68..754b82d 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h -@@ -376,7 +376,6 @@ void pci_bus_fire_intx_routing_notifier(PCIBus *bus); +@@ -373,7 +373,6 @@ void pci_bus_fire_intx_routing_notifier(PCIBus *bus); void pci_device_set_intx_routing_notifier(PCIDevice *dev, PCIINTxRoutingNotifier notifier); void pci_device_reset(PCIDevice *dev); diff --git a/0002-isapc-disable-kvmvapic.patch b/0002-isapc-disable-kvmvapic.patch deleted file mode 100644 index 4adf992..0000000 --- a/0002-isapc-disable-kvmvapic.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 85a924af30f31a4f701ee6f18d84dd27aa02f47b Mon Sep 17 00:00:00 2001 -From: Paolo Bonzini -Date: Tue, 13 Aug 2013 00:02:18 +0200 -Subject: [PATCH] isapc: disable kvmvapic - -vapic requires the VAPIC ROM to be mapped into RAM. This is not -possible without PAM hardware. This fixes a segmentation fault -running with -M isapc. - -Cc: qemu-stable@nongnu.org -Signed-off-by: Paolo Bonzini - -(crobinso: s/kvmvapic/vapic/g) - -Signed-off-by: Cole Robinson ---- - hw/i386/pc_piix.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c -index 28216ee..2f2cb4d 100644 ---- a/hw/i386/pc_piix.c -+++ b/hw/i386/pc_piix.c -@@ -795,7 +795,11 @@ static QEMUMachine isapc_machine = { - .init = pc_init_isa, - .max_cpus = 1, - .compat_props = (GlobalProperty[]) { -- { /* end of list */ } -+ { -+ .driver = "apic-common", -+ .property = "vapic", -+ .value = "off", -+ }, - }, - DEFAULT_MACHINE_OPTIONS, - }; diff --git a/0004-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch b/0002-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch similarity index 94% rename from 0004-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch rename to 0002-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch index 8580f62..eeeb7f8 100644 --- a/0004-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch +++ b/0002-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch @@ -1,4 +1,4 @@ -From cf09bc533d82f2b16d1e9f4888c1afd977ca256d Mon Sep 17 00:00:00 2001 +From ea25537789eb25313d6b4baee7c00d36b1dcdf17 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 2 May 2013 11:38:38 +0200 Subject: [PATCH] qdev: allow both pre- and post-order vists in qdev walking @@ -16,7 +16,7 @@ Signed-off-by: Paolo Bonzini 2 files changed, 42 insertions(+), 16 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c -index 9190a7e..842804f 100644 +index e374a93..5ddf1aa 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -240,12 +240,12 @@ static int qbus_reset_one(BusState *bus, void *opaque) @@ -34,7 +34,7 @@ index 9190a7e..842804f 100644 } void qbus_reset_all_fn(void *opaque) -@@ -343,49 +343,70 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name) +@@ -337,49 +337,70 @@ BusState *qdev_get_child_bus(DeviceState *dev, const char *name) return NULL; } @@ -116,10 +116,10 @@ index 9190a7e..842804f 100644 } diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h -index 46972f4..c6c9b14 100644 +index f2043a6..ecf5cb3 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h -@@ -270,10 +270,15 @@ BusState *qbus_create(const char *typename, DeviceState *parent, const char *nam +@@ -253,10 +253,15 @@ BusState *qbus_create(const char *typename, DeviceState *parent, const char *nam /* Returns > 0 if either devfn or busfn skip walk somewhere in cursion, * < 0 if either devfn or busfn terminate walk somewhere in cursion, * 0 otherwise. */ diff --git a/0005-qdev-switch-reset-to-post-order.patch b/0003-qdev-switch-reset-to-post-order.patch similarity index 95% rename from 0005-qdev-switch-reset-to-post-order.patch rename to 0003-qdev-switch-reset-to-post-order.patch index 2f533e5..d4dd4c9 100644 --- a/0005-qdev-switch-reset-to-post-order.patch +++ b/0003-qdev-switch-reset-to-post-order.patch @@ -1,4 +1,4 @@ -From 41a2077cea8ce006dbef885bcb0778af05a0b159 Mon Sep 17 00:00:00 2001 +From 6e6d80327eb2e249daaa0937468248d54222b125 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 2 May 2013 11:38:39 +0200 Subject: [PATCH] qdev: switch reset to post-order @@ -32,7 +32,7 @@ Signed-off-by: Paolo Bonzini 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c -index 842804f..87d7e1e 100644 +index 5ddf1aa..d2ffe35 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -233,19 +233,19 @@ static int qbus_reset_one(BusState *bus, void *opaque) @@ -59,7 +59,7 @@ index 842804f..87d7e1e 100644 void qbus_reset_all_fn(void *opaque) diff --git a/hw/pci/pci.c b/hw/pci/pci.c -index 0389375..bbca696 100644 +index ab73b4c..b52df14 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -46,7 +46,7 @@ @@ -129,10 +129,10 @@ index 0389375..bbca696 100644 static void pci_host_bus_register(PCIBus *bus, DeviceState *parent) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h -index c6c9b14..89dcbad 100644 +index ecf5cb3..a9ce4a3 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h -@@ -174,7 +174,7 @@ struct BusClass { +@@ -158,7 +158,7 @@ struct BusClass { * bindings can be found at http://playground.sun.com/1275/bindings/. */ char *(*get_fw_dev_path)(DeviceState *dev); diff --git a/0006-virtio-bus-remove-vdev-field.patch b/0004-virtio-bus-remove-vdev-field.patch similarity index 88% rename from 0006-virtio-bus-remove-vdev-field.patch rename to 0004-virtio-bus-remove-vdev-field.patch index 617326f..e058832 100644 --- a/0006-virtio-bus-remove-vdev-field.patch +++ b/0004-virtio-bus-remove-vdev-field.patch @@ -1,4 +1,4 @@ -From ed35f9edcc420b4f8c1f909bc7cfb002a54f437b Mon Sep 17 00:00:00 2001 +From 21cbcaf09677ba959d977bfc0712c5e08ca1aec9 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:50 +0200 Subject: [PATCH] virtio-bus: remove vdev field @@ -9,14 +9,14 @@ BusState's list of children. Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- - hw/virtio/virtio-bus.c | 67 ++++++++++++++++++++++++------------------ + hw/virtio/virtio-bus.c | 65 +++++++++++++++++++++++++----------------- hw/virtio/virtio-mmio.c | 9 +++--- hw/virtio/virtio-pci.c | 2 +- - include/hw/virtio/virtio-bus.h | 16 +++++++--- - 4 files changed, 57 insertions(+), 37 deletions(-) + include/hw/virtio/virtio-bus.h | 16 ++++++++--- + 4 files changed, 57 insertions(+), 35 deletions(-) diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c -index 6849a01..669ce38 100644 +index e6b103c..17dd06e 100644 --- a/hw/virtio/virtio-bus.c +++ b/hw/virtio/virtio-bus.c @@ -46,8 +46,6 @@ int virtio_bus_plug_device(VirtIODevice *vdev) @@ -28,7 +28,7 @@ index 6849a01..669ce38 100644 if (klass->device_plugged != NULL) { klass->device_plugged(qbus->parent); } -@@ -58,75 +56,84 @@ int virtio_bus_plug_device(VirtIODevice *vdev) +@@ -58,9 +56,11 @@ int virtio_bus_plug_device(VirtIODevice *vdev) /* Reset the virtio_bus */ void virtio_bus_reset(VirtioBusState *bus) { @@ -42,10 +42,8 @@ index 6849a01..669ce38 100644 } } - /* Destroy the VirtIODevice */ - void virtio_bus_destroy_device(VirtioBusState *bus) +@@ -69,62 +69,71 @@ void virtio_bus_destroy_device(VirtioBusState *bus) { -- DeviceState *qdev; BusState *qbus = BUS(bus); VirtioBusClass *klass = VIRTIO_BUS_GET_CLASS(bus); + VirtIODevice *vdev = virtio_bus_get_device(bus); @@ -57,10 +55,9 @@ index 6849a01..669ce38 100644 if (klass->device_unplug != NULL) { klass->device_unplug(qbus->parent); } -- qdev = DEVICE(bus->vdev); -- qdev_free(qdev); +- object_unparent(OBJECT(bus->vdev)); - bus->vdev = NULL; -+ qdev_free(DEVICE(vdev)); ++ object_unparent(OBJECT(vdev)); } } @@ -133,7 +130,7 @@ index 6849a01..669ce38 100644 } else { return 0; } -@@ -135,22 +142,26 @@ uint32_t virtio_bus_get_vdev_bad_features(VirtioBusState *bus) +@@ -133,22 +142,26 @@ uint32_t virtio_bus_get_vdev_bad_features(VirtioBusState *bus) /* Get config of the plugged device. */ void virtio_bus_get_vdev_config(VirtioBusState *bus, uint8_t *config) { @@ -167,10 +164,10 @@ index 6849a01..669ce38 100644 } diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c -index 4bd2953..8f7b764 100644 +index 29cf284..8829eb0 100644 --- a/hw/virtio/virtio-mmio.c +++ b/hw/virtio/virtio-mmio.c -@@ -94,7 +94,7 @@ static void virtio_mmio_bus_new(VirtioBusState *bus, VirtIOMMIOProxy *dev); +@@ -95,7 +95,7 @@ static void virtio_mmio_bus_new(VirtioBusState *bus, size_t bus_size, static uint64_t virtio_mmio_read(void *opaque, hwaddr offset, unsigned size) { VirtIOMMIOProxy *proxy = (VirtIOMMIOProxy *)opaque; @@ -179,7 +176,7 @@ index 4bd2953..8f7b764 100644 DPRINTF("virtio_mmio_read offset 0x%x\n", (int)offset); -@@ -184,7 +184,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value, +@@ -185,7 +185,7 @@ static void virtio_mmio_write(void *opaque, hwaddr offset, uint64_t value, unsigned size) { VirtIOMMIOProxy *proxy = (VirtIOMMIOProxy *)opaque; @@ -188,7 +185,7 @@ index 4bd2953..8f7b764 100644 DPRINTF("virtio_mmio_write offset 0x%x value 0x%" PRIx64 "\n", (int)offset, value); -@@ -297,12 +297,13 @@ static const MemoryRegionOps virtio_mem_ops = { +@@ -298,12 +298,13 @@ static const MemoryRegionOps virtio_mem_ops = { static void virtio_mmio_update_irq(DeviceState *opaque, uint16_t vector) { VirtIOMMIOProxy *proxy = VIRTIO_MMIO(opaque); @@ -205,10 +202,10 @@ index 4bd2953..8f7b764 100644 qemu_set_irq(proxy->irq, level); } diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c -index 41b96ce..55617a6 100644 +index 7647be8..76b7652 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c -@@ -942,7 +942,7 @@ static void virtio_pci_device_plugged(DeviceState *d) +@@ -943,7 +943,7 @@ static void virtio_pci_device_plugged(DeviceState *d) uint8_t *config; uint32_t size; diff --git a/0007-virtio-pci-remove-vdev-field.patch b/0005-virtio-pci-remove-vdev-field.patch similarity index 86% rename from 0007-virtio-pci-remove-vdev-field.patch rename to 0005-virtio-pci-remove-vdev-field.patch index f8000e7..2a4dabb 100644 --- a/0007-virtio-pci-remove-vdev-field.patch +++ b/0005-virtio-pci-remove-vdev-field.patch @@ -1,4 +1,4 @@ -From 1d388b4fda2c4c9d00dc6ae91aaf35eb9fc04c26 Mon Sep 17 00:00:00 2001 +From cc7e97d969c93e197bda7ed17d32254e31793b2d Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:51 +0200 Subject: [PATCH] virtio-pci: remove vdev field @@ -27,10 +27,10 @@ index 96d6f5d..00932c7 100644 uint32_t host_features[VIRTIO_CCW_FEATURE_SIZE]; VirtioBusState bus; diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c -index 55617a6..6fd6d6d 100644 +index 76b7652..be18e92 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c -@@ -112,31 +112,39 @@ static inline VirtIOPCIProxy *to_virtio_pci_proxy_fast(DeviceState *d) +@@ -113,31 +113,39 @@ static inline VirtIOPCIProxy *to_virtio_pci_proxy_fast(DeviceState *d) static void virtio_pci_notify(DeviceState *d, uint16_t vector) { VirtIOPCIProxy *proxy = to_virtio_pci_proxy_fast(d); @@ -39,8 +39,8 @@ index 55617a6..6fd6d6d 100644 if (msix_enabled(&proxy->pci_dev)) msix_notify(&proxy->pci_dev, vector); else -- qemu_set_irq(proxy->pci_dev.irq[0], proxy->vdev->isr & 1); -+ qemu_set_irq(proxy->pci_dev.irq[0], vdev->isr & 1); +- pci_set_irq(&proxy->pci_dev, proxy->vdev->isr & 1); ++ pci_set_irq(&proxy->pci_dev, vdev->isr & 1); } static void virtio_pci_save_config(DeviceState *d, QEMUFile *f) @@ -73,7 +73,7 @@ index 55617a6..6fd6d6d 100644 int ret; ret = pci_device_load(&proxy->pci_dev, f); if (ret) { -@@ -145,12 +153,12 @@ static int virtio_pci_load_config(DeviceState *d, QEMUFile *f) +@@ -146,12 +154,12 @@ static int virtio_pci_load_config(DeviceState *d, QEMUFile *f) msix_unuse_all_vectors(&proxy->pci_dev); msix_load(&proxy->pci_dev, f); if (msix_present(&proxy->pci_dev)) { @@ -90,7 +90,7 @@ index 55617a6..6fd6d6d 100644 } return 0; } -@@ -158,13 +166,15 @@ static int virtio_pci_load_config(DeviceState *d, QEMUFile *f) +@@ -159,13 +167,15 @@ static int virtio_pci_load_config(DeviceState *d, QEMUFile *f) static int virtio_pci_load_queue(DeviceState *d, int n, QEMUFile *f) { VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d); @@ -107,7 +107,7 @@ index 55617a6..6fd6d6d 100644 if (vector != VIRTIO_NO_VECTOR) { return msix_vector_use(&proxy->pci_dev, vector); } -@@ -174,7 +184,8 @@ static int virtio_pci_load_queue(DeviceState *d, int n, QEMUFile *f) +@@ -175,7 +185,8 @@ static int virtio_pci_load_queue(DeviceState *d, int n, QEMUFile *f) static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy, int n, bool assign, bool set_handler) { @@ -117,7 +117,7 @@ index 55617a6..6fd6d6d 100644 EventNotifier *notifier = virtio_queue_get_host_notifier(vq); int r = 0; -@@ -199,6 +210,7 @@ static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy, +@@ -200,6 +211,7 @@ static int virtio_pci_set_host_notifier_internal(VirtIOPCIProxy *proxy, static void virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy) { @@ -125,7 +125,7 @@ index 55617a6..6fd6d6d 100644 int n, r; if (!(proxy->flags & VIRTIO_PCI_FLAG_USE_IOEVENTFD) || -@@ -208,7 +220,7 @@ static void virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy) +@@ -209,7 +221,7 @@ static void virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy) } for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) { @@ -134,7 +134,7 @@ index 55617a6..6fd6d6d 100644 continue; } -@@ -222,7 +234,7 @@ static void virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy) +@@ -223,7 +235,7 @@ static void virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy) assign_error: while (--n >= 0) { @@ -143,7 +143,7 @@ index 55617a6..6fd6d6d 100644 continue; } -@@ -235,6 +247,7 @@ assign_error: +@@ -236,6 +248,7 @@ assign_error: static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy) { @@ -151,7 +151,7 @@ index 55617a6..6fd6d6d 100644 int r; int n; -@@ -243,7 +256,7 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy) +@@ -244,7 +257,7 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy) } for (n = 0; n < VIRTIO_PCI_QUEUE_MAX; n++) { @@ -160,7 +160,7 @@ index 55617a6..6fd6d6d 100644 continue; } -@@ -256,7 +269,7 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy) +@@ -257,7 +270,7 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy) static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) { VirtIOPCIProxy *proxy = opaque; @@ -169,7 +169,7 @@ index 55617a6..6fd6d6d 100644 hwaddr pa; switch (addr) { -@@ -271,7 +284,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) +@@ -272,7 +285,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) pa = (hwaddr)val << VIRTIO_PCI_QUEUE_ADDR_SHIFT; if (pa == 0) { virtio_pci_stop_ioeventfd(proxy); @@ -178,7 +178,7 @@ index 55617a6..6fd6d6d 100644 msix_unuse_all_vectors(&proxy->pci_dev); } else -@@ -298,7 +311,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) +@@ -299,7 +312,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) } if (vdev->status == 0) { @@ -187,7 +187,7 @@ index 55617a6..6fd6d6d 100644 msix_unuse_all_vectors(&proxy->pci_dev); } -@@ -334,7 +347,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) +@@ -335,7 +348,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val) static uint32_t virtio_ioport_read(VirtIOPCIProxy *proxy, uint32_t addr) { @@ -196,7 +196,7 @@ index 55617a6..6fd6d6d 100644 uint32_t ret = 0xFFFFFFFF; switch (addr) { -@@ -380,6 +393,7 @@ static uint64_t virtio_pci_config_read(void *opaque, hwaddr addr, +@@ -381,6 +394,7 @@ static uint64_t virtio_pci_config_read(void *opaque, hwaddr addr, unsigned size) { VirtIOPCIProxy *proxy = opaque; @@ -204,7 +204,7 @@ index 55617a6..6fd6d6d 100644 uint32_t config = VIRTIO_PCI_CONFIG(&proxy->pci_dev); uint64_t val = 0; if (addr < config) { -@@ -389,16 +403,16 @@ static uint64_t virtio_pci_config_read(void *opaque, hwaddr addr, +@@ -390,16 +404,16 @@ static uint64_t virtio_pci_config_read(void *opaque, hwaddr addr, switch (size) { case 1: @@ -224,7 +224,7 @@ index 55617a6..6fd6d6d 100644 if (virtio_is_big_endian()) { val = bswap32(val); } -@@ -412,6 +426,7 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr, +@@ -413,6 +427,7 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr, { VirtIOPCIProxy *proxy = opaque; uint32_t config = VIRTIO_PCI_CONFIG(&proxy->pci_dev); @@ -232,7 +232,7 @@ index 55617a6..6fd6d6d 100644 if (addr < config) { virtio_ioport_write(proxy, addr, val); return; -@@ -423,19 +438,19 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr, +@@ -424,19 +439,19 @@ static void virtio_pci_config_write(void *opaque, hwaddr addr, */ switch (size) { case 1: @@ -255,7 +255,7 @@ index 55617a6..6fd6d6d 100644 break; } } -@@ -454,6 +469,7 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, +@@ -455,6 +470,7 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, uint32_t val, int len) { VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev); @@ -263,7 +263,7 @@ index 55617a6..6fd6d6d 100644 pci_default_write_config(pci_dev, address, val, len); -@@ -461,8 +477,7 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, +@@ -462,8 +478,7 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address, !(pci_dev->config[PCI_COMMAND] & PCI_COMMAND_MASTER) && !(proxy->flags & VIRTIO_PCI_FLAG_BUS_MASTER_BUG)) { virtio_pci_stop_ioeventfd(proxy); @@ -273,7 +273,7 @@ index 55617a6..6fd6d6d 100644 } } -@@ -505,7 +520,8 @@ static int kvm_virtio_pci_irqfd_use(VirtIOPCIProxy *proxy, +@@ -506,7 +521,8 @@ static int kvm_virtio_pci_irqfd_use(VirtIOPCIProxy *proxy, unsigned int vector) { VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector]; @@ -282,8 +282,8 @@ index 55617a6..6fd6d6d 100644 + VirtQueue *vq = virtio_get_queue(vdev, queue_no); EventNotifier *n = virtio_queue_get_guest_notifier(vq); int ret; - ret = kvm_irqchip_add_irqfd_notifier(kvm_state, n, irqfd->virq); -@@ -516,7 +532,8 @@ static void kvm_virtio_pci_irqfd_release(VirtIOPCIProxy *proxy, + ret = kvm_irqchip_add_irqfd_notifier(kvm_state, n, NULL, irqfd->virq); +@@ -517,7 +533,8 @@ static void kvm_virtio_pci_irqfd_release(VirtIOPCIProxy *proxy, unsigned int queue_no, unsigned int vector) { @@ -293,7 +293,7 @@ index 55617a6..6fd6d6d 100644 EventNotifier *n = virtio_queue_get_guest_notifier(vq); VirtIOIRQFD *irqfd = &proxy->vector_irqfd[vector]; int ret; -@@ -528,7 +545,7 @@ static void kvm_virtio_pci_irqfd_release(VirtIOPCIProxy *proxy, +@@ -529,7 +546,7 @@ static void kvm_virtio_pci_irqfd_release(VirtIOPCIProxy *proxy, static int kvm_virtio_pci_vector_use(VirtIOPCIProxy *proxy, int nvqs) { PCIDevice *dev = &proxy->pci_dev; @@ -302,7 +302,7 @@ index 55617a6..6fd6d6d 100644 VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); unsigned int vector; int ret, queue_no; -@@ -577,7 +594,7 @@ undo: +@@ -578,7 +595,7 @@ undo: static void kvm_virtio_pci_vector_release(VirtIOPCIProxy *proxy, int nvqs) { PCIDevice *dev = &proxy->pci_dev; @@ -311,7 +311,7 @@ index 55617a6..6fd6d6d 100644 unsigned int vector; int queue_no; VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); -@@ -605,8 +622,9 @@ static int virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy, +@@ -606,8 +623,9 @@ static int virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy, unsigned int vector, MSIMessage msg) { @@ -323,7 +323,7 @@ index 55617a6..6fd6d6d 100644 EventNotifier *n = virtio_queue_get_guest_notifier(vq); VirtIOIRQFD *irqfd; int ret = 0; -@@ -625,10 +643,10 @@ static int virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy, +@@ -626,10 +644,10 @@ static int virtio_pci_vq_vector_unmask(VirtIOPCIProxy *proxy, * Otherwise, set it up now. */ if (k->guest_notifier_mask) { @@ -336,7 +336,7 @@ index 55617a6..6fd6d6d 100644 event_notifier_set(n); } } else { -@@ -641,13 +659,14 @@ static void virtio_pci_vq_vector_mask(VirtIOPCIProxy *proxy, +@@ -642,13 +660,14 @@ static void virtio_pci_vq_vector_mask(VirtIOPCIProxy *proxy, unsigned int queue_no, unsigned int vector) { @@ -353,7 +353,7 @@ index 55617a6..6fd6d6d 100644 } else { kvm_virtio_pci_irqfd_release(proxy, queue_no, vector); } -@@ -657,7 +676,7 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, unsigned vector, +@@ -658,7 +677,7 @@ static int virtio_pci_vector_unmask(PCIDevice *dev, unsigned vector, MSIMessage msg) { VirtIOPCIProxy *proxy = container_of(dev, VirtIOPCIProxy, pci_dev); @@ -362,7 +362,7 @@ index 55617a6..6fd6d6d 100644 int ret, queue_no; for (queue_no = 0; queue_no < proxy->nvqs_with_notifiers; queue_no++) { -@@ -687,7 +706,7 @@ undo: +@@ -688,7 +707,7 @@ undo: static void virtio_pci_vector_mask(PCIDevice *dev, unsigned vector) { VirtIOPCIProxy *proxy = container_of(dev, VirtIOPCIProxy, pci_dev); @@ -371,7 +371,7 @@ index 55617a6..6fd6d6d 100644 int queue_no; for (queue_no = 0; queue_no < proxy->nvqs_with_notifiers; queue_no++) { -@@ -706,7 +725,7 @@ static void virtio_pci_vector_poll(PCIDevice *dev, +@@ -707,7 +726,7 @@ static void virtio_pci_vector_poll(PCIDevice *dev, unsigned int vector_end) { VirtIOPCIProxy *proxy = container_of(dev, VirtIOPCIProxy, pci_dev); @@ -380,7 +380,7 @@ index 55617a6..6fd6d6d 100644 VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); int queue_no; unsigned int vector; -@@ -738,8 +757,9 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign, +@@ -739,8 +758,9 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign, bool with_irqfd) { VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d); @@ -392,7 +392,7 @@ index 55617a6..6fd6d6d 100644 EventNotifier *notifier = virtio_queue_get_guest_notifier(vq); if (assign) { -@@ -754,7 +774,7 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign, +@@ -755,7 +775,7 @@ static int virtio_pci_set_guest_notifier(DeviceState *d, int n, bool assign, } if (!msix_enabled(&proxy->pci_dev) && vdc->guest_notifier_mask) { @@ -401,7 +401,7 @@ index 55617a6..6fd6d6d 100644 } return 0; -@@ -769,7 +789,7 @@ static bool virtio_pci_query_guest_notifiers(DeviceState *d) +@@ -770,7 +790,7 @@ static bool virtio_pci_query_guest_notifiers(DeviceState *d) static int virtio_pci_set_guest_notifiers(DeviceState *d, int nvqs, bool assign) { VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d); @@ -410,7 +410,7 @@ index 55617a6..6fd6d6d 100644 VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); int r, n; bool with_irqfd = msix_enabled(&proxy->pci_dev) && -@@ -863,11 +883,12 @@ static int virtio_pci_set_host_notifier(DeviceState *d, int n, bool assign) +@@ -864,11 +884,12 @@ static int virtio_pci_set_host_notifier(DeviceState *d, int n, bool assign) static void virtio_pci_vmstate_change(DeviceState *d, bool running) { VirtIOPCIProxy *proxy = to_virtio_pci_proxy(d); @@ -424,7 +424,7 @@ index 55617a6..6fd6d6d 100644 !(proxy->pci_dev.config[PCI_COMMAND] & PCI_COMMAND_MASTER)) { proxy->flags |= VIRTIO_PCI_FLAG_BUS_MASTER_BUG; } -@@ -942,8 +963,6 @@ static void virtio_pci_device_plugged(DeviceState *d) +@@ -943,8 +964,6 @@ static void virtio_pci_device_plugged(DeviceState *d) uint8_t *config; uint32_t size; diff --git a/0008-virtio-ccw-remove-vdev-field.patch b/0006-virtio-ccw-remove-vdev-field.patch similarity index 87% rename from 0008-virtio-ccw-remove-vdev-field.patch rename to 0006-virtio-ccw-remove-vdev-field.patch index d0c8d62..19e3fd6 100644 --- a/0008-virtio-ccw-remove-vdev-field.patch +++ b/0006-virtio-ccw-remove-vdev-field.patch @@ -1,4 +1,4 @@ -From a9b1f1aeba8167ae90aecea9b8ca223faf33ae90 Mon Sep 17 00:00:00 2001 +From 7b81da30e3f4cb6e617f08cc822f4575a4a9e431 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:52 +0200 Subject: [PATCH] virtio-ccw: remove vdev field @@ -13,10 +13,10 @@ Signed-off-by: Paolo Bonzini 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c -index 8835bd4..0fc7387 100644 +index f93a81c..8947196 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c -@@ -56,9 +56,10 @@ static const TypeInfo virtual_css_bus_info = { +@@ -57,9 +57,10 @@ static const TypeInfo virtual_css_bus_info = { VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch) { VirtIODevice *vdev = NULL; @@ -29,7 +29,7 @@ index 8835bd4..0fc7387 100644 } return vdev; } -@@ -66,7 +67,8 @@ VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch) +@@ -67,7 +68,8 @@ VirtIODevice *virtio_ccw_get_vdev(SubchDev *sch) static int virtio_ccw_set_guest2host_notifier(VirtioCcwDevice *dev, int n, bool assign, bool set_handler) { @@ -39,7 +39,7 @@ index 8835bd4..0fc7387 100644 EventNotifier *notifier = virtio_queue_get_host_notifier(vq); int r = 0; SubchDev *sch = dev->sch; -@@ -96,6 +98,7 @@ static int virtio_ccw_set_guest2host_notifier(VirtioCcwDevice *dev, int n, +@@ -97,6 +99,7 @@ static int virtio_ccw_set_guest2host_notifier(VirtioCcwDevice *dev, int n, static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) { @@ -47,7 +47,7 @@ index 8835bd4..0fc7387 100644 int n, r; if (!(dev->flags & VIRTIO_CCW_FLAG_USE_IOEVENTFD) || -@@ -103,8 +106,9 @@ static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) +@@ -104,8 +107,9 @@ static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) dev->ioeventfd_started) { return; } @@ -58,7 +58,7 @@ index 8835bd4..0fc7387 100644 continue; } r = virtio_ccw_set_guest2host_notifier(dev, n, true, true); -@@ -117,7 +121,7 @@ static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) +@@ -118,7 +122,7 @@ static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) assign_error: while (--n >= 0) { @@ -67,7 +67,7 @@ index 8835bd4..0fc7387 100644 continue; } r = virtio_ccw_set_guest2host_notifier(dev, n, false, false); -@@ -131,13 +135,15 @@ static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) +@@ -132,13 +136,15 @@ static void virtio_ccw_start_ioeventfd(VirtioCcwDevice *dev) static void virtio_ccw_stop_ioeventfd(VirtioCcwDevice *dev) { @@ -84,7 +84,7 @@ index 8835bd4..0fc7387 100644 continue; } r = virtio_ccw_set_guest2host_notifier(dev, n, false, false); -@@ -188,7 +194,7 @@ typedef struct VirtioFeatDesc { +@@ -189,7 +195,7 @@ typedef struct VirtioFeatDesc { static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t addr, uint32_t align, uint16_t index, uint16_t num) { @@ -93,7 +93,7 @@ index 8835bd4..0fc7387 100644 if (index > VIRTIO_PCI_QUEUE_MAX) { return -EINVAL; -@@ -199,23 +205,23 @@ static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t addr, uint32_t align, +@@ -200,23 +206,23 @@ static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t addr, uint32_t align, return -EINVAL; } @@ -123,7 +123,7 @@ index 8835bd4..0fc7387 100644 return 0; } -@@ -229,6 +235,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) +@@ -230,6 +236,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) hwaddr indicators; VqConfigBlock vq_config; VirtioCcwDevice *dev = sch->driver_data; @@ -131,7 +131,7 @@ index 8835bd4..0fc7387 100644 bool check_len; int len; hwaddr hw_len; -@@ -271,7 +278,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) +@@ -272,7 +279,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) break; case CCW_CMD_VDEV_RESET: virtio_ccw_stop_ioeventfd(dev); @@ -140,7 +140,7 @@ index 8835bd4..0fc7387 100644 ret = 0; break; case CCW_CMD_READ_FEAT: -@@ -318,7 +325,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) +@@ -319,7 +326,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) features.features = ldl_le_phys(ccw.cda); if (features.index < ARRAY_SIZE(dev->host_features)) { virtio_bus_set_vdev_features(&dev->bus, features.features); @@ -149,7 +149,7 @@ index 8835bd4..0fc7387 100644 } else { /* * If the guest supports more feature bits, assert that it -@@ -336,30 +343,30 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) +@@ -337,30 +344,30 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) break; case CCW_CMD_READ_CONF: if (check_len) { @@ -186,7 +186,7 @@ index 8835bd4..0fc7387 100644 hw_len = len; if (!ccw.cda) { ret = -EFAULT; -@@ -370,9 +377,9 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) +@@ -371,9 +378,9 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) } else { len = hw_len; /* XXX config space endianness */ @@ -198,7 +198,7 @@ index 8835bd4..0fc7387 100644 sch->curr_status.scsw.count = ccw.count - len; ret = 0; } -@@ -396,9 +403,9 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) +@@ -397,9 +404,9 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) if (!(status & VIRTIO_CONFIG_S_DRIVER_OK)) { virtio_ccw_stop_ioeventfd(dev); } @@ -211,7 +211,7 @@ index 8835bd4..0fc7387 100644 } if (status & VIRTIO_CONFIG_S_DRIVER_OK) { virtio_ccw_start_ioeventfd(dev); -@@ -462,7 +469,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) +@@ -463,7 +470,7 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) ret = -EFAULT; } else { vq_config.index = lduw_phys(ccw.cda); @@ -220,7 +220,7 @@ index 8835bd4..0fc7387 100644 vq_config.index); stw_phys(ccw.cda + sizeof(vq_config.index), vq_config.num_max); sch->curr_status.scsw.count = ccw.count - sizeof(vq_config); -@@ -494,7 +501,6 @@ static int virtio_ccw_device_init(VirtioCcwDevice *dev, VirtIODevice *vdev) +@@ -495,7 +502,6 @@ static int virtio_ccw_device_init(VirtioCcwDevice *dev, VirtIODevice *vdev) sch->driver_data = dev; dev->sch = sch; @@ -228,7 +228,7 @@ index 8835bd4..0fc7387 100644 dev->indicators = 0; /* Initialize subchannel structure. */ -@@ -607,7 +613,7 @@ static int virtio_ccw_device_init(VirtioCcwDevice *dev, VirtIODevice *vdev) +@@ -608,7 +614,7 @@ static int virtio_ccw_device_init(VirtioCcwDevice *dev, VirtIODevice *vdev) memset(&sch->id, 0, sizeof(SenseId)); sch->id.reserved = 0xff; sch->id.cu_type = VIRTIO_CCW_CU_TYPE; @@ -237,7 +237,7 @@ index 8835bd4..0fc7387 100644 /* Only the first 32 feature bits are used. */ dev->host_features[0] = virtio_bus_get_vdev_features(&dev->bus, -@@ -891,9 +897,10 @@ static unsigned virtio_ccw_get_features(DeviceState *d) +@@ -892,9 +898,10 @@ static unsigned virtio_ccw_get_features(DeviceState *d) static void virtio_ccw_reset(DeviceState *d) { VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d); @@ -249,7 +249,7 @@ index 8835bd4..0fc7387 100644 css_reset_sch(dev->sch); dev->indicators = 0; dev->indicators2 = 0; -@@ -933,9 +940,10 @@ static int virtio_ccw_set_host_notifier(DeviceState *d, int n, bool assign) +@@ -934,9 +941,10 @@ static int virtio_ccw_set_host_notifier(DeviceState *d, int n, bool assign) static int virtio_ccw_set_guest_notifier(VirtioCcwDevice *dev, int n, bool assign, bool with_irqfd) { @@ -262,7 +262,7 @@ index 8835bd4..0fc7387 100644 if (assign) { int r = event_notifier_init(notifier, 0); -@@ -951,16 +959,16 @@ static int virtio_ccw_set_guest_notifier(VirtioCcwDevice *dev, int n, +@@ -952,16 +960,16 @@ static int virtio_ccw_set_guest_notifier(VirtioCcwDevice *dev, int n, * land in qemu (and only the irq fd) in this code. */ if (k->guest_notifier_mask) { @@ -282,7 +282,7 @@ index 8835bd4..0fc7387 100644 } virtio_queue_set_guest_notifier_fd_handler(vq, false, with_irqfd); event_notifier_cleanup(notifier); -@@ -972,7 +980,7 @@ static int virtio_ccw_set_guest_notifiers(DeviceState *d, int nvqs, +@@ -973,7 +981,7 @@ static int virtio_ccw_set_guest_notifiers(DeviceState *d, int nvqs, bool assigned) { VirtioCcwDevice *dev = VIRTIO_CCW_DEVICE(d); diff --git a/0009-virtio-bus-cleanup-plug-unplug-interface.patch b/0007-virtio-bus-cleanup-plug-unplug-interface.patch similarity index 97% rename from 0009-virtio-bus-cleanup-plug-unplug-interface.patch rename to 0007-virtio-bus-cleanup-plug-unplug-interface.patch index b8a91f4..b79e033 100644 --- a/0009-virtio-bus-cleanup-plug-unplug-interface.patch +++ b/0007-virtio-bus-cleanup-plug-unplug-interface.patch @@ -1,4 +1,4 @@ -From fe02fcc2b929e6a678ec783cb80890b79b7dca78 Mon Sep 17 00:00:00 2001 +From 7d948d3491e58e32ece358d783a05d51fdbd6ec3 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:53 +0200 Subject: [PATCH] virtio-bus: cleanup plug/unplug interface @@ -42,7 +42,7 @@ Signed-off-by: Paolo Bonzini 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c -index 669ce38..7aed6a4 100644 +index 17dd06e..7aed6a4 100644 --- a/hw/virtio/virtio-bus.c +++ b/hw/virtio/virtio-bus.c @@ -37,8 +37,8 @@ do { printf("virtio_bus: " fmt , ## __VA_ARGS__); } while (0) @@ -80,7 +80,7 @@ index 669ce38..7aed6a4 100644 + if (klass->device_unplugged != NULL) { + klass->device_unplugged(qbus->parent); } -- qdev_free(DEVICE(vdev)); +- object_unparent(OBJECT(vdev)); } } diff --git a/0010-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch b/0008-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch similarity index 88% rename from 0010-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch rename to 0008-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch index 57c2353..24aa7df 100644 --- a/0010-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch +++ b/0008-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch @@ -1,4 +1,4 @@ -From aa75555e6fb5cae0e495cb5f7d9f3511ad5ac6ce Mon Sep 17 00:00:00 2001 +From 07ffeff19959e11ae7d68f7dc17a3225deb88f8f Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:54 +0200 Subject: [PATCH] virtio-blk: switch exit callback to VirtioDeviceClass @@ -12,10 +12,10 @@ Signed-off-by: Paolo Bonzini 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c -index 49a23c3..aa37cc9 100644 +index 13f6d82..7f0440f 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c -@@ -729,20 +729,18 @@ static int virtio_blk_device_init(VirtIODevice *vdev) +@@ -728,20 +728,18 @@ static int virtio_blk_device_init(VirtIODevice *vdev) return 0; } @@ -39,7 +39,7 @@ index 49a23c3..aa37cc9 100644 } static Property virtio_blk_properties[] = { -@@ -754,10 +752,10 @@ static void virtio_blk_class_init(ObjectClass *klass, void *data) +@@ -753,10 +751,10 @@ static void virtio_blk_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); diff --git a/0011-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch b/0009-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch similarity index 95% rename from 0011-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch rename to 0009-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch index 86e48e4..0da9ea5 100644 --- a/0011-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch +++ b/0009-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch @@ -1,4 +1,4 @@ -From 811b51426d9e7819e6498d4dad0d6ac744a8e5d0 Mon Sep 17 00:00:00 2001 +From 010f4a29c797e098a1fe4b5b2b14c6cfba2f6327 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:55 +0200 Subject: [PATCH] virtio-serial: switch exit callback to VirtioDeviceClass @@ -12,7 +12,7 @@ Signed-off-by: Paolo Bonzini 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c -index da417c7..57dd070 100644 +index 703f026..a7ede90 100644 --- a/hw/char/virtio-serial-bus.c +++ b/hw/char/virtio-serial-bus.c @@ -987,12 +987,11 @@ static const TypeInfo virtio_serial_port_type_info = { diff --git a/0012-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch b/0010-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch similarity index 85% rename from 0012-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch rename to 0010-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch index 4bd6ede..41b4eec 100644 --- a/0012-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch +++ b/0010-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch @@ -1,4 +1,4 @@ -From 1582699fb9f748f9f91b015ef311f93bf5a95f5d Mon Sep 17 00:00:00 2001 +From 8ed30b7ae128c31617c96128d9aa126332c7afaa Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:56 +0200 Subject: [PATCH] virtio-net: switch exit callback to VirtioDeviceClass @@ -12,10 +12,10 @@ Signed-off-by: Paolo Bonzini 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c -index aa1880c..46a4d8c 100644 +index b75c753..93a81eb 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c -@@ -1568,16 +1568,15 @@ static int virtio_net_device_init(VirtIODevice *vdev) +@@ -1570,16 +1570,15 @@ static int virtio_net_device_init(VirtIODevice *vdev) return 0; } @@ -35,7 +35,7 @@ index aa1880c..46a4d8c 100644 if (n->netclient_name) { g_free(n->netclient_name); -@@ -1608,8 +1607,6 @@ static int virtio_net_device_exit(DeviceState *qdev) +@@ -1610,8 +1609,6 @@ static int virtio_net_device_exit(DeviceState *qdev) g_free(n->vqs); qemu_del_nic(n->nic); virtio_cleanup(vdev); @@ -44,7 +44,7 @@ index aa1880c..46a4d8c 100644 } static void virtio_net_instance_init(Object *obj) -@@ -1636,10 +1633,10 @@ static void virtio_net_class_init(ObjectClass *klass, void *data) +@@ -1638,10 +1635,10 @@ static void virtio_net_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); diff --git a/0013-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch b/0011-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch similarity index 94% rename from 0013-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch rename to 0011-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch index e654a87..7eac763 100644 --- a/0013-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch +++ b/0011-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch @@ -1,4 +1,4 @@ -From df750f462929ba85a61dbdd6a4020cb4b2ee68d0 Mon Sep 17 00:00:00 2001 +From 78ad270fe43666fb11ba1352f591a7f217dd87b7 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:57 +0200 Subject: [PATCH] virtio-scsi: switch exit callback to VirtioDeviceClass @@ -54,10 +54,10 @@ index 9e770fb..5e3cc61 100644 vdc->set_config = vhost_scsi_set_config; vdc->set_status = vhost_scsi_set_status; diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c -index 05da56b..5545993 100644 +index 26d95a1..83344ea 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c -@@ -643,22 +643,21 @@ static int virtio_scsi_device_init(VirtIODevice *vdev) +@@ -644,22 +644,21 @@ static int virtio_scsi_device_init(VirtIODevice *vdev) return 0; } @@ -86,7 +86,7 @@ index 05da56b..5545993 100644 } static Property virtio_scsi_properties[] = { -@@ -679,10 +678,10 @@ static void virtio_scsi_class_init(ObjectClass *klass, void *data) +@@ -680,10 +679,10 @@ static void virtio_scsi_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); diff --git a/0014-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch b/0012-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch similarity index 94% rename from 0014-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch rename to 0012-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch index 5c921d1..55019b0 100644 --- a/0014-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch +++ b/0012-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch @@ -1,4 +1,4 @@ -From d42ac36363ef9e3d3963c2c31fa7122492dbaf0e Mon Sep 17 00:00:00 2001 +From 6b83317ba5edf378a1d5d4ccf1af7cc2a521f6ca Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:58 +0200 Subject: [PATCH] virtio-balloon: switch exit callback to VirtioDeviceClass @@ -12,7 +12,7 @@ Signed-off-by: Paolo Bonzini 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c -index aac7f83..c23facb 100644 +index 9504877..d7a392d 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -370,16 +370,14 @@ static int virtio_balloon_device_init(VirtIODevice *vdev) diff --git a/0015-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch b/0013-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch similarity index 81% rename from 0015-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch rename to 0013-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch index 6c54e1b..b870c03 100644 --- a/0015-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch +++ b/0013-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch @@ -1,4 +1,4 @@ -From 2bb10b85ffa655f91a4777da4f7a5534ee4c266c Mon Sep 17 00:00:00 2001 +From 8095a86fea23b06cd6bac2e3d054e1df8b1558c6 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:59 +0200 Subject: [PATCH] virtio-rng: switch exit callback to VirtioDeviceClass @@ -12,10 +12,10 @@ Signed-off-by: Paolo Bonzini 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c -index bac8421..6895146 100644 +index b22ccf1..42ca568 100644 --- a/hw/virtio/virtio-rng.c +++ b/hw/virtio/virtio-rng.c -@@ -184,16 +184,14 @@ static int virtio_rng_device_init(VirtIODevice *vdev) +@@ -190,16 +190,14 @@ static int virtio_rng_device_init(VirtIODevice *vdev) return 0; } @@ -26,8 +26,8 @@ index bac8421..6895146 100644 - VirtIODevice *vdev = VIRTIO_DEVICE(qdev); + VirtIORNG *vrng = VIRTIO_RNG(vdev); - qemu_del_timer(vrng->rate_limit_timer); - qemu_free_timer(vrng->rate_limit_timer); + timer_del(vrng->rate_limit_timer); + timer_free(vrng->rate_limit_timer); - unregister_savevm(qdev, "virtio-rng", vrng); + unregister_savevm(DEVICE(vdev), "virtio-rng", vrng); virtio_cleanup(vdev); @@ -35,7 +35,7 @@ index bac8421..6895146 100644 } static Property virtio_rng_properties[] = { -@@ -205,10 +203,10 @@ static void virtio_rng_class_init(ObjectClass *klass, void *data) +@@ -211,10 +209,10 @@ static void virtio_rng_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); diff --git a/0016-virtio-pci-add-device_unplugged-callback.patch b/0014-virtio-pci-add-device_unplugged-callback.patch similarity index 87% rename from 0016-virtio-pci-add-device_unplugged-callback.patch rename to 0014-virtio-pci-add-device_unplugged-callback.patch index e96fc3b..17c8ae6 100644 --- a/0016-virtio-pci-add-device_unplugged-callback.patch +++ b/0014-virtio-pci-add-device_unplugged-callback.patch @@ -1,4 +1,4 @@ -From cb2282d55ee34d04a67d74111d69ab098f765680 Mon Sep 17 00:00:00 2001 +From 91ff7bf3e20ced8742319d77bd5f2b9929bc3c24 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:58:00 +0200 Subject: [PATCH] virtio-pci: add device_unplugged callback @@ -20,10 +20,10 @@ Signed-off-by: Paolo Bonzini 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c -index 6fd6d6d..242ec3e 100644 +index be18e92..1a363ca 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c -@@ -1000,6 +1000,15 @@ static void virtio_pci_device_plugged(DeviceState *d) +@@ -1001,6 +1001,15 @@ static void virtio_pci_device_plugged(DeviceState *d) proxy->host_features); } @@ -39,7 +39,7 @@ index 6fd6d6d..242ec3e 100644 static int virtio_pci_init(PCIDevice *pci_dev) { VirtIOPCIProxy *dev = VIRTIO_PCI(pci_dev); -@@ -1014,9 +1023,7 @@ static int virtio_pci_init(PCIDevice *pci_dev) +@@ -1015,9 +1024,7 @@ static int virtio_pci_init(PCIDevice *pci_dev) static void virtio_pci_exit(PCIDevice *pci_dev) { VirtIOPCIProxy *proxy = VIRTIO_PCI(pci_dev); @@ -49,7 +49,7 @@ index 6fd6d6d..242ec3e 100644 } static void virtio_pci_reset(DeviceState *qdev) -@@ -1550,6 +1557,7 @@ static void virtio_pci_bus_class_init(ObjectClass *klass, void *data) +@@ -1552,6 +1559,7 @@ static void virtio_pci_bus_class_init(ObjectClass *klass, void *data) k->set_guest_notifiers = virtio_pci_set_guest_notifiers; k->vmstate_change = virtio_pci_vmstate_change; k->device_plugged = virtio_pci_device_plugged; diff --git a/0101-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch b/0101-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch deleted file mode 100644 index b31f925..0000000 --- a/0101-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 411a7e4ad457f7f3c9f1d02ef9f726ce13a35f08 Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Fri, 6 Sep 2013 12:32:25 +0200 -Subject: [PATCH] qcow2: Pass discard type to qcow2_discard_clusters() - -The function will be used internally instead of only being called for -guest discard requests. - -Signed-off-by: Kevin Wolf ---- - block/qcow2-cluster.c | 8 ++++---- - block/qcow2.c | 2 +- - block/qcow2.h | 2 +- - 3 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c -index cca76d4..8c3185d 100644 ---- a/block/qcow2-cluster.c -+++ b/block/qcow2-cluster.c -@@ -1317,7 +1317,7 @@ int qcow2_decompress_cluster(BlockDriverState *bs, uint64_t cluster_offset) - * clusters. - */ - static int discard_single_l2(BlockDriverState *bs, uint64_t offset, -- unsigned int nb_clusters) -+ unsigned int nb_clusters, enum qcow2_discard_type type) - { - BDRVQcowState *s = bs->opaque; - uint64_t *l2_table; -@@ -1346,7 +1346,7 @@ static int discard_single_l2(BlockDriverState *bs, uint64_t offset, - l2_table[l2_index + i] = cpu_to_be64(0); - - /* Then decrease the refcount */ -- qcow2_free_any_clusters(bs, old_offset, 1, QCOW2_DISCARD_REQUEST); -+ qcow2_free_any_clusters(bs, old_offset, 1, type); - } - - ret = qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table); -@@ -1358,7 +1358,7 @@ static int discard_single_l2(BlockDriverState *bs, uint64_t offset, - } - - int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset, -- int nb_sectors) -+ int nb_sectors, enum qcow2_discard_type type) - { - BDRVQcowState *s = bs->opaque; - uint64_t end_offset; -@@ -1381,7 +1381,7 @@ int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset, - - /* Each L2 table is handled by its own loop iteration */ - while (nb_clusters > 0) { -- ret = discard_single_l2(bs, offset, nb_clusters); -+ ret = discard_single_l2(bs, offset, nb_clusters, type); - if (ret < 0) { - goto fail; - } -diff --git a/block/qcow2.c b/block/qcow2.c -index 7f7282e..16e45a0 100644 ---- a/block/qcow2.c -+++ b/block/qcow2.c -@@ -1506,7 +1506,7 @@ static coroutine_fn int qcow2_co_discard(BlockDriverState *bs, - - qemu_co_mutex_lock(&s->lock); - ret = qcow2_discard_clusters(bs, sector_num << BDRV_SECTOR_BITS, -- nb_sectors); -+ nb_sectors, QCOW2_DISCARD_REQUEST); - qemu_co_mutex_unlock(&s->lock); - return ret; - } -diff --git a/block/qcow2.h b/block/qcow2.h -index dba9771..52cf193 100644 ---- a/block/qcow2.h -+++ b/block/qcow2.h -@@ -405,7 +405,7 @@ uint64_t qcow2_alloc_compressed_cluster_offset(BlockDriverState *bs, - - int qcow2_alloc_cluster_link_l2(BlockDriverState *bs, QCowL2Meta *m); - int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset, -- int nb_sectors); -+ int nb_sectors, enum qcow2_discard_type type); - int qcow2_zero_clusters(BlockDriverState *bs, uint64_t offset, int nb_sectors); - - /* qcow2-snapshot.c functions */ diff --git a/0102-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch b/0102-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch deleted file mode 100644 index cb0e92c..0000000 --- a/0102-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 16d78f7cd9e1455ebb0599706ba5badfa3ee4fdc Mon Sep 17 00:00:00 2001 -From: Kevin Wolf -Date: Fri, 6 Sep 2013 12:32:26 +0200 -Subject: [PATCH] qcow2: Discard VM state in active L1 after creating snapshot - -During savevm, the VM state is written to the active L1 of the image and -then a snapshot is taken. After that, the VM state isn't needed any more -in the active L1 and should be discarded. This is implemented by this -patch. - -The impact of not discarding the VM state is that a snapshot can never -become smaller than any previous snapshot (because it would be padded -with old VM state), and more importantly that future savevm operations -cause unnecessary COWs (with associated flushes), which makes subsequent -snapshots much slower. - -Signed-off-by: Kevin Wolf ---- - block/qcow2-snapshot.c | 7 +++++++ - block/qcow2.c | 5 ----- - block/qcow2.h | 5 +++++ - 3 files changed, 12 insertions(+), 5 deletions(-) - -diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c -index 0caac90..ae33b45 100644 ---- a/block/qcow2-snapshot.c -+++ b/block/qcow2-snapshot.c -@@ -401,6 +401,13 @@ int qcow2_snapshot_create(BlockDriverState *bs, QEMUSnapshotInfo *sn_info) - - g_free(old_snapshot_list); - -+ /* The VM state isn't needed any more in the active L1 table; in fact, it -+ * hurts by causing expensive COW for the next snapshot. */ -+ qcow2_discard_clusters(bs, qcow2_vm_state_offset(s), -+ align_offset(sn->vm_state_size, s->cluster_size) -+ >> BDRV_SECTOR_BITS, -+ QCOW2_DISCARD_NEVER); -+ - #ifdef DEBUG_ALLOC - { - BdrvCheckResult result = {0}; -diff --git a/block/qcow2.c b/block/qcow2.c -index 16e45a0..f63c2cb 100644 ---- a/block/qcow2.c -+++ b/block/qcow2.c -@@ -1666,11 +1666,6 @@ static coroutine_fn int qcow2_co_flush_to_os(BlockDriverState *bs) - return 0; - } - --static int64_t qcow2_vm_state_offset(BDRVQcowState *s) --{ -- return (int64_t)s->l1_vm_state_index << (s->cluster_bits + s->l2_bits); --} -- - static int qcow2_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) - { - BDRVQcowState *s = bs->opaque; -diff --git a/block/qcow2.h b/block/qcow2.h -index 52cf193..da61d18 100644 ---- a/block/qcow2.h -+++ b/block/qcow2.h -@@ -324,6 +324,11 @@ static inline int64_t align_offset(int64_t offset, int n) - return offset; - } - -+static inline int64_t qcow2_vm_state_offset(BDRVQcowState *s) -+{ -+ return (int64_t)s->l1_vm_state_index << (s->cluster_bits + s->l2_bits); -+} -+ - static inline int qcow2_get_cluster_type(uint64_t l2_entry) - { - if (l2_entry & QCOW_OFLAG_COMPRESSED) { diff --git a/0103-hw-9pfs-Fix-errno-value-for-xattr-functions.patch b/0103-hw-9pfs-Fix-errno-value-for-xattr-functions.patch deleted file mode 100644 index cd7b42f..0000000 --- a/0103-hw-9pfs-Fix-errno-value-for-xattr-functions.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 6f7e1d2bddb5a0a1c65f6f02467460d6edbcc901 Mon Sep 17 00:00:00 2001 -From: "Daniel P. Berrange" -Date: Tue, 1 Oct 2013 12:28:17 +0100 -Subject: [PATCH] hw/9pfs: Fix errno value for xattr functions - -If there is no operation driver for the xattr type the -functions return '-1' and set errno to '-EOPNOTSUPP'. -When the calling code sets 'ret = -errno' this turns -into a large positive number. - -In Linux 3.11, the kernel has switched to using 9p -version 9p2000.L, instead of 9p2000.u, which enables -support for xattr operations. This on its own is harmless, -but for another change which makes it request the xattr -with a name 'security.capability'. - -The result is that the guest sees a succesful return -of 95 bytes of data, instead of a failure with errno -set to 95. Since the kernel expects a maximum of 20 -bytes for an xattr return this gets translated to the -unexpected errno ERANGE. - -This all means that when running a binary off a 9p fs -in 3.11 kernels you get a fun result of: - - # ./date - sh: ./date: Numerical result out of range - -The only workaround is to pass 'version=9p2000.u' when -mounting the 9p fs in the guest, to disable all use of -xattrs. - -Signed-off-by: Daniel P. Berrange ---- - hw/9pfs/virtio-9p-xattr.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/hw/9pfs/virtio-9p-xattr.c b/hw/9pfs/virtio-9p-xattr.c -index 90ae565..3fae557 100644 ---- a/hw/9pfs/virtio-9p-xattr.c -+++ b/hw/9pfs/virtio-9p-xattr.c -@@ -36,7 +36,7 @@ ssize_t v9fs_get_xattr(FsContext *ctx, const char *path, - if (xops) { - return xops->getxattr(ctx, path, name, value, size); - } -- errno = -EOPNOTSUPP; -+ errno = EOPNOTSUPP; - return -1; - } - -@@ -123,7 +123,7 @@ int v9fs_set_xattr(FsContext *ctx, const char *path, const char *name, - if (xops) { - return xops->setxattr(ctx, path, name, value, size, flags); - } -- errno = -EOPNOTSUPP; -+ errno = EOPNOTSUPP; - return -1; - - } -@@ -135,7 +135,7 @@ int v9fs_remove_xattr(FsContext *ctx, - if (xops) { - return xops->removexattr(ctx, path, name); - } -- errno = -EOPNOTSUPP; -+ errno = EOPNOTSUPP; - return -1; - - } diff --git a/0104-Fix-pc-migration-from-qemu-1.5.patch b/0104-Fix-pc-migration-from-qemu-1.5.patch deleted file mode 100644 index 022b66c..0000000 --- a/0104-Fix-pc-migration-from-qemu-1.5.patch +++ /dev/null @@ -1,203 +0,0 @@ -From 042c76790b1168766332b1aafa4429c265d35ed0 Mon Sep 17 00:00:00 2001 -From: Cole Robinson -Date: Mon, 7 Oct 2013 16:32:24 -0400 -Subject: [PATCH] Fix pc migration from qemu <= 1.5 - -The following commit introduced a migration incompatibility: - -commit 568f0690fd9aa4d39d84b04c1a5dbb53a915c3fe -Author: David Gibson -Date: Thu Jun 6 18:48:49 2013 +1000 - - pci: Replace pci_find_domain() with more general pci_root_bus_path() - -The issue is that i440fx savevm idstr went from 0000:00:00.0/I440FX to -0000:00.0/I440FX. Unfortunately we are stuck with the breakage for -1.6 machine types. - -Add a compat property to maintain the busted idstr for the 1.6 machine -types, but revert to the old style format for 1.7+, and <= 1.5. - -Tested with migration from qemu 1.5, qemu 1.6, and qemu.git. - -Cc: qemu-stable@nongnu.org -Signed-off-by: Cole Robinson ---- - hw/i386/pc_piix.c | 11 +++++++++++ - hw/i386/pc_q35.c | 11 +++++++++++ - hw/pci-host/piix.c | 9 ++++++++- - hw/pci-host/q35.c | 10 ++++++++-- - include/hw/i386/pc.h | 20 ++++++++++++++++++++ - include/hw/pci-host/q35.h | 1 + - 6 files changed, 59 insertions(+), 3 deletions(-) - -diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c -index 2f2cb4d..10866f5 100644 ---- a/hw/i386/pc_piix.c -+++ b/hw/i386/pc_piix.c -@@ -341,6 +341,13 @@ static void pc_xen_hvm_init(QEMUMachineInitArgs *args) - } - #endif - -+#define PC_I440FX_MACHINE_OPTIONS \ -+ PC_DEFAULT_MACHINE_OPTIONS, \ -+ .desc = "Standard PC (i440FX + PIIX, 1996)", \ -+ .hot_add_cpu = pc_hot_add_cpu -+ -+#define PC_I440FX_1_6_MACHINE_OPTIONS PC_I440FX_MACHINE_OPTIONS -+ - static QEMUMachine pc_i440fx_machine_v1_6 = { - .name = "pc-i440fx-1.6", - .alias = "pc", -@@ -349,6 +356,10 @@ static QEMUMachine pc_i440fx_machine_v1_6 = { - .hot_add_cpu = pc_hot_add_cpu, - .max_cpus = 255, - .is_default = 1, -+ .compat_props = (GlobalProperty[]) { -+ PC_COMPAT_1_6, -+ { /* end of list */ } -+ }, - DEFAULT_MACHINE_OPTIONS, - }; - -diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c -index dd13130..4998ed3 100644 ---- a/hw/i386/pc_q35.c -+++ b/hw/i386/pc_q35.c -@@ -243,6 +243,13 @@ static void pc_q35_init_1_4(QEMUMachineInitArgs *args) - pc_q35_init(args); - } - -+#define PC_Q35_MACHINE_OPTIONS \ -+ PC_DEFAULT_MACHINE_OPTIONS, \ -+ .desc = "Standard PC (Q35 + ICH9, 2009)", \ -+ .hot_add_cpu = pc_hot_add_cpu -+ -+#define PC_Q35_1_6_MACHINE_OPTIONS PC_Q35_MACHINE_OPTIONS -+ - static QEMUMachine pc_q35_machine_v1_6 = { - .name = "pc-q35-1.6", - .alias = "q35", -@@ -250,6 +257,10 @@ static QEMUMachine pc_q35_machine_v1_6 = { - .init = pc_q35_init_1_6, - .hot_add_cpu = pc_hot_add_cpu, - .max_cpus = 255, -+ .compat_props = (GlobalProperty[]) { -+ PC_COMPAT_1_6, -+ { /* end of list */ } -+ }, - DEFAULT_MACHINE_OPTIONS, - }; - -diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c -index 221d82b..967f949 100644 ---- a/hw/pci-host/piix.c -+++ b/hw/pci-host/piix.c -@@ -48,6 +48,7 @@ typedef struct I440FXState { - PCIHostState parent_obj; - PcPciInfo pci_info; - uint64_t pci_hole64_size; -+ uint32_t short_root_bus; - } I440FXState; - - #define PIIX_NUM_PIC_IRQS 16 /* i8259 * 2 */ -@@ -706,13 +707,19 @@ static const TypeInfo i440fx_info = { - static const char *i440fx_pcihost_root_bus_path(PCIHostState *host_bridge, - PCIBus *rootbus) - { -+ I440FXState *s = I440FX_PCI_HOST_BRIDGE(host_bridge); -+ - /* For backwards compat with old device paths */ -- return "0000"; -+ if (s->short_root_bus) { -+ return "0000"; -+ } -+ return "0000:00"; - } - - static Property i440fx_props[] = { - DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, I440FXState, - pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE), -+ DEFINE_PROP_UINT32("short_root_bus", I440FXState, short_root_bus, 0), - DEFINE_PROP_END_OF_LIST(), - }; - -diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c -index 4febd24..f762053 100644 ---- a/hw/pci-host/q35.c -+++ b/hw/pci-host/q35.c -@@ -61,8 +61,13 @@ static void q35_host_realize(DeviceState *dev, Error **errp) - static const char *q35_host_root_bus_path(PCIHostState *host_bridge, - PCIBus *rootbus) - { -- /* For backwards compat with old device paths */ -- return "0000"; -+ Q35PCIHost *s = Q35_HOST_DEVICE(host_bridge); -+ -+ /* For backwards compat with old device paths */ -+ if (s->mch.short_root_bus) { -+ return "0000"; -+ } -+ return "0000:00"; - } - - static void q35_host_get_pci_hole_start(Object *obj, Visitor *v, -@@ -108,6 +113,7 @@ static Property mch_props[] = { - MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT), - DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35PCIHost, - mch.pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE), -+ DEFINE_PROP_UINT32("short_root_bus", Q35PCIHost, mch.short_root_bus, 0), - DEFINE_PROP_END_OF_LIST(), - }; - -diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h -index 475ba9e..6e2b839 100644 ---- a/include/hw/i386/pc.h -+++ b/include/hw/i386/pc.h -@@ -225,7 +225,19 @@ void pvpanic_init(ISABus *bus); - - int e820_add_entry(uint64_t, uint64_t, uint32_t); - -+#define PC_COMPAT_1_6 \ -+ {\ -+ .driver = "i440FX-pcihost",\ -+ .property = "short_root_bus",\ -+ .value = stringify(1),\ -+ },{\ -+ .driver = "q35-pcihost",\ -+ .property = "short_root_bus",\ -+ .value = stringify(1),\ -+ } -+ - #define PC_COMPAT_1_5 \ -+ PC_COMPAT_1_6, \ - {\ - .driver = "Conroe-" TYPE_X86_CPU,\ - .property = "model",\ -@@ -258,6 +270,14 @@ int e820_add_entry(uint64_t, uint64_t, uint32_t); - .driver = TYPE_X86_CPU,\ - .property = "pmu",\ - .value = "on",\ -+ },{\ -+ .driver = "i440FX-pcihost",\ -+ .property = "short_root_bus",\ -+ .value = stringify(0),\ -+ },{\ -+ .driver = "q35-pcihost",\ -+ .property = "short_root_bus",\ -+ .value = stringify(0),\ - } - - #define PC_COMPAT_1_4 \ -diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h -index 6eb7ab6..95a3cc2 100644 ---- a/include/hw/pci-host/q35.h -+++ b/include/hw/pci-host/q35.h -@@ -61,6 +61,7 @@ typedef struct MCHPCIState { - ram_addr_t above_4g_mem_size; - uint64_t pci_hole64_size; - PcGuestInfo *guest_info; -+ uint32_t short_root_bus; - } MCHPCIState; - - typedef struct Q35PCIHost { diff --git a/0105-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch b/0105-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch deleted file mode 100644 index 30cfa3d..0000000 --- a/0105-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 6b7ac46a461482c06c5ccdf54815e94205bc7d95 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 9 Oct 2013 21:33:44 +0200 -Subject: [PATCH] audio: honor QEMU_AUDIO_TIMER_PERIOD instead of waking up - every *nano* second - -Now that we no longer have MIN_REARM_TIMER_NS a bug in the audio subsys has -clearly shown it self by trying to make a timer fire every nano second. - -Note we have a similar problem in 1.6, 1.5 and older but there -MIN_REARM_TIMER_NS limits the wakeups caused by audio being active to -4000 times / second. This still causes a host cpu load of 50 % for simply -playing audio, where as with this patch git master is at 13%, so we should -backport this to 1.5 and 1.6 too. - -Note this will not apply to 1.5 and 1.6 as is. - -Cc: qemu-stable@nongnu.org -Signed-off-by: Hans de Goede -Signed-off-by: Gerd Hoffmann -(cherry picked from commit b4350deed67b95651896ddb60cf9f765093a4848) - -Conflicts: - audio/audio.c ---- - audio/audio.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/audio/audio.c b/audio/audio.c -index 02bb886..f9b3e95 100644 ---- a/audio/audio.c -+++ b/audio/audio.c -@@ -1124,7 +1124,8 @@ static int audio_is_timer_needed (void) - static void audio_reset_timer (AudioState *s) - { - if (audio_is_timer_needed ()) { -- qemu_mod_timer (s->ts, qemu_get_clock_ns (vm_clock) + 1); -+ qemu_mod_timer (s->ts, -+ qemu_get_clock_ns (vm_clock) + conf.period.ticks); - } - else { - qemu_del_timer (s->ts); diff --git a/0106-qmp-access-the-local-QemuOptsLists-for-drive-option.patch b/0106-qmp-access-the-local-QemuOptsLists-for-drive-option.patch deleted file mode 100644 index 7ffa62a..0000000 --- a/0106-qmp-access-the-local-QemuOptsLists-for-drive-option.patch +++ /dev/null @@ -1,181 +0,0 @@ -From dd733d7097c126ee3b8ee8a0f4c38b8ccac76504 Mon Sep 17 00:00:00 2001 -From: Amos Kong -Date: Fri, 15 Nov 2013 18:53:14 +0100 -Subject: [PATCH] qmp: access the local QemuOptsLists for drive option - -Currently we have three QemuOptsList (qemu_common_drive_opts, -qemu_legacy_drive_opts, and qemu_drive_opts), only qemu_drive_opts -is added to vm_config_groups[]. - -This patch changes query-command-line-options to access three local -QemuOptsLists for drive option, and merge the description items -together. - -Signed-off-by: Amos Kong -Signed-off-by: Kevin Wolf ---- - blockdev.c | 1 - - include/qemu/config-file.h | 1 + - include/sysemu/sysemu.h | 1 + - util/qemu-config.c | 77 +++++++++++++++++++++++++++++++++++++++++++++- - vl.c | 2 ++ - 5 files changed, 80 insertions(+), 2 deletions(-) - -diff --git a/blockdev.c b/blockdev.c -index 097932c..1a6892e 100644 ---- a/blockdev.c -+++ b/blockdev.c -@@ -45,7 +45,6 @@ - #include "sysemu/arch_init.h" - - static QTAILQ_HEAD(drivelist, DriveInfo) drives = QTAILQ_HEAD_INITIALIZER(drives); --extern QemuOptsList qemu_common_drive_opts; - extern QemuOptsList qemu_old_drive_opts; - - static const char *const if_name[IF_COUNT] = { -diff --git a/include/qemu/config-file.h b/include/qemu/config-file.h -index ad4a9e5..508428f 100644 ---- a/include/qemu/config-file.h -+++ b/include/qemu/config-file.h -@@ -8,6 +8,7 @@ - QemuOptsList *qemu_find_opts(const char *group); - QemuOptsList *qemu_find_opts_err(const char *group, Error **errp); - void qemu_add_opts(QemuOptsList *list); -+void qemu_add_drive_opts(QemuOptsList *list); - int qemu_set_option(const char *str); - int qemu_global_option(const char *str); - void qemu_add_globals(void); -diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h -index 1a77c99..4962cef 100644 ---- a/include/sysemu/sysemu.h -+++ b/include/sysemu/sysemu.h -@@ -190,6 +190,7 @@ QemuOpts *qemu_get_machine_opts(void); - - bool usb_enabled(bool default_usb); - -+extern QemuOptsList qemu_common_drive_opts; - extern QemuOptsList qemu_drive_opts; - extern QemuOptsList qemu_chardev_opts; - extern QemuOptsList qemu_device_opts; -diff --git a/util/qemu-config.c b/util/qemu-config.c -index a59568d..04da942 100644 ---- a/util/qemu-config.c -+++ b/util/qemu-config.c -@@ -8,6 +8,7 @@ - #include "qmp-commands.h" - - static QemuOptsList *vm_config_groups[32]; -+static QemuOptsList *drive_config_groups[4]; - - static QemuOptsList *find_list(QemuOptsList **lists, const char *group, - Error **errp) -@@ -77,6 +78,59 @@ static CommandLineParameterInfoList *query_option_descs(const QemuOptDesc *desc) - return param_list; - } - -+/* remove repeated entry from the info list */ -+static void cleanup_infolist(CommandLineParameterInfoList *head) -+{ -+ CommandLineParameterInfoList *pre_entry, *cur, *del_entry; -+ -+ cur = head; -+ while (cur->next) { -+ pre_entry = head; -+ while (pre_entry != cur->next) { -+ if (!strcmp(pre_entry->value->name, cur->next->value->name)) { -+ del_entry = cur->next; -+ cur->next = cur->next->next; -+ g_free(del_entry); -+ break; -+ } -+ pre_entry = pre_entry->next; -+ } -+ cur = cur->next; -+ } -+} -+ -+/* merge the description items of two parameter infolists */ -+static void connect_infolist(CommandLineParameterInfoList *head, -+ CommandLineParameterInfoList *new) -+{ -+ CommandLineParameterInfoList *cur; -+ -+ cur = head; -+ while (cur->next) { -+ cur = cur->next; -+ } -+ cur->next = new; -+} -+ -+/* access all the local QemuOptsLists for drive option */ -+static CommandLineParameterInfoList *get_drive_infolist(void) -+{ -+ CommandLineParameterInfoList *head = NULL, *cur; -+ int i; -+ -+ for (i = 0; drive_config_groups[i] != NULL; i++) { -+ if (!head) { -+ head = query_option_descs(drive_config_groups[i]->desc); -+ } else { -+ cur = query_option_descs(drive_config_groups[i]->desc); -+ connect_infolist(head, cur); -+ } -+ } -+ cleanup_infolist(head); -+ -+ return head; -+} -+ - CommandLineOptionInfoList *qmp_query_command_line_options(bool has_option, - const char *option, - Error **errp) -@@ -89,7 +143,12 @@ CommandLineOptionInfoList *qmp_query_command_line_options(bool has_option, - if (!has_option || !strcmp(option, vm_config_groups[i]->name)) { - info = g_malloc0(sizeof(*info)); - info->option = g_strdup(vm_config_groups[i]->name); -- info->parameters = query_option_descs(vm_config_groups[i]->desc); -+ if (!strcmp("drive", vm_config_groups[i]->name)) { -+ info->parameters = get_drive_infolist(); -+ } else { -+ info->parameters = -+ query_option_descs(vm_config_groups[i]->desc); -+ } - entry = g_malloc0(sizeof(*entry)); - entry->value = info; - entry->next = conf_list; -@@ -109,6 +168,22 @@ QemuOptsList *qemu_find_opts_err(const char *group, Error **errp) - return find_list(vm_config_groups, group, errp); - } - -+void qemu_add_drive_opts(QemuOptsList *list) -+{ -+ int entries, i; -+ -+ entries = ARRAY_SIZE(drive_config_groups); -+ entries--; /* keep list NULL terminated */ -+ for (i = 0; i < entries; i++) { -+ if (drive_config_groups[i] == NULL) { -+ drive_config_groups[i] = list; -+ return; -+ } -+ } -+ fprintf(stderr, "ran out of space in drive_config_groups"); -+ abort(); -+} -+ - void qemu_add_opts(QemuOptsList *list) - { - int entries, i; -diff --git a/vl.c b/vl.c -index 2160933..63ecf16 100644 ---- a/vl.c -+++ b/vl.c -@@ -2942,6 +2942,8 @@ int main(int argc, char **argv, char **envp) - module_call_init(MODULE_INIT_QOM); - - qemu_add_opts(&qemu_drive_opts); -+ qemu_add_drive_opts(&qemu_common_drive_opts); -+ qemu_add_drive_opts(&qemu_drive_opts); - qemu_add_opts(&qemu_chardev_opts); - qemu_add_opts(&qemu_device_opts); - qemu_add_opts(&qemu_netdev_opts); diff --git a/0107-seccomp-fine-tuning-whitelist-by-adding-times.patch b/0107-seccomp-fine-tuning-whitelist-by-adding-times.patch deleted file mode 100644 index 6818b37..0000000 --- a/0107-seccomp-fine-tuning-whitelist-by-adding-times.patch +++ /dev/null @@ -1,28 +0,0 @@ -From aafda3de0ce3589fa69472bd4a1782c65c8c7ade Mon Sep 17 00:00:00 2001 -From: Eduardo Otubo -Date: Tue, 24 Sep 2013 14:50:44 -0300 -Subject: [PATCH] seccomp: fine tuning whitelist by adding times() - -This was causing Qemu process to hang when using -sandbox on as -discribed on RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1004175 - -Signed-off-by: Eduardo Otubo -Tested-by: Paul Moore -Acked-by: Paul Moore -(cherry picked from commit c236f4519c9838801798f3705c17dce9ab9e3b9d) ---- - qemu-seccomp.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/qemu-seccomp.c b/qemu-seccomp.c -index 37d38f8..69cee44 100644 ---- a/qemu-seccomp.c -+++ b/qemu-seccomp.c -@@ -90,6 +90,7 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { - { SCMP_SYS(getuid), 245 }, - { SCMP_SYS(geteuid), 245 }, - { SCMP_SYS(timer_create), 245 }, -+ { SCMP_SYS(times), 245 }, - { SCMP_SYS(exit), 245 }, - { SCMP_SYS(clock_gettime), 245 }, - { SCMP_SYS(time), 245 }, diff --git a/qemu.spec b/qemu.spec index 1c04dab..9f1822b 100644 --- a/qemu.spec +++ b/qemu.spec @@ -138,8 +138,8 @@ Summary: QEMU is a FAST! processor emulator Name: qemu -Version: 1.6.1 -Release: 2%{?dist} +Version: 1.7.0 +Release: 0.1.rc1%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -154,7 +154,8 @@ ExclusiveArch: %{kvm_archs} %define _smp_mflags %{nil} %endif -Source0: http://wiki.qemu-project.org/download/%{name}-%{version}.tar.bz2 +#Source0: http://wiki.qemu-project.org/download/%{name}-%{version}.tar.bz2 +Source0: http://wiki.qemu-project.org/download/%{name}-%{version}-rc1.tar.bz2 Source1: qemu.binfmt @@ -180,47 +181,25 @@ Source12: bridge.conf # qemu-kvm back compat wrapper Source13: qemu-kvm.sh -# qemu-kvm migration compat (not for upstream, drop by Fedora 21?) -Patch0001: 0001-Fix-migration-from-qemu-kvm.patch -# Fix crash with -M isapc -cpu Haswell (bz #986790) -Patch0002: 0002-isapc-disable-kvmvapic.patch # Fix crash in lsi_soft_reset (bz #1000947) # Patches posted upstream -Patch0003: 0003-pci-do-not-export-pci_bus_reset.patch -Patch0004: 0004-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch -Patch0005: 0005-qdev-switch-reset-to-post-order.patch +Patch0001: 0001-pci-do-not-export-pci_bus_reset.patch +Patch0002: 0002-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch +Patch0003: 0003-qdev-switch-reset-to-post-order.patch # CVE-2013-4377: Fix crash when unplugging virtio devices (bz #1012633, # bz #1012641) # Patches posted upstream -Patch0006: 0006-virtio-bus-remove-vdev-field.patch -Patch0007: 0007-virtio-pci-remove-vdev-field.patch -Patch0008: 0008-virtio-ccw-remove-vdev-field.patch -Patch0009: 0009-virtio-bus-cleanup-plug-unplug-interface.patch -Patch0010: 0010-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch -Patch0011: 0011-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch -Patch0012: 0012-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch -Patch0013: 0013-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch -Patch0014: 0014-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch -Patch0015: 0015-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch -Patch0016: 0016-virtio-pci-add-device_unplugged-callback.patch - -# Fix 'new snapshot' slowness after the first snap (bz #988436) -# Patches queued for upstream -Patch0101: 0101-qcow2-Pass-discard-type-to-qcow2_discard_clusters.patch -Patch0102: 0102-qcow2-Discard-VM-state-in-active-L1-after-creating-s.patch -# Fix 9pfs xattrs on kernel 3.11 (bz #1013676) -# Patch posted upstream -Patch0103: 0103-hw-9pfs-Fix-errno-value-for-xattr-functions.patch -# Fix migration from qemu <= 1.5 -# Patch posted upstream -Patch0104: 0104-Fix-pc-migration-from-qemu-1.5.patch -# Reduce CPU usage when audio is playing (bz #1017644) -Patch0105: 0105-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch -# Fix drive discard options via libvirt (bz #1029953) -# Patch queued upstream -Patch0106: 0106-qmp-access-the-local-QemuOptsLists-for-drive-option.patch -# Fix process exit with -sandbox on (bz #1027421) -Patch0107: 0107-seccomp-fine-tuning-whitelist-by-adding-times.patch +Patch0004: 0004-virtio-bus-remove-vdev-field.patch +Patch0005: 0005-virtio-pci-remove-vdev-field.patch +Patch0006: 0006-virtio-ccw-remove-vdev-field.patch +Patch0007: 0007-virtio-bus-cleanup-plug-unplug-interface.patch +Patch0008: 0008-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch +Patch0009: 0009-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch +Patch0010: 0010-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch +Patch0011: 0011-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch +Patch0012: 0012-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch +Patch0013: 0013-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch +Patch0014: 0014-virtio-pci-add-device_unplugged-callback.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -311,6 +290,7 @@ BuildRequires: librdmacm-devel BuildRequires: qemu-sanity-check-nodeps BuildRequires: kernel %endif +BuildRequires: iasl %if 0%{?user:1} Requires: %{name}-%{user} = %{epoch}:%{version}-%{release} @@ -731,20 +711,18 @@ CAC emulation development files. %endif %prep -%setup -q +%setup -q -n qemu-1.7.0-rc1 -# qemu-kvm migration compat (not for upstream, drop by Fedora 21?) -%patch0001 -p1 -# Fix crash with -M isapc -cpu Haswell (bz #986790) -%patch0002 -p1 # Fix crash in lsi_soft_reset (bz #1000947) # Patches posted upstream +%patch0001 -p1 +%patch0002 -p1 %patch0003 -p1 -%patch0004 -p1 -%patch0005 -p1 # CVE-2013-4377: Fix crash when unplugging virtio devices (bz #1012633, # bz #1012641) # Patches posted upstream +%patch0004 -p1 +%patch0005 -p1 %patch0006 -p1 %patch0007 -p1 %patch0008 -p1 @@ -754,26 +732,6 @@ CAC emulation development files. %patch0012 -p1 %patch0013 -p1 %patch0014 -p1 -%patch0015 -p1 -%patch0016 -p1 - -# Fix 'new snapshot' slowness after the first snap (bz #988436) -# Patches queued for upstream -%patch0101 -p1 -%patch0102 -p1 -# Fix 9pfs xattrs on kernel 3.11 (bz #1013676) -# Patch posted upstream -%patch0103 -p1 -# Fix migration from qemu <= 1.5 -# Patch posted upstream -%patch0104 -p1 -# Reduce CPU usage when audio is playing (bz #1017644) -%patch0105 -p1 -# Fix drive discard options via libvirt (bz #1029953) -# Patch queued upstream -%patch0106 -p1 -# Fix process exit with -sandbox on (bz #1027421) -%patch0107 -p1 %build @@ -814,17 +772,17 @@ dobuild() { --libdir=%{_libdir} \ --sysconfdir=%{_sysconfdir} \ --interp-prefix=%{_prefix}/qemu-%%M \ - --audio-drv-list=pa,sdl,alsa,oss \ --localstatedir=%{_localstatedir} \ --libexecdir=%{_libexecdir} \ --disable-strip \ --extra-ldflags="$extraldflags -pie -Wl,-z,relro -Wl,-z,now" \ --extra-cflags="%{optflags} -fPIE -DPIE" \ - --enable-mixemu \ - --enable-trace-backend=dtrace \ --disable-werror \ + --audio-drv-list=pa,sdl,alsa,oss \ + --enable-trace-backend=dtrace \ --disable-xen \ --enable-kvm \ + --enable-tpm \ %if 0%{?have_spice:1} --enable-spice \ %endif @@ -842,7 +800,6 @@ dobuild() { %if %{with gtk} --with-gtkabi="3.0" \ %endif - --enable-tpm \ %ifarch s390 --enable-tcg-interpreter \ %endif @@ -1481,6 +1438,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Thu Nov 21 2013 Cole Robinson - 2:1.7.0-0.1.rc1 +- Update qemu-1.7.0-rc1 + * Sun Nov 17 2013 Cole Robinson - 2:1.6.1-2 - Fix drive discard options via libvirt (bz #1029953) - Fix process exit with -sandbox on (bz #1027421) diff --git a/sources b/sources index 06f99b4..0eec911 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -3a897d722457c5a895cd6ac79a28fda0 qemu-1.6.1.tar.bz2 +4cd5d82632335e0a586c77725ef0547d qemu-1.7.0-rc1.tar.bz2 From dd16baaeb54e653776d73411250ee9e797880314 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 29 Nov 2013 13:00:27 +0000 Subject: [PATCH 35/45] Run chrpath on binaries, so qemu can be built using rpmbuild. --- qemu.spec | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index 9f1822b..872afb2 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,7 +139,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.7.0 -Release: 0.1.rc1%{?dist} +Release: 0.2.rc1%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -204,6 +204,7 @@ Patch0014: 0014-virtio-pci-add-device_unplugged-callback.patch BuildRequires: SDL-devel BuildRequires: zlib-devel BuildRequires: which +BuildRequires: chrpath BuildRequires: texi2html BuildRequires: gnutls-devel BuildRequires: cyrus-sasl-devel @@ -1025,6 +1026,15 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libcacard.pc rm -rf $RPM_BUILD_ROOT%{_includedir}/cacard %endif +# When building using 'rpmbuild' or 'fedpkg local', RPATHs are left in +# the binaries and libraries (although this doesn't occur when +# building in Koji, for some unknown reason). In any case it should +# always be safe to remove RPATHs from the final binaries: +for f in $RPM_BUILD_ROOT%{_bindir}/* $RPM_BUILD_ROOT%{_libdir}/* \ + $RPM_BUILD_ROOT%{_libexecdir}/*; do + if file $f | grep -q ELF; then chrpath --delete $f; fi +done + %check make check @@ -1438,6 +1448,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Fri Nov 29 2013 Richard W.M. Jones - 2:1.7.0-0.2.rc1 +- Run chrpath on binaries, so qemu can be built using rpmbuild. + * Thu Nov 21 2013 Cole Robinson - 2:1.7.0-0.1.rc1 - Update qemu-1.7.0-rc1 From bacd9b04682dabe5438d313a7aa50989fe185311 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 3 Dec 2013 06:36:52 -0500 Subject: [PATCH 36/45] Fix qemu-img create with NBD backing file (bz #1034433) Rebase to qemu-1.7 GA New monitor command blockdev-add for full featured block device hotplug. Performance and functionality improvements for USB 3.0. Many VFIO improvements ACPI tables can be generated by QEMU and can be used by firmware directly. Support creating and writing .vhdx images. qemu-img map: dump detailed image file metadata --- 0001-pci-do-not-export-pci_bus_reset.patch | 8 ++-- ...pre-and-post-order-vists-in-qdev-wal.patch | 2 +- 0003-qdev-switch-reset-to-post-order.patch | 12 +++--- 0004-virtio-bus-remove-vdev-field.patch | 2 +- 0005-virtio-pci-remove-vdev-field.patch | 2 +- 0006-virtio-ccw-remove-vdev-field.patch | 2 +- ...io-bus-cleanup-plug-unplug-interface.patch | 2 +- ...h-exit-callback-to-VirtioDeviceClass.patch | 2 +- ...itch-exit-callback-to-VirtioDeviceCl.patch | 2 +- ...h-exit-callback-to-VirtioDeviceClass.patch | 2 +- ...ch-exit-callback-to-VirtioDeviceClas.patch | 2 +- ...witch-exit-callback-to-VirtioDeviceC.patch | 2 +- ...h-exit-callback-to-VirtioDeviceClass.patch | 2 +- ...io-pci-add-device_unplugged-callback.patch | 2 +- qemu.spec | 43 +++++++++++-------- 15 files changed, 47 insertions(+), 40 deletions(-) diff --git a/0001-pci-do-not-export-pci_bus_reset.patch b/0001-pci-do-not-export-pci_bus_reset.patch index dc5ffbf..e23e793 100644 --- a/0001-pci-do-not-export-pci_bus_reset.patch +++ b/0001-pci-do-not-export-pci_bus_reset.patch @@ -1,4 +1,4 @@ -From 68c3010699db0e83c7bb2ac469527d6a7a36dfa4 Mon Sep 17 00:00:00 2001 +From 4f9f83c8b0a26a24ab2963e57a375b0ba99638f1 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 2 May 2013 11:38:37 +0200 Subject: [PATCH] pci: do not export pci_bus_reset @@ -19,10 +19,10 @@ Signed-off-by: Paolo Bonzini 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c -index ed32059..ab73b4c 100644 +index 49eca95..504ed9d 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c -@@ -210,8 +210,9 @@ void pci_device_reset(PCIDevice *dev) +@@ -212,8 +212,9 @@ void pci_device_reset(PCIDevice *dev) * Trigger pci bus reset under a given bus. * To be called on RST# assert. */ @@ -33,7 +33,7 @@ index ed32059..ab73b4c 100644 int i; for (i = 0; i < bus->nirq; i++) { -@@ -222,11 +223,6 @@ void pci_bus_reset(PCIBus *bus) +@@ -224,11 +225,6 @@ void pci_bus_reset(PCIBus *bus) pci_device_reset(bus->devices[i]); } } diff --git a/0002-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch b/0002-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch index eeeb7f8..52e32c4 100644 --- a/0002-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch +++ b/0002-qdev-allow-both-pre-and-post-order-vists-in-qdev-wal.patch @@ -1,4 +1,4 @@ -From ea25537789eb25313d6b4baee7c00d36b1dcdf17 Mon Sep 17 00:00:00 2001 +From 60ab1ca9f2a40610902b610fa0a06fccea7f0f57 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 2 May 2013 11:38:38 +0200 Subject: [PATCH] qdev: allow both pre- and post-order vists in qdev walking diff --git a/0003-qdev-switch-reset-to-post-order.patch b/0003-qdev-switch-reset-to-post-order.patch index d4dd4c9..a98f3dd 100644 --- a/0003-qdev-switch-reset-to-post-order.patch +++ b/0003-qdev-switch-reset-to-post-order.patch @@ -1,4 +1,4 @@ -From 6e6d80327eb2e249daaa0937468248d54222b125 Mon Sep 17 00:00:00 2001 +From b7906779d6a9eac1815d61cb34aa3d71154025bb Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 2 May 2013 11:38:39 +0200 Subject: [PATCH] qdev: switch reset to post-order @@ -59,7 +59,7 @@ index 5ddf1aa..d2ffe35 100644 void qbus_reset_all_fn(void *opaque) diff --git a/hw/pci/pci.c b/hw/pci/pci.c -index ab73b4c..b52df14 100644 +index 504ed9d..8806636 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -46,7 +46,7 @@ @@ -68,10 +68,10 @@ index ab73b4c..b52df14 100644 static char *pcibus_get_fw_dev_path(DeviceState *dev); -static int pcibus_reset(BusState *qbus); +static void pcibus_reset(BusState *qbus); + static void pci_bus_finalize(Object *obj); static Property pci_props[] = { - DEFINE_PROP_PCI_DEVFN("addr", PCIDevice, devfn, -1), -@@ -165,16 +165,10 @@ void pci_device_deassert_intx(PCIDevice *dev) +@@ -167,16 +167,10 @@ void pci_device_deassert_intx(PCIDevice *dev) } } @@ -89,7 +89,7 @@ index ab73b4c..b52df14 100644 dev->irq_state = 0; pci_update_irq_status(dev); pci_device_deassert_intx(dev); -@@ -207,10 +201,21 @@ void pci_device_reset(PCIDevice *dev) +@@ -209,10 +203,21 @@ void pci_device_reset(PCIDevice *dev) } /* @@ -113,7 +113,7 @@ index ab73b4c..b52df14 100644 { PCIBus *bus = DO_UPCAST(PCIBus, qbus, qbus); int i; -@@ -220,13 +225,9 @@ static int pcibus_reset(BusState *qbus) +@@ -222,13 +227,9 @@ static int pcibus_reset(BusState *qbus) } for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) { if (bus->devices[i]) { diff --git a/0004-virtio-bus-remove-vdev-field.patch b/0004-virtio-bus-remove-vdev-field.patch index e058832..b2823f5 100644 --- a/0004-virtio-bus-remove-vdev-field.patch +++ b/0004-virtio-bus-remove-vdev-field.patch @@ -1,4 +1,4 @@ -From 21cbcaf09677ba959d977bfc0712c5e08ca1aec9 Mon Sep 17 00:00:00 2001 +From d704692d459a40bd28950e734a57075b0ab87393 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:50 +0200 Subject: [PATCH] virtio-bus: remove vdev field diff --git a/0005-virtio-pci-remove-vdev-field.patch b/0005-virtio-pci-remove-vdev-field.patch index 2a4dabb..5e636b4 100644 --- a/0005-virtio-pci-remove-vdev-field.patch +++ b/0005-virtio-pci-remove-vdev-field.patch @@ -1,4 +1,4 @@ -From cc7e97d969c93e197bda7ed17d32254e31793b2d Mon Sep 17 00:00:00 2001 +From 3dfc39e3dcdf006d3aef8b8be1f3947f9393b90f Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:51 +0200 Subject: [PATCH] virtio-pci: remove vdev field diff --git a/0006-virtio-ccw-remove-vdev-field.patch b/0006-virtio-ccw-remove-vdev-field.patch index 19e3fd6..d1244d8 100644 --- a/0006-virtio-ccw-remove-vdev-field.patch +++ b/0006-virtio-ccw-remove-vdev-field.patch @@ -1,4 +1,4 @@ -From 7b81da30e3f4cb6e617f08cc822f4575a4a9e431 Mon Sep 17 00:00:00 2001 +From 6f5e351c3f91e76a70c0684276af8070cfeb07da Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:52 +0200 Subject: [PATCH] virtio-ccw: remove vdev field diff --git a/0007-virtio-bus-cleanup-plug-unplug-interface.patch b/0007-virtio-bus-cleanup-plug-unplug-interface.patch index b79e033..aa86829 100644 --- a/0007-virtio-bus-cleanup-plug-unplug-interface.patch +++ b/0007-virtio-bus-cleanup-plug-unplug-interface.patch @@ -1,4 +1,4 @@ -From 7d948d3491e58e32ece358d783a05d51fdbd6ec3 Mon Sep 17 00:00:00 2001 +From e26f88b6280b2386c36d3b3d5ec820deb1ac7749 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:53 +0200 Subject: [PATCH] virtio-bus: cleanup plug/unplug interface diff --git a/0008-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch b/0008-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch index 24aa7df..cbf3ad3 100644 --- a/0008-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch +++ b/0008-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch @@ -1,4 +1,4 @@ -From 07ffeff19959e11ae7d68f7dc17a3225deb88f8f Mon Sep 17 00:00:00 2001 +From e8821c68009a5b801ffef6d7d9ed5d770c0bfd9f Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:54 +0200 Subject: [PATCH] virtio-blk: switch exit callback to VirtioDeviceClass diff --git a/0009-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch b/0009-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch index 0da9ea5..840e1e3 100644 --- a/0009-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch +++ b/0009-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch @@ -1,4 +1,4 @@ -From 010f4a29c797e098a1fe4b5b2b14c6cfba2f6327 Mon Sep 17 00:00:00 2001 +From b4ea3493c8c99bd854eec8640bd5c90c31e8ac14 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:55 +0200 Subject: [PATCH] virtio-serial: switch exit callback to VirtioDeviceClass diff --git a/0010-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch b/0010-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch index 41b4eec..0406b04 100644 --- a/0010-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch +++ b/0010-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch @@ -1,4 +1,4 @@ -From 8ed30b7ae128c31617c96128d9aa126332c7afaa Mon Sep 17 00:00:00 2001 +From d399f7bf1a035d6158d20d3f11a44f03e15132d0 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:56 +0200 Subject: [PATCH] virtio-net: switch exit callback to VirtioDeviceClass diff --git a/0011-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch b/0011-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch index 7eac763..d34ab57 100644 --- a/0011-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch +++ b/0011-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch @@ -1,4 +1,4 @@ -From 78ad270fe43666fb11ba1352f591a7f217dd87b7 Mon Sep 17 00:00:00 2001 +From 18a73436b50ec6c28afde849c6de23ad7ebed459 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:57 +0200 Subject: [PATCH] virtio-scsi: switch exit callback to VirtioDeviceClass diff --git a/0012-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch b/0012-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch index 55019b0..004dc8c 100644 --- a/0012-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch +++ b/0012-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch @@ -1,4 +1,4 @@ -From 6b83317ba5edf378a1d5d4ccf1af7cc2a521f6ca Mon Sep 17 00:00:00 2001 +From 7f334f1eb88807e2fc7ae42cc729f8dd371833e4 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:58 +0200 Subject: [PATCH] virtio-balloon: switch exit callback to VirtioDeviceClass diff --git a/0013-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch b/0013-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch index b870c03..5eabe78 100644 --- a/0013-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch +++ b/0013-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch @@ -1,4 +1,4 @@ -From 8095a86fea23b06cd6bac2e3d054e1df8b1558c6 Mon Sep 17 00:00:00 2001 +From 8b9a562e23dbfdfb23a5eeb1b619619290216ad8 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:57:59 +0200 Subject: [PATCH] virtio-rng: switch exit callback to VirtioDeviceClass diff --git a/0014-virtio-pci-add-device_unplugged-callback.patch b/0014-virtio-pci-add-device_unplugged-callback.patch index 17c8ae6..5fdc5d9 100644 --- a/0014-virtio-pci-add-device_unplugged-callback.patch +++ b/0014-virtio-pci-add-device_unplugged-callback.patch @@ -1,4 +1,4 @@ -From 91ff7bf3e20ced8742319d77bd5f2b9929bc3c24 Mon Sep 17 00:00:00 2001 +From 96412e68c312ae4d91d6febc2284951f8b295ef7 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 20 Sep 2013 16:58:00 +0200 Subject: [PATCH] virtio-pci: add device_unplugged callback diff --git a/qemu.spec b/qemu.spec index 872afb2..dbe9ba9 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,7 +139,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.7.0 -Release: 0.2.rc1%{?dist} +Release: 1%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -154,9 +154,7 @@ ExclusiveArch: %{kvm_archs} %define _smp_mflags %{nil} %endif -#Source0: http://wiki.qemu-project.org/download/%{name}-%{version}.tar.bz2 -Source0: http://wiki.qemu-project.org/download/%{name}-%{version}-rc1.tar.bz2 - +Source0: http://wiki.qemu-project.org/download/%{name}-%{version}.tar.bz2 Source1: qemu.binfmt @@ -201,6 +199,10 @@ Patch0012: 0012-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch Patch0013: 0013-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch Patch0014: 0014-virtio-pci-add-device_unplugged-callback.patch +# Fix qemu-img create with NBD backing file (bz #1034433) +# Patch posted upstream +Patch0101: 0101-block-Close-backing-file-early-in-bdrv_img_create.patch + BuildRequires: SDL-devel BuildRequires: zlib-devel BuildRequires: which @@ -396,19 +398,6 @@ Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units -# ceph added new symbol rbd_aio_flush which qemu wants to use, but ceph -# lacks symbol versioning so RPM doesn't pick up the dependency. -# Can probably be dropped after Fedora 20 beta -%if %{with rbd} -Requires: ceph-libs >= 0.61 -%endif - -# New symbol libssh2_sftp_fsync. -# Can probably be dropped after Fedora 20 beta. -%if 0%{?fedora} >= 20 -Requires: libssh2 >= 1.4.3-5 -%endif - %description common QEMU is a generic and open source processor emulator which achieves a good emulation speed by using dynamic translation. @@ -712,7 +701,7 @@ CAC emulation development files. %endif %prep -%setup -q -n qemu-1.7.0-rc1 +%setup -q -n qemu-1.7.0 # Fix crash in lsi_soft_reset (bz #1000947) # Patches posted upstream @@ -734,6 +723,10 @@ CAC emulation development files. %patch0013 -p1 %patch0014 -p1 +# Fix qemu-img create with NBD backing file (bz #1034433) +# Patch posted upstream +%patch0101 -p1 + %build %if %{with kvmonly} @@ -901,6 +894,9 @@ rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{name}/spapr-rtas.bin rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/s390-zipl.rom rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/s390-ccw.img %endif +%if 0%{!?system_sparc:1} +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/QEMU,tcx.bin +%endif # Provided by package ipxe rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{name}/pxe*rom @@ -1370,6 +1366,7 @@ getent passwd qemu >/dev/null || \ %{_datadir}/systemtap/tapset/qemu-system-sparc64.stp %{_mandir}/man1/qemu-system-sparc.1* %{_mandir}/man1/qemu-system-sparc64.1* +%{_datadir}/%{name}/QEMU,tcx.bin %endif %if 0%{?system_ppc:1} @@ -1448,6 +1445,16 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Mon Dec 02 2013 Cole Robinson - 2:1.7.0-1 +- Fix qemu-img create with NBD backing file (bz #1034433) +- Rebase to qemu-1.7 GA +- New monitor command blockdev-add for full featured block device hotplug. +- Performance and functionality improvements for USB 3.0. +- Many VFIO improvements +- ACPI tables can be generated by QEMU and can be used by firmware directly. +- Support creating and writing .vhdx images. +- qemu-img map: dump detailed image file metadata + * Fri Nov 29 2013 Richard W.M. Jones - 2:1.7.0-0.2.rc1 - Run chrpath on binaries, so qemu can be built using rpmbuild. From 46c39e954f1fde10f6ebadb1586f34d3546ae792 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 3 Dec 2013 06:54:38 -0500 Subject: [PATCH 37/45] Actually missing files --- .gitignore | 1 + ...acking-file-early-in-bdrv_img_create.patch | 35 +++++++++++++++++++ sources | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 0101-block-Close-backing-file-early-in-bdrv_img_create.patch diff --git a/.gitignore b/.gitignore index 8938ae8..7da4d22 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ qemu-kvm-0.13.0-25fdf4a.tar.gz /qemu-1.6.0.tar.bz2 /qemu-1.6.1.tar.bz2 /qemu-1.7.0-rc1.tar.bz2 +/qemu-1.7.0.tar.bz2 diff --git a/0101-block-Close-backing-file-early-in-bdrv_img_create.patch b/0101-block-Close-backing-file-early-in-bdrv_img_create.patch new file mode 100644 index 0000000..2803a33 --- /dev/null +++ b/0101-block-Close-backing-file-early-in-bdrv_img_create.patch @@ -0,0 +1,35 @@ +From f2b896fa48272c26445e17b59a365fcaea808e0e Mon Sep 17 00:00:00 2001 +From: Max Reitz +Date: Fri, 29 Nov 2013 21:41:29 +0100 +Subject: [PATCH] block: Close backing file early in bdrv_img_create + +Leaving the backing file open although it is not needed anymore can +cause problems if it is opened through a block driver which allows +exclusive access only and if the create function of the block driver +used for the top image (the one being created) tries to close and reopen +the image file (which will include opening the backing file a second +time). + +In particular, this will happen with a backing file opened through +qemu-nbd and using qcow2 as the top image file format (which reopens the +image to flush it to disk). + +Signed-off-by: Max Reitz +--- + block.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/block.c b/block.c +index 382ea71..6d571ad 100644 +--- a/block.c ++++ b/block.c +@@ -4608,6 +4608,9 @@ void bdrv_img_create(const char *filename, const char *fmt, + + snprintf(buf, sizeof(buf), "%" PRId64, size); + set_option_parameter(param, BLOCK_OPT_SIZE, buf); ++ ++ bdrv_unref(bs); ++ bs = NULL; + } else { + error_setg(errp, "Image creation needs a size parameter"); + goto out; diff --git a/sources b/sources index 0eec911..52b8f46 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4cd5d82632335e0a586c77725ef0547d qemu-1.7.0-rc1.tar.bz2 +32893941d40d052a5e649efcf06aca06 qemu-1.7.0.tar.bz2 From cf5f9d239ebefdb9824d6a7bbb21c46ecb639f60 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 4 Dec 2013 18:13:23 -0500 Subject: [PATCH 38/45] Clarify chrpath comment --- qemu.spec | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/qemu.spec b/qemu.spec index dbe9ba9..5b20dad 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1022,10 +1022,14 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/libcacard.pc rm -rf $RPM_BUILD_ROOT%{_includedir}/cacard %endif -# When building using 'rpmbuild' or 'fedpkg local', RPATHs are left in +# When building using 'rpmbuild' or 'fedpkg local', RPATHs can be left in # the binaries and libraries (although this doesn't occur when -# building in Koji, for some unknown reason). In any case it should -# always be safe to remove RPATHs from the final binaries: +# building in Koji, for some unknown reason). Some discussion here: +# +# https://lists.fedoraproject.org/pipermail/devel/2013-November/192553.html +# +# In any case it should always be safe to remove RPATHs from +# the final binaries: for f in $RPM_BUILD_ROOT%{_bindir}/* $RPM_BUILD_ROOT%{_libdir}/* \ $RPM_BUILD_ROOT%{_libexecdir}/*; do if file $f | grep -q ELF; then chrpath --delete $f; fi From cba9c935f93fbc985fba47665e28d9ed83aaece3 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 4 Dec 2013 18:14:53 -0500 Subject: [PATCH 39/45] Update qemu-img patch to latest available upstream version --- ...acking-file-early-in-bdrv_img_create.patch | 51 ++++++++++++++++--- 1 file changed, 44 insertions(+), 7 deletions(-) diff --git a/0101-block-Close-backing-file-early-in-bdrv_img_create.patch b/0101-block-Close-backing-file-early-in-bdrv_img_create.patch index 2803a33..86d4ad1 100644 --- a/0101-block-Close-backing-file-early-in-bdrv_img_create.patch +++ b/0101-block-Close-backing-file-early-in-bdrv_img_create.patch @@ -1,6 +1,6 @@ -From f2b896fa48272c26445e17b59a365fcaea808e0e Mon Sep 17 00:00:00 2001 +From 62a30a970548466900ac45962a0fe8c051514329 Mon Sep 17 00:00:00 2001 From: Max Reitz -Date: Fri, 29 Nov 2013 21:41:29 +0100 +Date: Tue, 3 Dec 2013 14:57:52 +0100 Subject: [PATCH] block: Close backing file early in bdrv_img_create Leaving the backing file open although it is not needed anymore can @@ -14,22 +14,59 @@ In particular, this will happen with a backing file opened through qemu-nbd and using qcow2 as the top image file format (which reopens the image to flush it to disk). +In addition, the BlockDriverState in bdrv_img_create() is used for the +backing file only; it should therefore be made local to the respective +block. + Signed-off-by: Max Reitz --- - block.c | 3 +++ - 1 file changed, 3 insertions(+) + block.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c -index 382ea71..6d571ad 100644 +index 382ea71..0468765 100644 --- a/block.c +++ b/block.c -@@ -4608,6 +4608,9 @@ void bdrv_img_create(const char *filename, const char *fmt, +@@ -4504,7 +4504,6 @@ void bdrv_img_create(const char *filename, const char *fmt, + { + QEMUOptionParameter *param = NULL, *create_options = NULL; + QEMUOptionParameter *backing_fmt, *backing_file, *size; +- BlockDriverState *bs = NULL; + BlockDriver *drv, *proto_drv; + BlockDriver *backing_drv = NULL; + Error *local_err = NULL; +@@ -4583,6 +4582,7 @@ void bdrv_img_create(const char *filename, const char *fmt, + size = get_option_parameter(param, BLOCK_OPT_SIZE); + if (size && size->value.n == -1) { + if (backing_file && backing_file->value.s) { ++ BlockDriverState *bs; + uint64_t size; + char buf[32]; + int back_flags; +@@ -4601,6 +4601,7 @@ void bdrv_img_create(const char *filename, const char *fmt, + error_get_pretty(local_err)); + error_free(local_err); + local_err = NULL; ++ bdrv_unref(bs); + goto out; + } + bdrv_get_geometry(bs, &size); +@@ -4608,6 +4609,8 @@ void bdrv_img_create(const char *filename, const char *fmt, snprintf(buf, sizeof(buf), "%" PRId64, size); set_option_parameter(param, BLOCK_OPT_SIZE, buf); + + bdrv_unref(bs); -+ bs = NULL; } else { error_setg(errp, "Image creation needs a size parameter"); goto out; +@@ -4638,9 +4641,6 @@ out: + free_option_parameters(create_options); + free_option_parameters(param); + +- if (bs) { +- bdrv_unref(bs); +- } + if (error_is_set(&local_err)) { + error_propagate(errp, local_err); + } From c4025101e71863b28708bca84f17ecec4c897a95 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Wed, 18 Dec 2013 12:11:24 -0500 Subject: [PATCH 40/45] Add kill() to seccomp whitelist, fix AC97 with -sandbox on (bz #1043521) Changing streaming mode default to off for spice (bz #1038336) Fix guest scsi verify command (bz #1001617) --- ...mp-add-kill-to-the-syscall-whitelist.patch | 42 +++++++++ ...reaming-video-mode-to-off-by-default.patch | 33 +++++++ ...nsfer-length-and-direction-for-VERIF.patch | 59 ++++++++++++ 0105-scsi-disk-fix-VERIFY-emulation.patch | 90 +++++++++++++++++++ qemu.spec | 23 ++++- 5 files changed, 246 insertions(+), 1 deletion(-) create mode 100644 0102-seccomp-add-kill-to-the-syscall-whitelist.patch create mode 100644 0103-spice-flip-streaming-video-mode-to-off-by-default.patch create mode 100644 0104-scsi-bus-fix-transfer-length-and-direction-for-VERIF.patch create mode 100644 0105-scsi-disk-fix-VERIFY-emulation.patch diff --git a/0102-seccomp-add-kill-to-the-syscall-whitelist.patch b/0102-seccomp-add-kill-to-the-syscall-whitelist.patch new file mode 100644 index 0000000..b101332 --- /dev/null +++ b/0102-seccomp-add-kill-to-the-syscall-whitelist.patch @@ -0,0 +1,42 @@ +From cebb1cd8d123360634243ac527c136721fb7fba7 Mon Sep 17 00:00:00 2001 +From: Paul Moore +Date: Thu, 21 Nov 2013 10:40:15 -0500 +Subject: [PATCH] seccomp: add kill() to the syscall whitelist + +The kill() syscall is triggered with the following command: + + # qemu -sandbox on -monitor stdio \ + -device intel-hda -device hda-duplex -vnc :0 + +The resulting syslog/audit message: + + # ausearch -m SECCOMP + ---- + time->Wed Nov 20 09:52:08 2013 + type=SECCOMP msg=audit(1384912328.482:6656): auid=0 uid=0 gid=0 ses=854 + subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 pid=12087 + comm="qemu-kvm" sig=31 syscall=62 compat=0 ip=0x7f7a1d2abc67 code=0x0 + # scmp_sys_resolver 62 + kill + +Reported-by: CongLi +Tested-by: CongLi +Signed-off-by: Paul Moore +Acked-by: Eduardo Otubo +(cherry picked from commit e9eecb5bf82a71564bf018fcbbfc6cda19cab6c2) +--- + qemu-seccomp.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/qemu-seccomp.c b/qemu-seccomp.c +index 69cee44..cf07869 100644 +--- a/qemu-seccomp.c ++++ b/qemu-seccomp.c +@@ -114,6 +114,7 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = { + { SCMP_SYS(write), 244 }, + { SCMP_SYS(fcntl), 243 }, + { SCMP_SYS(tgkill), 242 }, ++ { SCMP_SYS(kill), 242 }, + { SCMP_SYS(rt_sigaction), 242 }, + { SCMP_SYS(pipe2), 242 }, + { SCMP_SYS(munmap), 242 }, diff --git a/0103-spice-flip-streaming-video-mode-to-off-by-default.patch b/0103-spice-flip-streaming-video-mode-to-off-by-default.patch new file mode 100644 index 0000000..afa6ac5 --- /dev/null +++ b/0103-spice-flip-streaming-video-mode-to-off-by-default.patch @@ -0,0 +1,33 @@ +From 200413b505dfc4ae8611d523e87f1dee18a6bf0f Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Mon, 2 Dec 2013 11:17:04 +0100 +Subject: [PATCH] spice: flip streaming video mode to off by default + +Video streaming detection heuristics in spice-server have problems +keeping modern desktop animations (as done by gnome shell) and real +video playback apart. This leads to jpeg compression artefacts on +your desktop, due to spice using mjpeg to send what it thinks is +a video stream. + +Turn off video detection by default to avoid these artifacts. + +Signed-off-by: Gerd Hoffmann +Reviewed-by: Alon Levy +(cherry picked from commit f1d3e586f069e17f83b669842bc02d60d509daca) +--- + ui/spice-core.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/ui/spice-core.c b/ui/spice-core.c +index e4d533d..9fb9544 100644 +--- a/ui/spice-core.c ++++ b/ui/spice-core.c +@@ -776,6 +776,8 @@ void qemu_spice_init(void) + if (str) { + int streaming_video = parse_stream_video(str); + spice_server_set_streaming_video(spice_server, streaming_video); ++ } else { ++ spice_server_set_streaming_video(spice_server, SPICE_STREAM_VIDEO_OFF); + } + + spice_server_set_agent_mouse diff --git a/0104-scsi-bus-fix-transfer-length-and-direction-for-VERIF.patch b/0104-scsi-bus-fix-transfer-length-and-direction-for-VERIF.patch new file mode 100644 index 0000000..a204453 --- /dev/null +++ b/0104-scsi-bus-fix-transfer-length-and-direction-for-VERIF.patch @@ -0,0 +1,59 @@ +From 3b1f248f3f8ff06ed4a4269871138db66e336ec5 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Thu, 28 Nov 2013 11:01:13 +0100 +Subject: [PATCH] scsi-bus: fix transfer length and direction for VERIFY + command +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The amount of bytes to transfer depends on the BYTCHK field. +If any data is transferred, it is sent to the device. + +Cc: qemu-stable@nongnu.org +Tested-by: Hervé Poussineau +Signed-off-by: Paolo Bonzini +(cherry picked from commit d12ad44cc4cc9142179e64295608611f118b8ad8) +--- + hw/scsi/scsi-bus.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c +index ea916d1..2d6ce4d 100644 +--- a/hw/scsi/scsi-bus.c ++++ b/hw/scsi/scsi-bus.c +@@ -886,7 +886,6 @@ static int scsi_req_length(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf) + case RELEASE: + case ERASE: + case ALLOW_MEDIUM_REMOVAL: +- case VERIFY_10: + case SEEK_10: + case SYNCHRONIZE_CACHE: + case SYNCHRONIZE_CACHE_16: +@@ -903,6 +902,16 @@ static int scsi_req_length(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf) + case ALLOW_OVERWRITE: + cmd->xfer = 0; + break; ++ case VERIFY_10: ++ case VERIFY_12: ++ case VERIFY_16: ++ if ((buf[1] & 2) == 0) { ++ cmd->xfer = 0; ++ } else if ((buf[1] & 4) == 1) { ++ cmd->xfer = 1; ++ } ++ cmd->xfer *= dev->blocksize; ++ break; + case MODE_SENSE: + break; + case WRITE_SAME_10: +@@ -1100,6 +1109,9 @@ static void scsi_cmd_xfer_mode(SCSICommand *cmd) + case WRITE_VERIFY_12: + case WRITE_16: + case WRITE_VERIFY_16: ++ case VERIFY_10: ++ case VERIFY_12: ++ case VERIFY_16: + case COPY: + case COPY_VERIFY: + case COMPARE: diff --git a/0105-scsi-disk-fix-VERIFY-emulation.patch b/0105-scsi-disk-fix-VERIFY-emulation.patch new file mode 100644 index 0000000..ba8f28e --- /dev/null +++ b/0105-scsi-disk-fix-VERIFY-emulation.patch @@ -0,0 +1,90 @@ +From ddc0dda3d6352e4c28e0bd11cce1d90734dce0db Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Thu, 28 Nov 2013 11:18:56 +0100 +Subject: [PATCH] scsi-disk: fix VERIFY emulation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +VERIFY emulation was completely botched (and remained botched through +all the refactorings). The command must be emulated both in check-medium +mode (BYTCHK=00, which we implement by doing nothing) and in check-bytes +mode (which we do not implement yet). Unlike WRITE AND VERIFY (which we +treat simply as WRITE with FUA bit set), VERIFY cannot be handled like +READ. In fact the device is _receiving_ data for VERIFY, not _sending_ +it like READ. + +Cc: qemu-stable@nongnu.org +Tested-by: Hervé Poussineau +Signed-off-by: Paolo Bonzini +(cherry picked from commit d97e7730816094a71cd1f19a56d7a73f77cdbf96) + +Conflicts: + hw/scsi/scsi-disk.c +--- + hw/scsi/scsi-disk.c | 26 +++++++++++++++++++------- + 1 file changed, 19 insertions(+), 7 deletions(-) + +diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c +index 74e6a14..1fd1c26 100644 +--- a/hw/scsi/scsi-disk.c ++++ b/hw/scsi/scsi-disk.c +@@ -1597,6 +1597,14 @@ static void scsi_disk_emulate_write_data(SCSIRequest *req) + scsi_disk_emulate_unmap(r, r->iov.iov_base); + break; + ++ case VERIFY_10: ++ case VERIFY_12: ++ case VERIFY_16: ++ if (r->req.status == -1) { ++ scsi_check_condition(r, SENSE_CODE(INVALID_FIELD)); ++ } ++ break; ++ + default: + abort(); + } +@@ -1837,6 +1845,14 @@ static int32_t scsi_disk_emulate_command(SCSIRequest *req, uint8_t *buf) + case UNMAP: + DPRINTF("Unmap (len %lu)\n", (long)r->req.cmd.xfer); + break; ++ case VERIFY_10: ++ case VERIFY_12: ++ case VERIFY_16: ++ DPRINTF("Verify (bytchk %lu)\n", (r->req.buf[1] >> 1) & 3); ++ if (req->cmd.buf[1] & 6) { ++ goto illegal_request; ++ } ++ break; + case WRITE_SAME_10: + case WRITE_SAME_16: + nb_sectors = scsi_data_cdb_length(r->req.cmd.buf); +@@ -1936,10 +1952,6 @@ static int32_t scsi_disk_dma_command(SCSIRequest *req, uint8_t *buf) + scsi_check_condition(r, SENSE_CODE(WRITE_PROTECTED)); + return 0; + } +- /* fallthrough */ +- case VERIFY_10: +- case VERIFY_12: +- case VERIFY_16: + DPRINTF("Write %s(sector %" PRId64 ", count %u)\n", + (command & 0xe) == 0xe ? "And Verify " : "", + r->req.cmd.lba, len); +@@ -2207,14 +2219,14 @@ static const SCSIReqOps *const scsi_disk_reqops_dispatch[256] = { + [UNMAP] = &scsi_disk_emulate_reqops, + [WRITE_SAME_10] = &scsi_disk_emulate_reqops, + [WRITE_SAME_16] = &scsi_disk_emulate_reqops, ++ [VERIFY_10] = &scsi_disk_emulate_reqops, ++ [VERIFY_12] = &scsi_disk_emulate_reqops, ++ [VERIFY_16] = &scsi_disk_emulate_reqops, + + [READ_6] = &scsi_disk_dma_reqops, + [READ_10] = &scsi_disk_dma_reqops, + [READ_12] = &scsi_disk_dma_reqops, + [READ_16] = &scsi_disk_dma_reqops, +- [VERIFY_10] = &scsi_disk_dma_reqops, +- [VERIFY_12] = &scsi_disk_dma_reqops, +- [VERIFY_16] = &scsi_disk_dma_reqops, + [WRITE_6] = &scsi_disk_dma_reqops, + [WRITE_10] = &scsi_disk_dma_reqops, + [WRITE_12] = &scsi_disk_dma_reqops, diff --git a/qemu.spec b/qemu.spec index 5b20dad..03a6307 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,7 +139,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.7.0 -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -202,6 +202,14 @@ Patch0014: 0014-virtio-pci-add-device_unplugged-callback.patch # Fix qemu-img create with NBD backing file (bz #1034433) # Patch posted upstream Patch0101: 0101-block-Close-backing-file-early-in-bdrv_img_create.patch +# Add kill() to seccomp whitelist, fix AC97 with -sandbox on (bz +# #1043521) +Patch0102: 0102-seccomp-add-kill-to-the-syscall-whitelist.patch +# Changing streaming mode default to off for spice (bz #1038336) +Patch0103: 0103-spice-flip-streaming-video-mode-to-off-by-default.patch +# Fix guest scsi verify command (bz #1001617) +Patch0104: 0104-scsi-bus-fix-transfer-length-and-direction-for-VERIF.patch +Patch0105: 0105-scsi-disk-fix-VERIFY-emulation.patch BuildRequires: SDL-devel BuildRequires: zlib-devel @@ -726,6 +734,14 @@ CAC emulation development files. # Fix qemu-img create with NBD backing file (bz #1034433) # Patch posted upstream %patch0101 -p1 +# Add kill() to seccomp whitelist, fix AC97 with -sandbox on (bz +# #1043521) +%patch0102 -p1 +# Changing streaming mode default to off for spice (bz #1038336) +%patch0103 -p1 +# Fix guest scsi verify command (bz #1001617) +%patch0104 -p1 +%patch0105 -p1 %build @@ -1449,6 +1465,11 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Wed Dec 18 2013 Cole Robinson - 2:1.7.0-2 +- Add kill() to seccomp whitelist, fix AC97 with -sandbox on (bz #1043521) +- Changing streaming mode default to off for spice (bz #1038336) +- Fix guest scsi verify command (bz #1001617) + * Mon Dec 02 2013 Cole Robinson - 2:1.7.0-1 - Fix qemu-img create with NBD backing file (bz #1034433) - Rebase to qemu-1.7 GA From c4896d008b4e71e0cdbc505d8ff8849f830ac531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 21 Dec 2013 20:30:28 +0200 Subject: [PATCH 41/45] Add libcacard ldconfig %post* scriptlets. --- qemu.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index 03a6307..f6c9593 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,7 +139,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.7.0 -Release: 2%{?dist} +Release: 3%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -1090,6 +1090,10 @@ getent passwd qemu >/dev/null || \ %systemd_postun_with_restart ksmtuned.service %endif +%if %{without separate_kvm} +%post -n libcacard -p /sbin/ldconfig +%postun -n libcacard -p /sbin/ldconfig +%endif %if 0%{?user:1} %post %{user} @@ -1465,6 +1469,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Sat Dec 21 2013 Ville Skyttä - 2:1.7.0-3 +- Add libcacard ldconfig %%post* scriptlets. + * Wed Dec 18 2013 Cole Robinson - 2:1.7.0-2 - Add kill() to seccomp whitelist, fix AC97 with -sandbox on (bz #1043521) - Changing streaming mode default to off for spice (bz #1038336) From e65bbe3b55f554a20718bae27903fd0f85559d4c Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Mon, 6 Jan 2014 12:34:57 -0500 Subject: [PATCH 42/45] spec: Fix some --without conditionals (bz 1048476) --- qemu.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qemu.spec b/qemu.spec index f6c9593..c5bf93a 100644 --- a/qemu.spec +++ b/qemu.spec @@ -795,9 +795,13 @@ dobuild() { --enable-tpm \ %if 0%{?have_spice:1} --enable-spice \ +%else + --disable-spice \ %endif %if 0%{?have_seccomp:1} --enable-seccomp \ +%else + --disable-seccomp \ %endif %if %{without rbd} --disable-rbd \ From aa1e9b6b3fa4123feb2d7e3f6383bf986526b3fe Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 13 Jan 2014 10:12:15 +0000 Subject: [PATCH 43/45] Disable make check on aarch64. --- qemu.spec | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index c5bf93a..d76fb08 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,7 +139,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.7.0 -Release: 3%{?dist} +Release: 4%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -1056,7 +1056,11 @@ for f in $RPM_BUILD_ROOT%{_bindir}/* $RPM_BUILD_ROOT%{_libdir}/* \ done %check +# Disabled on aarch64 where it fails with several errors. Will +# investigate and fix when we have access to real hardware - RWMJ. +%ifnarch aarch64 make check +%endif # Sanity-check current kernel can boot on this qemu. # The results are advisory only. @@ -1473,6 +1477,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Mon Jan 13 2014 Richard W.M. Jones - 2:1.7.0-4 +- Disable make check on aarch64. + * Sat Dec 21 2013 Ville Skyttä - 2:1.7.0-3 - Add libcacard ldconfig %%post* scriptlets. From 5b4ee6cf966e4935de128825dc42dee29aa63f7f Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 18 Feb 2014 11:42:44 -0500 Subject: [PATCH 44/45] Run qemu-sanity-check on x86 and armv7 too. The results are still only advisory. --- qemu.spec | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/qemu.spec b/qemu.spec index d76fb08..33cc56d 100644 --- a/qemu.spec +++ b/qemu.spec @@ -139,7 +139,7 @@ Summary: QEMU is a FAST! processor emulator Name: qemu Version: 1.7.0 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 2 License: GPLv2+ and LGPLv2+ and BSD Group: Development/Tools @@ -1065,9 +1065,16 @@ make check # Sanity-check current kernel can boot on this qemu. # The results are advisory only. %if 0%{?fedora} >= 20 -%ifarch x86_64 -qemu-sanity-check --qemu=x86_64-softmmu/qemu-system-x86_64 || : +%ifarch %{arm} +hostqemu=arm-softmmu/qemu-system-arm %endif +%ifarch %{ix86} +hostqemu=i386-softmmu/qemu-system-i386 +%endif +%ifarch x86_64 +hostqemu=x86_64-softmmu/qemu-system-x86_64 +%endif +if test -f $hostqemu; then qemu-sanity-check --qemu=$hostqemu ||: ; fi %endif %ifarch %{kvm_archs} @@ -1477,6 +1484,10 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Feb 18 2014 Richard W.M. Jones - 2:1.7.0-5 +- Run qemu-sanity-check on x86 and armv7 too. The results are still + only advisory. + * Mon Jan 13 2014 Richard W.M. Jones - 2:1.7.0-4 - Disable make check on aarch64. From 755ac92dbf195ffd07a0c27f3b3b05a9d66ae4c3 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 18 Feb 2014 17:10:08 +0000 Subject: [PATCH 45/45] Better to quote the argument to test. --- qemu.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu.spec b/qemu.spec index 33cc56d..95b1def 100644 --- a/qemu.spec +++ b/qemu.spec @@ -1074,7 +1074,7 @@ hostqemu=i386-softmmu/qemu-system-i386 %ifarch x86_64 hostqemu=x86_64-softmmu/qemu-system-x86_64 %endif -if test -f $hostqemu; then qemu-sanity-check --qemu=$hostqemu ||: ; fi +if test -f "$hostqemu"; then qemu-sanity-check --qemu=$hostqemu ||: ; fi %endif %ifarch %{kvm_archs}