* [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14
@ 2015-01-08 17:33 Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 01/88] qdev: Use NULL instead of local_err for qbus_child unrealize Michael Roth
` (89 more replies)
0 siblings, 90 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
Hi everyone,
The following new patches are queued for QEMU stable v2.1.3:
https://github.com/mdroth/qemu/commits/stable-2.1-staging
The release is planned for 2015-01-21:
http://wiki.qemu.org/Planning/2.1
Please respond here or CC qemu-stable@nongnu.org on any patches you
think should be included in the release.
This is the last planned release for the QEMU 2.1 series, and it's
quite a bit busier than usual for a final stable update so your
scrutiny/testing is very appreciated.
Thanks!
----------------------------------------------------------------
Alexander Graf (2):
kvmclock: Ensure time in migration never goes backward
kvm: Fix memory slot page alignment logic
Andreas Färber (1):
ivshmem: Fix fd leak on error
Aurelien Jarno (1):
tcg/mips: fix store softmmu slow path
Damjan Marion (1):
vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation
Don Slutz (1):
hw/ide/core.c: Prevent SIGSEGV during migration
Dr. David Alan Gilbert (1):
xhci PCIe endpoint migration compatibility fix
Eduardo Habkost (2):
kvmclock: Add comment explaining why we need cpu_clean_all_dirty()
smbios: Fix assertion on socket count calculation
Fam Zheng (1):
qemu-iotests: Test missing "driver" key for blockdev-add
Gary R Hook (1):
block migration: fix return value
Gerd Hoffmann (5):
vmware-vga: CVE-2014-3689: turn off hw accel
vmware-vga: add vmsvga_verify_rect
vmware-vga: use vmsvga_verify_rect in vmsvga_update_rect
vmware-vga: use vmsvga_verify_rect in vmsvga_copy_rect
vmware-vga: use vmsvga_verify_rect in vmsvga_fill_rect
Gonglei (13):
qdev: Use NULL instead of local_err for qbus_child unrealize
qdev: Add cleanup logic in device_set_realized() to avoid resource leak
virtio-net: use aliases instead of duplicate qdev properties
virtio-net: fix virtio-net child refcount in transports
virtio/vhost-scsi: use aliases instead of duplicate qdev properties
virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports
virtio-serial: use aliases instead of duplicate qdev properties
virtio-serial: fix virtio-serial child refcount in transports
virtio-rng: use aliases instead of duplicate qdev properties
virtio-rng: fix virtio-rng child refcount in transports
virtio-balloon: fix virtio-balloon child refcount in transports
virtio-9p: use aliases instead of duplicate qdev properties
virtio-9p: fix virtio-9p child refcount in transports
Greg Kurz (1):
spapr_pci: map the MSI window in each PHB
Hannes Reinecke (1):
esp-pci: fixup deadlock with linux
Igor Mammedov (1):
pc: acpi: mark all possible CPUs as enabled in SRAT
Jan Kiszka (3):
pci: Use bus master address space for delivering MSI/MSI-X messages
pc: Fix disabling of vapic for compat PC models
Make qemu_shutdown_requested signal-safe
Jason Wang (1):
virtio-net: fix unmap leak
Kevin Wolf (3):
qcow2: Fix header extension size check
qcow2.py: Add required padding for header extensions
block: Don't probe for unknown backing file format
Luiz Capitulino (2):
exec: file_ram_alloc(): print error when prealloc fails
virtio-balloon: fix integer overflow in memory stats feature
Marcelo Tosatti (2):
Introduce cpu_clean_all_dirty
kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation
Max Filippov (5):
hw/core/loader: implement address translation in uimage loader
hw/xtensa/xtfpga: treat uImage load address as virtual
target-xtensa: add missing window check for entry
target-xtensa: fix translation for opcodes crossing page boundary
target-xtensa: test cross-page opcode
Max Reitz (14):
qcow2: Do not overflow when writing an L1 sector
block: Make essential BlockDriver objects public
block: Omit bdrv_find_format for essential drivers
block/vvfat: qcow driver may not be found
block/nfs: Add create_opts
block: Check create_opts before image creation
qemu-img: Check create_opts before image creation
qemu-img: Check create_opts before image amendment
iotests: Only kill NBD server if it runs
iotests: Add test for unsupported image creation
qcow2: Prevent numerical overflow
qcow2: Flushing the caches in qcow2_close may fail
qcow2: Respect bdrv_truncate() error
block/raw-posix: Fix ret in raw_open_common()
Michael Roth (4):
qapi: add visit_start_union and visit_end_union
qapi: dealloc visitor, implement visit_start_union
tests: add QMP input visitor test for unions with no discriminator
tests: avoid running duplicate qom-tests
Michael S. Tsirkin (1):
virtio-pci: enable bus master for old guests
Paolo Bonzini (4):
vhost-scsi: use virtio_ldl_p
virtio-scsi: work around bug in old BIOSes
linuxboot: compute initrd loading address
linuxboot: fix loading old kernels
Pavel Dovgalyuk (1):
gdbstub: init mon_chr through qemu_chr_alloc
Peter Maydell (4):
hw/arm/virt: fix pl011 and pl031 irq flags
hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*)
exec: Handle multipage ranges in invalidate_and_set_dirty()
audio: Don't free hw resources until after hw backend is stopped
Petr Matousek (1):
vnc: sanitize bits_per_pixel from the client
Ray Strode (1):
libcacard: don't free sign buffer while sign op is pending
Sebastian Krahmer (1):
ivshmem: Fix potential OOB r/w access
Stefan Hajnoczi (2):
ivshmem: Check ivshmem_read() size argument
ivshmem: validate incoming_posn value from server
Stratos Psomadakis (1):
monitor: Reset HMP mon->rs in CHR_EVENT_OPEN
Ting Wang (1):
virtio-scsi: sense in virtio_scsi_command_complete
Zhang Haoyu (2):
snapshot: fix referencing wrong variable in while loop in do_delvm
snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem
zhanghailiang (3):
pc-dimm: Don't check dimm->node when there is non-NUMA config
libcacard: fix resource leak
l2tpv3: fix possible double free
audio/audio_template.h | 2 +-
block-migration.c | 10 +++-
block.c | 36 ++++++------
block/nfs.c | 15 +++++
block/qcow2-cluster.c | 8 ++-
block/qcow2.c | 33 +++++++----
block/raw-posix.c | 3 +-
block/raw-win32.c | 2 +-
block/raw_bsd.c | 2 +-
block/snapshot.c | 4 ++
block/vvfat.c | 6 ++
cpus.c | 9 +++
exec.c | 7 +--
gdbstub.c | 2 +-
hw/arm/boot.c | 2 +-
hw/arm/virt.c | 4 +-
hw/core/loader.c | 17 ++++--
hw/core/qdev.c | 66 +++++++++++++++-------
hw/display/vmware_vga.c | 116 +++++++++++++++++++++++++-------------
hw/i386/acpi-build.c | 11 +---
hw/i386/kvm/clock.c | 67 ++++++++++++++++++++++
hw/i386/pc_piix.c | 2 +-
hw/i386/smbios.c | 2 +-
hw/ide/core.c | 2 +-
hw/m68k/an5206.c | 3 +-
hw/m68k/dummy_m68k.c | 3 +-
hw/m68k/mcf5208.c | 3 +-
hw/mem/pc-dimm.c | 2 +-
hw/microblaze/boot.c | 3 +-
hw/misc/ivshmem.c | 66 ++++++++++++++++++++--
hw/net/vhost_net.c | 8 +--
hw/net/virtio-net.c | 5 +-
hw/openrisc/openrisc_sim.c | 2 +-
hw/pci/msi.c | 2 +-
hw/pci/msix.c | 2 +-
hw/ppc/e500.c | 3 +-
hw/ppc/ppc440_bamboo.c | 3 +-
hw/ppc/spapr.c | 1 -
hw/ppc/spapr_pci.c | 81 +++++++++++++--------------
hw/s390x/s390-virtio-bus.c | 16 ++++--
hw/s390x/virtio-ccw.c | 18 +++---
hw/scsi/esp-pci.c | 2 +
hw/scsi/vhost-scsi.c | 5 +-
hw/scsi/virtio-scsi.c | 19 ++++++-
hw/usb/hcd-xhci.c | 6 +-
hw/virtio/virtio-balloon.c | 7 ++-
hw/virtio/virtio-pci.c | 31 ++++++++---
hw/xtensa/xtfpga.c | 3 +-
include/block/block_int.h | 8 +++
include/exec/ram_addr.h | 25 +++++++++
include/hw/i386/pc.h | 5 ++
include/hw/loader.h | 4 +-
include/hw/pci-host/spapr.h | 2 +-
include/hw/ppc/spapr.h | 2 -
include/qapi/visitor-impl.h | 2 +
include/qapi/visitor.h | 2 +
include/sysemu/cpus.h | 1 +
include/sysemu/kvm.h | 8 +++
kvm-all.c | 11 +++-
libcacard/cac.c | 10 +++-
libcacard/vscclient.c | 7 ++-
monitor.c | 1 +
net/l2tpv3.c | 1 -
pc-bios/linuxboot.bin | Bin 1024 -> 1024 bytes
pc-bios/optionrom/linuxboot.S | 66 ++++++++++++++++++++--
pc-bios/optionrom/optionrom.h | 21 ++++++-
qapi/qapi-dealloc-visitor.c | 26 +++++++++
qapi/qapi-visit-core.c | 15 +++++
qemu-img.c | 21 +++++++
savevm.c | 11 ++--
scripts/qapi-visit.py | 6 ++
target-xtensa/cpu.h | 6 ++
target-xtensa/op_helper.c | 6 ++
target-xtensa/translate.c | 27 +++++++--
tcg/mips/tcg-target.c | 2 +-
tests/Makefile | 3 +-
tests/qapi-schema/qapi-schema-test.json | 10 ++++
tests/qapi-schema/qapi-schema-test.out | 3 +
tests/qemu-iotests/026.out | 120 ++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/071.out | 8 +++
tests/qemu-iotests/080 | 2 +
tests/qemu-iotests/080.out | 2 +
tests/qemu-iotests/087 | 17 ++++++
tests/qemu-iotests/087.out | 13 +++++
tests/qemu-iotests/089.out | 2 +
tests/qemu-iotests/113 | 76 +++++++++++++++++++++++++
tests/qemu-iotests/113.out | 15 +++++
tests/qemu-iotests/114 | 61 ++++++++++++++++++++
tests/qemu-iotests/114.out | 13 +++++
tests/qemu-iotests/common.rc | 4 +-
tests/qemu-iotests/group | 2 +
tests/qemu-iotests/qcow2.py | 4 ++
tests/tcg/xtensa/test_mmu.S | 26 ++++-----
tests/test-qmp-input-strict.c | 17 ++++++
ui/vnc.c | 10 ++++
vl.c | 4 +-
96 files changed, 1175 insertions(+), 255 deletions(-)
create mode 100755 tests/qemu-iotests/113
create mode 100644 tests/qemu-iotests/113.out
create mode 100755 tests/qemu-iotests/114
create mode 100644 tests/qemu-iotests/114.out
^ permalink raw reply [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 01/88] qdev: Use NULL instead of local_err for qbus_child unrealize
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 02/88] qdev: Add cleanup logic in device_set_realized() to avoid resource leak Michael Roth
` (88 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
Forcefully unrealize all children regardless of errors in earlier
iterations (if any). We should keep going with cleanup operation
rather than report an error immediately. Therefore store the first
child unrealization failure and propagate it at the end. We also
forcefully unregister vmsd and unrealize actual object, too.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
(cherry picked from commit cd4520adcab70dbac8db3fe4d41836dca63715a4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/core/qdev.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index da1ba48..1a88865 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -871,18 +871,18 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
}
dev->pending_deleted_event = false;
} else if (!value && dev->realized) {
+ Error **local_errp = NULL;
QLIST_FOREACH(bus, &dev->child_bus, sibling) {
+ local_errp = local_err ? NULL : &local_err;
object_property_set_bool(OBJECT(bus), false, "realized",
- &local_err);
- if (local_err != NULL) {
- break;
- }
+ local_errp);
}
- if (qdev_get_vmsd(dev) && local_err == NULL) {
+ if (qdev_get_vmsd(dev)) {
vmstate_unregister(dev, qdev_get_vmsd(dev), dev);
}
- if (dc->unrealize && local_err == NULL) {
- dc->unrealize(dev, &local_err);
+ if (dc->unrealize) {
+ local_errp = local_err ? NULL : &local_err;
+ dc->unrealize(dev, local_errp);
}
dev->pending_deleted_event = true;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 02/88] qdev: Add cleanup logic in device_set_realized() to avoid resource leak
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 01/88] qdev: Use NULL instead of local_err for qbus_child unrealize Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 03/88] exec: file_ram_alloc(): print error when prealloc fails Michael Roth
` (87 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
At present, this function doesn't have partial cleanup implemented,
which will cause resource leaks in some scenarios.
Example:
1. Assume that "dc->realize(dev, &local_err)" executes successful
and local_err == NULL;
2. device hotplug in hotplug_handler_plug() executes but fails
(it is prone to occur). Then local_err != NULL;
3. error_propagate(errp, local_err) and return. But the resources
which have been allocated in dc->realize() will be leaked.
Simple backtrace:
dc->realize()
|->device_realize
|->pci_qdev_init()
|->do_pci_register_device()
|->etc.
Add fuller cleanup logic which assures that function can
goto appropriate error label as local_err population is
detected at each relevant point.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
(cherry picked from commit 1d45a705fc007a13f20d18473290082eae6d1725)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/core/qdev.c | 52 ++++++++++++++++++++++++++++++++++++++--------------
1 file changed, 38 insertions(+), 14 deletions(-)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 1a88865..0e21fad 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -834,12 +834,14 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
dc->realize(dev, &local_err);
}
- if (dev->parent_bus && dev->parent_bus->hotplug_handler &&
- local_err == NULL) {
+ if (local_err != NULL) {
+ goto fail;
+ }
+
+ if (dev->parent_bus && dev->parent_bus->hotplug_handler) {
hotplug_handler_plug(dev->parent_bus->hotplug_handler,
dev, &local_err);
- } else if (local_err == NULL &&
- object_dynamic_cast(qdev_get_machine(), TYPE_MACHINE)) {
+ } else if (object_dynamic_cast(qdev_get_machine(), TYPE_MACHINE)) {
HotplugHandler *hotplug_ctrl;
MachineState *machine = MACHINE(qdev_get_machine());
MachineClass *mc = MACHINE_GET_CLASS(machine);
@@ -852,21 +854,24 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
}
}
- if (qdev_get_vmsd(dev) && local_err == NULL) {
+ if (local_err != NULL) {
+ goto post_realize_fail;
+ }
+
+ if (qdev_get_vmsd(dev)) {
vmstate_register_with_alias_id(dev, -1, qdev_get_vmsd(dev), dev,
dev->instance_id_alias,
dev->alias_required_for_version);
}
- if (local_err == NULL) {
- QLIST_FOREACH(bus, &dev->child_bus, sibling) {
- object_property_set_bool(OBJECT(bus), true, "realized",
+
+ QLIST_FOREACH(bus, &dev->child_bus, sibling) {
+ object_property_set_bool(OBJECT(bus), true, "realized",
&local_err);
- if (local_err != NULL) {
- break;
- }
+ if (local_err != NULL) {
+ goto child_realize_fail;
}
}
- if (dev->hotplugged && local_err == NULL) {
+ if (dev->hotplugged) {
device_reset(dev);
}
dev->pending_deleted_event = false;
@@ -888,11 +893,30 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
}
if (local_err != NULL) {
- error_propagate(errp, local_err);
- return;
+ goto fail;
}
dev->realized = value;
+ return;
+
+child_realize_fail:
+ QLIST_FOREACH(bus, &dev->child_bus, sibling) {
+ object_property_set_bool(OBJECT(bus), false, "realized",
+ NULL);
+ }
+
+ if (qdev_get_vmsd(dev)) {
+ vmstate_unregister(dev, qdev_get_vmsd(dev), dev);
+ }
+
+post_realize_fail:
+ if (dc->unrealize) {
+ dc->unrealize(dev, NULL);
+ }
+
+fail:
+ error_propagate(errp, local_err);
+ return;
}
static bool device_get_hotpluggable(Object *obj, Error **errp)
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 03/88] exec: file_ram_alloc(): print error when prealloc fails
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 01/88] qdev: Use NULL instead of local_err for qbus_child unrealize Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 02/88] qdev: Add cleanup logic in device_set_realized() to avoid resource leak Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 04/88] xhci PCIe endpoint migration compatibility fix Michael Roth
` (86 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Luiz Capitulino <lcapitulino@redhat.com>
If memory allocation fails when using the -mem-prealloc command-line
option, QEMU exits without printing any error information to
the user:
# qemu [...] -m 1G -mem-prealloc -mem-path /dev/hugepages
# echo $?
1
This commit adds an error message, so that we print instead:
# qemu [...] -m 1G -mem-prealloc -mem-path /dev/hugepages
qemu: unable to map backing store for hugepages: Cannot allocate memory
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit e4d9df4fb16861f413374b69fcdb12c8c7a4a17e)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
exec.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/exec.c b/exec.c
index 307bc24..a7d7daa 100644
--- a/exec.c
+++ b/exec.c
@@ -1130,6 +1130,7 @@ static void *file_ram_alloc(RAMBlock *block,
error:
if (mem_prealloc) {
+ error_report("%s\n", error_get_pretty(*errp));
exit(1);
}
return NULL;
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 04/88] xhci PCIe endpoint migration compatibility fix
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (2 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 03/88] exec: file_ram_alloc(): print error when prealloc fails Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 05/88] Introduce cpu_clean_all_dirty Michael Roth
` (85 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Add back the PCIe config capabilities on XHCI cards in non-PCIe slots,
but only for machine types before 2.1.
This fixes a migration incompatibility in the XHCI PCI devices
caused by:
058fdcf52cdbf57b67e7 - xhci: add endpoint cap on express bus only
Note that in fixing it for compatibility with older QEMUs, it breaks
compatibility with existing QEMU 2.1's on older machine types.
The status before this patch was (if it used an XHCI adapter):
machine type | source qemu
any pre-2.1 - FAIL
any 2.1... - PASS
With this patch:
machine type | source qemu
any pre-2.1 - PASS
pre-2.1 2.1... - FAIL
2.1 2.1... - PASS
A test to trigger it is to add '-device nec-usb-xhci,id=xhci,addr=0x12'
to the command line.
Cc: qemu-stable@nongnu.org
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit e6043e92c2812a56b8f6cf35d5512067c746ce21)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/usb/hcd-xhci.c | 6 +++++-
include/hw/i386/pc.h | 5 +++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 58c4b11..807e1ae 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -499,6 +499,7 @@ enum xhci_flags {
XHCI_FLAG_USE_MSI = 1,
XHCI_FLAG_USE_MSI_X,
XHCI_FLAG_SS_FIRST,
+ XHCI_FLAG_FORCE_PCIE_ENDCAP,
};
static void xhci_kick_ep(XHCIState *xhci, unsigned int slotid,
@@ -3626,7 +3627,8 @@ static int usb_xhci_initfn(struct PCIDevice *dev)
PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64,
&xhci->mem);
- if (pci_bus_is_express(dev->bus)) {
+ if (pci_bus_is_express(dev->bus) ||
+ xhci_get_flag(xhci, XHCI_FLAG_FORCE_PCIE_ENDCAP)) {
ret = pcie_endpoint_cap_init(dev, 0xa0);
assert(ret >= 0);
}
@@ -3818,6 +3820,8 @@ static Property xhci_properties[] = {
DEFINE_PROP_BIT("msix", XHCIState, flags, XHCI_FLAG_USE_MSI_X, true),
DEFINE_PROP_BIT("superspeed-ports-first",
XHCIState, flags, XHCI_FLAG_SS_FIRST, true),
+ DEFINE_PROP_BIT("force-pcie-endcap", XHCIState, flags,
+ XHCI_FLAG_FORCE_PCIE_ENDCAP, false),
DEFINE_PROP_UINT32("intrs", XHCIState, numintrs, MAXINTRS),
DEFINE_PROP_UINT32("slots", XHCIState, numslots, MAXSLOTS),
DEFINE_PROP_UINT32("p2", XHCIState, numports_2, 4),
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 5f0a265..b558875 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -318,6 +318,11 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
.value = "off",\
},\
{\
+ .driver = "nec-usb-xhci",\
+ .property = "force-pcie-endcap",\
+ .value = "on",\
+ },\
+ {\
.driver = "pci-serial",\
.property = "prog_if",\
.value = stringify(0),\
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 05/88] Introduce cpu_clean_all_dirty
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (3 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 04/88] xhci PCIe endpoint migration compatibility fix Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 06/88] kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation Michael Roth
` (84 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Marcelo Tosatti <mtosatti@redhat.com>
Introduce cpu_clean_all_dirty, to force subsequent cpu_synchronize_all_states
to read in-kernel register state.
Cc: qemu-stable@nongnu.org
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit de9d61e83d43be9069e6646fa9d57a3f47779d28)
Conflicts:
kvm-all.c
*removed context dependency on kvm_cpu_synchronize_post_init
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
cpus.c | 9 +++++++++
include/sysemu/cpus.h | 1 +
include/sysemu/kvm.h | 8 ++++++++
kvm-all.c | 5 +++++
4 files changed, 23 insertions(+)
diff --git a/cpus.c b/cpus.c
index 5e7f2cf..492defe 100644
--- a/cpus.c
+++ b/cpus.c
@@ -523,6 +523,15 @@ void cpu_synchronize_all_post_init(void)
}
}
+void cpu_clean_all_dirty(void)
+{
+ CPUState *cpu;
+
+ CPU_FOREACH(cpu) {
+ cpu_clean_state(cpu);
+ }
+}
+
static int do_vm_stop(RunState state)
{
int ret = 0;
diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h
index 4f79081..3f162a9 100644
--- a/include/sysemu/cpus.h
+++ b/include/sysemu/cpus.h
@@ -10,6 +10,7 @@ void cpu_stop_current(void);
void cpu_synchronize_all_states(void);
void cpu_synchronize_all_post_reset(void);
void cpu_synchronize_all_post_init(void);
+void cpu_clean_all_dirty(void);
void qtest_clock_warp(int64_t dest);
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 174ea36..777dc66 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -348,6 +348,7 @@ int kvm_physical_memory_addr_from_host(KVMState *s, void *ram_addr,
void kvm_cpu_synchronize_state(CPUState *cpu);
void kvm_cpu_synchronize_post_reset(CPUState *cpu);
void kvm_cpu_synchronize_post_init(CPUState *cpu);
+void kvm_cpu_clean_state(CPUState *cpu);
/* generic hooks - to be moved/refactored once there are more users */
@@ -372,6 +373,13 @@ static inline void cpu_synchronize_post_init(CPUState *cpu)
}
}
+static inline void cpu_clean_state(CPUState *cpu)
+{
+ if (kvm_enabled()) {
+ kvm_cpu_clean_state(cpu);
+ }
+}
+
int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg);
int kvm_irqchip_update_msi_route(KVMState *s, int virq, MSIMessage msg);
void kvm_irqchip_release_virq(KVMState *s, int virq);
diff --git a/kvm-all.c b/kvm-all.c
index 1402f4f..40f6b55 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -1681,6 +1681,11 @@ void kvm_cpu_synchronize_post_init(CPUState *cpu)
cpu->kvm_vcpu_dirty = false;
}
+void kvm_cpu_clean_state(CPUState *cpu)
+{
+ cpu->kvm_vcpu_dirty = false;
+}
+
int kvm_cpu_exec(CPUState *cpu)
{
struct kvm_run *run = cpu->kvm_run;
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 06/88] kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (4 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 05/88] Introduce cpu_clean_all_dirty Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 07/88] kvmclock: Ensure time in migration never goes backward Michael Roth
` (83 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Marcelo Tosatti <mtosatti@redhat.com>
Ensure proper env->tsc value for kvmclock_current_nsec calculation.
Reported-by: Marcin Gibuła <m.gibula@beyond.pl>
Analyzed-by: Marcin Gibuła <m.gibula@beyond.pl>
Cc: qemu-stable@nongnu.org
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 317b0a6d8ba44e9bf8f9c3dbd776c4536843d82c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/i386/kvm/clock.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c
index 07b9c0e..9d65766 100644
--- a/hw/i386/kvm/clock.c
+++ b/hw/i386/kvm/clock.c
@@ -16,6 +16,7 @@
#include "qemu-common.h"
#include "sysemu/sysemu.h"
#include "sysemu/kvm.h"
+#include "sysemu/cpus.h"
#include "hw/sysbus.h"
#include "hw/kvm/clock.h"
@@ -75,6 +76,9 @@ static void kvmclock_vm_state_change(void *opaque, int running,
if (s->clock_valid) {
return;
}
+
+ cpu_synchronize_all_states();
+ cpu_clean_all_dirty();
ret = kvm_vm_ioctl(kvm_state, KVM_GET_CLOCK, &data);
if (ret < 0) {
fprintf(stderr, "KVM_GET_CLOCK failed: %s\n", strerror(ret));
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 07/88] kvmclock: Ensure time in migration never goes backward
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (5 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 06/88] kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 08/88] kvmclock: Add comment explaining why we need cpu_clean_all_dirty() Michael Roth
` (82 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Alexander Graf <agraf@suse.de>
When we migrate we ask the kernel about its current belief on what the guest
time would be. However, I've seen cases where the kvmclock guest structure
indicates a time more recent than the kvm returned time.
To make sure we never go backwards, calculate what the guest would have seen as time at the point of migration and use that value instead of the kernel returned one when it's more recent.
This bases the view of the kvmclock after migration on the
same foundation in host as well as guest.
Signed-off-by: Alexander Graf <agraf@suse.de>
Cc: qemu-stable@nongnu.org
Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 9a48bcd1b82494671c111109b0eefdb882581499)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/i386/kvm/clock.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c
index 9d65766..1ac60d6 100644
--- a/hw/i386/kvm/clock.c
+++ b/hw/i386/kvm/clock.c
@@ -14,6 +14,7 @@
*/
#include "qemu-common.h"
+#include "qemu/host-utils.h"
#include "sysemu/sysemu.h"
#include "sysemu/kvm.h"
#include "sysemu/cpus.h"
@@ -35,6 +36,48 @@ typedef struct KVMClockState {
bool clock_valid;
} KVMClockState;
+struct pvclock_vcpu_time_info {
+ uint32_t version;
+ uint32_t pad0;
+ uint64_t tsc_timestamp;
+ uint64_t system_time;
+ uint32_t tsc_to_system_mul;
+ int8_t tsc_shift;
+ uint8_t flags;
+ uint8_t pad[2];
+} __attribute__((__packed__)); /* 32 bytes */
+
+static uint64_t kvmclock_current_nsec(KVMClockState *s)
+{
+ CPUState *cpu = first_cpu;
+ CPUX86State *env = cpu->env_ptr;
+ hwaddr kvmclock_struct_pa = env->system_time_msr & ~1ULL;
+ uint64_t migration_tsc = env->tsc;
+ struct pvclock_vcpu_time_info time;
+ uint64_t delta;
+ uint64_t nsec_lo;
+ uint64_t nsec_hi;
+ uint64_t nsec;
+
+ if (!(env->system_time_msr & 1ULL)) {
+ /* KVM clock not active */
+ return 0;
+ }
+
+ cpu_physical_memory_read(kvmclock_struct_pa, &time, sizeof(time));
+
+ assert(time.tsc_timestamp <= migration_tsc);
+ delta = migration_tsc - time.tsc_timestamp;
+ if (time.tsc_shift < 0) {
+ delta >>= -time.tsc_shift;
+ } else {
+ delta <<= time.tsc_shift;
+ }
+
+ mulu64(&nsec_lo, &nsec_hi, delta, time.tsc_to_system_mul);
+ nsec = (nsec_lo >> 32) | (nsec_hi << 32);
+ return nsec + time.system_time;
+}
static void kvmclock_vm_state_change(void *opaque, int running,
RunState state)
@@ -46,9 +89,15 @@ static void kvmclock_vm_state_change(void *opaque, int running,
if (running) {
struct kvm_clock_data data;
+ uint64_t time_at_migration = kvmclock_current_nsec(s);
s->clock_valid = false;
+ /* We can't rely on the migrated clock value, just discard it */
+ if (time_at_migration) {
+ s->clock = time_at_migration;
+ }
+
data.clock = s->clock;
data.flags = 0;
ret = kvm_vm_ioctl(kvm_state, KVM_SET_CLOCK, &data);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 08/88] kvmclock: Add comment explaining why we need cpu_clean_all_dirty()
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (6 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 07/88] kvmclock: Ensure time in migration never goes backward Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 09/88] pci: Use bus master address space for delivering MSI/MSI-X messages Michael Roth
` (81 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Eduardo Habkost <ehabkost@redhat.com>
Try to explain why commit 317b0a6d8ba44e9bf8f9c3dbd776c4536843d82c
needed a cpu_clean_all_dirty() call just after calling
cpu_synchronize_all_states().
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Cc: Andrey Korolyov <andrey@xdel.ru>
Cc: Marcin Gibuła <m.gibula@beyond.pl>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 1154d84dcc5f46e83db94281d071775819dd8884)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/i386/kvm/clock.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c
index 1ac60d6..58be2bd 100644
--- a/hw/i386/kvm/clock.c
+++ b/hw/i386/kvm/clock.c
@@ -127,7 +127,21 @@ static void kvmclock_vm_state_change(void *opaque, int running,
}
cpu_synchronize_all_states();
+ /* In theory, the cpu_synchronize_all_states() call above wouldn't
+ * affect the rest of the code, as the VCPU state inside CPUState
+ * is supposed to always match the VCPU state on the kernel side.
+ *
+ * In practice, calling cpu_synchronize_state() too soon will load the
+ * kernel-side APIC state into X86CPU.apic_state too early, APIC state
+ * won't be reloaded later because CPUState.vcpu_dirty==true, and
+ * outdated APIC state may be migrated to another host.
+ *
+ * The real fix would be to make sure outdated APIC state is read
+ * from the kernel again when necessary. While this is not fixed, we
+ * need the cpu_clean_all_dirty() call below.
+ */
cpu_clean_all_dirty();
+
ret = kvm_vm_ioctl(kvm_state, KVM_GET_CLOCK, &data);
if (ret < 0) {
fprintf(stderr, "KVM_GET_CLOCK failed: %s\n", strerror(ret));
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 09/88] pci: Use bus master address space for delivering MSI/MSI-X messages
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (7 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 08/88] kvmclock: Add comment explaining why we need cpu_clean_all_dirty() Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 10/88] virtio-pci: enable bus master for old guests Michael Roth
` (80 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Jan Kiszka <jan.kiszka@siemens.com>
The spec says (and real HW confirms this) that, if the bus master bit
is 0, the device will not generate any PCI accesses. MSI and MSI-X
messages fall among these, so we should use the corresponding address
space to deliver them. This will prevent delivery if bus master support
is disabled.
Cc: qemu-stable@nongnu.org
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit cc943c36faa192cd4b32af8fe5edb31894017d35)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/pci/msi.c | 2 +-
hw/pci/msix.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/pci/msi.c b/hw/pci/msi.c
index a4a3040..52d2313 100644
--- a/hw/pci/msi.c
+++ b/hw/pci/msi.c
@@ -291,7 +291,7 @@ void msi_notify(PCIDevice *dev, unsigned int vector)
"notify vector 0x%x"
" address: 0x%"PRIx64" data: 0x%"PRIx32"\n",
vector, msg.address, msg.data);
- stl_le_phys(&address_space_memory, msg.address, msg.data);
+ stl_le_phys(&dev->bus_master_as, msg.address, msg.data);
}
/* Normally called by pci_default_write_config(). */
diff --git a/hw/pci/msix.c b/hw/pci/msix.c
index 5c49bfc..20ae476 100644
--- a/hw/pci/msix.c
+++ b/hw/pci/msix.c
@@ -439,7 +439,7 @@ void msix_notify(PCIDevice *dev, unsigned vector)
msg = msix_get_message(dev, vector);
- stl_le_phys(&address_space_memory, msg.address, msg.data);
+ stl_le_phys(&dev->bus_master_as, msg.address, msg.data);
}
void msix_reset(PCIDevice *dev)
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 10/88] virtio-pci: enable bus master for old guests
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (8 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 09/88] pci: Use bus master address space for delivering MSI/MSI-X messages Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 11/88] spapr_pci: map the MSI window in each PHB Michael Roth
` (79 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: "Michael S. Tsirkin" <mst@redhat.com>
commit cc943c36faa192cd4b32af8fe5edb31894017d35
pci: Use bus master address space for delivering MSI/MSI-X messages
breaks virtio-net for rhel6.[56] x86 guests because they don't
enable bus mastering for virtio PCI devices. For the same reason,
rhel6.[56] ppc64 guests cannot boot on a virtio-blk disk anymore.
Old guests forgot to enable bus mastering, enable it automatically on
DRIVER (guests use some devices before DRIVER_OK).
Reported-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Tested-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit e43c0b2ea5574efb0bedebf6a7d05916eefeba52)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/virtio/virtio-pci.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 3007319..58ebbcf 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -314,6 +314,16 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
msix_unuse_all_vectors(&proxy->pci_dev);
}
+ /* Linux before 2.6.34 drives the device without enabling
+ the PCI device bus master bit. Enable it automatically
+ for the guest. This is a PCI spec violation but so is
+ initiating DMA with bus master bit clear. */
+ if (val == (VIRTIO_CONFIG_S_ACKNOWLEDGE | VIRTIO_CONFIG_S_DRIVER)) {
+ pci_default_write_config(&proxy->pci_dev, PCI_COMMAND,
+ proxy->pci_dev.config[PCI_COMMAND] |
+ PCI_COMMAND_MASTER, 1);
+ }
+
/* Linux before 2.6.34 sets the device as OK without enabling
the PCI device bus master bit. In this case we need to disable
some safety checks. */
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 11/88] spapr_pci: map the MSI window in each PHB
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (9 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 10/88] virtio-pci: enable bus master for old guests Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 12/88] hw/arm/virt: fix pl011 and pl031 irq flags Michael Roth
` (78 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Greg Kurz <gkurz@linux.vnet.ibm.com>
On sPAPR, virtio devices are connected to the PCI bus and use MSI-X.
Commit cc943c36faa192cd4b32af8fe5edb31894017d35 has modified MSI-X
so that writes are made using the bus master address space and follow
the IOMMU path.
Unfortunately, the IOMMU address space address space does not have an
MSI window: the notification is silently dropped in unassigned_mem_write
instead of reaching the guest... The most visible effect is that all
virtio devices are non-functional on sPAPR since then. :(
This patch does the following:
1) map the MSI window into the IOMMU address space for each PHB
- since each PHB instantiates its own IOMMU address space, we
can safely map the window at a fixed address (SPAPR_PCI_MSI_WINDOW)
- no real need to keep the MSI window setup in a separate function,
the spapr_pci_msi_init() code moves to spapr_phb_realize().
2) kill the global MSI window as it is not needed in the end
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
(cherry picked from commit 8c46f7ec85a4dd9663489b2fa2b425cd7b3653e1)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/ppc/spapr.c | 1 -
hw/ppc/spapr_pci.c | 53 ++++++++++++++++++++-------------------------
include/hw/pci-host/spapr.h | 2 +-
include/hw/ppc/spapr.h | 2 --
4 files changed, 25 insertions(+), 33 deletions(-)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index d01978f..4196a70 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -1377,7 +1377,6 @@ static void ppc_spapr_init(MachineState *machine)
spapr_create_nvram(spapr);
/* Set up PCI */
- spapr_pci_msi_init(spapr, SPAPR_PCI_MSI_WINDOW);
spapr_pci_rtas_init();
phb = spapr_create_phb(spapr, 0);
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 9ed39a9..dadba5f 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -341,7 +341,7 @@ static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPREnvironment *spapr,
}
/* Setup MSI/MSIX vectors in the device (via cfgspace or MSIX BAR) */
- spapr_msi_setmsg(pdev, spapr->msi_win_addr, ret_intr_type == RTAS_TYPE_MSIX,
+ spapr_msi_setmsg(pdev, SPAPR_PCI_MSI_WINDOW, ret_intr_type == RTAS_TYPE_MSIX,
irq, req_num);
/* Add MSI device to cache */
@@ -465,34 +465,6 @@ static const MemoryRegionOps spapr_msi_ops = {
.endianness = DEVICE_LITTLE_ENDIAN
};
-void spapr_pci_msi_init(sPAPREnvironment *spapr, hwaddr addr)
-{
- uint64_t window_size = 4096;
-
- /*
- * As MSI/MSIX interrupts trigger by writing at MSI/MSIX vectors,
- * we need to allocate some memory to catch those writes coming
- * from msi_notify()/msix_notify().
- * As MSIMessage:addr is going to be the same and MSIMessage:data
- * is going to be a VIRQ number, 4 bytes of the MSI MR will only
- * be used.
- *
- * For KVM we want to ensure that this memory is a full page so that
- * our memory slot is of page size granularity.
- */
-#ifdef CONFIG_KVM
- if (kvm_enabled()) {
- window_size = getpagesize();
- }
-#endif
-
- spapr->msi_win_addr = addr;
- memory_region_init_io(&spapr->msiwindow, NULL, &spapr_msi_ops, spapr,
- "msi", window_size);
- memory_region_add_subregion(get_system_memory(), spapr->msi_win_addr,
- &spapr->msiwindow);
-}
-
/*
* PHB PCI device
*/
@@ -512,6 +484,7 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
char *namebuf;
int i;
PCIBus *bus;
+ uint64_t msi_window_size = 4096;
if (sphb->index != -1) {
hwaddr windows_base;
@@ -604,6 +577,28 @@ static void spapr_phb_realize(DeviceState *dev, Error **errp)
address_space_init(&sphb->iommu_as, &sphb->iommu_root,
sphb->dtbusname);
+ /*
+ * As MSI/MSIX interrupts trigger by writing at MSI/MSIX vectors,
+ * we need to allocate some memory to catch those writes coming
+ * from msi_notify()/msix_notify().
+ * As MSIMessage:addr is going to be the same and MSIMessage:data
+ * is going to be a VIRQ number, 4 bytes of the MSI MR will only
+ * be used.
+ *
+ * For KVM we want to ensure that this memory is a full page so that
+ * our memory slot is of page size granularity.
+ */
+#ifdef CONFIG_KVM
+ if (kvm_enabled()) {
+ msi_window_size = getpagesize();
+ }
+#endif
+
+ memory_region_init_io(&sphb->msiwindow, NULL, &spapr_msi_ops, spapr,
+ "msi", msi_window_size);
+ memory_region_add_subregion(&sphb->iommu_root, SPAPR_PCI_MSI_WINDOW,
+ &sphb->msiwindow);
+
pci_setup_iommu(bus, spapr_pci_dma_iommu, sphb);
pci_bus_set_route_irq_fn(bus, spapr_route_intx_pin_to_irq);
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index 32f0aa7..4ea2a0d 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -70,7 +70,7 @@ struct sPAPRPHBState {
MemoryRegion memspace, iospace;
hwaddr mem_win_addr, mem_win_size, io_win_addr, io_win_size;
- MemoryRegion memwindow, iowindow;
+ MemoryRegion memwindow, iowindow, msiwindow;
uint32_t dma_liobn;
AddressSpace iommu_as;
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index bbba51a..832ad6b 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -13,8 +13,6 @@ struct sPAPRNVRAM;
typedef struct sPAPREnvironment {
struct VIOsPAPRBus *vio_bus;
QLIST_HEAD(, sPAPRPHBState) phbs;
- hwaddr msi_win_addr;
- MemoryRegion msiwindow;
struct sPAPRNVRAM *nvram;
XICSState *icp;
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 12/88] hw/arm/virt: fix pl011 and pl031 irq flags
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (10 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 11/88] spapr_pci: map the MSI window in each PHB Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 13/88] gdbstub: init mon_chr through qemu_chr_alloc Michael Roth
` (77 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Peter Maydell <peter.maydell@linaro.org>
The pl011 and pl031 devices both use level triggered interrupts,
but the device tree we construct was incorrectly telling the
kernel to configure the GIC to treat them as edge triggered.
This meant that output from the pl011 would hang after a while.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1410274423-9461-1-git-send-email-peter.maydell@linaro.org
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Cc: qemu-stable@nongnu.org
(cherry picked from commit 0be969a2d974971628fc4ed95834d22ecf0fd497)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/arm/virt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index c8fdac4..bdc1573 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -371,7 +371,7 @@ static void create_uart(const VirtBoardInfo *vbi, qemu_irq *pic)
2, base, 2, size);
qemu_fdt_setprop_cells(vbi->fdt, nodename, "interrupts",
GIC_FDT_IRQ_TYPE_SPI, irq,
- GIC_FDT_IRQ_FLAGS_EDGE_LO_HI);
+ GIC_FDT_IRQ_FLAGS_LEVEL_HI);
qemu_fdt_setprop_cells(vbi->fdt, nodename, "clocks",
vbi->clock_phandle, vbi->clock_phandle);
qemu_fdt_setprop(vbi->fdt, nodename, "clock-names",
@@ -396,7 +396,7 @@ static void create_rtc(const VirtBoardInfo *vbi, qemu_irq *pic)
2, base, 2, size);
qemu_fdt_setprop_cells(vbi->fdt, nodename, "interrupts",
GIC_FDT_IRQ_TYPE_SPI, irq,
- GIC_FDT_IRQ_FLAGS_EDGE_LO_HI);
+ GIC_FDT_IRQ_FLAGS_LEVEL_HI);
qemu_fdt_setprop_cell(vbi->fdt, nodename, "clocks", vbi->clock_phandle);
qemu_fdt_setprop_string(vbi->fdt, nodename, "clock-names", "apb_pclk");
g_free(nodename);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 13/88] gdbstub: init mon_chr through qemu_chr_alloc
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (11 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 12/88] hw/arm/virt: fix pl011 and pl031 irq flags Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 14/88] qapi: add visit_start_union and visit_end_union Michael Roth
` (76 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
This patch initializes monitor for gdbstub with the qemu_chr_alloc function
instead of just allocating the memory. Initialization function call
is required, because it also creates chr_write_lock mutex, which is used
when writing to this character device.
Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 462efe9e530e22b1b60aaf01716e1423cd94302c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
gdbstub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdbstub.c b/gdbstub.c
index 8afe0b7..71aaa23 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1707,7 +1707,7 @@ int gdbserver_start(const char *device)
qemu_add_vm_change_state_handler(gdb_vm_state_change, NULL);
/* Initialize a monitor terminal for gdb */
- mon_chr = g_malloc0(sizeof(*mon_chr));
+ mon_chr = qemu_chr_alloc();
mon_chr->chr_write = gdb_monitor_write;
monitor_init(mon_chr, 0);
} else {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 14/88] qapi: add visit_start_union and visit_end_union
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (12 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 13/88] gdbstub: init mon_chr through qemu_chr_alloc Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 15/88] qapi: dealloc visitor, implement visit_start_union Michael Roth
` (75 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
In some cases an input visitor might bail out on filling out a
struct for various reasons, such as missing fields when running
in strict mode. In the case of a QAPI Union type, this may lead
to cases where the .kind field which encodes the union type
is uninitialized. Subsequently, other visitors, such as the
dealloc visitor, may use this .kind value as if it were
initialized, leading to assumptions about the union type which
in this case may lead to segfaults. For example, freeing an
integer value.
However, we can generally rely on the fact that the always-present
.data void * field that we generate for these union types will
always be NULL in cases where .kind is uninitialized (at least,
there shouldn't be a reason where we'd do this purposefully).
So pass this information on to Visitor implementation via these
optional start_union/end_union interfaces so this information
can be used to guard against the situation above. We will make
use of this information in a subsequent patch for the dealloc
visitor.
Cc: qemu-stable@nongnu.org
Reported-by: Fam Zheng <famz@redhat.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
(cherry picked from commit cee2dedb85b97e4976c83bea84064c3921b8b7ac)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
include/qapi/visitor-impl.h | 2 ++
include/qapi/visitor.h | 2 ++
qapi/qapi-visit-core.c | 15 +++++++++++++++
scripts/qapi-visit.py | 6 ++++++
4 files changed, 25 insertions(+)
diff --git a/include/qapi/visitor-impl.h b/include/qapi/visitor-impl.h
index ecc0183..09bb0fd 100644
--- a/include/qapi/visitor-impl.h
+++ b/include/qapi/visitor-impl.h
@@ -55,6 +55,8 @@ struct Visitor
void (*type_int64)(Visitor *v, int64_t *obj, const char *name, Error **errp);
/* visit_type_size() falls back to (*type_uint64)() if type_size is unset */
void (*type_size)(Visitor *v, uint64_t *obj, const char *name, Error **errp);
+ bool (*start_union)(Visitor *v, bool data_present, Error **errp);
+ void (*end_union)(Visitor *v, bool data_present, Error **errp);
};
void input_type_enum(Visitor *v, int *obj, const char *strings[],
diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h
index 4a0178f..5934f59 100644
--- a/include/qapi/visitor.h
+++ b/include/qapi/visitor.h
@@ -58,5 +58,7 @@ void visit_type_size(Visitor *v, uint64_t *obj, const char *name, Error **errp);
void visit_type_bool(Visitor *v, bool *obj, const char *name, Error **errp);
void visit_type_str(Visitor *v, char **obj, const char *name, Error **errp);
void visit_type_number(Visitor *v, double *obj, const char *name, Error **errp);
+bool visit_start_union(Visitor *v, bool data_present, Error **errp);
+void visit_end_union(Visitor *v, bool data_present, Error **errp);
#endif
diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
index 55f8d40..b66b93a 100644
--- a/qapi/qapi-visit-core.c
+++ b/qapi/qapi-visit-core.c
@@ -58,6 +58,21 @@ void visit_end_list(Visitor *v, Error **errp)
v->end_list(v, errp);
}
+bool visit_start_union(Visitor *v, bool data_present, Error **errp)
+{
+ if (v->start_union) {
+ return v->start_union(v, data_present, errp);
+ }
+ return true;
+}
+
+void visit_end_union(Visitor *v, bool data_present, Error **errp)
+{
+ if (v->end_union) {
+ v->end_union(v, data_present, errp);
+ }
+}
+
void visit_optional(Visitor *v, bool *present, const char *name,
Error **errp)
{
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index c129697..cfce31b 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -357,6 +357,9 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error **e
if (err) {
goto out_obj;
}
+ if (!visit_start_union(m, !!(*obj)->data, &err) || err) {
+ goto out_obj;
+ }
switch ((*obj)->kind) {
''',
disc_type = disc_type,
@@ -385,6 +388,9 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error **e
out_obj:
error_propagate(errp, err);
err = NULL;
+ visit_end_union(m, !!(*obj)->data, &err);
+ error_propagate(errp, err);
+ err = NULL;
}
visit_end_struct(m, &err);
out:
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 15/88] qapi: dealloc visitor, implement visit_start_union
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (13 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 14/88] qapi: add visit_start_union and visit_end_union Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 16/88] tests: add QMP input visitor test for unions with no discriminator Michael Roth
` (74 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
If the .data field of a QAPI Union is NULL, we don't need to free
any of the union fields.
Make use of the new visit_start_union interface to access this
information and instruct the generated code to not visit these
fields when this occurs.
Cc: qemu-stable@nongnu.org
Reported-by: Fam Zheng <famz@redhat.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
(cherry picked from commit 146db9f91979db89a123ea10d2b825d3670d2b36)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
qapi/qapi-dealloc-visitor.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index dc53545..a14a1c7 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -162,6 +162,31 @@ static void qapi_dealloc_type_enum(Visitor *v, int *obj, const char *strings[],
{
}
+/* If there's no data present, the dealloc visitor has nothing to free.
+ * Thus, indicate to visitor code that the subsequent union fields can
+ * be skipped. This is not an error condition, since the cleanup of the
+ * rest of an object can continue unhindered, so leave errp unset in
+ * these cases.
+ *
+ * NOTE: In cases where we're attempting to deallocate an object that
+ * may have missing fields, the field indicating the union type may
+ * be missing. In such a case, it's possible we don't have enough
+ * information to differentiate data_present == false from a case where
+ * data *is* present but happens to be a scalar with a value of 0.
+ * This is okay, since in the case of the dealloc visitor there's no
+ * work that needs to done in either situation.
+ *
+ * The current inability in QAPI code to more thoroughly verify a union
+ * type in such cases will likely need to be addressed if we wish to
+ * implement this interface for other types of visitors in the future,
+ * however.
+ */
+static bool qapi_dealloc_start_union(Visitor *v, bool data_present,
+ Error **errp)
+{
+ return data_present;
+}
+
Visitor *qapi_dealloc_get_visitor(QapiDeallocVisitor *v)
{
return &v->visitor;
@@ -191,6 +216,7 @@ QapiDeallocVisitor *qapi_dealloc_visitor_new(void)
v->visitor.type_str = qapi_dealloc_type_str;
v->visitor.type_number = qapi_dealloc_type_number;
v->visitor.type_size = qapi_dealloc_type_size;
+ v->visitor.start_union = qapi_dealloc_start_union;
QTAILQ_INIT(&v->stack);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 16/88] tests: add QMP input visitor test for unions with no discriminator
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (14 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 15/88] qapi: dealloc visitor, implement visit_start_union Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 17/88] qemu-iotests: Test missing "driver" key for blockdev-add Michael Roth
` (73 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
This is more of an exercise of the dealloc visitor, where it may
erroneously use an uninitialized discriminator field as indication
that union fields corresponding to that discriminator field/type are
present, which can lead to attempts to free random chunks of heap
memory.
Cc: qemu-stable@nongnu.org
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
(cherry picked from commit cb55111b4e425fa3279302fa7306b9a3d5164ff4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
tests/qapi-schema/qapi-schema-test.json | 10 ++++++++++
tests/qapi-schema/qapi-schema-test.out | 3 +++
tests/test-qmp-input-strict.c | 17 +++++++++++++++++
3 files changed, 30 insertions(+)
diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json
index ab4d3d9..d43b5fd 100644
--- a/tests/qapi-schema/qapi-schema-test.json
+++ b/tests/qapi-schema/qapi-schema-test.json
@@ -33,6 +33,9 @@
{ 'type': 'UserDefB',
'data': { 'integer': 'int' } }
+{ 'type': 'UserDefC',
+ 'data': { 'string1': 'str', 'string2': 'str' } }
+
{ 'union': 'UserDefUnion',
'base': 'UserDefZero',
'data': { 'a' : 'UserDefA', 'b' : 'UserDefB' } }
@@ -47,6 +50,13 @@
# FIXME generated struct UserDefFlatUnion has members for direct base
# UserDefOne, but lacks members for indirect base UserDefZero
+# this variant of UserDefFlatUnion defaults to a union that uses fields with
+# allocated types to test corner cases in the cleanup/dealloc visitor
+{ 'union': 'UserDefFlatUnion2',
+ 'base': 'UserDefUnionBase',
+ 'discriminator': 'enum1',
+ 'data': { 'value1' : 'UserDefC', 'value2' : 'UserDefB', 'value3' : 'UserDefA' } }
+
{ 'union': 'UserDefAnonUnion',
'discriminator': {},
'data': { 'uda': 'UserDefA', 's': 'str', 'i': 'int' } }
diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out
index 95e9899..08d7304 100644
--- a/tests/qapi-schema/qapi-schema-test.out
+++ b/tests/qapi-schema/qapi-schema-test.out
@@ -6,9 +6,11 @@
OrderedDict([('type', 'UserDefNested'), ('data', OrderedDict([('string0', 'str'), ('dict1', OrderedDict([('string1', 'str'), ('dict2', OrderedDict([('userdef1', 'UserDefOne'), ('string2', 'str')])), ('*dict3', OrderedDict([('userdef2', 'UserDefOne'), ('string3', 'str')]))]))]))]),
OrderedDict([('type', 'UserDefA'), ('data', OrderedDict([('boolean', 'bool')]))]),
OrderedDict([('type', 'UserDefB'), ('data', OrderedDict([('integer', 'int')]))]),
+ OrderedDict([('type', 'UserDefC'), ('data', OrderedDict([('string1', 'str'), ('string2', 'str')]))]),
OrderedDict([('union', 'UserDefUnion'), ('base', 'UserDefZero'), ('data', OrderedDict([('a', 'UserDefA'), ('b', 'UserDefB')]))]),
OrderedDict([('type', 'UserDefUnionBase'), ('data', OrderedDict([('string', 'str'), ('enum1', 'EnumOne')]))]),
OrderedDict([('union', 'UserDefFlatUnion'), ('base', 'UserDefUnionBase'), ('discriminator', 'enum1'), ('data', OrderedDict([('value1', 'UserDefA'), ('value2', 'UserDefB'), ('value3', 'UserDefB')]))]),
+ OrderedDict([('union', 'UserDefFlatUnion2'), ('base', 'UserDefUnionBase'), ('discriminator', 'enum1'), ('data', OrderedDict([('value1', 'UserDefC'), ('value2', 'UserDefB'), ('value3', 'UserDefA')]))]),
OrderedDict([('union', 'UserDefAnonUnion'), ('discriminator', OrderedDict()), ('data', OrderedDict([('uda', 'UserDefA'), ('s', 'str'), ('i', 'int')]))]),
OrderedDict([('union', 'UserDefNativeListUnion'), ('data', OrderedDict([('integer', ['int']), ('s8', ['int8']), ('s16', ['int16']), ('s32', ['int32']), ('s64', ['int64']), ('u8', ['uint8']), ('u16', ['uint16']), ('u32', ['uint32']), ('u64', ['uint64']), ('number', ['number']), ('boolean', ['bool']), ('string', ['str'])]))]),
OrderedDict([('command', 'user_def_cmd'), ('data', OrderedDict())]),
@@ -32,6 +34,7 @@
OrderedDict([('type', 'UserDefNested'), ('data', OrderedDict([('string0', 'str'), ('dict1', OrderedDict([('string1', 'str'), ('dict2', OrderedDict([('userdef1', 'UserDefOne'), ('string2', 'str')])), ('*dict3', OrderedDict([('userdef2', 'UserDefOne'), ('string3', 'str')]))]))]))]),
OrderedDict([('type', 'UserDefA'), ('data', OrderedDict([('boolean', 'bool')]))]),
OrderedDict([('type', 'UserDefB'), ('data', OrderedDict([('integer', 'int')]))]),
+ OrderedDict([('type', 'UserDefC'), ('data', OrderedDict([('string1', 'str'), ('string2', 'str')]))]),
OrderedDict([('type', 'UserDefUnionBase'), ('data', OrderedDict([('string', 'str'), ('enum1', 'EnumOne')]))]),
OrderedDict([('type', 'UserDefOptions'), ('data', OrderedDict([('*i64', ['int']), ('*u64', ['uint64']), ('*u16', ['uint16']), ('*i64x', 'int'), ('*u64x', 'uint64')]))]),
OrderedDict([('type', 'EventStructOne'), ('data', OrderedDict([('struct1', 'UserDefOne'), ('string', 'str'), ('*enum2', 'EnumOne')]))])]
diff --git a/tests/test-qmp-input-strict.c b/tests/test-qmp-input-strict.c
index 0f77003..d5360c6 100644
--- a/tests/test-qmp-input-strict.c
+++ b/tests/test-qmp-input-strict.c
@@ -260,6 +260,21 @@ static void test_validate_fail_union_flat(TestInputVisitorData *data,
qapi_free_UserDefFlatUnion(tmp);
}
+static void test_validate_fail_union_flat_no_discrim(TestInputVisitorData *data,
+ const void *unused)
+{
+ UserDefFlatUnion2 *tmp = NULL;
+ Error *err = NULL;
+ Visitor *v;
+
+ /* test situation where discriminator field ('enum1' here) is missing */
+ v = validate_test_init(data, "{ 'string': 'c', 'string1': 'd', 'string2': 'e' }");
+
+ visit_type_UserDefFlatUnion2(v, &tmp, NULL, &err);
+ g_assert(err);
+ qapi_free_UserDefFlatUnion2(tmp);
+}
+
static void test_validate_fail_union_anon(TestInputVisitorData *data,
const void *unused)
{
@@ -310,6 +325,8 @@ int main(int argc, char **argv)
&testdata, test_validate_fail_union);
validate_test_add("/visitor/input-strict/fail/union-flat",
&testdata, test_validate_fail_union_flat);
+ validate_test_add("/visitor/input-strict/fail/union-flat-no-discriminator",
+ &testdata, test_validate_fail_union_flat_no_discrim);
validate_test_add("/visitor/input-strict/fail/union-anon",
&testdata, test_validate_fail_union_anon);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 17/88] qemu-iotests: Test missing "driver" key for blockdev-add
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (15 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 16/88] tests: add QMP input visitor test for unions with no discriminator Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 18/88] monitor: Reset HMP mon->rs in CHR_EVENT_OPEN Michael Roth
` (72 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Fam Zheng <famz@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
(cherry picked from commit fe509ee2373078435fb8c4f68eebd2740c4e388f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
tests/qemu-iotests/087 | 17 +++++++++++++++++
tests/qemu-iotests/087.out | 13 +++++++++++++
2 files changed, 30 insertions(+)
diff --git a/tests/qemu-iotests/087 b/tests/qemu-iotests/087
index 82c56b1..d7454d1 100755
--- a/tests/qemu-iotests/087
+++ b/tests/qemu-iotests/087
@@ -218,6 +218,23 @@ run_qemu <<EOF
{ "execute": "quit" }
EOF
+echo
+echo === Missing driver ===
+echo
+
+_make_test_img -o encryption=on $size
+run_qemu -S <<EOF
+{ "execute": "qmp_capabilities" }
+{ "execute": "blockdev-add",
+ "arguments": {
+ "options": {
+ "id": "disk"
+ }
+ }
+ }
+{ "execute": "quit" }
+EOF
+
# success, all done
echo "*** done"
rm -f $seq.full
diff --git a/tests/qemu-iotests/087.out b/tests/qemu-iotests/087.out
index 7fbee3f..f16bad0 100644
--- a/tests/qemu-iotests/087.out
+++ b/tests/qemu-iotests/087.out
@@ -64,4 +64,17 @@ QMP_VERSION
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
+
+=== Missing driver ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 encryption=on
+Testing: -S
+QMP_VERSION
+{"return": {}}
+{"error": {"class": "GenericError", "desc": "Invalid parameter type for 'driver', expected: string"}}
+{"return": {}}
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"}
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
+
*** done
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 18/88] monitor: Reset HMP mon->rs in CHR_EVENT_OPEN
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (16 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 17/88] qemu-iotests: Test missing "driver" key for blockdev-add Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 19/88] virtio-balloon: fix integer overflow in memory stats feature Michael Roth
` (71 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Stratos Psomadakis <psomas@grnet.gr>
Commit cdaa86a54 ("Add G_IO_HUP handler for socket chardev") exposed a bug in
the way the HMP monitor handles its command buffer. When a client closes the
connection to the monitor, tcp_chr_read() will detect the G_IO_HUP condition
and call tcp_chr_disconnect() to close the server-side connection too. Due to
the fact that monitor reads 1 byte at a time (for each tcp_chr_read()), the
monitor readline state / buffers might contain junk (i.e. a half-finished
command). Thus, without calling readline_restart() on mon->rs in
CHR_EVENT_OPEN, future HMP commands will fail.
Signed-off-by: Stratos Psomadakis <psomas@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
(cherry picked from commit e5554e2015f8fb452135f7b1ce1976536266379c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
monitor.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/monitor.c b/monitor.c
index 5bc70a6..1ae32c0 100644
--- a/monitor.c
+++ b/monitor.c
@@ -5243,6 +5243,7 @@ static void monitor_event(void *opaque, int event)
monitor_printf(mon, "QEMU %s monitor - type 'help' for more "
"information\n", QEMU_VERSION);
if (!mon->mux_out) {
+ readline_restart(mon->rs);
readline_show_prompt(mon->rs);
}
mon->reset_seen = 1;
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 19/88] virtio-balloon: fix integer overflow in memory stats feature
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (17 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 18/88] monitor: Reset HMP mon->rs in CHR_EVENT_OPEN Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 20/88] vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation Michael Roth
` (70 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Luiz Capitulino <lcapitulino@redhat.com>
When a QMP client changes the polling interval time by setting
the guest-stats-polling-interval property, the interval value
is stored and manipulated as an int64_t variable.
However, the balloon_stats_change_timer() function, which is
used to set the actual timer with the interval value, takes
an int instead, causing an overflow for big interval values.
This commit fix this bug by changing balloon_stats_change_timer()
to take an int64_t and also it limits the polling interval value
to UINT_MAX to avoid other kinds of overflow.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
(cherry picked from commit 1f9296b51a26650916a2c4191268bb64057bdc5f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/virtio/virtio-balloon.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 2c30b3d..b5cf7ca 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -87,7 +87,7 @@ static void balloon_stats_destroy_timer(VirtIOBalloon *s)
}
}
-static void balloon_stats_change_timer(VirtIOBalloon *s, int secs)
+static void balloon_stats_change_timer(VirtIOBalloon *s, int64_t secs)
{
timer_mod(s->stats_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + secs * 1000);
}
@@ -170,6 +170,11 @@ static void balloon_stats_set_poll_interval(Object *obj, struct Visitor *v,
return;
}
+ if (value > UINT_MAX) {
+ error_setg(errp, "timer value is too big");
+ return;
+ }
+
if (value == s->stats_poll_interval) {
return;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 20/88] vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (18 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 19/88] virtio-balloon: fix integer overflow in memory stats feature Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 21/88] ivshmem: Check ivshmem_read() size argument Michael Roth
` (69 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Damjan Marion <damarion@cisco.com>
Header length check should happen only if backend is kernel. For user
backend there is no reason to reset this bit.
vhost-user code does not define .has_vnet_hdr_len so
VIRTIO_NET_F_MRG_RXBUF cannot be negotiated even if both sides
support it.
Signed-off-by: Damjan Marion <damarion@cisco.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit d8e80ae37a7acfea416ad9abbe76b453a73d9cc0)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/net/vhost_net.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index b37438b..7e3386d 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -163,11 +163,11 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options)
if (r < 0) {
goto fail;
}
- if (!qemu_has_vnet_hdr_len(options->net_backend,
- sizeof(struct virtio_net_hdr_mrg_rxbuf))) {
- net->dev.features &= ~(1 << VIRTIO_NET_F_MRG_RXBUF);
- }
if (backend_kernel) {
+ if (!qemu_has_vnet_hdr_len(options->net_backend,
+ sizeof(struct virtio_net_hdr_mrg_rxbuf))) {
+ net->dev.features &= ~(1 << VIRTIO_NET_F_MRG_RXBUF);
+ }
if (~net->dev.features & net->dev.backend_features) {
fprintf(stderr, "vhost lacks feature mask %" PRIu64
" for backend\n",
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 21/88] ivshmem: Check ivshmem_read() size argument
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (19 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 20/88] vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 22/88] ivshmem: validate incoming_posn value from server Michael Roth
` (68 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Stefan Hajnoczi <stefanha@redhat.com>
The third argument to the fd_read() callback implemented by
ivshmem_read() is the number of bytes, not a flags field. Fix this and
check we received enough bytes before accessing the buffer pointer.
Cc: Cam Macdonell <cam@cs.ualberta.ca>
Reported-by: Sebastian Krahmer <krahmer@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
[AF: Handle partial reads via FIFO]
Reported-by: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit a2e9011b4164894594bf0b2a2a59e9c55c58c17b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/misc/ivshmem.c | 30 ++++++++++++++++++++++++++++--
1 file changed, 28 insertions(+), 2 deletions(-)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 768e528..2a05961 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -24,6 +24,7 @@
#include "migration/migration.h"
#include "qapi/qmp/qerror.h"
#include "qemu/event_notifier.h"
+#include "qemu/fifo8.h"
#include "sysemu/char.h"
#include <sys/mman.h>
@@ -73,6 +74,7 @@ typedef struct IVShmemState {
CharDriverState **eventfd_chr;
CharDriverState *server_chr;
+ Fifo8 incoming_fifo;
MemoryRegion ivshmem_mmio;
/* We might need to register the BAR before we actually have the memory.
@@ -420,14 +422,35 @@ static void increase_dynamic_storage(IVShmemState *s, int new_min_size) {
}
}
-static void ivshmem_read(void *opaque, const uint8_t * buf, int flags)
+static void ivshmem_read(void *opaque, const uint8_t *buf, int size)
{
IVShmemState *s = opaque;
int incoming_fd, tmp_fd;
int guest_max_eventfd;
long incoming_posn;
- memcpy(&incoming_posn, buf, sizeof(long));
+ if (fifo8_is_empty(&s->incoming_fifo) && size == sizeof(incoming_posn)) {
+ memcpy(&incoming_posn, buf, size);
+ } else {
+ const uint8_t *p;
+ uint32_t num;
+
+ IVSHMEM_DPRINTF("short read of %d bytes\n", size);
+ num = MAX(size, sizeof(long) - fifo8_num_used(&s->incoming_fifo));
+ fifo8_push_all(&s->incoming_fifo, buf, num);
+ if (fifo8_num_used(&s->incoming_fifo) < sizeof(incoming_posn)) {
+ return;
+ }
+ size -= num;
+ buf += num;
+ p = fifo8_pop_buf(&s->incoming_fifo, sizeof(incoming_posn), &num);
+ g_assert(num == sizeof(incoming_posn));
+ memcpy(&incoming_posn, p, sizeof(incoming_posn));
+ if (size > 0) {
+ fifo8_push_all(&s->incoming_fifo, buf, size);
+ }
+ }
+
/* pick off s->server_chr->msgfd and store it, posn should accompany msg */
tmp_fd = qemu_chr_fe_get_msgfd(s->server_chr);
IVSHMEM_DPRINTF("posn is %ld, fd is %d\n", incoming_posn, tmp_fd);
@@ -659,6 +682,8 @@ static int pci_ivshmem_init(PCIDevice *dev)
s->ivshmem_size = ivshmem_get_size(s);
}
+ fifo8_create(&s->incoming_fifo, sizeof(long));
+
register_savevm(DEVICE(dev), "ivshmem", 0, 0, ivshmem_save, ivshmem_load,
dev);
@@ -795,6 +820,7 @@ static void pci_ivshmem_uninit(PCIDevice *dev)
memory_region_destroy(&s->ivshmem);
memory_region_destroy(&s->bar);
unregister_savevm(DEVICE(dev), "ivshmem", s);
+ fifo8_destroy(&s->incoming_fifo);
}
static Property ivshmem_properties[] = {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 22/88] ivshmem: validate incoming_posn value from server
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (20 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 21/88] ivshmem: Check ivshmem_read() size argument Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 23/88] ivshmem: Fix potential OOB r/w access Michael Roth
` (67 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Stefan Hajnoczi <stefanha@redhat.com>
Check incoming_posn to avoid out-of-bounds array accesses if the ivshmem
server on the host sends invalid values.
Cc: Cam Macdonell <cam@cs.ualberta.ca>
Reported-by: Sebastian Krahmer <krahmer@suse.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
[AF: Tighten upper bound check for posn in close_guest_eventfds()]
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 363ba1c72fed4425e7917afc36722584aaeaad8a)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/misc/ivshmem.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 2a05961..02e3dd9 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -385,6 +385,9 @@ static void close_guest_eventfds(IVShmemState *s, int posn)
if (!ivshmem_has_feature(s, IVSHMEM_IOEVENTFD)) {
return;
}
+ if (posn < 0 || posn >= s->nb_peers) {
+ return;
+ }
guest_curr_max = s->peers[posn].nb_eventfds;
@@ -451,6 +454,11 @@ static void ivshmem_read(void *opaque, const uint8_t *buf, int size)
}
}
+ if (incoming_posn < -1) {
+ IVSHMEM_DPRINTF("invalid incoming_posn %ld\n", incoming_posn);
+ return;
+ }
+
/* pick off s->server_chr->msgfd and store it, posn should accompany msg */
tmp_fd = qemu_chr_fe_get_msgfd(s->server_chr);
IVSHMEM_DPRINTF("posn is %ld, fd is %d\n", incoming_posn, tmp_fd);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 23/88] ivshmem: Fix potential OOB r/w access
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (21 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 22/88] ivshmem: validate incoming_posn value from server Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 24/88] ivshmem: Fix fd leak on error Michael Roth
` (66 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Sebastian Krahmer <krahmer@suse.de>
Fix OOB access via malformed incoming_posn parameters
and check that requested memory is actually alloc'ed.
Signed-off-by: Sebastian Krahmer <krahmer@suse.de>
[AF: Rebased, cleanups, avoid fd leak]
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 34bc07c5282a631c2663ae1ded0a186f46f64612)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/misc/ivshmem.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 02e3dd9..c3dc5c3 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -29,6 +29,7 @@
#include <sys/mman.h>
#include <sys/types.h>
+#include <limits.h>
#define PCI_VENDOR_ID_IVSHMEM PCI_VENDOR_ID_REDHAT_QUMRANET
#define PCI_DEVICE_ID_IVSHMEM 0x1110
@@ -406,14 +407,24 @@ static void close_guest_eventfds(IVShmemState *s, int posn)
/* this function increase the dynamic storage need to store data about other
* guests */
-static void increase_dynamic_storage(IVShmemState *s, int new_min_size) {
+static int increase_dynamic_storage(IVShmemState *s, int new_min_size)
+{
int j, old_nb_alloc;
+ /* check for integer overflow */
+ if (new_min_size >= INT_MAX / sizeof(Peer) - 1 || new_min_size <= 0) {
+ return -1;
+ }
+
old_nb_alloc = s->nb_peers;
- while (new_min_size >= s->nb_peers)
- s->nb_peers = s->nb_peers * 2;
+ if (new_min_size >= s->nb_peers) {
+ /* +1 because #new_min_size is used as last array index */
+ s->nb_peers = new_min_size + 1;
+ } else {
+ return 0;
+ }
IVSHMEM_DPRINTF("bumping storage to %d guests\n", s->nb_peers);
s->peers = g_realloc(s->peers, s->nb_peers * sizeof(Peer));
@@ -423,6 +434,8 @@ static void increase_dynamic_storage(IVShmemState *s, int new_min_size) {
s->peers[j].eventfds = NULL;
s->peers[j].nb_eventfds = 0;
}
+
+ return 0;
}
static void ivshmem_read(void *opaque, const uint8_t *buf, int size)
@@ -465,7 +478,13 @@ static void ivshmem_read(void *opaque, const uint8_t *buf, int size)
/* make sure we have enough space for this guest */
if (incoming_posn >= s->nb_peers) {
- increase_dynamic_storage(s, incoming_posn);
+ if (increase_dynamic_storage(s, incoming_posn) < 0) {
+ error_report("increase_dynamic_storage() failed");
+ if (tmp_fd != -1) {
+ close(tmp_fd);
+ }
+ return;
+ }
}
if (tmp_fd == -1) {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 24/88] ivshmem: Fix fd leak on error
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (22 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 23/88] ivshmem: Fix potential OOB r/w access Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 25/88] pc-dimm: Don't check dimm->node when there is non-NUMA config Michael Roth
` (65 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Andreas Färber <afaerber@suse.de>
Reported-by: Stefan Hajnoczi <stefanha@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 3a31cff11203bf62ebafa6d74b1fcf2aba345eed)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/misc/ivshmem.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index c3dc5c3..7252f64 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -508,6 +508,7 @@ static void ivshmem_read(void *opaque, const uint8_t *buf, int size)
if (incoming_fd == -1) {
fprintf(stderr, "could not allocate file descriptor %s\n",
strerror(errno));
+ close(tmp_fd);
return;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 25/88] pc-dimm: Don't check dimm->node when there is non-NUMA config
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (23 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 24/88] ivshmem: Fix fd leak on error Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 26/88] tests: avoid running duplicate qom-tests Michael Roth
` (64 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: zhanghailiang <zhang.zhanghailiang@huawei.com>
It should not break memory hotplug feature if there is non-NUMA option.
This patch would also allow to use pc-dimm as replacement for initial memory
for non-NUMA configs.
Note: After this patch, the memory hotplug can work normally for Linux guest OS
when there is non-NUMA option and NUMA option. But not support Windows guest OS
to hotplug memory with no-NUMA config, actully, it's Windows limitation.
Reviewed-By: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit fc50ff0666315be5120c70ad00cd0b0097484b84)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/mem/pc-dimm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 5bfc5b7..a800ea7 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -252,7 +252,7 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)
error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property is not set");
return;
}
- if (dimm->node >= nb_numa_nodes) {
+ if ((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) {
error_setg(errp, "'DIMM property " PC_DIMM_NODE_PROP " has value %"
PRIu32 "' which exceeds the number of numa nodes: %d",
dimm->node, nb_numa_nodes);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 26/88] tests: avoid running duplicate qom-tests
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (24 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 25/88] pc-dimm: Don't check dimm->node when there is non-NUMA config Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 27/88] snapshot: fix referencing wrong variable in while loop in do_delvm Michael Roth
` (63 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
Since 3687d532 we've been unconditionally adding qom-test to our qtests
for every arch. However, some archs inherit their tests from Makefile
variables for other archs, such as i386/x86_64,
microblaze/microblazeel, and xtensa/xtensaeb. Since these are evaluated
in a lazy manner, we ultimately end up adding qom-test twice.
In the case x86_64, where we have a large number of machine types that
we rerun qom-test for, this has lead to a fairly noticeable increase
in the overall run-time of `make check` (78s vs. 42s on my machine).
Similar speed-ups are visible for other such archs, but not nearly as
significant.
Fix this by only adding qom-test to an arch's test list if it's not
already present.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Cc: qemu-stable@nongnu.org
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 2b8419cb4911731db6c883fa7b0428ad4a355d9d)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
tests/Makefile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tests/Makefile b/tests/Makefile
index 4b2e1bb..2ea54fc 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -187,7 +187,8 @@ check-qtest-xtensaeb-y = $(check-qtest-xtensa-y)
# qom-test works for all sysemu architectures:
$(foreach target,$(SYSEMU_TARGET_LIST), \
- $(eval check-qtest-$(target)-y += tests/qom-test$(EXESUF)))
+ $(if $(findstring tests/qom-test$(EXESUF), $(check-qtest-$(target)-y)),, \
+ $(eval check-qtest-$(target)-y += tests/qom-test$(EXESUF))))
check-qapi-schema-y := $(addprefix tests/qapi-schema/, \
comments.json empty.json funny-char.json indented-expr.json \
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 27/88] snapshot: fix referencing wrong variable in while loop in do_delvm
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (25 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 26/88] tests: avoid running duplicate qom-tests Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 28/88] smbios: Fix assertion on socket count calculation Michael Roth
` (62 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Zhang Haoyu <zhanghy@sangfor.com>
The while loop variabal is "bs1",
but "bs" is always passed to bdrv_snapshot_delete_by_id_or_name.
Broken in commit a89d89d, v1.7.0.
Signed-off-by: Zhang Haoyu <zhanghy@sangfor.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit af957387547b05ed6dc4d84c10cca42700a7aeda)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
savevm.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/savevm.c b/savevm.c
index e19ae0a..2d8eb96 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1245,19 +1245,18 @@ int load_vmstate(const char *name)
void do_delvm(Monitor *mon, const QDict *qdict)
{
- BlockDriverState *bs, *bs1;
+ BlockDriverState *bs;
Error *err = NULL;
const char *name = qdict_get_str(qdict, "name");
- bs = find_vmstate_bs();
- if (!bs) {
+ if (!find_vmstate_bs()) {
monitor_printf(mon, "No block device supports snapshots\n");
return;
}
- bs1 = NULL;
- while ((bs1 = bdrv_next(bs1))) {
- if (bdrv_can_snapshot(bs1)) {
+ bs = NULL;
+ while ((bs = bdrv_next(bs))) {
+ if (bdrv_can_snapshot(bs)) {
bdrv_snapshot_delete_by_id_or_name(bs, name, &err);
if (err) {
monitor_printf(mon,
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 28/88] smbios: Fix assertion on socket count calculation
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (26 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 27/88] snapshot: fix referencing wrong variable in while loop in do_delvm Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 29/88] vhost-scsi: use virtio_ldl_p Michael Roth
` (61 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Eduardo Habkost <ehabkost@redhat.com>
QEMU currently allows the number of VCPUs to not be a multiple of the
number of threads per socket, but the smbios socket count calculation
introduced by commit c97294ec1b9e36887e119589d456557d72ab37b5 doesn't
take that into account, triggering an assertion. e.g.:
$ ./x86_64-softmmu/qemu-system-x86_64 -smp 4,sockets=2,cores=6,threads=1
qemu-system-x86_64: /home/ehabkost/rh/proj/virt/qemu/hw/i386/smbios.c:825: smbios_get_tables: Assertion `smbios_smp_sockets >= 1' failed.
Aborted (core dumped)
Socket count calculation doesn't belong to smbios.c and should
eventually be moved to the main SMP topology configuration code. But
while we don't move the code, at least make it correct by rounding up
the division.
Cc: Gabriel Somlo <somlo@cmu.edu>
Cc: qemu-stable@nongnu.org
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-By: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 7dfddd7f884b6dd2abf230d8fa6c7c83aab4f5ec)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/i386/smbios.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/smbios.c b/hw/i386/smbios.c
index e3fa1b2..0ae5960 100644
--- a/hw/i386/smbios.c
+++ b/hw/i386/smbios.c
@@ -821,7 +821,7 @@ void smbios_get_tables(uint8_t **tables, size_t *tables_len,
smbios_build_type_2_table();
smbios_build_type_3_table();
- smbios_smp_sockets = smp_cpus / (smp_cores * smp_threads);
+ smbios_smp_sockets = DIV_ROUND_UP(smp_cpus, smp_cores * smp_threads);
assert(smbios_smp_sockets >= 1);
for (i = 0; i < smbios_smp_sockets; i++) {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 29/88] vhost-scsi: use virtio_ldl_p
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (27 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 28/88] smbios: Fix assertion on socket count calculation Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 30/88] virtio-net: use aliases instead of duplicate qdev properties Michael Roth
` (60 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Paolo Bonzini <pbonzini@redhat.com>
This helps for cross-endian configurations.
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 7ce0425575745a40e94e75426607e0bec17899fa)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/scsi/vhost-scsi.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
index 7146e0e..308b393 100644
--- a/hw/scsi/vhost-scsi.c
+++ b/hw/scsi/vhost-scsi.c
@@ -23,6 +23,7 @@
#include "hw/virtio/vhost.h"
#include "hw/virtio/virtio-scsi.h"
#include "hw/virtio/virtio-bus.h"
+#include "hw/virtio/virtio-access.h"
/* Features supported by host kernel. */
static const int kernel_feature_bits[] = {
@@ -163,8 +164,8 @@ static void vhost_scsi_set_config(VirtIODevice *vdev,
VirtIOSCSIConfig *scsiconf = (VirtIOSCSIConfig *)config;
VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(vdev);
- if ((uint32_t) ldl_p(&scsiconf->sense_size) != vs->sense_size ||
- (uint32_t) ldl_p(&scsiconf->cdb_size) != vs->cdb_size) {
+ if ((uint32_t) virtio_ldl_p(vdev, &scsiconf->sense_size) != vs->sense_size ||
+ (uint32_t) virtio_ldl_p(vdev, &scsiconf->cdb_size) != vs->cdb_size) {
error_report("vhost-scsi does not support changing the sense data and CDB sizes");
exit(1);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 30/88] virtio-net: use aliases instead of duplicate qdev properties
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (28 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 29/88] vhost-scsi: use virtio_ldl_p Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 31/88] virtio-net: fix virtio-net child refcount in transports Michael Roth
` (59 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
virtio-net-pci, virtio-net-s390, and virtio-net-ccw all duplicate the
qdev properties of their VirtIONet child. This approach does not work
well with string or pointer properties since we must be careful about
leaking or double-freeing them.
Use the QOM alias property to forward property accesses to the
VirtIONet child. This way no duplication is necessary.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 7779edfeb1822ff5f554a4c1f3e9798789a9352c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/s390x/s390-virtio-bus.c | 3 +--
hw/s390x/virtio-ccw.c | 3 +--
hw/virtio/virtio-pci.c | 3 +--
3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 6b6fb61..5b5d595 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -161,6 +161,7 @@ static void s390_virtio_net_instance_init(Object *obj)
VirtIONetS390 *dev = VIRTIO_NET_S390(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_NET);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
static int s390_virtio_blk_init(VirtIOS390Device *s390_dev)
@@ -493,10 +494,8 @@ static unsigned virtio_s390_get_features(DeviceState *d)
/**************** S390 Virtio Bus Device Descriptions *******************/
static Property s390_virtio_net_properties[] = {
- DEFINE_NIC_PROPERTIES(VirtIONetS390, vdev.nic_conf),
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
DEFINE_VIRTIO_NET_FEATURES(VirtIOS390Device, host_features),
- DEFINE_VIRTIO_NET_PROPERTIES(VirtIONetS390, vdev.net_conf),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 33a1d86..7d67577 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -794,6 +794,7 @@ static void virtio_ccw_net_instance_init(Object *obj)
VirtIONetCcw *dev = VIRTIO_NET_CCW(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_NET);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
static int virtio_ccw_blk_init(VirtioCcwDevice *ccw_dev)
@@ -1374,8 +1375,6 @@ static int virtio_ccw_load_config(DeviceState *d, QEMUFile *f)
static Property virtio_ccw_net_properties[] = {
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
DEFINE_VIRTIO_NET_FEATURES(VirtioCcwDevice, host_features[0]),
- DEFINE_VIRTIO_NET_PROPERTIES(VirtIONetCcw, vdev.net_conf),
- DEFINE_NIC_PROPERTIES(VirtIONetCcw, vdev.nic_conf),
DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
DEFINE_PROP_END_OF_LIST(),
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 58ebbcf..2452db9 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1427,8 +1427,6 @@ static Property virtio_net_properties[] = {
VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false),
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 3),
DEFINE_VIRTIO_NET_FEATURES(VirtIOPCIProxy, host_features),
- DEFINE_NIC_PROPERTIES(VirtIONetPCI, vdev.nic_conf),
- DEFINE_VIRTIO_NET_PROPERTIES(VirtIONetPCI, vdev.net_conf),
DEFINE_PROP_END_OF_LIST(),
};
@@ -1469,6 +1467,7 @@ static void virtio_net_pci_instance_init(Object *obj)
VirtIONetPCI *dev = VIRTIO_NET_PCI(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_NET);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
static const TypeInfo virtio_net_pci_info = {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 31/88] virtio-net: fix virtio-net child refcount in transports
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (29 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 30/88] virtio-net: use aliases instead of duplicate qdev properties Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 32/88] virtio/vhost-scsi: use aliases instead of duplicate qdev properties Michael Roth
` (58 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is dropped
again when the property is deleted.
The upshot of this is that we always have a refcount >= 1. Upon hot
unplug the virtio-net child is not finalized!
Drop our reference after the child property has been added to the
parent.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 6a0c6b59788627541faf70864464f1e155dc18d7)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/s390x/s390-virtio-bus.c | 1 +
hw/s390x/virtio-ccw.c | 1 +
hw/virtio/virtio-pci.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 5b5d595..297eac2 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -161,6 +161,7 @@ static void s390_virtio_net_instance_init(Object *obj)
VirtIONetS390 *dev = VIRTIO_NET_S390(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_NET);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ object_unref(OBJECT(&dev->vdev));
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 7d67577..bb699f2 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -794,6 +794,7 @@ static void virtio_ccw_net_instance_init(Object *obj)
VirtIONetCcw *dev = VIRTIO_NET_CCW(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_NET);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ object_unref(OBJECT(&dev->vdev));
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 2452db9..eb1d138 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1467,6 +1467,7 @@ static void virtio_net_pci_instance_init(Object *obj)
VirtIONetPCI *dev = VIRTIO_NET_PCI(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_NET);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ object_unref(OBJECT(&dev->vdev));
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 32/88] virtio/vhost-scsi: use aliases instead of duplicate qdev properties
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (30 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 31/88] virtio-net: fix virtio-net child refcount in transports Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 33/88] virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports Michael Roth
` (57 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
{virtio, vhost}-scsi-{pci, s390, ccw} all duplicate the
qdev properties of their VirtIOSCSI/VHostSCSI child.
This approach does not work well with string or pointer
properties since we must be careful about leaking or
double-freeing them.
Use the QOM alias property to forward property accesses to the
VirtIOSCSI/VHostSCSI child. This way no duplication is necessary.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit c39343fd811a22c921fc08e9e6ca62c8e7539264)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/s390x/s390-virtio-bus.c | 4 ++--
hw/s390x/virtio-ccw.c | 4 ++--
hw/virtio/virtio-pci.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 297eac2..eaaa275 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -258,6 +258,7 @@ static void s390_virtio_scsi_instance_init(Object *obj)
VirtIOSCSIS390 *dev = VIRTIO_SCSI_S390(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
#ifdef CONFIG_VHOST_SCSI
@@ -279,6 +280,7 @@ static void s390_vhost_scsi_instance_init(Object *obj)
VHostSCSIS390 *dev = VHOST_SCSI_S390(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VHOST_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
#endif
@@ -614,7 +616,6 @@ static const TypeInfo virtio_s390_device_info = {
};
static Property s390_virtio_scsi_properties[] = {
- DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOSCSIS390, vdev.parent_obj.conf),
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
DEFINE_VIRTIO_SCSI_FEATURES(VirtIOS390Device, host_features),
DEFINE_PROP_END_OF_LIST(),
@@ -640,7 +641,6 @@ static const TypeInfo s390_virtio_scsi = {
#ifdef CONFIG_VHOST_SCSI
static Property s390_vhost_scsi_properties[] = {
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
- DEFINE_VHOST_SCSI_PROPERTIES(VHostSCSIS390, vdev.parent_obj.conf),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index bb699f2..458aabc 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -938,6 +938,7 @@ static void virtio_ccw_scsi_instance_init(Object *obj)
VirtIOSCSICcw *dev = VIRTIO_SCSI_CCW(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
#ifdef CONFIG_VHOST_SCSI
@@ -959,6 +960,7 @@ static void vhost_ccw_scsi_instance_init(Object *obj)
VHostSCSICcw *dev = VHOST_SCSI_CCW(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VHOST_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
#endif
@@ -1481,7 +1483,6 @@ static const TypeInfo virtio_ccw_balloon = {
static Property virtio_ccw_scsi_properties[] = {
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
- DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOSCSICcw, vdev.parent_obj.conf),
DEFINE_VIRTIO_SCSI_FEATURES(VirtioCcwDevice, host_features[0]),
DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
@@ -1510,7 +1511,6 @@ static const TypeInfo virtio_ccw_scsi = {
#ifdef CONFIG_VHOST_SCSI
static Property vhost_ccw_scsi_properties[] = {
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
- DEFINE_VHOST_SCSI_PROPERTIES(VirtIOSCSICcw, vdev.parent_obj.conf),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index eb1d138..a3086a9 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1137,7 +1137,6 @@ static Property virtio_scsi_pci_properties[] = {
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
DEV_NVECTORS_UNSPECIFIED),
DEFINE_VIRTIO_SCSI_FEATURES(VirtIOPCIProxy, host_features),
- DEFINE_VIRTIO_SCSI_PROPERTIES(VirtIOSCSIPCI, vdev.parent_obj.conf),
DEFINE_PROP_END_OF_LIST(),
};
@@ -1189,6 +1188,7 @@ static void virtio_scsi_pci_instance_init(Object *obj)
VirtIOSCSIPCI *dev = VIRTIO_SCSI_PCI(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
static const TypeInfo virtio_scsi_pci_info = {
@@ -1205,7 +1205,6 @@ static const TypeInfo virtio_scsi_pci_info = {
static Property vhost_scsi_pci_properties[] = {
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
DEV_NVECTORS_UNSPECIFIED),
- DEFINE_VHOST_SCSI_PROPERTIES(VHostSCSIPCI, vdev.parent_obj.conf),
DEFINE_PROP_END_OF_LIST(),
};
@@ -1245,6 +1244,7 @@ static void vhost_scsi_pci_instance_init(Object *obj)
VHostSCSIPCI *dev = VHOST_SCSI_PCI(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VHOST_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
static const TypeInfo vhost_scsi_pci_info = {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 33/88] virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (31 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 32/88] virtio/vhost-scsi: use aliases instead of duplicate qdev properties Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 34/88] virtio-serial: use aliases instead of duplicate qdev properties Michael Roth
` (56 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is dropped
again when the property is deleted.
The upshot of this is that we always have a refcount >= 1. Upon hot
unplug the virtio-scsi/vhost-scsi child is not finalized!
Drop our reference after the child property has been added to the
parent.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 1312f12bcc8911ed99b67227fb9d1607295f71ed)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/s390x/s390-virtio-bus.c | 2 ++
hw/s390x/virtio-ccw.c | 2 ++
hw/virtio/virtio-pci.c | 2 ++
3 files changed, 6 insertions(+)
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index eaaa275..4276034 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -258,6 +258,7 @@ static void s390_virtio_scsi_instance_init(Object *obj)
VirtIOSCSIS390 *dev = VIRTIO_SCSI_S390(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ object_unref(OBJECT(&dev->vdev));
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
@@ -280,6 +281,7 @@ static void s390_vhost_scsi_instance_init(Object *obj)
VHostSCSIS390 *dev = VHOST_SCSI_S390(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VHOST_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ object_unref(OBJECT(&dev->vdev));
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
#endif
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 458aabc..a466674 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -938,6 +938,7 @@ static void virtio_ccw_scsi_instance_init(Object *obj)
VirtIOSCSICcw *dev = VIRTIO_SCSI_CCW(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ object_unref(OBJECT(&dev->vdev));
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
@@ -960,6 +961,7 @@ static void vhost_ccw_scsi_instance_init(Object *obj)
VHostSCSICcw *dev = VHOST_SCSI_CCW(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VHOST_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ object_unref(OBJECT(&dev->vdev));
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
#endif
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index a3086a9..b632326 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1188,6 +1188,7 @@ static void virtio_scsi_pci_instance_init(Object *obj)
VirtIOSCSIPCI *dev = VIRTIO_SCSI_PCI(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ object_unref(OBJECT(&dev->vdev));
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
@@ -1244,6 +1245,7 @@ static void vhost_scsi_pci_instance_init(Object *obj)
VHostSCSIPCI *dev = VHOST_SCSI_PCI(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VHOST_SCSI);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ object_unref(OBJECT(&dev->vdev));
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 34/88] virtio-serial: use aliases instead of duplicate qdev properties
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (32 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 33/88] virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-05-11 15:21 ` Peter Maydell
2015-01-08 17:33 ` [Qemu-devel] [PATCH 35/88] virtio-serial: fix virtio-serial child refcount in transports Michael Roth
` (55 subsequent siblings)
89 siblings, 1 reply; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
virtio-serial-{pci, s390, ccw} all duplicate the
qdev properties of their VirtIOSerial child.
This approach does not work well with string or pointer
properties since we must be careful about leaking or
double-freeing them.
Use the QOM alias property to forward property accesses to the
VirtIOSerial child. This way no duplication is necessary.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 4f456d8025c7259c66b2b2bcec99d5c6c94d99be)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/s390x/s390-virtio-bus.c | 2 +-
hw/s390x/virtio-ccw.c | 2 +-
hw/virtio/virtio-pci.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 4276034..31f5286 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -226,6 +226,7 @@ static void s390_virtio_serial_instance_init(Object *obj)
VirtIOSerialS390 *dev = VIRTIO_SERIAL_S390(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SERIAL);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
static int s390_virtio_scsi_init(VirtIOS390Device *s390_dev)
@@ -537,7 +538,6 @@ static const TypeInfo s390_virtio_blk = {
};
static Property s390_virtio_serial_properties[] = {
- DEFINE_VIRTIO_SERIAL_PROPERTIES(VirtIOSerialS390, vdev.serial),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index a466674..271104d 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -852,6 +852,7 @@ static void virtio_ccw_serial_instance_init(Object *obj)
VirtioSerialCcw *dev = VIRTIO_SERIAL_CCW(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SERIAL);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
static int virtio_ccw_balloon_init(VirtioCcwDevice *ccw_dev)
@@ -1432,7 +1433,6 @@ static const TypeInfo virtio_ccw_blk = {
static Property virtio_ccw_serial_properties[] = {
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
- DEFINE_VIRTIO_SERIAL_PROPERTIES(VirtioSerialCcw, vdev.serial),
DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
DEFINE_PROP_END_OF_LIST(),
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index b632326..db085d5 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1389,7 +1389,6 @@ static Property virtio_serial_pci_properties[] = {
VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true),
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
DEFINE_PROP_UINT32("class", VirtIOPCIProxy, class_code, 0),
- DEFINE_VIRTIO_SERIAL_PROPERTIES(VirtIOSerialPCI, vdev.serial),
DEFINE_PROP_END_OF_LIST(),
};
@@ -1412,6 +1411,7 @@ static void virtio_serial_pci_instance_init(Object *obj)
VirtIOSerialPCI *dev = VIRTIO_SERIAL_PCI(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SERIAL);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
static const TypeInfo virtio_serial_pci_info = {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 35/88] virtio-serial: fix virtio-serial child refcount in transports
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (33 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 34/88] virtio-serial: use aliases instead of duplicate qdev properties Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 36/88] virtio-rng: use aliases instead of duplicate qdev properties Michael Roth
` (54 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is dropped
again when the property is deleted.
The upshot of this is that we always have a refcount >= 1. Upon hot
unplug the virtio-serial child is not finalized!
Drop our reference after the child property has been added to the
parent.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit e77ca8b92af8a5213897331d676089e8919f383d)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/s390x/s390-virtio-bus.c | 1 +
hw/s390x/virtio-ccw.c | 1 +
hw/virtio/virtio-pci.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 31f5286..422402e 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -227,6 +227,7 @@ static void s390_virtio_serial_instance_init(Object *obj)
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SERIAL);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
+ object_unref(OBJECT(&dev->vdev));
}
static int s390_virtio_scsi_init(VirtIOS390Device *s390_dev)
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 271104d..5d7f3a6 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -853,6 +853,7 @@ static void virtio_ccw_serial_instance_init(Object *obj)
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SERIAL);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
+ object_unref(OBJECT(&dev->vdev));
}
static int virtio_ccw_balloon_init(VirtioCcwDevice *ccw_dev)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index db085d5..4d830aa 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1412,6 +1412,7 @@ static void virtio_serial_pci_instance_init(Object *obj)
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_SERIAL);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
+ object_unref(OBJECT(&dev->vdev));
}
static const TypeInfo virtio_serial_pci_info = {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 36/88] virtio-rng: use aliases instead of duplicate qdev properties
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (34 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 35/88] virtio-serial: fix virtio-serial child refcount in transports Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 37/88] virtio-rng: fix virtio-rng child refcount in transports Michael Roth
` (53 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
virtio-rng-{pci, s390, ccw} all duplicate the
qdev properties of their VirtIORNG child.
This approach does not work well with string or pointer
properties since we must be careful about leaking or
double-freeing them.
Use the QOM alias property to forward property accesses to the
VirtIORNG child. This way no duplication is necessary.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 8ee486ae339f0e5236f4a9ab988fc963edcc73b5)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/s390x/s390-virtio-bus.c | 2 +-
hw/s390x/virtio-ccw.c | 2 +-
hw/virtio/virtio-pci.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 422402e..6d0a7f3 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -311,6 +311,7 @@ static void s390_virtio_rng_instance_init(Object *obj)
VirtIORNGS390 *dev = VIRTIO_RNG_S390(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_RNG);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
object_property_add_link(obj, "rng", TYPE_RNG_BACKEND,
(Object **)&dev->vdev.conf.rng,
qdev_prop_allow_set_link_before_realize,
@@ -561,7 +562,6 @@ static const TypeInfo s390_virtio_serial = {
static Property s390_virtio_rng_properties[] = {
DEFINE_VIRTIO_COMMON_FEATURES(VirtIOS390Device, host_features),
- DEFINE_VIRTIO_RNG_PROPERTIES(VirtIORNGS390, vdev.conf),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index 5d7f3a6..da2e427 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1542,6 +1542,7 @@ static void virtio_ccw_rng_instance_init(Object *obj)
VirtIORNGCcw *dev = VIRTIO_RNG_CCW(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_RNG);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
object_property_add_link(obj, "rng", TYPE_RNG_BACKEND,
(Object **)&dev->vdev.conf.rng,
qdev_prop_allow_set_link_before_realize,
@@ -1550,7 +1551,6 @@ static void virtio_ccw_rng_instance_init(Object *obj)
static Property virtio_ccw_rng_properties[] = {
DEFINE_PROP_STRING("devno", VirtioCcwDevice, bus_id),
- DEFINE_VIRTIO_RNG_PROPERTIES(VirtIORNGCcw, vdev.conf),
DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags,
VIRTIO_CCW_FLAG_USE_IOEVENTFD_BIT, true),
DEFINE_PROP_END_OF_LIST(),
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 4d830aa..39cda4e 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1485,7 +1485,6 @@ static const TypeInfo virtio_net_pci_info = {
/* virtio-rng-pci */
static Property virtio_rng_pci_properties[] = {
- DEFINE_VIRTIO_RNG_PROPERTIES(VirtIORngPCI, vdev.conf),
DEFINE_PROP_END_OF_LIST(),
};
@@ -1527,6 +1526,7 @@ static void virtio_rng_initfn(Object *obj)
VirtIORngPCI *dev = VIRTIO_RNG_PCI(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_RNG);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
object_property_add_link(obj, "rng", TYPE_RNG_BACKEND,
(Object **)&dev->vdev.conf.rng,
qdev_prop_allow_set_link_before_realize,
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 37/88] virtio-rng: fix virtio-rng child refcount in transports
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (35 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 36/88] virtio-rng: use aliases instead of duplicate qdev properties Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 38/88] virtio-balloon: fix virtio-balloon " Michael Roth
` (52 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is dropped
again when the property is deleted.
The upshot of this is that we always have a refcount >= 1. Upon hot
unplug the virtio-rng child is not finalized!
Drop our reference after the child property has been added to the
parent.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 352fa88dfb2e9c72fa2a1506acb39f349d4befbf)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/s390x/s390-virtio-bus.c | 1 +
hw/s390x/virtio-ccw.c | 1 +
hw/virtio/virtio-pci.c | 1 +
3 files changed, 3 insertions(+)
diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 6d0a7f3..ca682bb 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -312,6 +312,7 @@ static void s390_virtio_rng_instance_init(Object *obj)
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_RNG);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
+ object_unref(OBJECT(&dev->vdev));
object_property_add_link(obj, "rng", TYPE_RNG_BACKEND,
(Object **)&dev->vdev.conf.rng,
qdev_prop_allow_set_link_before_realize,
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index da2e427..de0764d 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -1543,6 +1543,7 @@ static void virtio_ccw_rng_instance_init(Object *obj)
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_RNG);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
+ object_unref(OBJECT(&dev->vdev));
object_property_add_link(obj, "rng", TYPE_RNG_BACKEND,
(Object **)&dev->vdev.conf.rng,
qdev_prop_allow_set_link_before_realize,
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 39cda4e..6853955 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1527,6 +1527,7 @@ static void virtio_rng_initfn(Object *obj)
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_RNG);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
+ object_unref(OBJECT(&dev->vdev));
object_property_add_link(obj, "rng", TYPE_RNG_BACKEND,
(Object **)&dev->vdev.conf.rng,
qdev_prop_allow_set_link_before_realize,
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 38/88] virtio-balloon: fix virtio-balloon child refcount in transports
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (36 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 37/88] virtio-rng: fix virtio-rng child refcount in transports Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 39/88] virtio-9p: use aliases instead of duplicate qdev properties Michael Roth
` (51 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is dropped
again when the property is deleted.
The upshot of this is that we always have a refcount >= 1. Upon hot
unplug the virtio-balloon child is not finalized!
Drop our reference after the child property has been added to the
parent.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 91ba21208839643603e7f7fa5864723c3f371ebe)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/s390x/virtio-ccw.c | 2 +-
hw/virtio/virtio-pci.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index de0764d..c074f64 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -900,7 +900,7 @@ static void virtio_ccw_balloon_instance_init(Object *obj)
VirtIOBalloonCcw *dev = VIRTIO_BALLOON_CCW(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_BALLOON);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
-
+ object_unref(OBJECT(&dev->vdev));
object_property_add(obj, "guest-stats", "guest statistics",
balloon_ccw_stats_get_all, NULL, NULL, dev, NULL);
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 6853955..6a355e7 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1327,7 +1327,7 @@ static void virtio_balloon_pci_instance_init(Object *obj)
VirtIOBalloonPCI *dev = VIRTIO_BALLOON_PCI(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_BALLOON);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
-
+ object_unref(OBJECT(&dev->vdev));
object_property_add(obj, "guest-stats", "guest statistics",
balloon_pci_stats_get_all, NULL, NULL, dev,
NULL);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 39/88] virtio-9p: use aliases instead of duplicate qdev properties
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (37 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 38/88] virtio-balloon: fix virtio-balloon " Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 40/88] virtio-9p: fix virtio-9p child refcount in transports Michael Roth
` (50 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
virtio-9p-pci all duplicate the qdev properties of their
V9fsState child. This approach does not work well with
string or pointer properties since we must be careful
about leaking or double-freeing them.
Use the QOM alias property to forward property accesses to the
V9fsState child. This way no duplication is necessary.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 48833071d955406ebeddc365a8df8b5cb12b035f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/virtio/virtio-pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 6a355e7..50ef68c 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -924,7 +924,6 @@ static Property virtio_9p_pci_properties[] = {
DEFINE_PROP_BIT("ioeventfd", VirtIOPCIProxy, flags,
VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, true),
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors, 2),
- DEFINE_VIRTIO_9P_PROPERTIES(V9fsPCIState, vdev.fsconf),
DEFINE_PROP_END_OF_LIST(),
};
@@ -948,6 +947,7 @@ static void virtio_9p_pci_instance_init(Object *obj)
V9fsPCIState *dev = VIRTIO_9P_PCI(obj);
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_9P);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
+ qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
}
static const TypeInfo virtio_9p_pci_info = {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 40/88] virtio-9p: fix virtio-9p child refcount in transports
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (38 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 39/88] virtio-9p: use aliases instead of duplicate qdev properties Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 41/88] pc: Fix disabling of vapic for compat PC models Michael Roth
` (49 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
object_initialize() leaves the object with a refcount of 1.
object_property_add_child() adds its own reference which is
dropped again when the property is deleted.
The upshot of this is that we always have a refcount >= 1. Upon
unplug the virtio-9p child is not finalized!
Drop our reference after the child property has been added to the
parent.
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 8f3d60e568f53cb3ccdedd917f8e49cdb304973b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/virtio/virtio-pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 50ef68c..ba675fe 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -948,6 +948,7 @@ static void virtio_9p_pci_instance_init(Object *obj)
object_initialize(&dev->vdev, sizeof(dev->vdev), TYPE_VIRTIO_9P);
object_property_add_child(obj, "virtio-backend", OBJECT(&dev->vdev), NULL);
qdev_alias_all_properties(DEVICE(&dev->vdev), obj);
+ object_unref(OBJECT(&dev->vdev));
}
static const TypeInfo virtio_9p_pci_info = {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 41/88] pc: Fix disabling of vapic for compat PC models
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (39 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 40/88] virtio-9p: fix virtio-9p child refcount in transports Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 42/88] vmware-vga: CVE-2014-3689: turn off hw accel Michael Roth
` (48 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Jan Kiszka <jan.kiszka@siemens.com>
We used to be able to address both the QEMU and the KVM APIC via "apic".
This doesn't work anymore. So we need to use their parent class to turn
off the vapic on machines that should not expose them.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit df1fd4b541b3ae0dc44843741363d00080775294)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/i386/pc_piix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 8dc8290..96b8a18 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -646,7 +646,7 @@ static QEMUMachine pc_machine_v1_1 = {
.property = "class",\
.value = stringify(PCI_CLASS_MEMORY_RAM),\
},{\
- .driver = "apic",\
+ .driver = "apic-common",\
.property = "vapic",\
.value = "off",\
},{\
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 42/88] vmware-vga: CVE-2014-3689: turn off hw accel
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (40 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 41/88] pc: Fix disabling of vapic for compat PC models Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 43/88] vmware-vga: add vmsvga_verify_rect Michael Roth
` (47 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gerd Hoffmann <kraxel@redhat.com>
Quick & easy stopgap for CVE-2014-3689: We just compile out the
hardware acceleration functions which lack sanity checks. Thankfully
we have capability bits for them (SVGA_CAP_RECT_COPY and
SVGA_CAP_RECT_FILL), so guests should deal just fine, in theory.
Subsequent patches will add the missing checks and re-enable the
hardware acceleration emulation.
Cc: qemu-stable@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Don Koch <dkoch@verizon.com>
(cherry picked from commit 83afa38eb20ca27e30683edc7729880e091387fc)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/display/vmware_vga.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 591b645..4a4229b 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -29,8 +29,10 @@
#include "hw/pci/pci.h"
#undef VERBOSE
+#if 0
#define HW_RECT_ACCEL
#define HW_FILL_ACCEL
+#endif
#define HW_MOUSE_ACCEL
#include "vga_int.h"
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 43/88] vmware-vga: add vmsvga_verify_rect
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (41 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 42/88] vmware-vga: CVE-2014-3689: turn off hw accel Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 44/88] vmware-vga: use vmsvga_verify_rect in vmsvga_update_rect Michael Roth
` (46 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gerd Hoffmann <kraxel@redhat.com>
Add verification function for rectangles, returning
true if verification passes and false otherwise.
Cc: qemu-stable@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Don Koch <dkoch@verizon.com>
(cherry picked from commit 07258900fd45b646f5b69048d64c4490b3243e1b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/display/vmware_vga.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 52 insertions(+), 1 deletion(-)
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 4a4229b..f0e487f 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -294,8 +294,59 @@ enum {
SVGA_CURSOR_ON_RESTORE_TO_FB = 3,
};
+static inline bool vmsvga_verify_rect(DisplaySurface *surface,
+ const char *name,
+ int x, int y, int w, int h)
+{
+ if (x < 0) {
+ fprintf(stderr, "%s: x was < 0 (%d)\n", name, x);
+ return false;
+ }
+ if (x > SVGA_MAX_WIDTH) {
+ fprintf(stderr, "%s: x was > %d (%d)\n", name, SVGA_MAX_WIDTH, x);
+ return false;
+ }
+ if (w < 0) {
+ fprintf(stderr, "%s: w was < 0 (%d)\n", name, w);
+ return false;
+ }
+ if (w > SVGA_MAX_WIDTH) {
+ fprintf(stderr, "%s: w was > %d (%d)\n", name, SVGA_MAX_WIDTH, w);
+ return false;
+ }
+ if (x + w > surface_width(surface)) {
+ fprintf(stderr, "%s: width was > %d (x: %d, w: %d)\n",
+ name, surface_width(surface), x, w);
+ return false;
+ }
+
+ if (y < 0) {
+ fprintf(stderr, "%s: y was < 0 (%d)\n", name, y);
+ return false;
+ }
+ if (y > SVGA_MAX_HEIGHT) {
+ fprintf(stderr, "%s: y was > %d (%d)\n", name, SVGA_MAX_HEIGHT, y);
+ return false;
+ }
+ if (h < 0) {
+ fprintf(stderr, "%s: h was < 0 (%d)\n", name, h);
+ return false;
+ }
+ if (h > SVGA_MAX_HEIGHT) {
+ fprintf(stderr, "%s: h was > %d (%d)\n", name, SVGA_MAX_HEIGHT, h);
+ return false;
+ }
+ if (y + h > surface_height(surface)) {
+ fprintf(stderr, "%s: update height > %d (y: %d, h: %d)\n",
+ name, surface_height(surface), y, h);
+ return false;
+ }
+
+ return true;
+}
+
static inline void vmsvga_update_rect(struct vmsvga_state_s *s,
- int x, int y, int w, int h)
+ int x, int y, int w, int h)
{
DisplaySurface *surface = qemu_console_surface(s->vga.con);
int line;
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 44/88] vmware-vga: use vmsvga_verify_rect in vmsvga_update_rect
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (42 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 43/88] vmware-vga: add vmsvga_verify_rect Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 45/88] vmware-vga: use vmsvga_verify_rect in vmsvga_copy_rect Michael Roth
` (45 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gerd Hoffmann <kraxel@redhat.com>
Switch vmsvga_update_rect over to use vmsvga_verify_rect. Slight change
in behavior: We don't try to automatically fixup rectangles any more.
In case we find invalid update requests we'll do a full-screen update
instead.
Cc: qemu-stable@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Don Koch <dkoch@verizon.com>
(cherry picked from commit 1735fe1edba9cc86bc0f26937ed5a62d3cb47c9c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/display/vmware_vga.c | 32 ++++----------------------------
1 file changed, 4 insertions(+), 28 deletions(-)
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index f0e487f..718746e 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -356,36 +356,12 @@ static inline void vmsvga_update_rect(struct vmsvga_state_s *s,
uint8_t *src;
uint8_t *dst;
- if (x < 0) {
- fprintf(stderr, "%s: update x was < 0 (%d)\n", __func__, x);
- w += x;
+ if (!vmsvga_verify_rect(surface, __func__, x, y, w, h)) {
+ /* go for a fullscreen update as fallback */
x = 0;
- }
- if (w < 0) {
- fprintf(stderr, "%s: update w was < 0 (%d)\n", __func__, w);
- w = 0;
- }
- if (x + w > surface_width(surface)) {
- fprintf(stderr, "%s: update width too large x: %d, w: %d\n",
- __func__, x, w);
- x = MIN(x, surface_width(surface));
- w = surface_width(surface) - x;
- }
-
- if (y < 0) {
- fprintf(stderr, "%s: update y was < 0 (%d)\n", __func__, y);
- h += y;
y = 0;
- }
- if (h < 0) {
- fprintf(stderr, "%s: update h was < 0 (%d)\n", __func__, h);
- h = 0;
- }
- if (y + h > surface_height(surface)) {
- fprintf(stderr, "%s: update height too large y: %d, h: %d\n",
- __func__, y, h);
- y = MIN(y, surface_height(surface));
- h = surface_height(surface) - y;
+ w = surface_width(surface);
+ h = surface_height(surface);
}
bypl = surface_stride(surface);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 45/88] vmware-vga: use vmsvga_verify_rect in vmsvga_copy_rect
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (43 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 44/88] vmware-vga: use vmsvga_verify_rect in vmsvga_update_rect Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 46/88] vmware-vga: use vmsvga_verify_rect in vmsvga_fill_rect Michael Roth
` (44 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gerd Hoffmann <kraxel@redhat.com>
Add verification to vmsvga_copy_rect, re-enable HW_RECT_ACCEL.
Cc: qemu-stable@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Don Koch <dkoch@verizon.com>
(cherry picked from commit 61b41b4c20eba08d2185297767e69153d7f3e09d)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/display/vmware_vga.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 718746e..c2e0a43 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -29,8 +29,8 @@
#include "hw/pci/pci.h"
#undef VERBOSE
-#if 0
#define HW_RECT_ACCEL
+#if 0
#define HW_FILL_ACCEL
#endif
#define HW_MOUSE_ACCEL
@@ -406,7 +406,7 @@ static inline void vmsvga_update_rect_flush(struct vmsvga_state_s *s)
}
#ifdef HW_RECT_ACCEL
-static inline void vmsvga_copy_rect(struct vmsvga_state_s *s,
+static inline int vmsvga_copy_rect(struct vmsvga_state_s *s,
int x0, int y0, int x1, int y1, int w, int h)
{
DisplaySurface *surface = qemu_console_surface(s->vga.con);
@@ -417,6 +417,13 @@ static inline void vmsvga_copy_rect(struct vmsvga_state_s *s,
int line = h;
uint8_t *ptr[2];
+ if (!vmsvga_verify_rect(surface, "vmsvga_copy_rect/src", x0, y0, w, h)) {
+ return -1;
+ }
+ if (!vmsvga_verify_rect(surface, "vmsvga_copy_rect/dst", x1, y1, w, h)) {
+ return -1;
+ }
+
if (y1 > y0) {
ptr[0] = vram + bypp * x0 + bypl * (y0 + h - 1);
ptr[1] = vram + bypp * x1 + bypl * (y1 + h - 1);
@@ -432,6 +439,7 @@ static inline void vmsvga_copy_rect(struct vmsvga_state_s *s,
}
vmsvga_update_rect_delayed(s, x1, y1, w, h);
+ return 0;
}
#endif
@@ -625,12 +633,12 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
width = vmsvga_fifo_read(s);
height = vmsvga_fifo_read(s);
#ifdef HW_RECT_ACCEL
- vmsvga_copy_rect(s, x, y, dx, dy, width, height);
- break;
-#else
+ if (vmsvga_copy_rect(s, x, y, dx, dy, width, height) == 0) {
+ break;
+ }
+#endif
args = 0;
goto badcmd;
-#endif
case SVGA_CMD_DEFINE_CURSOR:
len -= 8;
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 46/88] vmware-vga: use vmsvga_verify_rect in vmsvga_fill_rect
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (44 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 45/88] vmware-vga: use vmsvga_verify_rect in vmsvga_copy_rect Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 47/88] qcow2: Do not overflow when writing an L1 sector Michael Roth
` (43 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gerd Hoffmann <kraxel@redhat.com>
Add verification to vmsvga_fill_rect, re-enable HW_FILL_ACCEL.
Cc: qemu-stable@nongnu.org
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Don Koch <dkoch@verizon.com>
(cherry picked from commit bd9ccd8517e83b7c33a9167815dbfffb30d70b13)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/display/vmware_vga.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index c2e0a43..d44e3e8 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -30,9 +30,7 @@
#undef VERBOSE
#define HW_RECT_ACCEL
-#if 0
#define HW_FILL_ACCEL
-#endif
#define HW_MOUSE_ACCEL
#include "vga_int.h"
@@ -444,7 +442,7 @@ static inline int vmsvga_copy_rect(struct vmsvga_state_s *s,
#endif
#ifdef HW_FILL_ACCEL
-static inline void vmsvga_fill_rect(struct vmsvga_state_s *s,
+static inline int vmsvga_fill_rect(struct vmsvga_state_s *s,
uint32_t c, int x, int y, int w, int h)
{
DisplaySurface *surface = qemu_console_surface(s->vga.con);
@@ -457,6 +455,10 @@ static inline void vmsvga_fill_rect(struct vmsvga_state_s *s,
uint8_t *src;
uint8_t col[4];
+ if (!vmsvga_verify_rect(surface, __func__, x, y, w, h)) {
+ return -1;
+ }
+
col[0] = c;
col[1] = c >> 8;
col[2] = c >> 16;
@@ -481,6 +483,7 @@ static inline void vmsvga_fill_rect(struct vmsvga_state_s *s,
}
vmsvga_update_rect_delayed(s, x, y, w, h);
+ return 0;
}
#endif
@@ -613,12 +616,12 @@ static void vmsvga_fifo_run(struct vmsvga_state_s *s)
width = vmsvga_fifo_read(s);
height = vmsvga_fifo_read(s);
#ifdef HW_FILL_ACCEL
- vmsvga_fill_rect(s, colour, x, y, width, height);
- break;
-#else
+ if (vmsvga_fill_rect(s, colour, x, y, width, height) == 0) {
+ break;
+ }
+#endif
args = 0;
goto badcmd;
-#endif
case SVGA_CMD_RECT_COPY:
len -= 7;
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 47/88] qcow2: Do not overflow when writing an L1 sector
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (45 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 46/88] vmware-vga: use vmsvga_verify_rect in vmsvga_fill_rect Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 48/88] libcacard: don't free sign buffer while sign op is pending Michael Roth
` (42 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
While writing an L1 table sector, qcow2_write_l1_entry() copies the
respective range from s->l1_table to the local "buf" array. The size of
s->l1_table does not have to be a multiple of L1_ENTRIES_PER_SECTOR;
thus, limit the index which is used for copying all entries to the L1
size.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit a1391444fe1cfef14976458f3293a2c6945e725c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/qcow2-cluster.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 4208dc0..26827a2 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -158,12 +158,14 @@ static int l2_load(BlockDriverState *bs, uint64_t l2_offset,
int qcow2_write_l1_entry(BlockDriverState *bs, int l1_index)
{
BDRVQcowState *s = bs->opaque;
- uint64_t buf[L1_ENTRIES_PER_SECTOR];
+ uint64_t buf[L1_ENTRIES_PER_SECTOR] = { 0 };
int l1_start_index;
int i, ret;
l1_start_index = l1_index & ~(L1_ENTRIES_PER_SECTOR - 1);
- for (i = 0; i < L1_ENTRIES_PER_SECTOR; i++) {
+ for (i = 0; i < L1_ENTRIES_PER_SECTOR && l1_start_index + i < s->l1_size;
+ i++)
+ {
buf[i] = cpu_to_be64(s->l1_table[l1_start_index + i]);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 48/88] libcacard: don't free sign buffer while sign op is pending
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (46 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 47/88] qcow2: Do not overflow when writing an L1 sector Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 49/88] Make qemu_shutdown_requested signal-safe Michael Roth
` (41 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Ray Strode <rstrode@redhat.com>
commit 57f97834efe0c208ffadc9d2959f3d3d55580e52 cleaned up
the cac_applet_pki_process_apdu function to have a single
exit point. Unfortunately, that commit introduced a bug
where the sign buffer can get free'd and nullified while
it's still being used.
This commit corrects the bug by introducing a boolean to
track whether or not the sign buffer should be freed in
the function exit path.
Signed-off-by: Ray Strode <rstrode@redhat.com>
Reviewed-by: Alon Levy <alon@pobox.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 81b49e8f892a977f3821f3416ea51aa641d63ac4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
libcacard/cac.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/libcacard/cac.c b/libcacard/cac.c
index ae8c378..f38fdce 100644
--- a/libcacard/cac.c
+++ b/libcacard/cac.c
@@ -115,6 +115,7 @@ cac_applet_pki_process_apdu(VCard *card, VCardAPDU *apdu,
VCardAppletPrivate *applet_private;
int size, next;
unsigned char *sign_buffer;
+ bool retain_sign_buffer = FALSE;
vcard_7816_status_t status;
VCardStatus ret = VCARD_FAIL;
@@ -178,6 +179,7 @@ cac_applet_pki_process_apdu(VCard *card, VCardAPDU *apdu,
pki_applet->sign_buffer = sign_buffer;
pki_applet->sign_buffer_len = size;
*response = vcard_make_response(VCARD7816_STATUS_SUCCESS);
+ retain_sign_buffer = TRUE;
break;
case 0x00:
/* we now have the whole buffer, do the operation, result will be
@@ -200,9 +202,11 @@ cac_applet_pki_process_apdu(VCard *card, VCardAPDU *apdu,
VCARD7816_STATUS_ERROR_P1_P2_INCORRECT);
break;
}
- g_free(sign_buffer);
- pki_applet->sign_buffer = NULL;
- pki_applet->sign_buffer_len = 0;
+ if (!retain_sign_buffer) {
+ g_free(sign_buffer);
+ pki_applet->sign_buffer = NULL;
+ pki_applet->sign_buffer_len = 0;
+ }
ret = VCARD_DONE;
break;
case CAC_READ_BUFFER:
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 49/88] Make qemu_shutdown_requested signal-safe
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (47 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 48/88] libcacard: don't free sign buffer while sign op is pending Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 50/88] vnc: sanitize bits_per_pixel from the client Michael Roth
` (40 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Jan Kiszka <jan.kiszka@siemens.com>
qemu_shutdown_requested may be interrupted by qemu_system_killed. If the
latter sets shutdown_requested after qemu_shutdown_requested has read it
but before it was cleared, the shutdown event is lost. Fix this by using
atomic_xchg.
This provides a different fix for the problem which commit 15124e142
attempts to deal with. That commit breaks use of ^C to drop into gdb,
and so this approach is better (and 15124e142 can be reverted).
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
[PMM: commit message tweak]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 817ef04db2cfa2df04daffd6917f4ea7605f6403)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
vl.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/vl.c b/vl.c
index 7f8bd39..3650f4f 100644
--- a/vl.c
+++ b/vl.c
@@ -1745,9 +1745,7 @@ int qemu_reset_requested_get(void)
static int qemu_shutdown_requested(void)
{
- int r = shutdown_requested;
- shutdown_requested = 0;
- return r;
+ return atomic_xchg(&shutdown_requested, 0);
}
static void qemu_kill_report(void)
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 50/88] vnc: sanitize bits_per_pixel from the client
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (48 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 49/88] Make qemu_shutdown_requested signal-safe Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 51/88] virtio-scsi: sense in virtio_scsi_command_complete Michael Roth
` (39 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Petr Matousek <pmatouse@redhat.com>
bits_per_pixel that are less than 8 could result in accessing
non-initialized buffers later in the code due to the expectation
that bytes_per_pixel value that is used to initialize these buffers is
never zero.
To fix this check that bits_per_pixel from the client is one of the
values that the rfb protocol specification allows.
This is CVE-2014-7815.
Signed-off-by: Petr Matousek <pmatouse@redhat.com>
[ kraxel: apply codestyle fix ]
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit e6908bfe8e07f2b452e78e677da1b45b1c0f6829)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
ui/vnc.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/ui/vnc.c b/ui/vnc.c
index f8d9b7d..87e34ae 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2026,6 +2026,16 @@ static void set_pixel_format(VncState *vs,
return;
}
+ switch (bits_per_pixel) {
+ case 8:
+ case 16:
+ case 32:
+ break;
+ default:
+ vnc_client_error(vs);
+ return;
+ }
+
vs->client_pf.rmax = red_max;
vs->client_pf.rbits = hweight_long(red_max);
vs->client_pf.rshift = red_shift;
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 51/88] virtio-scsi: sense in virtio_scsi_command_complete
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (49 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 50/88] vnc: sanitize bits_per_pixel from the client Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 52/88] tcg/mips: fix store softmmu slow path Michael Roth
` (38 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Ting Wang <kathy.wangting@huawei.com>
If req->resp.cmd.status is not GOOD, the address of sense for
qemu_iovec_from_buf should be modified from &req->resp to sense.
Cc: qemu-stable@nongnu.org
Signed-off-by: Ting Wang <kathy.wangting@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit b7890c40e557f4733b6fcd1eb79af79b70dc8c05)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/scsi/virtio-scsi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 0eb069a..f041991 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -400,7 +400,7 @@ static void virtio_scsi_command_complete(SCSIRequest *r, uint32_t status,
sense_len = scsi_req_get_sense(r, sense, sizeof(sense));
sense_len = MIN(sense_len, req->resp_iov.size - sizeof(req->resp.cmd));
qemu_iovec_from_buf(&req->resp_iov, sizeof(req->resp.cmd),
- &req->resp, sense_len);
+ sense, sense_len);
req->resp.cmd.sense_len = virtio_tswap32(vdev, sense_len);
}
virtio_scsi_complete_cmd_req(req);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 52/88] tcg/mips: fix store softmmu slow path
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (50 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 51/88] virtio-scsi: sense in virtio_scsi_command_complete Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 53/88] hw/core/loader: implement address translation in uimage loader Michael Roth
` (37 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Aurelien Jarno <aurelien@aurel32.net>
Commit 9d8bf2d1 moved the softmmu slow path out of line and introduce a
regression at the same time by always calling tcg_out_tlb_load with
is_load=1. This makes impossible to run any significant code under
qemu-system-mips*.
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
(cherry picked from commit 0a2923f8488498000eec54871456aa64a4391da4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
tcg/mips/tcg-target.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c
index 9cce356..b7f4d67 100644
--- a/tcg/mips/tcg-target.c
+++ b/tcg/mips/tcg-target.c
@@ -1302,7 +1302,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, bool is_64)
so we can reuse that for the base. */
base = (TARGET_LONG_BITS == 32 ? TCG_REG_A1 : TCG_REG_A2);
tcg_out_tlb_load(s, base, addr_regl, addr_regh, mem_index,
- s_bits, label_ptr, 1);
+ s_bits, label_ptr, 0);
tcg_out_qemu_st_direct(s, data_regl, data_regh, base, opc);
add_qemu_ldst_label(s, 0, opc, data_regl, data_regh, addr_regl, addr_regh,
mem_index, s->code_ptr, label_ptr);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 53/88] hw/core/loader: implement address translation in uimage loader
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (51 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 52/88] tcg/mips: fix store softmmu slow path Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 54/88] hw/xtensa/xtfpga: treat uImage load address as virtual Michael Roth
` (36 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Filippov <jcmvbkbc@gmail.com>
Such address translation is needed when load address recorded in uImage
is a virtual address. When the actual load address is requested, return
untranslated address: user that needs the translated address can always
apply translation function to it and those that need it untranslated
don't need to do the inverse translation.
Add translation function pointer and its parameter to uimage_load
prototype. Update all existing users.
No user-visible functional changes.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
(cherry picked from commit 25bda50a0c7241dcb247483af2b7f961632020cc)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/arm/boot.c | 2 +-
hw/core/loader.c | 17 +++++++++++++----
hw/m68k/an5206.c | 3 ++-
hw/m68k/dummy_m68k.c | 3 ++-
hw/m68k/mcf5208.c | 3 ++-
hw/microblaze/boot.c | 3 ++-
hw/openrisc/openrisc_sim.c | 2 +-
hw/ppc/e500.c | 3 ++-
hw/ppc/ppc440_bamboo.c | 3 ++-
hw/xtensa/xtfpga.c | 3 ++-
include/hw/loader.h | 4 +++-
11 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 3d1f4a2..50b6c5c 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -508,7 +508,7 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info)
entry = elf_entry;
if (kernel_size < 0) {
kernel_size = load_uimage(info->kernel_filename, &entry, NULL,
- &is_linux);
+ &is_linux, NULL, NULL);
}
if (kernel_size < 0) {
entry = info->loader_start + kernel_load_offset;
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 2bf6b8f..8b84c12 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -456,7 +456,9 @@ static ssize_t gunzip(void *dst, size_t dstlen, uint8_t *src,
/* Load a U-Boot image. */
static int load_uboot_image(const char *filename, hwaddr *ep, hwaddr *loadaddr,
- int *is_linux, uint8_t image_type)
+ int *is_linux, uint8_t image_type,
+ uint64_t (*translate_fn)(void *, uint64_t),
+ void *translate_opaque)
{
int fd;
int size;
@@ -490,6 +492,9 @@ static int load_uboot_image(const char *filename, hwaddr *ep, hwaddr *loadaddr,
switch (hdr->ih_type) {
case IH_TYPE_KERNEL:
address = hdr->ih_load;
+ if (translate_fn) {
+ address = translate_fn(translate_opaque, address);
+ }
if (loadaddr) {
*loadaddr = hdr->ih_load;
}
@@ -566,15 +571,19 @@ out:
}
int load_uimage(const char *filename, hwaddr *ep, hwaddr *loadaddr,
- int *is_linux)
+ int *is_linux,
+ uint64_t (*translate_fn)(void *, uint64_t),
+ void *translate_opaque)
{
- return load_uboot_image(filename, ep, loadaddr, is_linux, IH_TYPE_KERNEL);
+ return load_uboot_image(filename, ep, loadaddr, is_linux, IH_TYPE_KERNEL,
+ translate_fn, translate_opaque);
}
/* Load a ramdisk. */
int load_ramdisk(const char *filename, hwaddr addr, uint64_t max_sz)
{
- return load_uboot_image(filename, NULL, &addr, NULL, IH_TYPE_RAMDISK);
+ return load_uboot_image(filename, NULL, &addr, NULL, IH_TYPE_RAMDISK,
+ NULL, NULL);
}
/*
diff --git a/hw/m68k/an5206.c b/hw/m68k/an5206.c
index 684496a..388420e 100644
--- a/hw/m68k/an5206.c
+++ b/hw/m68k/an5206.c
@@ -74,7 +74,8 @@ static void an5206_init(MachineState *machine)
NULL, NULL, 1, ELF_MACHINE, 0);
entry = elf_entry;
if (kernel_size < 0) {
- kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL);
+ kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
+ NULL, NULL);
}
if (kernel_size < 0) {
kernel_size = load_image_targphys(kernel_filename, KERNEL_LOAD_ADDR,
diff --git a/hw/m68k/dummy_m68k.c b/hw/m68k/dummy_m68k.c
index 6db1b71..fb9ca0e 100644
--- a/hw/m68k/dummy_m68k.c
+++ b/hw/m68k/dummy_m68k.c
@@ -50,7 +50,8 @@ static void dummy_m68k_init(MachineState *machine)
NULL, NULL, 1, ELF_MACHINE, 0);
entry = elf_entry;
if (kernel_size < 0) {
- kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL);
+ kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
+ NULL, NULL);
}
if (kernel_size < 0) {
kernel_size = load_image_targphys(kernel_filename,
diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
index 2ef617f..07683db 100644
--- a/hw/m68k/mcf5208.c
+++ b/hw/m68k/mcf5208.c
@@ -279,7 +279,8 @@ static void mcf5208evb_init(MachineState *machine)
NULL, NULL, 1, ELF_MACHINE, 0);
entry = elf_entry;
if (kernel_size < 0) {
- kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL);
+ kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL,
+ NULL, NULL);
}
if (kernel_size < 0) {
kernel_size = load_image_targphys(kernel_filename, 0x40000000,
diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
index 6bf36d0..a2843cd 100644
--- a/hw/microblaze/boot.c
+++ b/hw/microblaze/boot.c
@@ -154,7 +154,8 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base,
if (kernel_size < 0) {
hwaddr uentry, loadaddr;
- kernel_size = load_uimage(kernel_filename, &uentry, &loadaddr, 0);
+ kernel_size = load_uimage(kernel_filename, &uentry, &loadaddr, 0,
+ NULL, NULL);
boot_info.bootstrap_pc = uentry;
high = (loadaddr + kernel_size + 3) & ~3;
}
diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c
index b2b4f9b..123cf4d 100644
--- a/hw/openrisc/openrisc_sim.c
+++ b/hw/openrisc/openrisc_sim.c
@@ -72,7 +72,7 @@ static void cpu_openrisc_load_kernel(ram_addr_t ram_size,
entry = elf_entry;
if (kernel_size < 0) {
kernel_size = load_uimage(kernel_filename,
- &entry, NULL, NULL);
+ &entry, NULL, NULL, NULL, NULL);
}
if (kernel_size < 0) {
kernel_size = load_image_targphys(kernel_filename,
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 1a5b30d..c268b91 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -830,7 +830,8 @@ void ppce500_init(MachineState *machine, PPCE500Params *params)
* Hrm. No ELF image? Try a uImage, maybe someone is giving us an
* ePAPR compliant kernel
*/
- kernel_size = load_uimage(filename, &bios_entry, &loadaddr, NULL);
+ kernel_size = load_uimage(filename, &bios_entry, &loadaddr, NULL,
+ NULL, NULL);
if (kernel_size < 0) {
fprintf(stderr, "qemu: could not load firmware '%s'\n", filename);
exit(1);
diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c
index 81a06d3..778970a 100644
--- a/hw/ppc/ppc440_bamboo.c
+++ b/hw/ppc/ppc440_bamboo.c
@@ -253,7 +253,8 @@ static void bamboo_init(MachineState *machine)
/* Load kernel. */
if (kernel_filename) {
- success = load_uimage(kernel_filename, &entry, &loadaddr, NULL);
+ success = load_uimage(kernel_filename, &entry, &loadaddr, NULL,
+ NULL, NULL);
if (success < 0) {
success = load_elf(kernel_filename, NULL, NULL, &elf_entry,
&elf_lowaddr, NULL, 1, ELF_MACHINE, 0);
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index a2dff5a..937d01e 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -325,7 +325,8 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
} else {
hwaddr ep;
int is_linux;
- success = load_uimage(kernel_filename, &ep, NULL, &is_linux);
+ success = load_uimage(kernel_filename, &ep, NULL, &is_linux,
+ NULL, NULL);
if (success > 0 && is_linux) {
entry_point = ep;
} else {
diff --git a/include/hw/loader.h b/include/hw/loader.h
index 796cbf9..11b6b5a 100644
--- a/include/hw/loader.h
+++ b/include/hw/loader.h
@@ -28,7 +28,9 @@ int load_elf(const char *filename, uint64_t (*translate_fn)(void *, uint64_t),
int load_aout(const char *filename, hwaddr addr, int max_sz,
int bswap_needed, hwaddr target_page_size);
int load_uimage(const char *filename, hwaddr *ep,
- hwaddr *loadaddr, int *is_linux);
+ hwaddr *loadaddr, int *is_linux,
+ uint64_t (*translate_fn)(void *, uint64_t),
+ void *translate_opaque);
/**
* load_ramdisk:
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 54/88] hw/xtensa/xtfpga: treat uImage load address as virtual
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (52 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 53/88] hw/core/loader: implement address translation in uimage loader Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 55/88] snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem Michael Roth
` (35 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Filippov <jcmvbkbc@gmail.com>
U-boot for xtensa always treats uImage load address as virtual address.
This is important when booting uImage on xtensa core with MMUv2, because
MMUv2 has fixed non-identity virtual-to-physical mapping after reset.
Always do virtual-to-physical translation of uImage load address and
load uImage at the translated address. This fixes booting uImage kernels
on dc232b and other MMUv2 cores.
Cc: qemu-stable@nongnu.org
Reported-by: Waldemar Brodkorb <mail@waldemar-brodkorb.de>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
(cherry picked from commit 6d2e4530532ca1dbb5e68bdcca12e10931bc6503)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/xtensa/xtfpga.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index 937d01e..e60ff90 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -326,7 +326,7 @@ static void lx_init(const LxBoardDesc *board, MachineState *machine)
hwaddr ep;
int is_linux;
success = load_uimage(kernel_filename, &ep, NULL, &is_linux,
- NULL, NULL);
+ translate_phys_addr, cpu);
if (success > 0 && is_linux) {
entry_point = ep;
} else {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 55/88] snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (53 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 54/88] hw/xtensa/xtfpga: treat uImage load address as virtual Michael Roth
@ 2015-01-08 17:33 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 56/88] hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*) Michael Roth
` (34 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:33 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Zhang Haoyu <zhanghy@sangfor.com>
If there are still pending i/o while deleting snapshot,
because deleting snapshot is done in non-coroutine context, and
the pending i/o read/write (bdrv_co_do_rw) is done in coroutine context,
so it's possible to cause concurrency problem between above two operations.
Add bdrv_drain_all() to bdrv_snapshot_delete() to avoid this problem.
Signed-off-by: Zhang Haoyu <zhanghy@sangfor.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 201410211637596311287@sangfor.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit 3432a1929ee18e08787ce35476abd74f2c93a17c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/snapshot.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/snapshot.c b/block/snapshot.c
index 85c52ff..698e1a1 100644
--- a/block/snapshot.c
+++ b/block/snapshot.c
@@ -236,6 +236,10 @@ int bdrv_snapshot_delete(BlockDriverState *bs,
error_setg(errp, "snapshot_id and name are both NULL");
return -EINVAL;
}
+
+ /* drain all pending i/o before deleting snapshot */
+ bdrv_drain_all();
+
if (drv->bdrv_snapshot_delete) {
return drv->bdrv_snapshot_delete(bs, snapshot_id, name, errp);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 56/88] hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*)
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (54 preceding siblings ...)
2015-01-08 17:33 ` [Qemu-devel] [PATCH 55/88] snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 57/88] esp-pci: fixup deadlock with linux Michael Roth
` (33 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Peter Maydell <peter.maydell@linaro.org>
The g_hash_table_iter_* functions for iterating through a hash table
are not present in glib 2.12, which is our current minimum requirement.
Rewrite the code to use g_hash_table_foreach() instead.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
(cherry picked from commit f8833a37c0c6b22ddd57b45e48cfb0f97dbd5af4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/ppc/spapr_pci.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index dadba5f..7c18e68 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -700,28 +700,34 @@ static const VMStateDescription vmstate_spapr_pci_msi = {
},
};
+static void spapr_pci_fill_msi_devs(gpointer key, gpointer value,
+ gpointer opaque)
+{
+ sPAPRPHBState *sphb = opaque;
+
+ sphb->msi_devs[sphb->msi_devs_num].key = *(uint32_t *)key;
+ sphb->msi_devs[sphb->msi_devs_num].value = *(spapr_pci_msi *)value;
+ sphb->msi_devs_num++;
+}
+
static void spapr_pci_pre_save(void *opaque)
{
sPAPRPHBState *sphb = opaque;
- GHashTableIter iter;
- gpointer key, value;
- int i;
+ int msi_devs_num;
if (sphb->msi_devs) {
g_free(sphb->msi_devs);
sphb->msi_devs = NULL;
}
- sphb->msi_devs_num = g_hash_table_size(sphb->msi);
- if (!sphb->msi_devs_num) {
+ sphb->msi_devs_num = 0;
+ msi_devs_num = g_hash_table_size(sphb->msi);
+ if (!msi_devs_num) {
return;
}
- sphb->msi_devs = g_malloc(sphb->msi_devs_num * sizeof(spapr_pci_msi_mig));
+ sphb->msi_devs = g_malloc(msi_devs_num * sizeof(spapr_pci_msi_mig));
- g_hash_table_iter_init(&iter, sphb->msi);
- for (i = 0; g_hash_table_iter_next(&iter, &key, &value); ++i) {
- sphb->msi_devs[i].key = *(uint32_t *) key;
- sphb->msi_devs[i].value = *(spapr_pci_msi *) value;
- }
+ g_hash_table_foreach(sphb->msi, spapr_pci_fill_msi_devs, sphb);
+ assert(sphb->msi_devs_num == msi_devs_num);
}
static int spapr_pci_post_load(void *opaque, int version_id)
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 57/88] esp-pci: fixup deadlock with linux
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (55 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 56/88] hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*) Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 58/88] target-xtensa: add missing window check for entry Michael Roth
` (32 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Hannes Reinecke <hare@suse.de>
A linux guest will be issuing messages:
[ 32.124042] DC390: Deadlock in DataIn_0: DMA aborted unfinished: 000000 bytes remain!!
[ 32.126348] DC390: DataIn_0: DMA State: 0
and the HBA will fail to work properly.
Reason is the emulation is not setting the 'DMA transfer done'
status correctly.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit c3543fb5fe4520f03dd4fef04fab7745eeca1c96)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/scsi/esp-pci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/scsi/esp-pci.c b/hw/scsi/esp-pci.c
index 9971bbf..32849bd 100644
--- a/hw/scsi/esp-pci.c
+++ b/hw/scsi/esp-pci.c
@@ -268,6 +268,8 @@ static void esp_pci_dma_memory_rw(PCIESPState *pci, uint8_t *buf, int len,
/* update status registers */
pci->dma_regs[DMA_WBC] -= len;
pci->dma_regs[DMA_WAC] += len;
+ if (pci->dma_regs[DMA_WBC] == 0)
+ pci->dma_regs[DMA_STAT] |= DMA_STAT_DONE;
}
static void esp_pci_dma_memory_read(void *opaque, uint8_t *buf, int len)
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 58/88] target-xtensa: add missing window check for entry
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (56 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 57/88] esp-pci: fixup deadlock with linux Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 59/88] kvm: Fix memory slot page alignment logic Michael Roth
` (31 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Filippov <jcmvbkbc@gmail.com>
Entry opcode needs to check if moving to new register frame would cause
register window overflow. Entry used in function prologue never
overflows because preceding windowed call* opcode writes return address
to the target register window frame, causing overflow exceptions at the
point of call. But when a sequence of entry opcodes is used for register
window spilling there may not be a call or other opcode that would cause
window check between entries and they would not raise overflow exception
themselves resulting in data corruption.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
(cherry picked from commit 1b3e71f8ee17ced609213d9b41758110f3c026e9)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
target-xtensa/cpu.h | 6 ++++++
target-xtensa/op_helper.c | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h
index d797d26..6e4e2b2 100644
--- a/target-xtensa/cpu.h
+++ b/target-xtensa/cpu.h
@@ -471,6 +471,12 @@ static inline xtensa_tlb_entry *xtensa_tlb_get_entry(CPUXtensaState *env,
env->itlb[wi] + ei;
}
+static inline uint32_t xtensa_replicate_windowstart(CPUXtensaState *env)
+{
+ return env->sregs[WINDOW_START] |
+ (env->sregs[WINDOW_START] << env->config->nareg / 4);
+}
+
/* MMU modes definitions */
#define MMU_MODE0_SUFFIX _ring0
#define MMU_MODE1_SUFFIX _ring1
diff --git a/target-xtensa/op_helper.c b/target-xtensa/op_helper.c
index dae1386..872e5a8 100644
--- a/target-xtensa/op_helper.c
+++ b/target-xtensa/op_helper.c
@@ -235,6 +235,12 @@ void HELPER(entry)(CPUXtensaState *env, uint32_t pc, uint32_t s, uint32_t imm)
pc, env->sregs[PS]);
HELPER(exception_cause)(env, pc, ILLEGAL_INSTRUCTION_CAUSE);
} else {
+ uint32_t windowstart = xtensa_replicate_windowstart(env) >>
+ (env->sregs[WINDOW_BASE] + 1);
+
+ if (windowstart & ((1 << callinc) - 1)) {
+ HELPER(window_check)(env, pc, callinc);
+ }
env->regs[(callinc << 2) | (s & 3)] = env->regs[s] - (imm << 3);
rotate_window(env, callinc);
env->sregs[WINDOW_START] |=
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 59/88] kvm: Fix memory slot page alignment logic
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (57 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 58/88] target-xtensa: add missing window check for entry Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 60/88] virtio-scsi: work around bug in old BIOSes Michael Roth
` (30 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Alexander Graf <agraf@suse.de>
Memory slots have to be page aligned to get entered into KVM. There
is existing logic that tries to ensure that we pad memory slots that
are not page aligned to the biggest region that would still fit in the
alignment requirements.
Unfortunately, that logic is broken. It tries to calculate the start
offset based on the region size.
Fix up the logic to do the thing it was intended to do and document it
properly in the comment above it.
With this patch applied, I can successfully run an e500 guest with more
than 3GB RAM (at which point RAM starts overlapping subpage memory regions).
Cc: qemu-stable@nongnu.org
Signed-off-by: Alexander Graf <agraf@suse.de>
(cherry picked from commit f2a64032a14c642d0ddc9a7a846fc3d737deede5)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
kvm-all.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index 40f6b55..c8f9bca 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -617,8 +617,10 @@ static void kvm_set_phys_mem(MemoryRegionSection *section, bool add)
unsigned delta;
/* kvm works in page size chunks, but the function may be called
- with sub-page size and unaligned start address. */
- delta = TARGET_PAGE_ALIGN(size) - size;
+ with sub-page size and unaligned start address. Pad the start
+ address to next and truncate size to previous page boundary. */
+ delta = (TARGET_PAGE_SIZE - (start_addr & ~TARGET_PAGE_MASK));
+ delta &= ~TARGET_PAGE_MASK;
if (delta > size) {
return;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 60/88] virtio-scsi: work around bug in old BIOSes
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (58 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 59/88] kvm: Fix memory slot page alignment logic Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 61/88] libcacard: fix resource leak Michael Roth
` (29 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Paolo Bonzini <pbonzini@redhat.com>
Old BIOSes left some padding by mistake after the req_size/resp_size.
New QEMU does not like it, thinking it is a bidirectional command.
As a workaround, we can check if the ANY_LAYOUT bit is set; if not, we
always consider the first buffer as the virtio-scsi request/response,
because, back when QEMU did not support ANY_LAYOUT, it expected the
payload to start at the second element of the iovec.
This can show up during migration.
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 55783a5521a3b1f93ee6a072e414a27c6cfa15f0)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/scsi/virtio-scsi.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index f041991..f7e77e9 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -135,6 +135,7 @@ static size_t qemu_sgl_concat(VirtIOSCSIReq *req, struct iovec *iov,
static int virtio_scsi_parse_req(VirtIOSCSIReq *req,
unsigned req_size, unsigned resp_size)
{
+ VirtIODevice *vdev = (VirtIODevice *) req->dev;
size_t in_size, out_size;
if (iov_to_buf(req->elem.out_sg, req->elem.out_num, 0,
@@ -147,8 +148,24 @@ static int virtio_scsi_parse_req(VirtIOSCSIReq *req,
resp_size) < resp_size) {
return -EINVAL;
}
+
req->resp_size = resp_size;
+ /* Old BIOSes left some padding by mistake after the req_size/resp_size.
+ * As a workaround, always consider the first buffer as the virtio-scsi
+ * request/response, making the payload start at the second element
+ * of the iovec.
+ *
+ * The actual length of the response header, stored in req->resp_size,
+ * does not change.
+ *
+ * TODO: always disable this workaround for virtio 1.0 devices.
+ */
+ if ((vdev->guest_features & VIRTIO_F_ANY_LAYOUT) == 0) {
+ req_size = req->elem.out_sg[0].iov_len;
+ resp_size = req->elem.in_sg[0].iov_len;
+ }
+
out_size = qemu_sgl_concat(req, req->elem.out_sg,
&req->elem.out_addr[0], req->elem.out_num,
req_size);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 61/88] libcacard: fix resource leak
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (59 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 60/88] virtio-scsi: work around bug in old BIOSes Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 62/88] l2tpv3: fix possible double free Michael Roth
` (28 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: zhanghailiang <zhang.zhanghailiang@huawei.com>
In function connect_to_qemu(), getaddrinfo() will allocate memory
that is stored into server, it should be freed by using freeaddrinfo()
before connect_to_qemu() return.
Cc: qemu-stable@nongnu.org
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 5bbebf622897a59db5da4c468e737bfec4d71280)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
libcacard/vscclient.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/libcacard/vscclient.c b/libcacard/vscclient.c
index 80111df..fa6041d 100644
--- a/libcacard/vscclient.c
+++ b/libcacard/vscclient.c
@@ -597,7 +597,7 @@ connect_to_qemu(
const char *port
) {
struct addrinfo hints;
- struct addrinfo *server;
+ struct addrinfo *server = NULL;
int ret, sock;
sock = socket(AF_INET, SOCK_STREAM, 0);
@@ -629,9 +629,14 @@ connect_to_qemu(
if (verbose) {
printf("Connected (sizeof Header=%zd)!\n", sizeof(VSCMsgHeader));
}
+
+ freeaddrinfo(server);
return sock;
cleanup_socket:
+ if (server) {
+ freeaddrinfo(server);
+ }
closesocket(sock);
return -1;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 62/88] l2tpv3: fix possible double free
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (60 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 61/88] libcacard: fix resource leak Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 63/88] exec: Handle multipage ranges in invalidate_and_set_dirty() Michael Roth
` (27 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: zhanghailiang <zhang.zhanghailiang@huawei.com>
freeaddrinfo(result) does not assign result = NULL, after frees it.
There will be a double free when it goes error case.
It is reported by covertiy.
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 77374582ab961af2c5e702f767f52179d5f7676c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
net/l2tpv3.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 528d95b..65db5ef 100644
--- a/net/l2tpv3.c
+++ b/net/l2tpv3.c
@@ -660,7 +660,6 @@ int net_init_l2tpv3(const NetClientOptions *opts,
if (fd == -1) {
fd = -errno;
error_report("l2tpv3_open : socket creation failed, errno = %d", -fd);
- freeaddrinfo(result);
goto outerr;
}
if (bind(fd, (struct sockaddr *) result->ai_addr, result->ai_addrlen)) {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 63/88] exec: Handle multipage ranges in invalidate_and_set_dirty()
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (61 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 62/88] l2tpv3: fix possible double free Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 64/88] hw/ide/core.c: Prevent SIGSEGV during migration Michael Roth
` (26 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Peter Maydell <peter.maydell@linaro.org>
The code in invalidate_and_set_dirty() needs to handle addr/length
combinations which cross guest physical page boundaries. This can happen,
for example, when disk I/O reads large blocks into guest RAM which previously
held code that we have cached translations for. Unfortunately we were only
checking the clean/dirty status of the first page in the range, and then
were calling a tb_invalidate function which only handles ranges that don't
cross page boundaries. Fix the function to deal with multipage ranges.
The symptoms of this bug were that guest code would misbehave (eg segfault),
in particular after a guest reboot but potentially any time the guest
reused a page of its physical RAM for new code.
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-id: 1416167061-13203-1-git-send-email-peter.maydell@linaro.org
(cherry picked from commit f874bf905ff2f8dcc17acbfc61e49a92a6f4d04b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
exec.c | 6 ++----
include/exec/ram_addr.h | 25 +++++++++++++++++++++++++
2 files changed, 27 insertions(+), 4 deletions(-)
diff --git a/exec.c b/exec.c
index a7d7daa..bfee04a 100644
--- a/exec.c
+++ b/exec.c
@@ -2009,10 +2009,8 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
static void invalidate_and_set_dirty(hwaddr addr,
hwaddr length)
{
- if (cpu_physical_memory_is_clean(addr)) {
- /* invalidate code */
- tb_invalidate_phys_page_range(addr, addr + length, 0);
- /* set dirty bit */
+ if (cpu_physical_memory_range_includes_clean(addr, length)) {
+ tb_invalidate_phys_range(addr, addr + length, 0);
cpu_physical_memory_set_dirty_range_nocode(addr, length);
}
xen_modified_memory(addr, length);
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index 6593be1..e50e71c 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -49,6 +49,21 @@ static inline bool cpu_physical_memory_get_dirty(ram_addr_t start,
return next < end;
}
+static inline bool cpu_physical_memory_get_clean(ram_addr_t start,
+ ram_addr_t length,
+ unsigned client)
+{
+ unsigned long end, page, next;
+
+ assert(client < DIRTY_MEMORY_NUM);
+
+ end = TARGET_PAGE_ALIGN(start + length) >> TARGET_PAGE_BITS;
+ page = start >> TARGET_PAGE_BITS;
+ next = find_next_zero_bit(ram_list.dirty_memory[client], end, page);
+
+ return next < end;
+}
+
static inline bool cpu_physical_memory_get_dirty_flag(ram_addr_t addr,
unsigned client)
{
@@ -64,6 +79,16 @@ static inline bool cpu_physical_memory_is_clean(ram_addr_t addr)
return !(vga && code && migration);
}
+static inline bool cpu_physical_memory_range_includes_clean(ram_addr_t start,
+ ram_addr_t length)
+{
+ bool vga = cpu_physical_memory_get_clean(start, length, DIRTY_MEMORY_VGA);
+ bool code = cpu_physical_memory_get_clean(start, length, DIRTY_MEMORY_CODE);
+ bool migration =
+ cpu_physical_memory_get_clean(start, length, DIRTY_MEMORY_MIGRATION);
+ return vga || code || migration;
+}
+
static inline void cpu_physical_memory_set_dirty_flag(ram_addr_t addr,
unsigned client)
{
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 64/88] hw/ide/core.c: Prevent SIGSEGV during migration
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (62 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 63/88] exec: Handle multipage ranges in invalidate_and_set_dirty() Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 65/88] virtio-net: fix unmap leak Michael Roth
` (25 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Don Slutz <dslutz@verizon.com>
The other callers to blk_set_enable_write_cache() in this file
already check for s->blk == NULL.
Signed-off-by: Don Slutz <dslutz@verizon.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1416259239-13281-1-git-send-email-dslutz@verizon.com
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 6b896ab261942f441a16836e3fa3c83f3f4488b9)
Conflicts:
hw/ide/core.c
*removed dependency on 4be746345
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/ide/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/ide/core.c b/hw/ide/core.c
index 7256592..fa4cafa 100644
--- a/hw/ide/core.c
+++ b/hw/ide/core.c
@@ -2299,7 +2299,7 @@ static int ide_drive_post_load(void *opaque, int version_id)
{
IDEState *s = opaque;
- if (s->identify_set) {
+ if (s->bs && s->identify_set) {
bdrv_set_enable_write_cache(s->bs, !!(s->identify_data[85] & (1 << 5)));
}
return 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 65/88] virtio-net: fix unmap leak
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (63 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 64/88] hw/ide/core.c: Prevent SIGSEGV during migration Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 66/88] block: Make essential BlockDriver objects public Michael Roth
` (24 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Jason Wang <jasowang@redhat.com>
virtio_net_handle_ctrl() and other functions that process control vq
request call iov_discard_front() which will shorten the iov. This will
lead unmapping in virtqueue_push() leaks mapping.
Fixes this by keeping the original iov untouched and using a temp variable
in those functions.
Cc: Wen Congyang <wency@cn.fujitsu.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-id: 1417082643-23907-1-git-send-email-jasowang@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 771b6ed37e3aa188a7485560b949a41c6cf174dc)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/net/virtio-net.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 2040eac..6360374 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -798,7 +798,7 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
virtio_net_ctrl_ack status = VIRTIO_NET_ERR;
VirtQueueElement elem;
size_t s;
- struct iovec *iov;
+ struct iovec *iov, *iov2;
unsigned int iov_cnt;
while (virtqueue_pop(vq, &elem)) {
@@ -808,8 +808,8 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
exit(1);
}
- iov = elem.out_sg;
iov_cnt = elem.out_num;
+ iov2 = iov = g_memdup(elem.out_sg, sizeof(struct iovec) * elem.out_num);
s = iov_to_buf(iov, iov_cnt, 0, &ctrl, sizeof(ctrl));
iov_discard_front(&iov, &iov_cnt, sizeof(ctrl));
if (s != sizeof(ctrl)) {
@@ -833,6 +833,7 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq)
virtqueue_push(vq, &elem, sizeof(status));
virtio_notify(vdev, vq);
+ g_free(iov2);
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 66/88] block: Make essential BlockDriver objects public
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (64 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 65/88] virtio-net: fix unmap leak Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 67/88] block: Omit bdrv_find_format for essential drivers Michael Roth
` (23 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
There are some block drivers which are essential to QEMU and may not be
removed: These are raw, file and qcow2 (as the default non-raw format).
Make their BlockDriver objects public so they can be directly referenced
throughout the block layer without needing to call bdrv_find_format()
and having to deal with an error at runtime, while the real problem
occurred during linking (where raw, file or qcow2 were not linked into
qemu).
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 5f535a941e52229d81e55603eb69b2bd449b937a)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/qcow2.c | 2 +-
block/raw-posix.c | 2 +-
block/raw-win32.c | 2 +-
block/raw_bsd.c | 2 +-
include/block/block_int.h | 8 ++++++++
5 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 1e3ab6b..2695e2b 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2404,7 +2404,7 @@ static QemuOptsList qcow2_create_opts = {
}
};
-static BlockDriver bdrv_qcow2 = {
+BlockDriver bdrv_qcow2 = {
.format_name = "qcow2",
.instance_size = sizeof(BDRVQcowState),
.bdrv_probe = qcow2_probe,
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 87fc170..2d51f26 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -1585,7 +1585,7 @@ static QemuOptsList raw_create_opts = {
}
};
-static BlockDriver bdrv_file = {
+BlockDriver bdrv_file = {
.format_name = "file",
.protocol_name = "file",
.instance_size = sizeof(BDRVRawState),
diff --git a/block/raw-win32.c b/block/raw-win32.c
index 902eab6..0f24dd8 100644
--- a/block/raw-win32.c
+++ b/block/raw-win32.c
@@ -540,7 +540,7 @@ static QemuOptsList raw_create_opts = {
}
};
-static BlockDriver bdrv_file = {
+BlockDriver bdrv_file = {
.format_name = "file",
.protocol_name = "file",
.instance_size = sizeof(BDRVRawState),
diff --git a/block/raw_bsd.c b/block/raw_bsd.c
index f82f4c2..431af8f 100644
--- a/block/raw_bsd.c
+++ b/block/raw_bsd.c
@@ -173,7 +173,7 @@ static int raw_probe(const uint8_t *buf, int buf_size, const char *filename)
return 1;
}
-static BlockDriver bdrv_raw = {
+BlockDriver bdrv_raw = {
.format_name = "raw",
.bdrv_probe = &raw_probe,
.bdrv_reopen_prepare = &raw_reopen_prepare,
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 7b541a0..21b8718 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -395,6 +395,14 @@ struct BlockDriverState {
Error *backing_blocker;
};
+
+/* Essential block drivers which must always be statically linked into qemu, and
+ * which therefore can be accessed without using bdrv_find_format() */
+extern BlockDriver bdrv_file;
+extern BlockDriver bdrv_raw;
+extern BlockDriver bdrv_qcow2;
+
+
int get_tmp_filename(char *filename, int size);
void bdrv_set_io_limits(BlockDriverState *bs,
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 67/88] block: Omit bdrv_find_format for essential drivers
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (65 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 66/88] block: Make essential BlockDriver objects public Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 68/88] block/vvfat: qcow driver may not be found Michael Roth
` (22 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
We can always assume raw, file and qcow2 being available; so do not use
bdrv_find_format() to locate their BlockDriver objects but statically
reference the respective objects.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit ef8104378c4a0497be079e48ee5ac5a89c68f978)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block.c | 17 +++++------------
block/qcow2.c | 7 +++----
2 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/block.c b/block.c
index 8cf519b..f8b36a6 100644
--- a/block.c
+++ b/block.c
@@ -633,7 +633,7 @@ BlockDriver *bdrv_find_protocol(const char *filename,
}
if (!path_has_protocol(filename) || !allow_protocol_prefix) {
- return bdrv_find_format("file");
+ return &bdrv_file;
}
p = strchr(filename, ':');
@@ -662,12 +662,7 @@ static int find_image_format(BlockDriverState *bs, const char *filename,
/* Return the raw BlockDriver * to scsi-generic devices or empty drives */
if (bs->sg || !bdrv_is_inserted(bs) || bdrv_getlength(bs) == 0) {
- drv = bdrv_find_format("raw");
- if (!drv) {
- error_setg(errp, "Could not find raw image format");
- ret = -ENOENT;
- }
- *pdrv = drv;
+ *pdrv = &bdrv_raw;
return ret;
}
@@ -1296,7 +1291,6 @@ int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp)
/* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
char *tmp_filename = g_malloc0(PATH_MAX + 1);
int64_t total_size;
- BlockDriver *bdrv_qcow2;
QemuOpts *opts = NULL;
QDict *snapshot_options;
BlockDriverState *bs_snapshot;
@@ -1322,11 +1316,10 @@ int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp)
goto out;
}
- bdrv_qcow2 = bdrv_find_format("qcow2");
- opts = qemu_opts_create(bdrv_qcow2->create_opts, NULL, 0,
+ opts = qemu_opts_create(bdrv_qcow2.create_opts, NULL, 0,
&error_abort);
qemu_opt_set_number(opts, BLOCK_OPT_SIZE, total_size);
- ret = bdrv_create(bdrv_qcow2, tmp_filename, opts, &local_err);
+ ret = bdrv_create(&bdrv_qcow2, tmp_filename, opts, &local_err);
qemu_opts_del(opts);
if (ret < 0) {
error_setg_errno(errp, -ret, "Could not create temporary overlay "
@@ -1346,7 +1339,7 @@ int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp)
bs_snapshot = bdrv_new("", &error_abort);
ret = bdrv_open(&bs_snapshot, NULL, NULL, snapshot_options,
- flags, bdrv_qcow2, &local_err);
+ flags, &bdrv_qcow2, &local_err);
if (ret < 0) {
error_propagate(errp, local_err);
goto out;
diff --git a/block/qcow2.c b/block/qcow2.c
index 2695e2b..68b0191 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1712,10 +1712,9 @@ static int qcow2_create2(const char *filename, int64_t total_size,
* refcount of the cluster that is occupied by the header and the refcount
* table)
*/
- BlockDriver* drv = bdrv_find_format("qcow2");
- assert(drv != NULL);
ret = bdrv_open(&bs, filename, NULL, NULL,
- BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH, drv, &local_err);
+ BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_NO_FLUSH,
+ &bdrv_qcow2, &local_err);
if (ret < 0) {
error_propagate(errp, local_err);
goto out;
@@ -1767,7 +1766,7 @@ static int qcow2_create2(const char *filename, int64_t total_size,
/* Reopen the image without BDRV_O_NO_FLUSH to flush it before returning */
ret = bdrv_open(&bs, filename, NULL, NULL,
BDRV_O_RDWR | BDRV_O_CACHE_WB | BDRV_O_NO_BACKING,
- drv, &local_err);
+ &bdrv_qcow2, &local_err);
if (local_err) {
error_propagate(errp, local_err);
goto out;
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 68/88] block/vvfat: qcow driver may not be found
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (66 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 67/88] block: Omit bdrv_find_format for essential drivers Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 69/88] block/nfs: Add create_opts Michael Roth
` (21 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
Although virtually impossible right now, bdrv_find_format("qcow") may
fail. The vvfat block driver should heed that case.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 1bcb15cf776a57e8963072c1919a59a90aea8e94)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/vvfat.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/block/vvfat.c b/block/vvfat.c
index 70176b1..1de8808 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2926,6 +2926,12 @@ static int enable_write_target(BDRVVVFATState *s, Error **errp)
}
bdrv_qcow = bdrv_find_format("qcow");
+ if (!bdrv_qcow) {
+ error_setg(errp, "Failed to locate qcow driver");
+ ret = -ENOENT;
+ goto err;
+ }
+
opts = qemu_opts_create(bdrv_qcow->create_opts, NULL, 0, &error_abort);
qemu_opt_set_number(opts, BLOCK_OPT_SIZE, s->sector_count * 512);
qemu_opt_set(opts, BLOCK_OPT_BACKING_FILE, "fat:");
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 69/88] block/nfs: Add create_opts
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (67 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 68/88] block/vvfat: qcow driver may not be found Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 70/88] block: Check create_opts before image creation Michael Roth
` (20 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
The nfs protocol driver is capable of creating images, but did not
specify any creation options. Fix it.
A way to test this issue is the following:
$ qemu-img create -f nfs nfs://127.0.0.1/foo.qcow2 64M
Without this patch, it segfaults. With this patch, it does not. However,
this is not something that should really work; qemu-img should check
whether the parameter for the -f option (and -O for convert) is indeed a
format, and error out if it is not. Therefore, I am not making it an
iotest.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit fd752801ae1cc729359a37f29e32265de6948d37)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/nfs.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/block/nfs.c b/block/nfs.c
index 8439e0d..1bb05ad 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -401,6 +401,19 @@ static int nfs_file_open(BlockDriverState *bs, QDict *options, int flags,
return 0;
}
+static QemuOptsList nfs_create_opts = {
+ .name = "nfs-create-opts",
+ .head = QTAILQ_HEAD_INITIALIZER(nfs_create_opts.head),
+ .desc = {
+ {
+ .name = BLOCK_OPT_SIZE,
+ .type = QEMU_OPT_SIZE,
+ .help = "Virtual disk size"
+ },
+ { /* end of list */ }
+ }
+};
+
static int nfs_file_create(const char *url, QemuOpts *opts, Error **errp)
{
int ret = 0;
@@ -461,6 +474,8 @@ static BlockDriver bdrv_nfs = {
.instance_size = sizeof(NFSClient),
.bdrv_needs_filename = true,
+ .create_opts = &nfs_create_opts,
+
.bdrv_has_zero_init = nfs_has_zero_init,
.bdrv_get_allocated_file_size = nfs_get_allocated_file_size,
.bdrv_truncate = nfs_file_truncate,
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 70/88] block: Check create_opts before image creation
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (68 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 69/88] block/nfs: Add create_opts Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 71/88] qemu-img: " Michael Roth
` (19 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
If a driver supports image creation, it needs to set the .create_opts
field. We can use that to make sure .create_opts for both drivers
involved is not NULL in bdrv_img_create(), which is important so that
the create_opts pointer in that function is not NULL after the
qemu_opts_append() calls and when going into qemu_opts_create().
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit c6149724080af7b3d5d61eac8942655e6d212783)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/block.c b/block.c
index f8b36a6..f6c8de4 100644
--- a/block.c
+++ b/block.c
@@ -5528,6 +5528,18 @@ void bdrv_img_create(const char *filename, const char *fmt,
return;
}
+ if (!drv->create_opts) {
+ error_setg(errp, "Format driver '%s' does not support image creation",
+ drv->format_name);
+ return;
+ }
+
+ if (!proto_drv->create_opts) {
+ error_setg(errp, "Protocol driver '%s' does not support image creation",
+ proto_drv->format_name);
+ return;
+ }
+
create_opts = qemu_opts_append(create_opts, drv->create_opts);
create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 71/88] qemu-img: Check create_opts before image creation
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (69 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 70/88] block: Check create_opts before image creation Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 72/88] qemu-img: Check create_opts before image amendment Michael Roth
` (18 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
If a driver supports image creation, it needs to set the .create_opts
field. We can use that to make sure .create_opts for both drivers
involved is not NULL for the target image in qemu-img convert, which is
important so that the create_opts pointer in img_convert() is not NULL
after the qemu_opts_append() calls and when going into
qemu_opts_create().
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit f75613cf2488a37fb8019bc32a06ddbcd477d0ce)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
qemu-img.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/qemu-img.c b/qemu-img.c
index d4518e7..309c14b 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1378,6 +1378,20 @@ static int img_convert(int argc, char **argv)
goto out;
}
+ if (!drv->create_opts) {
+ error_report("Format driver '%s' does not support image creation",
+ drv->format_name);
+ ret = -1;
+ goto out;
+ }
+
+ if (!proto_drv->create_opts) {
+ error_report("Protocol driver '%s' does not support image creation",
+ proto_drv->format_name);
+ ret = -1;
+ goto out;
+ }
+
create_opts = qemu_opts_append(create_opts, drv->create_opts);
create_opts = qemu_opts_append(create_opts, proto_drv->create_opts);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 72/88] qemu-img: Check create_opts before image amendment
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (70 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 71/88] qemu-img: " Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 73/88] iotests: Only kill NBD server if it runs Michael Roth
` (17 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
The image options which can be amended are described by the .create_opts
field for every driver. This field must therefore be non-NULL so that
anything can be amended in the first place. Check that this holds true
before going into qemu_opts_create() (because if .create_opts is NULL,
the create_opts pointer in img_amend() will be NULL after
qemu_opts_append()).
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit b2439d26f078c826e5e06b34d978a6f6d5c7c56f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
qemu-img.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/qemu-img.c b/qemu-img.c
index 309c14b..27ac1fc 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2775,6 +2775,13 @@ static int img_amend(int argc, char **argv)
goto out;
}
+ if (!bs->drv->create_opts) {
+ error_report("Format driver '%s' does not support any options to amend",
+ fmt);
+ ret = -1;
+ goto out;
+ }
+
create_opts = qemu_opts_append(create_opts, bs->drv->create_opts);
opts = qemu_opts_create(create_opts, NULL, 0, &error_abort);
if (options && qemu_opts_do_parse(opts, options, NULL)) {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 73/88] iotests: Only kill NBD server if it runs
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (71 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 72/88] qemu-img: Check create_opts before image amendment Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 74/88] iotests: Add test for unsupported image creation Michael Roth
` (16 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
There may be NBD tests which do not create a sample image and simply
test whether wrong usage of the protocol is rejected as expected. In
this case, there will be no NBD server and trying to kill it during
clean-up will fail.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit f798068c565918ead63218d083ff814b7635be72)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
tests/qemu-iotests/common.rc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index e0ea7e3..e7760a2 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -189,7 +189,9 @@ _cleanup_test_img()
case "$IMGPROTO" in
nbd)
- kill $QEMU_NBD_PID
+ if [ -n "$QEMU_NBD_PID" ]; then
+ kill $QEMU_NBD_PID
+ fi
rm -f "$TEST_IMG_FILE"
;;
file)
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 74/88] iotests: Add test for unsupported image creation
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (72 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 73/88] iotests: Only kill NBD server if it runs Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 75/88] qcow2: Prevent numerical overflow Michael Roth
` (15 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
Add a test for creating and amending images (amendment uses the creation
options) with formats not supporting creation over protocols not
supporting creation.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 2247798d13e5295a097da0a42f9d0d70d88690a4)
Conflicts:
tests/qemu-iotests/group
*removed context dependencies from upstream iotest groups
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
tests/qemu-iotests/113 | 76 ++++++++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/113.out | 15 +++++++++
tests/qemu-iotests/group | 1 +
3 files changed, 92 insertions(+)
create mode 100755 tests/qemu-iotests/113
create mode 100644 tests/qemu-iotests/113.out
diff --git a/tests/qemu-iotests/113 b/tests/qemu-iotests/113
new file mode 100755
index 0000000..a2cd96b
--- /dev/null
+++ b/tests/qemu-iotests/113
@@ -0,0 +1,76 @@
+#!/bin/bash
+#
+# Test case for accessing creation options on image formats and
+# protocols not supporting image creation
+#
+# Copyright (C) 2014 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+
+# creator
+owner=mreitz@redhat.com
+
+seq="$(basename $0)"
+echo "QA output created by $seq"
+
+here="$PWD"
+tmp=/tmp/$$
+status=1 # failure is the default!
+
+_cleanup()
+{
+ _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+# We can only test one format here because we need its sample file
+_supported_fmt bochs
+_supported_proto nbd
+_supported_os Linux
+
+echo
+echo '=== Unsupported image creation in qemu-img create ==='
+echo
+
+$QEMU_IMG create -f $IMGFMT nbd://example.com 2>&1 64M | _filter_imgfmt
+
+echo
+echo '=== Unsupported image creation in qemu-img convert ==='
+echo
+
+# We could use any input image format here, but this is a bochs test, so just
+# use the bochs image
+_use_sample_img empty.bochs.bz2
+$QEMU_IMG convert -f $IMGFMT -O $IMGFMT "$TEST_IMG" nbd://example.com 2>&1 \
+ | _filter_imgfmt
+
+echo
+echo '=== Unsupported format in qemu-img amend ==='
+echo
+
+# The protocol does not matter here
+_use_sample_img empty.bochs.bz2
+$QEMU_IMG amend -f $IMGFMT -o foo=bar "$TEST_IMG" 2>&1 | _filter_imgfmt
+
+
+# success, all done
+echo
+echo '*** done'
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/113.out b/tests/qemu-iotests/113.out
new file mode 100644
index 0000000..00bdfd6
--- /dev/null
+++ b/tests/qemu-iotests/113.out
@@ -0,0 +1,15 @@
+QA output created by 113
+
+=== Unsupported image creation in qemu-img create ===
+
+qemu-img: nbd://example.com: Format driver 'IMGFMT' does not support image creation
+
+=== Unsupported image creation in qemu-img convert ===
+
+qemu-img: Format driver 'IMGFMT' does not support image creation
+
+=== Unsupported format in qemu-img amend ===
+
+qemu-img: Format driver 'IMGFMT' does not support any options to amend
+
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index e25e992..4bb70d7 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -101,3 +101,4 @@
092 rw auto quick
095 rw auto quick
101 rw auto quick
+113 rw auto quick
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 75/88] qcow2: Prevent numerical overflow
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (73 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 74/88] iotests: Add test for unsupported image creation Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 76/88] qcow2: Flushing the caches in qcow2_close may fail Michael Roth
` (14 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
In qcow2_alloc_cluster_offset(), *num is limited to
INT_MAX >> BDRV_SECTOR_BITS by all callers. However, since remaining is
of type uint64_t, we might as well cast *num to that type before
performing the shift.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 11c89769dc3e638ef72915d97058411ddf79b64b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/qcow2-cluster.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 26827a2..769e68d 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -1202,7 +1202,7 @@ int qcow2_alloc_cluster_offset(BlockDriverState *bs, uint64_t offset,
again:
start = offset;
- remaining = *num << BDRV_SECTOR_BITS;
+ remaining = (uint64_t)*num << BDRV_SECTOR_BITS;
cluster_offset = 0;
*host_offset = 0;
cur_bytes = 0;
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 76/88] qcow2: Flushing the caches in qcow2_close may fail
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (74 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 75/88] qcow2: Prevent numerical overflow Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 77/88] qcow2: Respect bdrv_truncate() error Michael Roth
` (13 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
qcow2_cache_flush() may fail; if one of the caches failed to be flushed
successfully to disk in qcow2_close() the image should not be marked
clean, and we should emit a warning.
This breaks the (qcow2-specific) iotests 026, 071 and 089; change their
output accordingly.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 3b5e14c76a6bb142bf250ddf99e24a0ac8c7bc12)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/qcow2.c | 19 +++++--
tests/qemu-iotests/026.out | 120 +++++++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/071.out | 8 +++
tests/qemu-iotests/089.out | 2 +
4 files changed, 146 insertions(+), 3 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 68b0191..e3cc23c 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1275,10 +1275,23 @@ static void qcow2_close(BlockDriverState *bs)
s->l1_table = NULL;
if (!(bs->open_flags & BDRV_O_INCOMING)) {
- qcow2_cache_flush(bs, s->l2_table_cache);
- qcow2_cache_flush(bs, s->refcount_block_cache);
+ int ret1, ret2;
- qcow2_mark_clean(bs);
+ ret1 = qcow2_cache_flush(bs, s->l2_table_cache);
+ ret2 = qcow2_cache_flush(bs, s->refcount_block_cache);
+
+ if (ret1) {
+ error_report("Failed to flush the L2 table cache: %s",
+ strerror(-ret1));
+ }
+ if (ret2) {
+ error_report("Failed to flush the refcount block cache: %s",
+ strerror(-ret2));
+ }
+
+ if (!ret1 && !ret2) {
+ qcow2_mark_clean(bs);
+ }
}
qcow2_cache_destroy(bs, s->l2_table_cache);
diff --git a/tests/qemu-iotests/026.out b/tests/qemu-iotests/026.out
index f7c78e7..ad84ac2 100644
--- a/tests/qemu-iotests/026.out
+++ b/tests/qemu-iotests/026.out
@@ -14,6 +14,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l1_update; errno: 5; imm: off; once: off; write
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
1 leaked clusters were found on the image.
@@ -21,6 +23,8 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l1_update; errno: 5; imm: off; once: off; write -b
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
1 leaked clusters were found on the image.
@@ -38,6 +42,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l1_update; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
1 leaked clusters were found on the image.
@@ -45,6 +51,8 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l1_update; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
1 leaked clusters were found on the image.
@@ -70,7 +78,11 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_load; errno: 5; imm: off; once: off; write
wrote 131072/131072 bytes at offset 0
128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
read failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -78,7 +90,11 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_load; errno: 5; imm: off; once: off; write -b
wrote 131072/131072 bytes at offset 0
128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
read failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -102,7 +118,11 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_load; errno: 28; imm: off; once: off; write
wrote 131072/131072 bytes at offset 0
128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
read failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -110,12 +130,17 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_load; errno: 28; imm: off; once: off; write -b
wrote 131072/131072 bytes at offset 0
128 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
read failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_update; errno: 5; imm: off; once: on; write
+Failed to flush the L2 table cache: Input/output error
write failed: Input/output error
127 leaked clusters were found on the image.
@@ -123,6 +148,7 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_update; errno: 5; imm: off; once: on; write -b
+Failed to flush the L2 table cache: Input/output error
write failed: Input/output error
127 leaked clusters were found on the image.
@@ -130,6 +156,8 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_update; errno: 5; imm: off; once: off; write
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
127 leaked clusters were found on the image.
@@ -137,6 +165,8 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_update; errno: 5; imm: off; once: off; write -b
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
127 leaked clusters were found on the image.
@@ -144,6 +174,7 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_update; errno: 28; imm: off; once: on; write
+Failed to flush the L2 table cache: No space left on device
write failed: No space left on device
127 leaked clusters were found on the image.
@@ -151,6 +182,7 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_update; errno: 28; imm: off; once: on; write -b
+Failed to flush the L2 table cache: No space left on device
write failed: No space left on device
127 leaked clusters were found on the image.
@@ -158,6 +190,8 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_update; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
127 leaked clusters were found on the image.
@@ -165,6 +199,8 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_update; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
127 leaked clusters were found on the image.
@@ -182,11 +218,15 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_alloc.write; errno: 5; imm: off; once: off; write
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_alloc.write; errno: 5; imm: off; once: off; write -b
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
1 leaked clusters were found on the image.
@@ -204,11 +244,15 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_alloc.write; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l2_alloc.write; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
1 leaked clusters were found on the image.
@@ -226,11 +270,15 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: write_aio; errno: 5; imm: off; once: off; write
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: write_aio; errno: 5; imm: off; once: off; write -b
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -246,11 +294,15 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: write_aio; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: write_aio; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -266,11 +318,15 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_load; errno: 5; imm: off; once: off; write
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_load; errno: 5; imm: off; once: off; write -b
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -286,51 +342,67 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_load; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_load; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_update_part; errno: 5; imm: off; once: on; write
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_update_part; errno: 5; imm: off; once: on; write -b
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_update_part; errno: 5; imm: off; once: off; write
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_update_part; errno: 5; imm: off; once: off; write -b
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_update_part; errno: 28; imm: off; once: on; write
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_update_part; errno: 28; imm: off; once: on; write -b
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_update_part; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_update_part; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -346,11 +418,15 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc; errno: 5; imm: off; once: off; write
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc; errno: 5; imm: off; once: off; write -b
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -366,11 +442,15 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -386,11 +466,15 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: cluster_alloc; errno: 5; imm: off; once: off; write
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: cluster_alloc; errno: 5; imm: off; once: off; write -b
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -406,11 +490,15 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: cluster_alloc; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: cluster_alloc; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
@@ -429,6 +517,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc.hookup; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
55 leaked clusters were found on the image.
@@ -436,6 +526,8 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc.hookup; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
251 leaked clusters were found on the image.
@@ -453,11 +545,15 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc.write; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc.write; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -473,6 +569,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc.write_blocks; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
11 leaked clusters were found on the image.
@@ -480,6 +578,8 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc.write_blocks; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
23 leaked clusters were found on the image.
@@ -497,6 +597,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc.write_table; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
11 leaked clusters were found on the image.
@@ -504,6 +606,8 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc.write_table; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
23 leaked clusters were found on the image.
@@ -521,6 +625,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc.switch_table; errno: 28; imm: off; once: off; write
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
11 leaked clusters were found on the image.
@@ -528,6 +634,8 @@ This means waste of disk space, but no harm to data.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: refblock_alloc.switch_table; errno: 28; imm: off; once: off; write -b
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
23 leaked clusters were found on the image.
@@ -543,6 +651,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l1_grow.alloc_table; errno: 5; imm: off; once: off
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -553,6 +663,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l1_grow.alloc_table; errno: 28; imm: off; once: off
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -563,6 +675,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l1_grow.write_table; errno: 5; imm: off; once: off
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -573,6 +687,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l1_grow.write_table; errno: 28; imm: off; once: off
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
@@ -583,6 +699,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l1_grow.activate_table; errno: 5; imm: off; once: off
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
write failed: Input/output error
96 leaked clusters were found on the image.
@@ -595,6 +713,8 @@ No errors were found on the image.
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824
Event: l1_grow.activate_table; errno: 28; imm: off; once: off
+Failed to flush the L2 table cache: No space left on device
+Failed to flush the refcount block cache: No space left on device
write failed: No space left on device
96 leaked clusters were found on the image.
diff --git a/tests/qemu-iotests/071.out b/tests/qemu-iotests/071.out
index 5f840a9..0624581 100644
--- a/tests/qemu-iotests/071.out
+++ b/tests/qemu-iotests/071.out
@@ -30,10 +30,14 @@ blkverify: read sector_num=0 nb_sectors=4 contents mismatch in sector 0
=== Testing blkdebug through filename ===
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
read failed: Input/output error
=== Testing blkdebug through file blockref ===
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
read failed: Input/output error
=== Testing blkdebug on existing block device ===
@@ -48,6 +52,8 @@ read failed: Input/output error
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
+qemu-system-x86_64: Failed to flush the L2 table cache: Input/output error
+qemu-system-x86_64: Failed to flush the refcount block cache: Input/output error
=== Testing blkverify on existing block device ===
@@ -86,5 +92,7 @@ read failed: Input/output error
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
+qemu-system-x86_64: Failed to flush the L2 table cache: Input/output error
+qemu-system-x86_64: Failed to flush the refcount block cache: Input/output error
*** done
diff --git a/tests/qemu-iotests/089.out b/tests/qemu-iotests/089.out
index 4ca2f88..ab06c55 100644
--- a/tests/qemu-iotests/089.out
+++ b/tests/qemu-iotests/089.out
@@ -24,6 +24,8 @@ read 512/512 bytes at offset 0
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
wrote 512/512 bytes at offset 229376
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+Failed to flush the L2 table cache: Input/output error
+Failed to flush the refcount block cache: Input/output error
read failed: Input/output error
=== Testing qemu-img info output ===
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 77/88] qcow2: Respect bdrv_truncate() error
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (75 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 76/88] qcow2: Flushing the caches in qcow2_close may fail Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 78/88] block/raw-posix: Fix ret in raw_open_common() Michael Roth
` (12 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
bdrv_truncate() may fail and qcow2_write_compressed() should return the
error code in that case.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 6a69b9620ac1562a067990d87284a85552bfd61b)
Conflicts:
block/qcow2.c
*removed context dependency on 75d3d21
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/qcow2.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index e3cc23c..d53f181 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1960,8 +1960,7 @@ static int qcow2_write_compressed(BlockDriverState *bs, int64_t sector_num,
sector based I/Os */
cluster_offset = bdrv_getlength(bs->file);
cluster_offset = (cluster_offset + 511) & ~511;
- bdrv_truncate(bs->file, cluster_offset);
- return 0;
+ return bdrv_truncate(bs->file, cluster_offset);
}
if (nb_sectors != s->cluster_sectors) {
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 78/88] block/raw-posix: Fix ret in raw_open_common()
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (76 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 77/88] qcow2: Respect bdrv_truncate() error Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 79/88] block migration: fix return value Michael Roth
` (11 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Reitz <mreitz@redhat.com>
The return value must be negative on error; there is one place in
raw_open_common() where errp is set, but ret remains 0. Fix it.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 01212d4ed68fc8daa29062a9a38650cf8febe392)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/raw-posix.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 2d51f26..efa5686 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -447,6 +447,7 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
s->has_write_zeroes = true;
if (fstat(s->fd, &st) < 0) {
+ ret = -errno;
error_setg_errno(errp, errno, "Could not stat file");
goto fail;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 79/88] block migration: fix return value
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (77 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 78/88] block/raw-posix: Fix ret in raw_open_common() Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 80/88] qcow2: Fix header extension size check Michael Roth
` (10 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Gary R Hook <gary.hook@nimboxx.com>
Modify block_save_iterate() to return positive/zero/negative
(success/not done/failure) return status. The computation of
the blocks transferred (an int64_t) exceeds the size of an
int return value.
Signed-off-by: Gary R Hook <gary.hook@nimboxx.com>
Reviewed-by: ChenLiang <chenliang88@huawei.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-id: 1416958202-15913-1-git-send-email-gary.hook@nimboxx.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit ebd9fbd7e102c533143c2c8372312b75c2b2678a)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block-migration.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/block-migration.c b/block-migration.c
index 73cdd07..2bb98d8 100644
--- a/block-migration.c
+++ b/block-migration.c
@@ -652,6 +652,7 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
{
int ret;
int64_t last_ftell = qemu_ftell(f);
+ int64_t delta_ftell;
DPRINTF("Enter save live iterate submitted %d transferred %d\n",
block_mig_state.submitted, block_mig_state.transferred);
@@ -701,7 +702,14 @@ static int block_save_iterate(QEMUFile *f, void *opaque)
}
qemu_put_be64(f, BLK_MIG_FLAG_EOS);
- return qemu_ftell(f) - last_ftell;
+ delta_ftell = qemu_ftell(f) - last_ftell;
+ if (delta_ftell > 0) {
+ return 1;
+ } else if (delta_ftell < 0) {
+ return -1;
+ } else {
+ return 0;
+ }
}
/* Called with iothread lock taken. */
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 80/88] qcow2: Fix header extension size check
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (78 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 79/88] block migration: fix return value Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 81/88] qcow2.py: Add required padding for header extensions Michael Roth
` (9 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Kevin Wolf <kwolf@redhat.com>
After reading the extension header, offset is incremented, but not
checked against end_offset any more. This way an integer overflow could
happen when checking whether the extension end is within the allowed
range, effectively disabling the check.
This patch adds the missing check and a test case for it.
Cc: qemu-stable@nongnu.org
Reported-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1416935562-7760-2-git-send-email-kwolf@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 2ebafc854d109ff09b66fb4dd62c2c53fc29754a)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block/qcow2.c | 2 +-
tests/qemu-iotests/080 | 2 ++
tests/qemu-iotests/080.out | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index d53f181..ea6d3f2 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -114,7 +114,7 @@ static int qcow2_read_extensions(BlockDriverState *bs, uint64_t start_offset,
#ifdef DEBUG_EXT
printf("ext.magic = 0x%x\n", ext.magic);
#endif
- if (ext.len > end_offset - offset) {
+ if (offset > end_offset || ext.len > end_offset - offset) {
error_setg(errp, "Header extension too large");
return -EINVAL;
}
diff --git a/tests/qemu-iotests/080 b/tests/qemu-iotests/080
index 6b3a3e7..b9f9630 100755
--- a/tests/qemu-iotests/080
+++ b/tests/qemu-iotests/080
@@ -78,6 +78,8 @@ poke_file "$TEST_IMG" "$offset_backing_file_offset" "\xff\xff\xff\xff\xff\xff\xf
poke_file "$TEST_IMG" "$offset_ext_magic" "\x12\x34\x56\x78"
poke_file "$TEST_IMG" "$offset_ext_size" "\x7f\xff\xff\xff"
{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
+poke_file "$TEST_IMG" "$offset_backing_file_offset" "\x00\x00\x00\x00\x00\x00\x00\x$(printf %x $offset_ext_size)"
+{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
poke_file "$TEST_IMG" "$offset_backing_file_offset" "\x00\x00\x00\x00\x00\x00\x00\x00"
{ $QEMU_IO -c "read 0 512" $TEST_IMG; } 2>&1 | _filter_qemu_io | _filter_testdir
diff --git a/tests/qemu-iotests/080.out b/tests/qemu-iotests/080.out
index f7a943c..33d1f71 100644
--- a/tests/qemu-iotests/080.out
+++ b/tests/qemu-iotests/080.out
@@ -13,6 +13,8 @@ qemu-io: can't open device TEST_DIR/t.qcow2: Invalid backing file offset
no file open, try 'help open'
qemu-io: can't open device TEST_DIR/t.qcow2: Header extension too large
no file open, try 'help open'
+qemu-io: can't open device TEST_DIR/t.qcow2: Header extension too large
+no file open, try 'help open'
== Huge refcount table size ==
Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 81/88] qcow2.py: Add required padding for header extensions
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (79 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 80/88] qcow2: Fix header extension size check Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 82/88] block: Don't probe for unknown backing file format Michael Roth
` (8 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Kevin Wolf <kwolf@redhat.com>
The qcow2 specification requires that the header extension data be
padded to round up the extension size to the next multiple of 8 bytes.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1416935562-7760-3-git-send-email-kwolf@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 8884dd1bbc5ce42cd657ffcbef3a477443468974)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
(cherry picked from commit a163ac3f57b5baa117158f7c0488d276ba3377e2)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
tests/qemu-iotests/qcow2.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/qemu-iotests/qcow2.py b/tests/qemu-iotests/qcow2.py
index 2058596..9cc4cf7 100755
--- a/tests/qemu-iotests/qcow2.py
+++ b/tests/qemu-iotests/qcow2.py
@@ -7,6 +7,10 @@ import string
class QcowHeaderExtension:
def __init__(self, magic, length, data):
+ if length % 8 != 0:
+ padding = 8 - (length % 8)
+ data += "\0" * padding
+
self.magic = magic
self.length = length
self.data = data
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 82/88] block: Don't probe for unknown backing file format
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (80 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 81/88] qcow2.py: Add required padding for header extensions Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 83/88] linuxboot: compute initrd loading address Michael Roth
` (7 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Kevin Wolf <kwolf@redhat.com>
If a qcow2 image specifies a backing file format that doesn't correspond
to any format driver that qemu knows, we shouldn't fall back to probing,
but simply error out.
Not looking up the backing file driver in bdrv_open_backing_file(), but
just filling in the "driver" option if it isn't there moves us closer to
the goal of having everything in QDict options and gets us the error
handling of bdrv_open(), which correctly refuses unknown drivers.
Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 1416935562-7760-4-git-send-email-kwolf@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit c5f6e493bb5339d244eae5d3f21c5b6d73996739)
Conflicts:
tests/qemu-iotests/group
*removed context from upstream iotest groups
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
block.c | 7 +++---
tests/qemu-iotests/114 | 61 ++++++++++++++++++++++++++++++++++++++++++++++
tests/qemu-iotests/114.out | 13 ++++++++++
tests/qemu-iotests/group | 1 +
4 files changed, 78 insertions(+), 4 deletions(-)
create mode 100755 tests/qemu-iotests/114
create mode 100644 tests/qemu-iotests/114.out
diff --git a/block.c b/block.c
index f6c8de4..ed87b7e 100644
--- a/block.c
+++ b/block.c
@@ -1177,7 +1177,6 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
{
char *backing_filename = g_malloc0(PATH_MAX);
int ret = 0;
- BlockDriver *back_drv = NULL;
BlockDriverState *backing_hd;
Error *local_err = NULL;
@@ -1210,14 +1209,14 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *options, Error **errp)
backing_hd = bdrv_new("", errp);
- if (bs->backing_format[0] != '\0') {
- back_drv = bdrv_find_format(bs->backing_format);
+ if (bs->backing_format[0] != '\0' && !qdict_haskey(options, "driver")) {
+ qdict_put(options, "driver", qstring_from_str(bs->backing_format));
}
assert(bs->backing_hd == NULL);
ret = bdrv_open(&backing_hd,
*backing_filename ? backing_filename : NULL, NULL, options,
- bdrv_backing_flags(bs->open_flags), back_drv, &local_err);
+ bdrv_backing_flags(bs->open_flags), NULL, &local_err);
if (ret < 0) {
bdrv_unref(backing_hd);
backing_hd = NULL;
diff --git a/tests/qemu-iotests/114 b/tests/qemu-iotests/114
new file mode 100755
index 0000000..d02e7ff
--- /dev/null
+++ b/tests/qemu-iotests/114
@@ -0,0 +1,61 @@
+#!/bin/bash
+#
+# Test invalid backing file format in qcow2 images
+#
+# Copyright (C) 2014 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+
+# creator
+owner=kwolf@redhat.com
+
+seq="$(basename $0)"
+echo "QA output created by $seq"
+
+here="$PWD"
+tmp=/tmp/$$
+status=1 # failure is the default!
+
+_cleanup()
+{
+ _cleanup_test_img
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+
+_supported_fmt qcow2
+_supported_proto generic
+_supported_os Linux
+
+
+TEST_IMG="$TEST_IMG.base" _make_test_img 64M
+_make_test_img -b "$TEST_IMG.base" 64M
+
+# Set an invalid backing file format
+$PYTHON qcow2.py "$TEST_IMG" add-header-ext 0xE2792ACA "foo"
+_img_info
+
+# Try opening the image. Should fail (and not probe) in the first case, but
+# overriding the backing file format should be possible.
+$QEMU_IO -c "open $TEST_IMG" -c "read 0 4k" 2>&1 | _filter_qemu_io | _filter_testdir
+$QEMU_IO -c "open -o backing.driver=$IMGFMT $TEST_IMG" -c "read 0 4k" | _filter_qemu_io
+
+# success, all done
+echo '*** done'
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/114.out b/tests/qemu-iotests/114.out
new file mode 100644
index 0000000..6c6b210
--- /dev/null
+++ b/tests/qemu-iotests/114.out
@@ -0,0 +1,13 @@
+QA output created by 114
+Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file='TEST_DIR/t.IMGFMT.base'
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
+virtual size: 64M (67108864 bytes)
+cluster_size: 65536
+backing file: TEST_DIR/t.IMGFMT.base
+backing file format: foo
+qemu-io: can't open device TEST_DIR/t.qcow2: Could not open backing file: Unknown driver 'foo'
+read 4096/4096 bytes at offset 0
+4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 4bb70d7..97026f3 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -102,3 +102,4 @@
095 rw auto quick
101 rw auto quick
113 rw auto quick
+114 rw auto quick
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 83/88] linuxboot: compute initrd loading address
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (81 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 82/88] block: Don't probe for unknown backing file format Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 84/88] linuxboot: fix loading old kernels Michael Roth
` (6 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Paolo Bonzini <pbonzini@redhat.com>
Even though hw/i386/pc.c tries to compute a valid loading address for the
initrd, close to the top of RAM, this does not take into account other
data that is malloced into that memory by SeaBIOS.
Luckily we can easily look at the memory map to find out how much memory is
used up there. This patch places the initrd in the first four gigabytes,
below the first hole (as returned by INT 15h, AX=e801h).
Without this patch:
[ 0.000000] init_memory_mapping: [mem 0x07000000-0x07fdffff]
[ 0.000000] RAMDISK: [mem 0x0710a000-0x07fd7fff]
With this patch:
[ 0.000000] init_memory_mapping: [mem 0x07000000-0x07fdffff]
[ 0.000000] RAMDISK: [mem 0x07112000-0x07fdffff]
So linuxboot is able to use the 64k that were added as padding for
QEMU <= 2.1.
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit cdebec5e40bd0af82da0659f37af85ee2aa2c9d1)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
pc-bios/linuxboot.bin | Bin 1024 -> 1024 bytes
pc-bios/optionrom/linuxboot.S | 47 ++++++++++++++++++++++++++++++++++++++----
pc-bios/optionrom/optionrom.h | 21 ++++++++++++++++---
3 files changed, 61 insertions(+), 7 deletions(-)
diff --git a/pc-bios/linuxboot.bin b/pc-bios/linuxboot.bin
index e7c36694f997c3c34f7f4af3c2923bd2ef6094e7..130103fb739228a6869aaf1b174b9d20c13378fc 100644
GIT binary patch
delta 168
zcmZqRXyBNj#e9V6<V4+-#yc2a7@jn|bXJt}WGM&drBas8gPpg4G+*OE29`Ab?LX5F
zKIeMP(|Cx15y<-m<Oxh}WRz3ZJf7D0oZ-X&|7o31)0*E19C!O5&XCq~0;uRf+QA1b
zX{>7|eo$aa3kRw;nk>i|IC(Q;0c%?4;T_@=t7IoTF$qbirKj~bOE57or0rk;0)C|f
SJtz7Oyqvi?nJI*kF&F^X7ev$m
delta 107
zcmZqRXyBNj#azSGI8k@yWCKP?#+1okj0#LU*e5$O$xYtNXvD|`VlnOD22!$<yBUQi
zzh^99+93|&DjwV+!H~8~fR%ya{VqY)Kk1)y(snQa0l(6Lo)disUOwEsnkj^F@&_gl
G#(w~}wj;0r
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
index 748c831..5bc0af0 100644
--- a/pc-bios/optionrom/linuxboot.S
+++ b/pc-bios/optionrom/linuxboot.S
@@ -76,14 +76,45 @@ boot_kernel:
copy_kernel:
+ /* Compute initrd address */
+ mov $0xe801, %ax
+ xor %cx, %cx
+ xor %dx, %dx
+ int $0x15
+
+ /* Output could be in AX/BX or CX/DX */
+ or %cx, %cx
+ jnz 1f
+ or %dx, %dx
+ jnz 1f
+ mov %ax, %cx
+ mov %bx, %dx
+1:
+
+ or %dx, %dx
+ jnz 2f
+ addw $1024, %cx /* add 1 MB */
+ movzwl %cx, %edi
+ shll $10, %edi /* convert to bytes */
+ jmp 3f
+
+2:
+ addw $16777216 >> 16, %dx /* add 16 MB */
+ movzwl %dx, %edi
+ shll $16, %edi /* convert to bytes */
+
+3:
+ read_fw FW_CFG_INITRD_SIZE
+ subl %eax, %edi
+ andl $-4096, %edi /* EDI = start of initrd */
/* We need to load the kernel into memory we can't access in 16 bit
mode, so let's get into 32 bit mode, write the kernel and jump
back again. */
/* Reserve space on the stack for our GDT descriptor. */
- mov %esp, %ebp
- sub $16, %esp
+ mov %esp, %ebp
+ sub $16, %esp
/* Now create the GDT descriptor */
movw $((3 * 8) - 1), -16(%bp)
@@ -108,10 +139,18 @@ copy_kernel:
/* We're now running in 16-bit CS, but 32-bit ES! */
/* Load kernel and initrd */
+ pushl %edi
+ read_fw_blob_addr32_edi(FW_CFG_INITRD)
read_fw_blob_addr32(FW_CFG_KERNEL)
- read_fw_blob_addr32(FW_CFG_INITRD)
read_fw_blob_addr32(FW_CFG_CMDLINE)
- read_fw_blob_addr32(FW_CFG_SETUP)
+
+ read_fw FW_CFG_SETUP_ADDR
+ mov %eax, %edi
+ mov %eax, %ebx
+ read_fw_blob_addr32_edi(FW_CFG_SETUP)
+
+ /* Update the header with the initrd address we chose above */
+ popl %es:0x218(%ebx)
/* And now jump into Linux! */
mov $0, %eax
diff --git a/pc-bios/optionrom/optionrom.h b/pc-bios/optionrom/optionrom.h
index ce43608..f1a9021 100644
--- a/pc-bios/optionrom/optionrom.h
+++ b/pc-bios/optionrom/optionrom.h
@@ -51,8 +51,6 @@
.endm
#define read_fw_blob_pre(var) \
- read_fw var ## _ADDR; \
- mov %eax, %edi; \
read_fw var ## _SIZE; \
mov %eax, %ecx; \
mov $var ## _DATA, %ax; \
@@ -68,6 +66,8 @@
* Clobbers: %eax, %edx, %es, %ecx, %edi
*/
#define read_fw_blob(var) \
+ read_fw var ## _ADDR; \
+ mov %eax, %edi; \
read_fw_blob_pre(var); \
/* old as(1) doesn't like this insn so emit the bytes instead: \
rep insb (%dx), %es:(%edi); \
@@ -80,7 +80,22 @@
*
* Clobbers: %eax, %edx, %es, %ecx, %edi
*/
-#define read_fw_blob_addr32(var) \
+#define read_fw_blob_addr32(var) \
+ read_fw var ## _ADDR; \
+ mov %eax, %edi; \
+ read_fw_blob_pre(var); \
+ /* old as(1) doesn't like this insn so emit the bytes instead: \
+ addr32 rep insb (%dx), %es:(%edi); \
+ */ \
+ .dc.b 0x67,0xf3,0x6c
+
+/*
+ * Read a blob from the fw_cfg device in forced addr32 mode, address is in %edi.
+ * Requires _SIZE and _DATA values for the parameter.
+ *
+ * Clobbers: %eax, %edx, %edi, %es, %ecx
+ */
+#define read_fw_blob_addr32_edi(var) \
read_fw_blob_pre(var); \
/* old as(1) doesn't like this insn so emit the bytes instead: \
addr32 rep insb (%dx), %es:(%edi); \
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 84/88] linuxboot: fix loading old kernels
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (82 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 83/88] linuxboot: compute initrd loading address Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 85/88] audio: Don't free hw resources until after hw backend is stopped Michael Roth
` (5 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Paolo Bonzini <pbonzini@redhat.com>
Old kernels that used high memory only allowed the initrd to be in the
first 896MB of memory. If you load the initrd above, they complain
that "initrd extends beyond end of memory".
In order to fix this, while not breaking machines with small amounts
of memory fixed by cdebec5 (linuxboot: compute initrd loading address,
2014-10-06), we need to distinguish two cases. If pc.c placed the
initrd at end of memory, use the new algorithm based on the e801
memory map. If instead pc.c placed the initrd at the maximum address
specified by the bzImage, leave it there.
The only interesting part is that the low-memory info block is now
loaded very early, in real mode, and thus the 32-bit address has
to be converted into a real mode segment. The initrd address is
also patched in the info block before entering real mode, it is
simpler that way.
This fixes booting the RHEL4.8 32-bit installation image with 1GB
of RAM.
Cc: qemu-stable@nongnu.org
Cc: mst@redhat.com
Cc: jsnow@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 269e2358492b674c50160553d037702e916b9f1b)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
pc-bios/linuxboot.bin | Bin 1024 -> 1024 bytes
pc-bios/optionrom/linuxboot.S | 37 +++++++++++++++++++++++++++----------
2 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/pc-bios/linuxboot.bin b/pc-bios/linuxboot.bin
index 130103fb739228a6869aaf1b174b9d20c13378fc..923d1796fbc58f1a836c160be533d1cf697b7511 100644
GIT binary patch
delta 142
zcmZqRXyBNj#iGKj$vjbS<zxpYS+0XGSo#j68UEiPKG~5;c5)+=ut=jF8xu2AF_&7}
zaW);M|NsA+@8AMT$}#QW22wHtj6c-UjDa#~sth0g|1U|HcrA)eEv?f|f@!h=qa+g#
o^JH&Ed5B`!$=!@w1k-jf00F<!fu0k62VPqJWthB%=`*7=0A&s>tpET3
delta 89
zcmV-f0H*(d2!IHXDg?v=$pVossgsWZS(EMo83L>VlL-PJ0%li}!2uqVMgp}0xE7KA
v9R$Z_iNlfnG8kuOkAoNj003sV000004<f*f$d172nf;Rt1M`zm17HDDa`7NG
diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S
index 5bc0af0..ba821ab 100644
--- a/pc-bios/optionrom/linuxboot.S
+++ b/pc-bios/optionrom/linuxboot.S
@@ -76,7 +76,31 @@ boot_kernel:
copy_kernel:
- /* Compute initrd address */
+ /* Read info block in low memory (0x10000 or 0x90000) */
+ read_fw FW_CFG_SETUP_ADDR
+ shr $4, %eax
+ mov %eax, %es
+ xor %edi, %edi
+ read_fw_blob_addr32_edi(FW_CFG_SETUP)
+
+ cmpw $0x203, %es:0x206 // if protocol >= 0x203
+ jae 1f // have initrd_max
+ movl $0x37ffffff, %es:0x22c // else assume 0x37ffffff
+1:
+
+ /* Check if using kernel-specified initrd address */
+ read_fw FW_CFG_INITRD_ADDR
+ mov %eax, %edi // (load_kernel wants it in %edi)
+ read_fw FW_CFG_INITRD_SIZE // find end of initrd
+ add %edi, %eax
+ xor %es:0x22c, %eax // if it matches es:0x22c
+ and $-4096, %eax // (apart from padding for page)
+ jz load_kernel // then initrd is not at top
+ // of memory
+
+ /* pc.c placed the initrd at end of memory. Compute a better
+ * initrd address based on e801 data.
+ */
mov $0xe801, %ax
xor %cx, %cx
xor %dx, %dx
@@ -107,7 +131,9 @@ copy_kernel:
read_fw FW_CFG_INITRD_SIZE
subl %eax, %edi
andl $-4096, %edi /* EDI = start of initrd */
+ movl %edi, %es:0x218 /* put it in the header */
+load_kernel:
/* We need to load the kernel into memory we can't access in 16 bit
mode, so let's get into 32 bit mode, write the kernel and jump
back again. */
@@ -139,19 +165,10 @@ copy_kernel:
/* We're now running in 16-bit CS, but 32-bit ES! */
/* Load kernel and initrd */
- pushl %edi
read_fw_blob_addr32_edi(FW_CFG_INITRD)
read_fw_blob_addr32(FW_CFG_KERNEL)
read_fw_blob_addr32(FW_CFG_CMDLINE)
- read_fw FW_CFG_SETUP_ADDR
- mov %eax, %edi
- mov %eax, %ebx
- read_fw_blob_addr32_edi(FW_CFG_SETUP)
-
- /* Update the header with the initrd address we chose above */
- popl %es:0x218(%ebx)
-
/* And now jump into Linux! */
mov $0, %eax
mov %eax, %cr0
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 85/88] audio: Don't free hw resources until after hw backend is stopped
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (83 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 84/88] linuxboot: fix loading old kernels Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 86/88] target-xtensa: fix translation for opcodes crossing page boundary Michael Roth
` (4 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Peter Maydell <peter.maydell@linaro.org>
When stopping an audio voice, call the audio backend's fini
method before calling audio_pcm_hw_free_resources_ rather than
afterwards. This allows backends which use helper threads (like
pulseaudio) to terminate those threads before the conv_buf or
mix_buf are freed and avoids race conditions where the helper
may access a NULL pointer or freed memory.
Cc: qemu-stable@nongnu.org
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1418406239-9838-1-git-send-email-peter.maydell@linaro.org
(cherry picked from commit b28fb27b5edf77f6fd0ac550a156fb20f2218db3)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
audio/audio_template.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/audio/audio_template.h b/audio/audio_template.h
index 8173188..584e536 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -191,9 +191,9 @@ static void glue (audio_pcm_hw_gc_, TYPE) (HW **hwp)
audio_detach_capture (hw);
#endif
QLIST_REMOVE (hw, entries);
+ glue (hw->pcm_ops->fini_, TYPE) (hw);
glue (s->nb_hw_voices_, TYPE) += 1;
glue (audio_pcm_hw_free_resources_ ,TYPE) (hw);
- glue (hw->pcm_ops->fini_, TYPE) (hw);
g_free (hw);
*hwp = NULL;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 86/88] target-xtensa: fix translation for opcodes crossing page boundary
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (84 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 85/88] audio: Don't free hw resources until after hw backend is stopped Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 87/88] target-xtensa: test cross-page opcode Michael Roth
` (3 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Filippov <jcmvbkbc@gmail.com>
If TB ends with an opcode that crosses page boundary and the following
page is not executable then EPC1 for the code fetch exception wrongly
points at the beginning of the TB. Always treat instruction that crosses
page boundary as a separate TB.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
(cherry picked from commit 01673a3401614b4199c9946ad47b97bedfc7a7c2)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
target-xtensa/translate.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c
index 2f22cce..ff7eb23 100644
--- a/target-xtensa/translate.c
+++ b/target-xtensa/translate.c
@@ -884,6 +884,11 @@ static TCGv_i32 gen_mac16_m(TCGv_i32 v, bool hi, bool is_unsigned)
return m;
}
+static inline unsigned xtensa_op0_insn_len(unsigned op0)
+{
+ return op0 >= 8 ? 2 : 3;
+}
+
static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc)
{
#define HAS_OPTION_BITS(opt) do { \
@@ -986,6 +991,7 @@ static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc)
uint8_t b0 = cpu_ldub_code(env, dc->pc);
uint8_t b1 = cpu_ldub_code(env, dc->pc + 1);
uint8_t b2 = 0;
+ unsigned len = xtensa_op0_insn_len(OP0);
static const uint32_t B4CONST[] = {
0xffffffff, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 16, 32, 64, 128, 256
@@ -995,13 +1001,19 @@ static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc)
32768, 65536, 2, 3, 4, 5, 6, 7, 8, 10, 12, 16, 32, 64, 128, 256
};
- if (OP0 >= 8) {
- dc->next_pc = dc->pc + 2;
+ switch (len) {
+ case 2:
HAS_OPTION(XTENSA_OPTION_CODE_DENSITY);
- } else {
- dc->next_pc = dc->pc + 3;
+ break;
+
+ case 3:
b2 = cpu_ldub_code(env, dc->pc + 2);
+ break;
+
+ default:
+ RESERVED();
}
+ dc->next_pc = dc->pc + len;
switch (OP0) {
case 0: /*QRST*/
@@ -2946,6 +2958,12 @@ invalid_opcode:
#undef HAS_OPTION
}
+static inline unsigned xtensa_insn_len(CPUXtensaState *env, DisasContext *dc)
+{
+ uint8_t b0 = cpu_ldub_code(env, dc->pc);
+ return xtensa_op0_insn_len(OP0);
+}
+
static void check_breakpoint(CPUXtensaState *env, DisasContext *dc)
{
CPUState *cs = CPU(xtensa_env_get_cpu(env));
@@ -3078,6 +3096,7 @@ void gen_intermediate_code_internal(XtensaCPU *cpu,
} while (dc.is_jmp == DISAS_NEXT &&
insn_count < max_insns &&
dc.pc < next_page_start &&
+ dc.pc + xtensa_insn_len(env, &dc) <= next_page_start &&
tcg_ctx.gen_opc_ptr < gen_opc_end);
reset_litbase(&dc);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 87/88] target-xtensa: test cross-page opcode
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (85 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 86/88] target-xtensa: fix translation for opcodes crossing page boundary Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 88/88] pc: acpi: mark all possible CPUs as enabled in SRAT Michael Roth
` (2 subsequent siblings)
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Max Filippov <jcmvbkbc@gmail.com>
Alter cross-page TB test to also test cross-page opcode.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
(cherry picked from commit 85d36377e4ff8b98119420099d445369bfd6b7bb)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
tests/tcg/xtensa/test_mmu.S | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/tests/tcg/xtensa/test_mmu.S b/tests/tcg/xtensa/test_mmu.S
index 58c5bca..a15316f 100644
--- a/tests/tcg/xtensa/test_mmu.S
+++ b/tests/tcg/xtensa/test_mmu.S
@@ -641,7 +641,7 @@ test cross_page_tb
witlb a2, a3
wdtlb a2, a3
- movi a2, 0x00007ffd
+ movi a2, 0x00007ffc
movi a3, 20f
movi a4, 21f
sub a4, a4, a3
@@ -651,7 +651,7 @@ test cross_page_tb
addi a2, a2, 1
addi a3, a3, 1
1:
- movi a2, 0x00007ffd
+ movi a2, 0x00007ffc
movi a3, 0x00008000
/* DTLB: OK, ITLB: OK */
jx a2
@@ -668,10 +668,10 @@ test cross_page_tb
movi a3, 1
assert eq, a2, a3
rsr a2, epc1
- movi a3, 0x8000
+ movi a3, 0x7fff
assert eq, a2, a3
rsr a2, excsave1
- movi a3, 0x00007ffd
+ movi a3, 0x00007ffc
assert ne, a2, a3
reset_ps
@@ -680,7 +680,7 @@ test cross_page_tb
movi a2, 0x0400000c /* PPN */
movi a3, 0x00008000 /* VPN */
wdtlb a2, a3
- movi a2, 0x00007ffd
+ movi a2, 0x00007ffc
movi a3, 0x00008000
/* DTLB: FAIL, ITLB: OK */
jx a2
@@ -689,10 +689,10 @@ test cross_page_tb
movi a3, 28
assert eq, a2, a3
rsr a2, epc1
- movi a3, 0x7ffd
+ movi a3, 0x7ffc
assert eq, a2, a3
rsr a2, excsave1
- movi a3, 0x00007ffd
+ movi a3, 0x00007ffc
assert eq, a2, a3
reset_ps
@@ -703,7 +703,7 @@ test cross_page_tb
witlb a2, a3
movi a2, 0x04000003 /* PPN */
wdtlb a2, a3
- movi a2, 0x00007ffd
+ movi a2, 0x00007ffc
movi a3, 0x00008000
/* DTLB: OK, ITLB: FAIL */
jx a2
@@ -712,10 +712,10 @@ test cross_page_tb
movi a3, 20
assert eq, a2, a3
rsr a2, epc1
- movi a3, 0x8000
+ movi a3, 0x7fff
assert eq, a2, a3
rsr a2, excsave1
- movi a3, 0x00007ffd
+ movi a3, 0x00007ffc
assert ne, a2, a3
reset_ps
@@ -724,7 +724,7 @@ test cross_page_tb
movi a2, 0x0400000c /* PPN */
movi a3, 0x00008000 /* VPN */
wdtlb a2, a3
- movi a2, 0x00007ffd
+ movi a2, 0x00007ffc
movi a3, 0x00008000
/* DTLB: FAIL, ITLB: FAIL */
jx a2
@@ -733,10 +733,10 @@ test cross_page_tb
movi a3, 28
assert eq, a2, a3
rsr a2, epc1
- movi a3, 0x7ffd
+ movi a3, 0x7ffc
assert eq, a2, a3
rsr a2, excsave1
- movi a3, 0x00007ffd
+ movi a3, 0x00007ffc
assert eq, a2, a3
test_end
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* [Qemu-devel] [PATCH 88/88] pc: acpi: mark all possible CPUs as enabled in SRAT
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (86 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 87/88] target-xtensa: test cross-page opcode Michael Roth
@ 2015-01-08 17:34 ` Michael Roth
2015-01-09 17:27 ` [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Marcel Apfelbaum
2015-01-13 19:55 ` Michael Roth
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-08 17:34 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
From: Igor Mammedov <imammedo@redhat.com>
If QEMU is started with -numa ... Windows only notices that
CPU has been hot-added but it will not online such CPUs.
It's caused by the fact that possible CPUs are flagged as
not enabled in SRAT and Windows honoring that information
doesn't use corresponding CPU.
ACPI 5.0 Spec regarding to flag says:
"
Table 5-47 Local APIC Flags
...
Enabled: if zero, this processor is unusable, and the operating system
support will not attempt to use it.
"
Fix QEMU to adhere to spec and mark possible CPUs as enabled
in SRAT.
With that Windows onlines hot-added CPUs as expected.
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit dd0247e09a542d2a7ba6e390c70b5616edb9ec56)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/i386/acpi-build.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 8609871..5d9f654 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1228,8 +1228,7 @@ acpi_build_srat_memory(AcpiSratMemoryAffinity *numamem, uint64_t base,
}
static void
-build_srat(GArray *table_data, GArray *linker,
- AcpiCpuInfo *cpu, PcGuestInfo *guest_info)
+build_srat(GArray *table_data, GArray *linker, PcGuestInfo *guest_info)
{
AcpiSystemResourceAffinityTable *srat;
AcpiSratProcessorAffinity *core;
@@ -1259,11 +1258,7 @@ build_srat(GArray *table_data, GArray *linker,
core->proximity_lo = curnode;
memset(core->proximity_hi, 0, 3);
core->local_sapic_eid = 0;
- if (test_bit(i, cpu->found_cpus)) {
- core->flags = cpu_to_le32(1);
- } else {
- core->flags = cpu_to_le32(0);
- }
+ core->flags = cpu_to_le32(1);
}
@@ -1539,7 +1534,7 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables)
}
if (guest_info->numa_nodes) {
acpi_add_table(table_offsets, tables->table_data);
- build_srat(tables->table_data, tables->linker, &cpu, guest_info);
+ build_srat(tables->table_data, tables->linker, guest_info);
}
if (acpi_get_mcfg(&mcfg)) {
acpi_add_table(table_offsets, tables->table_data);
--
1.9.1
^ permalink raw reply related [flat|nested] 100+ messages in thread
* Re: [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (87 preceding siblings ...)
2015-01-08 17:34 ` [Qemu-devel] [PATCH 88/88] pc: acpi: mark all possible CPUs as enabled in SRAT Michael Roth
@ 2015-01-09 17:27 ` Marcel Apfelbaum
2015-01-09 22:42 ` Paolo Bonzini
2015-01-13 19:55 ` Michael Roth
89 siblings, 1 reply; 100+ messages in thread
From: Marcel Apfelbaum @ 2015-01-09 17:27 UTC (permalink / raw)
To: Michael Roth, qemu-devel; +Cc: qemu-stable
On 01/08/2015 07:33 PM, Michael Roth wrote:
> Hi everyone,
>
> The following new patches are queued for QEMU stable v2.1.3:
>
> https://github.com/mdroth/qemu/commits/stable-2.1-staging
>
> The release is planned for 2015-01-21:
>
> http://wiki.qemu.org/Planning/2.1
>
> Please respond here or CC qemu-stable@nongnu.org on any patches you
> think should be included in the release.
I think that also this patch should be added:
[Qemu-devel] [PATCH v3] vl.c: fix regression when reading machine type from config file
Link:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg272730.html
Thanks,
Marcel
>
> This is the last planned release for the QEMU 2.1 series, and it's
> quite a bit busier than usual for a final stable update so your
> scrutiny/testing is very appreciated.
>
> Thanks!
>
> ----------------------------------------------------------------
> Alexander Graf (2):
> kvmclock: Ensure time in migration never goes backward
> kvm: Fix memory slot page alignment logic
>
> Andreas Färber (1):
> ivshmem: Fix fd leak on error
>
> Aurelien Jarno (1):
> tcg/mips: fix store softmmu slow path
>
> Damjan Marion (1):
> vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation
>
> Don Slutz (1):
> hw/ide/core.c: Prevent SIGSEGV during migration
>
> Dr. David Alan Gilbert (1):
> xhci PCIe endpoint migration compatibility fix
>
> Eduardo Habkost (2):
> kvmclock: Add comment explaining why we need cpu_clean_all_dirty()
> smbios: Fix assertion on socket count calculation
>
> Fam Zheng (1):
> qemu-iotests: Test missing "driver" key for blockdev-add
>
> Gary R Hook (1):
> block migration: fix return value
>
> Gerd Hoffmann (5):
> vmware-vga: CVE-2014-3689: turn off hw accel
> vmware-vga: add vmsvga_verify_rect
> vmware-vga: use vmsvga_verify_rect in vmsvga_update_rect
> vmware-vga: use vmsvga_verify_rect in vmsvga_copy_rect
> vmware-vga: use vmsvga_verify_rect in vmsvga_fill_rect
>
> Gonglei (13):
> qdev: Use NULL instead of local_err for qbus_child unrealize
> qdev: Add cleanup logic in device_set_realized() to avoid resource leak
> virtio-net: use aliases instead of duplicate qdev properties
> virtio-net: fix virtio-net child refcount in transports
> virtio/vhost-scsi: use aliases instead of duplicate qdev properties
> virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports
> virtio-serial: use aliases instead of duplicate qdev properties
> virtio-serial: fix virtio-serial child refcount in transports
> virtio-rng: use aliases instead of duplicate qdev properties
> virtio-rng: fix virtio-rng child refcount in transports
> virtio-balloon: fix virtio-balloon child refcount in transports
> virtio-9p: use aliases instead of duplicate qdev properties
> virtio-9p: fix virtio-9p child refcount in transports
>
> Greg Kurz (1):
> spapr_pci: map the MSI window in each PHB
>
> Hannes Reinecke (1):
> esp-pci: fixup deadlock with linux
>
> Igor Mammedov (1):
> pc: acpi: mark all possible CPUs as enabled in SRAT
>
> Jan Kiszka (3):
> pci: Use bus master address space for delivering MSI/MSI-X messages
> pc: Fix disabling of vapic for compat PC models
> Make qemu_shutdown_requested signal-safe
>
> Jason Wang (1):
> virtio-net: fix unmap leak
>
> Kevin Wolf (3):
> qcow2: Fix header extension size check
> qcow2.py: Add required padding for header extensions
> block: Don't probe for unknown backing file format
>
> Luiz Capitulino (2):
> exec: file_ram_alloc(): print error when prealloc fails
> virtio-balloon: fix integer overflow in memory stats feature
>
> Marcelo Tosatti (2):
> Introduce cpu_clean_all_dirty
> kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation
>
> Max Filippov (5):
> hw/core/loader: implement address translation in uimage loader
> hw/xtensa/xtfpga: treat uImage load address as virtual
> target-xtensa: add missing window check for entry
> target-xtensa: fix translation for opcodes crossing page boundary
> target-xtensa: test cross-page opcode
>
> Max Reitz (14):
> qcow2: Do not overflow when writing an L1 sector
> block: Make essential BlockDriver objects public
> block: Omit bdrv_find_format for essential drivers
> block/vvfat: qcow driver may not be found
> block/nfs: Add create_opts
> block: Check create_opts before image creation
> qemu-img: Check create_opts before image creation
> qemu-img: Check create_opts before image amendment
> iotests: Only kill NBD server if it runs
> iotests: Add test for unsupported image creation
> qcow2: Prevent numerical overflow
> qcow2: Flushing the caches in qcow2_close may fail
> qcow2: Respect bdrv_truncate() error
> block/raw-posix: Fix ret in raw_open_common()
>
> Michael Roth (4):
> qapi: add visit_start_union and visit_end_union
> qapi: dealloc visitor, implement visit_start_union
> tests: add QMP input visitor test for unions with no discriminator
> tests: avoid running duplicate qom-tests
>
> Michael S. Tsirkin (1):
> virtio-pci: enable bus master for old guests
>
> Paolo Bonzini (4):
> vhost-scsi: use virtio_ldl_p
> virtio-scsi: work around bug in old BIOSes
> linuxboot: compute initrd loading address
> linuxboot: fix loading old kernels
>
> Pavel Dovgalyuk (1):
> gdbstub: init mon_chr through qemu_chr_alloc
>
> Peter Maydell (4):
> hw/arm/virt: fix pl011 and pl031 irq flags
> hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*)
> exec: Handle multipage ranges in invalidate_and_set_dirty()
> audio: Don't free hw resources until after hw backend is stopped
>
> Petr Matousek (1):
> vnc: sanitize bits_per_pixel from the client
>
> Ray Strode (1):
> libcacard: don't free sign buffer while sign op is pending
>
> Sebastian Krahmer (1):
> ivshmem: Fix potential OOB r/w access
>
> Stefan Hajnoczi (2):
> ivshmem: Check ivshmem_read() size argument
> ivshmem: validate incoming_posn value from server
>
> Stratos Psomadakis (1):
> monitor: Reset HMP mon->rs in CHR_EVENT_OPEN
>
> Ting Wang (1):
> virtio-scsi: sense in virtio_scsi_command_complete
>
> Zhang Haoyu (2):
> snapshot: fix referencing wrong variable in while loop in do_delvm
> snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem
>
> zhanghailiang (3):
> pc-dimm: Don't check dimm->node when there is non-NUMA config
> libcacard: fix resource leak
> l2tpv3: fix possible double free
>
> audio/audio_template.h | 2 +-
> block-migration.c | 10 +++-
> block.c | 36 ++++++------
> block/nfs.c | 15 +++++
> block/qcow2-cluster.c | 8 ++-
> block/qcow2.c | 33 +++++++----
> block/raw-posix.c | 3 +-
> block/raw-win32.c | 2 +-
> block/raw_bsd.c | 2 +-
> block/snapshot.c | 4 ++
> block/vvfat.c | 6 ++
> cpus.c | 9 +++
> exec.c | 7 +--
> gdbstub.c | 2 +-
> hw/arm/boot.c | 2 +-
> hw/arm/virt.c | 4 +-
> hw/core/loader.c | 17 ++++--
> hw/core/qdev.c | 66 +++++++++++++++-------
> hw/display/vmware_vga.c | 116 +++++++++++++++++++++++++-------------
> hw/i386/acpi-build.c | 11 +---
> hw/i386/kvm/clock.c | 67 ++++++++++++++++++++++
> hw/i386/pc_piix.c | 2 +-
> hw/i386/smbios.c | 2 +-
> hw/ide/core.c | 2 +-
> hw/m68k/an5206.c | 3 +-
> hw/m68k/dummy_m68k.c | 3 +-
> hw/m68k/mcf5208.c | 3 +-
> hw/mem/pc-dimm.c | 2 +-
> hw/microblaze/boot.c | 3 +-
> hw/misc/ivshmem.c | 66 ++++++++++++++++++++--
> hw/net/vhost_net.c | 8 +--
> hw/net/virtio-net.c | 5 +-
> hw/openrisc/openrisc_sim.c | 2 +-
> hw/pci/msi.c | 2 +-
> hw/pci/msix.c | 2 +-
> hw/ppc/e500.c | 3 +-
> hw/ppc/ppc440_bamboo.c | 3 +-
> hw/ppc/spapr.c | 1 -
> hw/ppc/spapr_pci.c | 81 +++++++++++++--------------
> hw/s390x/s390-virtio-bus.c | 16 ++++--
> hw/s390x/virtio-ccw.c | 18 +++---
> hw/scsi/esp-pci.c | 2 +
> hw/scsi/vhost-scsi.c | 5 +-
> hw/scsi/virtio-scsi.c | 19 ++++++-
> hw/usb/hcd-xhci.c | 6 +-
> hw/virtio/virtio-balloon.c | 7 ++-
> hw/virtio/virtio-pci.c | 31 ++++++++---
> hw/xtensa/xtfpga.c | 3 +-
> include/block/block_int.h | 8 +++
> include/exec/ram_addr.h | 25 +++++++++
> include/hw/i386/pc.h | 5 ++
> include/hw/loader.h | 4 +-
> include/hw/pci-host/spapr.h | 2 +-
> include/hw/ppc/spapr.h | 2 -
> include/qapi/visitor-impl.h | 2 +
> include/qapi/visitor.h | 2 +
> include/sysemu/cpus.h | 1 +
> include/sysemu/kvm.h | 8 +++
> kvm-all.c | 11 +++-
> libcacard/cac.c | 10 +++-
> libcacard/vscclient.c | 7 ++-
> monitor.c | 1 +
> net/l2tpv3.c | 1 -
> pc-bios/linuxboot.bin | Bin 1024 -> 1024 bytes
> pc-bios/optionrom/linuxboot.S | 66 ++++++++++++++++++++--
> pc-bios/optionrom/optionrom.h | 21 ++++++-
> qapi/qapi-dealloc-visitor.c | 26 +++++++++
> qapi/qapi-visit-core.c | 15 +++++
> qemu-img.c | 21 +++++++
> savevm.c | 11 ++--
> scripts/qapi-visit.py | 6 ++
> target-xtensa/cpu.h | 6 ++
> target-xtensa/op_helper.c | 6 ++
> target-xtensa/translate.c | 27 +++++++--
> tcg/mips/tcg-target.c | 2 +-
> tests/Makefile | 3 +-
> tests/qapi-schema/qapi-schema-test.json | 10 ++++
> tests/qapi-schema/qapi-schema-test.out | 3 +
> tests/qemu-iotests/026.out | 120 ++++++++++++++++++++++++++++++++++++++++
> tests/qemu-iotests/071.out | 8 +++
> tests/qemu-iotests/080 | 2 +
> tests/qemu-iotests/080.out | 2 +
> tests/qemu-iotests/087 | 17 ++++++
> tests/qemu-iotests/087.out | 13 +++++
> tests/qemu-iotests/089.out | 2 +
> tests/qemu-iotests/113 | 76 +++++++++++++++++++++++++
> tests/qemu-iotests/113.out | 15 +++++
> tests/qemu-iotests/114 | 61 ++++++++++++++++++++
> tests/qemu-iotests/114.out | 13 +++++
> tests/qemu-iotests/common.rc | 4 +-
> tests/qemu-iotests/group | 2 +
> tests/qemu-iotests/qcow2.py | 4 ++
> tests/tcg/xtensa/test_mmu.S | 26 ++++-----
> tests/test-qmp-input-strict.c | 17 ++++++
> ui/vnc.c | 10 ++++
> vl.c | 4 +-
> 96 files changed, 1175 insertions(+), 255 deletions(-)
> create mode 100755 tests/qemu-iotests/113
> create mode 100644 tests/qemu-iotests/113.out
> create mode 100755 tests/qemu-iotests/114
> create mode 100644 tests/qemu-iotests/114.out
>
>
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14
2015-01-09 17:27 ` [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Marcel Apfelbaum
@ 2015-01-09 22:42 ` Paolo Bonzini
2015-01-13 17:49 ` William Dauchy
0 siblings, 1 reply; 100+ messages in thread
From: Paolo Bonzini @ 2015-01-09 22:42 UTC (permalink / raw)
To: marcel, qemu-devel, qemu-stable, Michael Roth
On 09/01/2015 18:27, Marcel Apfelbaum wrote:
>>
>>
>> Please respond here or CC qemu-stable@nongnu.org on any patches you
>> think should be included in the release.
> I think that also this patch should be added:
> [Qemu-devel] [PATCH v3] vl.c: fix regression when reading machine
> type from config file
> Link:
> https://www.mail-archive.com/qemu-devel@nongnu.org/msg272730.html
That's commit 364c3e6b8dd7912e01d19122d791b8c8f6df4f6c on branch
uq/master of git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git.
Paolo
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14
2015-01-09 22:42 ` Paolo Bonzini
@ 2015-01-13 17:49 ` William Dauchy
2015-01-13 18:48 ` Marcel Apfelbaum
0 siblings, 1 reply; 100+ messages in thread
From: William Dauchy @ 2015-01-13 17:49 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: marcel, Michael Roth, qemu-devel, qemu-stable
[-- Attachment #1: Type: text/plain, Size: 324 bytes --]
Hello,
On Jan09 23:42, Paolo Bonzini wrote:
> That's commit 364c3e6b8dd7912e01d19122d791b8c8f6df4f6c on branch
> uq/master of git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git.
maybe the one for:
fix regression when reading memory size from config file
is also a patch to think about.
Thanks,
--
William
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14
2015-01-13 17:49 ` William Dauchy
@ 2015-01-13 18:48 ` Marcel Apfelbaum
2015-01-13 19:53 ` Michael Roth
0 siblings, 1 reply; 100+ messages in thread
From: Marcel Apfelbaum @ 2015-01-13 18:48 UTC (permalink / raw)
To: William Dauchy, Paolo Bonzini; +Cc: Michael Roth, qemu-devel, qemu-stable
On 01/13/2015 07:49 PM, William Dauchy wrote:
> Hello,
>
> On Jan09 23:42, Paolo Bonzini wrote:
>> That's commit 364c3e6b8dd7912e01d19122d791b8c8f6df4f6c on branch
>> uq/master of git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git.
>
> maybe the one for:
> fix regression when reading memory size from config file
>
> is also a patch to think about.
Definitely, the patch was:
[PATCH] vl.c: fix regression when reading memory size from config file + Paolo's fix
The thread is:
http://lists.gnu.org/archive/html/qemu-devel/2015-01/msg01000.html
Be aware that we need both the patch and Paolo's fix.
Thanks,
Marcel
>
> Thanks,
>
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14
2015-01-13 18:48 ` Marcel Apfelbaum
@ 2015-01-13 19:53 ` Michael Roth
2015-01-13 20:40 ` Paolo Bonzini
0 siblings, 1 reply; 100+ messages in thread
From: Michael Roth @ 2015-01-13 19:53 UTC (permalink / raw)
To: Marcel Apfelbaum, William Dauchy, Paolo Bonzini; +Cc: qemu-devel, qemu-stable
Quoting Marcel Apfelbaum (2015-01-13 12:48:50)
> On 01/13/2015 07:49 PM, William Dauchy wrote:
> > Hello,
> >
> > On Jan09 23:42, Paolo Bonzini wrote:
> >> That's commit 364c3e6b8dd7912e01d19122d791b8c8f6df4f6c on branch
> >> uq/master of git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git.
> >
> > maybe the one for:
> > fix regression when reading memory size from config file
> >
> > is also a patch to think about.
> Definitely, the patch was:
> [PATCH] vl.c: fix regression when reading memory size from config file + Paolo's fix
>
> The thread is:
> http://lists.gnu.org/archive/html/qemu-devel/2015-01/msg01000.html
>
> Be aware that we need both the patch and Paolo's fix.
By Paolo's fix you mean:
364c3e6, "vl.c: fix regression when reading machine type from config file"?
I've gone ahead and applied from uq/uq/master, but still waiting on
"vl.c: fix regression when reading memory size from config file" to be picked
up by a maintainer.
> Thanks,
> Marcel
>
>
> >
> > Thanks,
> >
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [Qemu-devel] [Qemu-stable] Patch Round-up for stable 2.1.3, freeze on 2015-01-14
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
` (88 preceding siblings ...)
2015-01-09 17:27 ` [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Marcel Apfelbaum
@ 2015-01-13 19:55 ` Michael Roth
89 siblings, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-13 19:55 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-stable
Quoting Michael Roth (2015-01-08 11:33:04)
> Hi everyone,
>
> The following new patches are queued for QEMU stable v2.1.3:
>
> https://github.com/mdroth/qemu/commits/stable-2.1-staging
>
> The release is planned for 2015-01-21:
>
> http://wiki.qemu.org/Planning/2.1
>
> Please respond here or CC qemu-stable@nongnu.org on any patches you
> think should be included in the release.
>
> This is the last planned release for the QEMU 2.1 series, and it's
> quite a bit busier than usual for a final stable update so your
> scrutiny/testing is very appreciated.
The following patches have since been added:
5acac17 vl.c: fix regression when reading machine type from config file
2da3577 PPC: Fix crash on spapr_tce_table_finalize()
307e017 atomic: fix position of volatile qualifier
a043ba3 migration/block: fix pending() return value
https://github.com/mdroth/qemu/commits/stable-2.1-staging
Freeze is EOD tomorrow.
>
> Thanks!
>
> ----------------------------------------------------------------
> Alexander Graf (2):
> kvmclock: Ensure time in migration never goes backward
> kvm: Fix memory slot page alignment logic
>
> Andreas Färber (1):
> ivshmem: Fix fd leak on error
>
> Aurelien Jarno (1):
> tcg/mips: fix store softmmu slow path
>
> Damjan Marion (1):
> vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation
>
> Don Slutz (1):
> hw/ide/core.c: Prevent SIGSEGV during migration
>
> Dr. David Alan Gilbert (1):
> xhci PCIe endpoint migration compatibility fix
>
> Eduardo Habkost (2):
> kvmclock: Add comment explaining why we need cpu_clean_all_dirty()
> smbios: Fix assertion on socket count calculation
>
> Fam Zheng (1):
> qemu-iotests: Test missing "driver" key for blockdev-add
>
> Gary R Hook (1):
> block migration: fix return value
>
> Gerd Hoffmann (5):
> vmware-vga: CVE-2014-3689: turn off hw accel
> vmware-vga: add vmsvga_verify_rect
> vmware-vga: use vmsvga_verify_rect in vmsvga_update_rect
> vmware-vga: use vmsvga_verify_rect in vmsvga_copy_rect
> vmware-vga: use vmsvga_verify_rect in vmsvga_fill_rect
>
> Gonglei (13):
> qdev: Use NULL instead of local_err for qbus_child unrealize
> qdev: Add cleanup logic in device_set_realized() to avoid resource leak
> virtio-net: use aliases instead of duplicate qdev properties
> virtio-net: fix virtio-net child refcount in transports
> virtio/vhost-scsi: use aliases instead of duplicate qdev properties
> virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports
> virtio-serial: use aliases instead of duplicate qdev properties
> virtio-serial: fix virtio-serial child refcount in transports
> virtio-rng: use aliases instead of duplicate qdev properties
> virtio-rng: fix virtio-rng child refcount in transports
> virtio-balloon: fix virtio-balloon child refcount in transports
> virtio-9p: use aliases instead of duplicate qdev properties
> virtio-9p: fix virtio-9p child refcount in transports
>
> Greg Kurz (1):
> spapr_pci: map the MSI window in each PHB
>
> Hannes Reinecke (1):
> esp-pci: fixup deadlock with linux
>
> Igor Mammedov (1):
> pc: acpi: mark all possible CPUs as enabled in SRAT
>
> Jan Kiszka (3):
> pci: Use bus master address space for delivering MSI/MSI-X messages
> pc: Fix disabling of vapic for compat PC models
> Make qemu_shutdown_requested signal-safe
>
> Jason Wang (1):
> virtio-net: fix unmap leak
>
> Kevin Wolf (3):
> qcow2: Fix header extension size check
> qcow2.py: Add required padding for header extensions
> block: Don't probe for unknown backing file format
>
> Luiz Capitulino (2):
> exec: file_ram_alloc(): print error when prealloc fails
> virtio-balloon: fix integer overflow in memory stats feature
>
> Marcelo Tosatti (2):
> Introduce cpu_clean_all_dirty
> kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation
>
> Max Filippov (5):
> hw/core/loader: implement address translation in uimage loader
> hw/xtensa/xtfpga: treat uImage load address as virtual
> target-xtensa: add missing window check for entry
> target-xtensa: fix translation for opcodes crossing page boundary
> target-xtensa: test cross-page opcode
>
> Max Reitz (14):
> qcow2: Do not overflow when writing an L1 sector
> block: Make essential BlockDriver objects public
> block: Omit bdrv_find_format for essential drivers
> block/vvfat: qcow driver may not be found
> block/nfs: Add create_opts
> block: Check create_opts before image creation
> qemu-img: Check create_opts before image creation
> qemu-img: Check create_opts before image amendment
> iotests: Only kill NBD server if it runs
> iotests: Add test for unsupported image creation
> qcow2: Prevent numerical overflow
> qcow2: Flushing the caches in qcow2_close may fail
> qcow2: Respect bdrv_truncate() error
> block/raw-posix: Fix ret in raw_open_common()
>
> Michael Roth (4):
> qapi: add visit_start_union and visit_end_union
> qapi: dealloc visitor, implement visit_start_union
> tests: add QMP input visitor test for unions with no discriminator
> tests: avoid running duplicate qom-tests
>
> Michael S. Tsirkin (1):
> virtio-pci: enable bus master for old guests
>
> Paolo Bonzini (4):
> vhost-scsi: use virtio_ldl_p
> virtio-scsi: work around bug in old BIOSes
> linuxboot: compute initrd loading address
> linuxboot: fix loading old kernels
>
> Pavel Dovgalyuk (1):
> gdbstub: init mon_chr through qemu_chr_alloc
>
> Peter Maydell (4):
> hw/arm/virt: fix pl011 and pl031 irq flags
> hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*)
> exec: Handle multipage ranges in invalidate_and_set_dirty()
> audio: Don't free hw resources until after hw backend is stopped
>
> Petr Matousek (1):
> vnc: sanitize bits_per_pixel from the client
>
> Ray Strode (1):
> libcacard: don't free sign buffer while sign op is pending
>
> Sebastian Krahmer (1):
> ivshmem: Fix potential OOB r/w access
>
> Stefan Hajnoczi (2):
> ivshmem: Check ivshmem_read() size argument
> ivshmem: validate incoming_posn value from server
>
> Stratos Psomadakis (1):
> monitor: Reset HMP mon->rs in CHR_EVENT_OPEN
>
> Ting Wang (1):
> virtio-scsi: sense in virtio_scsi_command_complete
>
> Zhang Haoyu (2):
> snapshot: fix referencing wrong variable in while loop in do_delvm
> snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem
>
> zhanghailiang (3):
> pc-dimm: Don't check dimm->node when there is non-NUMA config
> libcacard: fix resource leak
> l2tpv3: fix possible double free
>
> audio/audio_template.h | 2 +-
> block-migration.c | 10 +++-
> block.c | 36 ++++++------
> block/nfs.c | 15 +++++
> block/qcow2-cluster.c | 8 ++-
> block/qcow2.c | 33 +++++++----
> block/raw-posix.c | 3 +-
> block/raw-win32.c | 2 +-
> block/raw_bsd.c | 2 +-
> block/snapshot.c | 4 ++
> block/vvfat.c | 6 ++
> cpus.c | 9 +++
> exec.c | 7 +--
> gdbstub.c | 2 +-
> hw/arm/boot.c | 2 +-
> hw/arm/virt.c | 4 +-
> hw/core/loader.c | 17 ++++--
> hw/core/qdev.c | 66 +++++++++++++++-------
> hw/display/vmware_vga.c | 116 +++++++++++++++++++++++++-------------
> hw/i386/acpi-build.c | 11 +---
> hw/i386/kvm/clock.c | 67 ++++++++++++++++++++++
> hw/i386/pc_piix.c | 2 +-
> hw/i386/smbios.c | 2 +-
> hw/ide/core.c | 2 +-
> hw/m68k/an5206.c | 3 +-
> hw/m68k/dummy_m68k.c | 3 +-
> hw/m68k/mcf5208.c | 3 +-
> hw/mem/pc-dimm.c | 2 +-
> hw/microblaze/boot.c | 3 +-
> hw/misc/ivshmem.c | 66 ++++++++++++++++++++--
> hw/net/vhost_net.c | 8 +--
> hw/net/virtio-net.c | 5 +-
> hw/openrisc/openrisc_sim.c | 2 +-
> hw/pci/msi.c | 2 +-
> hw/pci/msix.c | 2 +-
> hw/ppc/e500.c | 3 +-
> hw/ppc/ppc440_bamboo.c | 3 +-
> hw/ppc/spapr.c | 1 -
> hw/ppc/spapr_pci.c | 81 +++++++++++++--------------
> hw/s390x/s390-virtio-bus.c | 16 ++++--
> hw/s390x/virtio-ccw.c | 18 +++---
> hw/scsi/esp-pci.c | 2 +
> hw/scsi/vhost-scsi.c | 5 +-
> hw/scsi/virtio-scsi.c | 19 ++++++-
> hw/usb/hcd-xhci.c | 6 +-
> hw/virtio/virtio-balloon.c | 7 ++-
> hw/virtio/virtio-pci.c | 31 ++++++++---
> hw/xtensa/xtfpga.c | 3 +-
> include/block/block_int.h | 8 +++
> include/exec/ram_addr.h | 25 +++++++++
> include/hw/i386/pc.h | 5 ++
> include/hw/loader.h | 4 +-
> include/hw/pci-host/spapr.h | 2 +-
> include/hw/ppc/spapr.h | 2 -
> include/qapi/visitor-impl.h | 2 +
> include/qapi/visitor.h | 2 +
> include/sysemu/cpus.h | 1 +
> include/sysemu/kvm.h | 8 +++
> kvm-all.c | 11 +++-
> libcacard/cac.c | 10 +++-
> libcacard/vscclient.c | 7 ++-
> monitor.c | 1 +
> net/l2tpv3.c | 1 -
> pc-bios/linuxboot.bin | Bin 1024 -> 1024 bytes
> pc-bios/optionrom/linuxboot.S | 66 ++++++++++++++++++++--
> pc-bios/optionrom/optionrom.h | 21 ++++++-
> qapi/qapi-dealloc-visitor.c | 26 +++++++++
> qapi/qapi-visit-core.c | 15 +++++
> qemu-img.c | 21 +++++++
> savevm.c | 11 ++--
> scripts/qapi-visit.py | 6 ++
> target-xtensa/cpu.h | 6 ++
> target-xtensa/op_helper.c | 6 ++
> target-xtensa/translate.c | 27 +++++++--
> tcg/mips/tcg-target.c | 2 +-
> tests/Makefile | 3 +-
> tests/qapi-schema/qapi-schema-test.json | 10 ++++
> tests/qapi-schema/qapi-schema-test.out | 3 +
> tests/qemu-iotests/026.out | 120 ++++++++++++++++++++++++++++++++++++++++
> tests/qemu-iotests/071.out | 8 +++
> tests/qemu-iotests/080 | 2 +
> tests/qemu-iotests/080.out | 2 +
> tests/qemu-iotests/087 | 17 ++++++
> tests/qemu-iotests/087.out | 13 +++++
> tests/qemu-iotests/089.out | 2 +
> tests/qemu-iotests/113 | 76 +++++++++++++++++++++++++
> tests/qemu-iotests/113.out | 15 +++++
> tests/qemu-iotests/114 | 61 ++++++++++++++++++++
> tests/qemu-iotests/114.out | 13 +++++
> tests/qemu-iotests/common.rc | 4 +-
> tests/qemu-iotests/group | 2 +
> tests/qemu-iotests/qcow2.py | 4 ++
> tests/tcg/xtensa/test_mmu.S | 26 ++++-----
> tests/test-qmp-input-strict.c | 17 ++++++
> ui/vnc.c | 10 ++++
> vl.c | 4 +-
> 96 files changed, 1175 insertions(+), 255 deletions(-)
> create mode 100755 tests/qemu-iotests/113
> create mode 100644 tests/qemu-iotests/113.out
> create mode 100755 tests/qemu-iotests/114
> create mode 100644 tests/qemu-iotests/114.out
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14
2015-01-13 19:53 ` Michael Roth
@ 2015-01-13 20:40 ` Paolo Bonzini
2015-01-13 21:03 ` Michael Roth
0 siblings, 1 reply; 100+ messages in thread
From: Paolo Bonzini @ 2015-01-13 20:40 UTC (permalink / raw)
To: Michael Roth, Marcel Apfelbaum, William Dauchy; +Cc: qemu-devel, qemu-stable
On 13/01/2015 20:53, Michael Roth wrote:
> 364c3e6, "vl.c: fix regression when reading machine type from config file"?
>
> I've gone ahead and applied from uq/uq/master, but still waiting on
>
> "vl.c: fix regression when reading memory size from config file" to be picked
> up by a maintainer.
This is now fa31bf14294cbdf63de5dde8961c2ebaf7167c69 in uq/master.
This is not a regression as far as I know, it just never worked. I
don't feel too comfortable including that patch.
Paolo
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14
2015-01-13 20:40 ` Paolo Bonzini
@ 2015-01-13 21:03 ` Michael Roth
2015-01-13 21:03 ` Michael Roth
2015-01-26 9:06 ` [Qemu-devel] [Qemu-stable] " Gonglei (Arei)
0 siblings, 2 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-13 21:03 UTC (permalink / raw)
To: Paolo Bonzini, Marcel Apfelbaum, William Dauchy; +Cc: qemu-devel, qemu-stable
Quoting Paolo Bonzini (2015-01-13 14:40:07)
> On 13/01/2015 20:53, Michael Roth wrote:
> > 364c3e6, "vl.c: fix regression when reading machine type from config file"?
> >
> > I've gone ahead and applied from uq/uq/master, but still waiting on
> >
> > "vl.c: fix regression when reading memory size from config file" to be picked
> > up by a maintainer.
>
> This is now fa31bf14294cbdf63de5dde8961c2ebaf7167c69 in uq/master.
>
> This is not a regression as far as I know, it just never worked. I
> don't feel too comfortable including that patch.
That doesn't seem rather hairy for a non-regression. Maybe I'll off now,
we can maybe reconsider for 2.2.1
>
> Paolo
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14
2015-01-13 21:03 ` Michael Roth
@ 2015-01-13 21:03 ` Michael Roth
2015-01-26 9:06 ` [Qemu-devel] [Qemu-stable] " Gonglei (Arei)
1 sibling, 0 replies; 100+ messages in thread
From: Michael Roth @ 2015-01-13 21:03 UTC (permalink / raw)
To: Paolo Bonzini, Marcel Apfelbaum, William Dauchy; +Cc: qemu-devel, qemu-stable
Quoting Michael Roth (2015-01-13 15:03:17)
> Quoting Paolo Bonzini (2015-01-13 14:40:07)
> > On 13/01/2015 20:53, Michael Roth wrote:
> > > 364c3e6, "vl.c: fix regression when reading machine type from config file"?
> > >
> > > I've gone ahead and applied from uq/uq/master, but still waiting on
> > >
> > > "vl.c: fix regression when reading memory size from config file" to be picked
> > > up by a maintainer.
> >
> > This is now fa31bf14294cbdf63de5dde8961c2ebaf7167c69 in uq/master.
> >
> > This is not a regression as far as I know, it just never worked. I
> > don't feel too comfortable including that patch.
>
> That doesn't seem rather hairy for a non-regression. Maybe I'll off now,
> we can maybe reconsider for 2.2.1
And by doesn't I of course mean the opposite
>
> >
> > Paolo
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [Qemu-devel] [Qemu-stable] Patch Round-up for stable 2.1.3, freeze on 2015-01-14
2015-01-13 21:03 ` Michael Roth
2015-01-13 21:03 ` Michael Roth
@ 2015-01-26 9:06 ` Gonglei (Arei)
1 sibling, 0 replies; 100+ messages in thread
From: Gonglei (Arei) @ 2015-01-26 9:06 UTC (permalink / raw)
To: Michael Roth, Paolo Bonzini, Marcel Apfelbaum, William Dauchy
Cc: qemu-devel, qemu-stable
> Subject: Re: [Qemu-stable] Patch Round-up for stable 2.1.3, freeze on
> 2015-01-14
>
> Quoting Paolo Bonzini (2015-01-13 14:40:07)
> > On 13/01/2015 20:53, Michael Roth wrote:
> > > 364c3e6, "vl.c: fix regression when reading machine type from config file"?
> > >
> > > I've gone ahead and applied from uq/uq/master, but still waiting on
> > >
> > > "vl.c: fix regression when reading memory size from config file" to be picked
> > > up by a maintainer.
> >
> > This is now fa31bf14294cbdf63de5dde8961c2ebaf7167c69 in uq/master.
> >
> > This is not a regression as far as I know, it just never worked. I
> > don't feel too comfortable including that patch.
>
> That doesn't seem rather hairy for a non-regression. Maybe I'll off now,
> we can maybe reconsider for 2.2.1
>
Hi, Michael
When are you going to release stable 2.2.1? Thanks :)
Regards,
-Gonglei
^ permalink raw reply [flat|nested] 100+ messages in thread
* Re: [Qemu-devel] [PATCH 34/88] virtio-serial: use aliases instead of duplicate qdev properties
2015-01-08 17:33 ` [Qemu-devel] [PATCH 34/88] virtio-serial: use aliases instead of duplicate qdev properties Michael Roth
@ 2015-05-11 15:21 ` Peter Maydell
0 siblings, 0 replies; 100+ messages in thread
From: Peter Maydell @ 2015-05-11 15:21 UTC (permalink / raw)
To: Michael Roth; +Cc: Cornelia Huck, QEMU Developers, qemu-stable
On 8 January 2015 at 17:33, Michael Roth <mdroth@linux.vnet.ibm.com> wrote:
> From: Gonglei <arei.gonglei@huawei.com>
>
> virtio-serial-{pci, s390, ccw} all duplicate the
> qdev properties of their VirtIOSerial child.
> This approach does not work well with string or pointer
> properties since we must be careful about leaking or
> double-freeing them.
>
> Use the QOM alias property to forward property accesses to the
> VirtIOSerial child. This way no duplication is necessary.
>
> @@ -537,7 +538,6 @@ static const TypeInfo s390_virtio_blk = {
> };
>
> static Property s390_virtio_serial_properties[] = {
> - DEFINE_VIRTIO_SERIAL_PROPERTIES(VirtIOSerialS390, vdev.serial),
> DEFINE_PROP_END_OF_LIST(),
> };
This hunk leaves us with a Property array which has nothing
in it except the list terminator, which is a bit pointless...
Since this is now in master perhaps a cleanup patch is in order.
(noticed while I was fixing conflicts in a recent pullreq)
-- PMM
^ permalink raw reply [flat|nested] 100+ messages in thread
end of thread, other threads:[~2015-05-11 15:21 UTC | newest]
Thread overview: 100+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-08 17:33 [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 01/88] qdev: Use NULL instead of local_err for qbus_child unrealize Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 02/88] qdev: Add cleanup logic in device_set_realized() to avoid resource leak Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 03/88] exec: file_ram_alloc(): print error when prealloc fails Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 04/88] xhci PCIe endpoint migration compatibility fix Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 05/88] Introduce cpu_clean_all_dirty Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 06/88] kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 07/88] kvmclock: Ensure time in migration never goes backward Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 08/88] kvmclock: Add comment explaining why we need cpu_clean_all_dirty() Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 09/88] pci: Use bus master address space for delivering MSI/MSI-X messages Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 10/88] virtio-pci: enable bus master for old guests Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 11/88] spapr_pci: map the MSI window in each PHB Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 12/88] hw/arm/virt: fix pl011 and pl031 irq flags Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 13/88] gdbstub: init mon_chr through qemu_chr_alloc Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 14/88] qapi: add visit_start_union and visit_end_union Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 15/88] qapi: dealloc visitor, implement visit_start_union Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 16/88] tests: add QMP input visitor test for unions with no discriminator Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 17/88] qemu-iotests: Test missing "driver" key for blockdev-add Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 18/88] monitor: Reset HMP mon->rs in CHR_EVENT_OPEN Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 19/88] virtio-balloon: fix integer overflow in memory stats feature Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 20/88] vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 21/88] ivshmem: Check ivshmem_read() size argument Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 22/88] ivshmem: validate incoming_posn value from server Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 23/88] ivshmem: Fix potential OOB r/w access Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 24/88] ivshmem: Fix fd leak on error Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 25/88] pc-dimm: Don't check dimm->node when there is non-NUMA config Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 26/88] tests: avoid running duplicate qom-tests Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 27/88] snapshot: fix referencing wrong variable in while loop in do_delvm Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 28/88] smbios: Fix assertion on socket count calculation Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 29/88] vhost-scsi: use virtio_ldl_p Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 30/88] virtio-net: use aliases instead of duplicate qdev properties Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 31/88] virtio-net: fix virtio-net child refcount in transports Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 32/88] virtio/vhost-scsi: use aliases instead of duplicate qdev properties Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 33/88] virtio/vhost-scsi: fix virtio-scsi/vhost-scsi child refcount in transports Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 34/88] virtio-serial: use aliases instead of duplicate qdev properties Michael Roth
2015-05-11 15:21 ` Peter Maydell
2015-01-08 17:33 ` [Qemu-devel] [PATCH 35/88] virtio-serial: fix virtio-serial child refcount in transports Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 36/88] virtio-rng: use aliases instead of duplicate qdev properties Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 37/88] virtio-rng: fix virtio-rng child refcount in transports Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 38/88] virtio-balloon: fix virtio-balloon " Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 39/88] virtio-9p: use aliases instead of duplicate qdev properties Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 40/88] virtio-9p: fix virtio-9p child refcount in transports Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 41/88] pc: Fix disabling of vapic for compat PC models Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 42/88] vmware-vga: CVE-2014-3689: turn off hw accel Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 43/88] vmware-vga: add vmsvga_verify_rect Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 44/88] vmware-vga: use vmsvga_verify_rect in vmsvga_update_rect Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 45/88] vmware-vga: use vmsvga_verify_rect in vmsvga_copy_rect Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 46/88] vmware-vga: use vmsvga_verify_rect in vmsvga_fill_rect Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 47/88] qcow2: Do not overflow when writing an L1 sector Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 48/88] libcacard: don't free sign buffer while sign op is pending Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 49/88] Make qemu_shutdown_requested signal-safe Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 50/88] vnc: sanitize bits_per_pixel from the client Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 51/88] virtio-scsi: sense in virtio_scsi_command_complete Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 52/88] tcg/mips: fix store softmmu slow path Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 53/88] hw/core/loader: implement address translation in uimage loader Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 54/88] hw/xtensa/xtfpga: treat uImage load address as virtual Michael Roth
2015-01-08 17:33 ` [Qemu-devel] [PATCH 55/88] snapshot: add bdrv_drain_all() to bdrv_snapshot_delete() to avoid concurrency problem Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 56/88] hw/ppc/spapr_pci.c: Avoid functions not in glib 2.12 (g_hash_table_iter_*) Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 57/88] esp-pci: fixup deadlock with linux Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 58/88] target-xtensa: add missing window check for entry Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 59/88] kvm: Fix memory slot page alignment logic Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 60/88] virtio-scsi: work around bug in old BIOSes Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 61/88] libcacard: fix resource leak Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 62/88] l2tpv3: fix possible double free Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 63/88] exec: Handle multipage ranges in invalidate_and_set_dirty() Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 64/88] hw/ide/core.c: Prevent SIGSEGV during migration Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 65/88] virtio-net: fix unmap leak Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 66/88] block: Make essential BlockDriver objects public Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 67/88] block: Omit bdrv_find_format for essential drivers Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 68/88] block/vvfat: qcow driver may not be found Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 69/88] block/nfs: Add create_opts Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 70/88] block: Check create_opts before image creation Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 71/88] qemu-img: " Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 72/88] qemu-img: Check create_opts before image amendment Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 73/88] iotests: Only kill NBD server if it runs Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 74/88] iotests: Add test for unsupported image creation Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 75/88] qcow2: Prevent numerical overflow Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 76/88] qcow2: Flushing the caches in qcow2_close may fail Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 77/88] qcow2: Respect bdrv_truncate() error Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 78/88] block/raw-posix: Fix ret in raw_open_common() Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 79/88] block migration: fix return value Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 80/88] qcow2: Fix header extension size check Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 81/88] qcow2.py: Add required padding for header extensions Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 82/88] block: Don't probe for unknown backing file format Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 83/88] linuxboot: compute initrd loading address Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 84/88] linuxboot: fix loading old kernels Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 85/88] audio: Don't free hw resources until after hw backend is stopped Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 86/88] target-xtensa: fix translation for opcodes crossing page boundary Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 87/88] target-xtensa: test cross-page opcode Michael Roth
2015-01-08 17:34 ` [Qemu-devel] [PATCH 88/88] pc: acpi: mark all possible CPUs as enabled in SRAT Michael Roth
2015-01-09 17:27 ` [Qemu-devel] Patch Round-up for stable 2.1.3, freeze on 2015-01-14 Marcel Apfelbaum
2015-01-09 22:42 ` Paolo Bonzini
2015-01-13 17:49 ` William Dauchy
2015-01-13 18:48 ` Marcel Apfelbaum
2015-01-13 19:53 ` Michael Roth
2015-01-13 20:40 ` Paolo Bonzini
2015-01-13 21:03 ` Michael Roth
2015-01-13 21:03 ` Michael Roth
2015-01-26 9:06 ` [Qemu-devel] [Qemu-stable] " Gonglei (Arei)
2015-01-13 19:55 ` Michael Roth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).