Re: [Qemu-devel] Hot reload network configuration

2016-05-17 Thread Markus Armbruster
Stefan Hajnoczi writes: > On Wed, May 11, 2016 at 08:50:54PM +0800, Hu Keping wrote: >> Is there any possible that start qemu with --net=none and then change the >> configuration of the network, say using tap for example? > > Yes. If your machine type supports PCI hotplug then you can use the >

[Qemu-devel] [PATCH v7 00/25] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-05-17 Thread Peter Xu
This is v7 patchset for Intel IOMMU IR support. This patchset is based on the following two patches: - [PATCH v3] pci: fix pci_requester_id() https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg02672.html - [PATCH 0/2] IOAPIC: clear remote IRR for edge interrupts https://lists.gnu.org/

[Qemu-devel] [PATCH v7 03/25] intel_iommu: set IR bit for ECAP register

2016-05-17 Thread Peter Xu
Enable IR in IOMMU Extended Capability register. Signed-off-by: Peter Xu --- hw/i386/intel_iommu.c | 7 +++ hw/i386/intel_iommu_internal.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 4b0558e..17668d6 100644 --- a/hw/i386

[Qemu-devel] [PATCH v7 01/25] acpi: enable INTR for DMAR report structure

2016-05-17 Thread Peter Xu
Introduce iommu_intr in MachineState to show whether IOMMU IR is enabled. By default, IR is off. In ACPI DMA remapping report structure, enable INTR flag when specified. Signed-off-by: Peter Xu --- hw/core/machine.c | 2 ++ hw/i386/acpi-build.c | 12 +--- include/h

[Qemu-devel] [PATCH v7 06/25] intel_iommu: handle interrupt remap enable

2016-05-17 Thread Peter Xu
Handle writting to IRE bit in global command register. Signed-off-by: Peter Xu --- hw/i386/intel_iommu.c | 20 1 file changed, 20 insertions(+) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index 00b873c..4d14124 100644 --- a/hw/i386/intel_iommu.c +++ b/hw/i386

[Qemu-devel] [PATCH v7 02/25] intel_iommu: allow queued invalidation for IR

2016-05-17 Thread Peter Xu
Queued invalidation is required for IR. This patch add basic support for interrupt cache invalidate requests. Since we currently have no IR cache implemented yet, we can just skip all interrupt cache invalidation requests for now. Signed-off-by: Peter Xu --- hw/i386/intel_iommu.c | 9 ++

[Qemu-devel] [PATCH v7 05/25] intel_iommu: define interrupt remap table addr register

2016-05-17 Thread Peter Xu
Defined Interrupt Remap Table Address register to store IR table pointer. Also, do proper handling on global command register writes to store table pointer and its size. One more debug flag "DEBUG_IR" is added for interrupt remapping. Signed-off-by: Peter Xu --- hw/i386/intel_iommu.c |

[Qemu-devel] [PATCH v7 08/25] x86-iommu: introduce parent class

2016-05-17 Thread Peter Xu
Introducing parent class for intel-iommu devices named "x86-iommu". This is preparation work to abstract shared functionalities out from Intel and AMD IOMMUs. Currently, only the parent class is introduced. It does nothing yet. Signed-off-by: Peter Xu --- hw/i386/Makefile.objs | 2 +- h

[Qemu-devel] [PATCH v7 09/25] x86-iommu: provide x86_iommu_get_default

2016-05-17 Thread Peter Xu
Instead of searching the device tree every time, one static variable is declared for the default system x86 IOMMU device. Also, some VT-d macros are replaced by x86 ones. Signed-off-by: Peter Xu --- hw/i386/acpi-build.c | 9 ++--- hw/i386/intel_iommu.c | 8 +--- hw/i3

[Qemu-devel] [PATCH v7 04/25] acpi: add DMAR scope definition for root IOAPIC

2016-05-17 Thread Peter Xu
To enable interrupt remapping for intel IOMMU device, each IOAPIC device in the system reported via ACPI MADT must be explicitly enumerated under one specific remapping hardware unit. This patch adds the root-complex IOAPIC into the default DMAR device. Please refer to VT-d spec 8.3.1.1 for more i

[Qemu-devel] [PATCH v7 07/25] intel_iommu: define several structs for IOMMU IR

2016-05-17 Thread Peter Xu
Several data structs are defined to better support the rest of the patches: IRTE to parse remapping table entries, and IOAPIC/MSI related structure bits to parse interrupt entries to be filled in by guest kernel. Signed-off-by: Peter Xu --- include/hw/i386/intel_iommu.h | 60

[Qemu-devel] [PATCH v7 15/25] intel_iommu: add support for split irqchip

2016-05-17 Thread Peter Xu
In split irqchip mode, IOAPIC is working in user space, only update kernel irq routes when entry changed. When IR is enabled, we directly update the kernel with translated messages. It works just like a kernel cache for the remapping entries. Since KVM irqfd is using kernel gsi routes to deliver i

[Qemu-devel] [PATCH v7 21/25] kvm-irqchip: simplify kvm_irqchip_add_msi_route

2016-05-17 Thread Peter Xu
Changing the original MSIMessage parameter in kvm_irqchip_add_msi_route into the vector number. Vector index provides more information than the MSIMessage, we can retrieve the MSIMessage using the vector easily. This will avoid fetching MSIMessage every time before adding MSI routes. Meanwhile, th

[Qemu-devel] [PATCH v7 10/25] x86-iommu: q35: generalize find_add_as()

2016-05-17 Thread Peter Xu
Remove VT-d calls in common q35 codes. Instead, we provide a general find_add_as() for x86-iommu type. Signed-off-by: Peter Xu --- hw/i386/intel_iommu.c | 7 +-- hw/pci-host/q35.c | 10 -- include/hw/i386/intel_iommu.h | 5 - include/hw/i386/x86-iommu.h |

[Qemu-devel] [PATCH v7 11/25] intel_iommu: add IR translation faults defines

2016-05-17 Thread Peter Xu
Adding translation fault definitions for interrupt remapping. Please refer to VT-d spec section 7.1. Signed-off-by: Peter Xu --- hw/i386/intel_iommu_internal.h | 13 + 1 file changed, 13 insertions(+) diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h index

[Qemu-devel] [PATCH v7 12/25] intel_iommu: Add support for PCI MSI remap

2016-05-17 Thread Peter Xu
This patch enables interrupt remapping for PCI devices. To play the trick, one memory region "iommu_ir" is added as child region of the original iommu memory region, covering range 0xfeeX (which is the address range for APIC). All the writes to this range will be taken as MSI, and translation

Re: [Qemu-devel] Hot reload network configuration

2016-05-17 Thread Hu Keping
>> ... possibly changing to a different network. That would be most interesting part. On 2016/5/17 15:02, Markus Armbruster wrote: Stefan Hajnoczi writes: On Wed, May 11, 2016 at 08:50:54PM +0800, Hu Keping wrote: Is there any possible that start qemu with --net=none and then change the con

[Qemu-devel] [PATCH v7 13/25] q35: ioapic: add support for emulated IOAPIC IR

2016-05-17 Thread Peter Xu
This patch translates all IOAPIC interrupts into MSI ones. One pseudo ioapic address space is added to transfer the MSI message. By default, it will be system memory address space. When IR is enabled, it will be IOMMU address space. Currently, only emulated IOAPIC is supported. Idea suggested by

[Qemu-devel] [PATCH v7 17/25] x86-iommu: introduce IEC notifiers

2016-05-17 Thread Peter Xu
This patch introduces x86 IOMMU IEC (Interrupt Entry Cache) invalidation notifier list. When vIOMMU receives IEC invalidate request, all the registered units will be notified with specific invalidation requests. Intel IOMMU is the first provider that generates such a event. Signed-off-by: Peter X

[Qemu-devel] [PATCH v7 14/25] ioapic: introduce ioapic_entry_parse() helper

2016-05-17 Thread Peter Xu
Abstract IOAPIC entry parsing logic into a helper function. Signed-off-by: Peter Xu --- hw/intc/ioapic.c | 110 +++ 1 file changed, 54 insertions(+), 56 deletions(-) diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c index edd50ff..dafefd0 10064

[Qemu-devel] [PATCH v7 16/25] q35: add "intremap" parameter to enable IR

2016-05-17 Thread Peter Xu
One flag is added to specify whether to enable IR for emulated IOMMU. By default, interrupt remapping is not supportted. To enable it, we should specify something like: $ qemu-system-x86_64 -M q35,iommu=on,intremap=on To be more clear, the following command: $ qemu-system-x86_64 -M q35,iommu=on

[Qemu-devel] [PATCH v7 18/25] ioapic: register IOMMU IEC notifier for ioapic

2016-05-17 Thread Peter Xu
Let IOAPIC the first consumer of x86 IOMMU IEC invalidation notifiers. This is only used for split irqchip case, when vIOMMU receives IR invalidation requests, IOAPIC will be notified to update kernel irq routes. For simplicity, we just update all IOAPIC routes, even if the invalidated entries are

[Qemu-devel] [PATCH v7 20/25] intel_iommu: add SID validation for IR

2016-05-17 Thread Peter Xu
This patch enables SID validation. Invalid interrupts will be dropped. Signed-off-by: Peter Xu --- hw/i386/intel_iommu.c | 68 --- include/hw/i386/intel_iommu.h | 17 +++ 2 files changed, 74 insertions(+), 11 deletions(-) diff --git a/hw/i

[Qemu-devel] [PATCH v7 19/25] intel_iommu: Add support for Extended Interrupt Mode

2016-05-17 Thread Peter Xu
From: Jan Kiszka As neither QEMU nor KVM support more than 255 CPUs so far, this is simple: we only need to switch the destination ID translation in vtd_remap_irq_get if EIME is set. Once CFI support is there, it will have to take EIM into account as well. So far, nothing to do for this. This p

[Qemu-devel] [PATCH v7 22/25] kvm-irqchip: i386: add hook for add/remove virq

2016-05-17 Thread Peter Xu
Adding two hooks to be notified when adding/removing msi routes. There are two kinds of MSI routes: - in kvm_irqchip_add_irq_route(): before assigning IRQFD. Used by vhost, vfio, etc. - in kvm_irqchip_send_msi(): when sending direct MSI message, if direct MSI not allowed, we will first create

[Qemu-devel] [PATCH v7 25/25] intel_iommu: support all masks in interrupt entry cache invalidation

2016-05-17 Thread Peter Xu
From: Radim Krčmář Linux guests do not gracefully handle cases when the invalidation mask they wanted is not supported, probably because real hardware always allowed all. We can just say that all 16 masks are supported, because both ioapic_iec_notifier and kvm_update_msi_routes_all invalidate al

[Qemu-devel] [PATCH] SDL2: add bgrx pixel format

2016-05-17 Thread Pavel Dovgalyuk
This patch adds support of b8g8r8x8 pixel format for SDL2. Signed-off-by: Pavel Dovgalyuk --- ui/sdl2-2d.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/sdl2-2d.c b/ui/sdl2-2d.c index 9593006..8ab68d6 100644 --- a/ui/sdl2-2d.c +++ b/ui/sdl2-2d.c @@ -116,6 +116,9 @@ void sdl2_2d_sw

[Qemu-devel] [PATCH v7 24/25] kvm-irqchip: do explicit commit when update irq

2016-05-17 Thread Peter Xu
In the past, we are doing gsi route commit for each irqchip route update. This is not efficient if we are updating lots of routes in the same time. This patch removes the committing phase in kvm_irqchip_update_msi_route(). Instead, we do explicit commit after all routes updated. Signed-off-by: Pet

[Qemu-devel] [PATCH v7 23/25] kvm-irqchip: x86: add msi route notify fn

2016-05-17 Thread Peter Xu
One more IEC notifier is added to let msi routes know about the IEC changes. When interrupt invalidation happens, all registered msi routes will be updated for all PCI devices. Since both vfio and vhost are possible gsi route consumers, this patch will go one step further to keep them safe in spli

Re: [Qemu-devel] [PATCH v7 00/25] IOMMU: Enable interrupt remapping for Intel IOMMU

2016-05-17 Thread Peter Xu
On Tue, May 17, 2016 at 03:15:28PM +0800, Peter Xu wrote: > This is v7 patchset for Intel IOMMU IR support. This patchset is > based on the following two patches: > > - [PATCH v3] pci: fix pci_requester_id() > > https://lists.gnu.org/archive/html/qemu-devel/2016-05/msg02672.html > > - [PATCH 0

Re: [Qemu-devel] [PATCH v5 09/11] pci bridge dev: change msi property type

2016-05-17 Thread Cao jin
On 05/15/2016 09:25 PM, Marcel Apfelbaum wrote: On 05/06/2016 07:20 AM, Cao jin wrote: From bit to enum OnOffAuto. cc: Michael S. Tsirkin cc: Markus Armbruster cc: Marcel Apfelbaum Signed-off-by: Cao jin --- Actually, I am not quite sure this device need this change, RFC. Well, it al

[Qemu-devel] [PATCH v5 00/27] block: Lock images when opening

2016-05-17 Thread Fam Zheng
v5: - Change "lock-image=on/off" to "lock-mode=exclusive/shared/off". Default is "lock-mode=exclusive" to exclusively lock RW images and shared lock RO images; with lock-mode="shared", RW images are shared locked too; lock-mode=off turns off image locking completely. - Use F_O

[Qemu-devel] [PATCH v5 09/27] osdep: Introduce qemu_dup

2016-05-17 Thread Fam Zheng
This takes care both the CLOEXEC flag and fd-path mapping for image locking. Signed-off-by: Fam Zheng --- include/qemu/osdep.h | 1 + util/osdep.c | 6 ++ 2 files changed, 7 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 81913a7..0e51279 100644 --- a/in

[Qemu-devel] [PATCH v5 04/27] block: Introduce image file locking

2016-05-17 Thread Fam Zheng
Block drivers can implement this new operation .bdrv_lockf to actually lock the image in the protocol specific way. Signed-off-by: Fam Zheng --- block.c | 48 +++ include/block/block_int.h | 11 +++ 2 files changed, 59 inserti

[Qemu-devel] [PATCH v5 03/27] blockdev: Add and parse "lock-mode" option for image locking

2016-05-17 Thread Fam Zheng
Respect the locking mode from CLI or QMP, and set the open flags accordingly. Signed-off-by: Fam Zheng --- blockdev.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/blockdev.c b/blockdev.c index 1892b8e..0784c4a 100644 --- a/blockdev.c +++ b/blockdev.c @@ -356,6 +35

[Qemu-devel] [PATCH v5 01/27] block: Add flag bits for image locking

2016-05-17 Thread Fam Zheng
Later the block layer will automatically lock the images to avoid unexpected concurrent accesses to the same image, which will easily corrupt the metadata or user data, unless in some very special cases, like migration. The exceptional cases like shared storage migration and testing should set BDR

[Qemu-devel] [PATCH v5 07/27] block: Handle image locking during reopen

2016-05-17 Thread Fam Zheng
Stash the locking state into BDRVReopenState. If it was locked, unlock in prepare, and lock it again when commit or abort. Signed-off-by: Fam Zheng --- block.c | 11 +++ include/block/block.h | 1 + 2 files changed, 12 insertions(+) diff --git a/block.c b/block.c index ad

[Qemu-devel] [PATCH v5 16/27] qemu-nbd: Add "--no-lock/-L" option

2016-05-17 Thread Fam Zheng
Signed-off-by: Fam Zheng --- qemu-nbd.c| 7 ++- qemu-nbd.texi | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index 3e54113..57bc18d 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -97,6 +97,7 @@ static void usage(const char *name) "Block device

[Qemu-devel] [PATCH v5 06/27] block: Make bdrv_reopen_{commit, abort} private functions

2016-05-17 Thread Fam Zheng
As parts of the transactional reopen, they are not necessary outside block.c. Make them static. Signed-off-by: Fam Zheng --- block.c | 6 -- include/block/block.h | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block.c b/block.c index 1b42303..ad3663c 100

[Qemu-devel] [PATCH v5 02/27] qapi: Add lock-mode in blockdev-add options

2016-05-17 Thread Fam Zheng
To allow overriding the default locking behavior when opening the image. Signed-off-by: Fam Zheng --- qapi/block-core.json | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 98a20d2..3c54f64 100644 --- a/qapi

[Qemu-devel] [PATCH v5 13/27] qemu-io: Add "-L" option for BDRV_O_NO_LOCK

2016-05-17 Thread Fam Zheng
Signed-off-by: Fam Zheng --- qemu-io.c | 24 +--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/qemu-io.c b/qemu-io.c index 5ef3ef7..4291cb7 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -107,6 +107,7 @@ static void open_help(void) " -r, -- open file read-only\n"

[Qemu-devel] [PATCH v5 11/27] raw-posix: Implement .bdrv_lockf

2016-05-17 Thread Fam Zheng
virtlockd in libvirt locks the first byte, we lock byte 1 to avoid the intervene. Both file and host device protocols are covered. Suggested-by: "Daniel P. Berrange" Signed-off-by: Fam Zheng --- block/raw-posix.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/block

[Qemu-devel] [PATCH v5 08/27] osdep: Add qemu_lock_fd and qemu_unlock_fd

2016-05-17 Thread Fam Zheng
They are wrappers of POSIX fcntl "file private locking". Signed-off-by: Fam Zheng --- include/qemu/osdep.h | 2 ++ util/osdep.c | 31 +++ 2 files changed, 33 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 1e3221c..81913a7 100644

[Qemu-devel] [PATCH v5 05/27] block: Add bdrv_image_locked

2016-05-17 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block.c | 5 + include/block/block.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/block.c b/block.c index 153f9d2..1b42303 100644 --- a/block.c +++ b/block.c @@ -879,6 +879,11 @@ static int bdrv_unlock_image(BlockDriverState

[Qemu-devel] [PATCH v5 10/27] raw-posix: Use qemu_dup

2016-05-17 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/raw-posix.c | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/block/raw-posix.c b/block/raw-posix.c index a4f5a1b..bb8669f 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -645,15 +645,7 @@ static int raw_reopen_prepare(BDRVR

[Qemu-devel] [PATCH v5 27/27] qemu-iotests: Add test case 153 for image locking

2016-05-17 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/153 | 197 + tests/qemu-iotests/153.out | 426 + tests/qemu-iotests/group | 1 + 3 files changed, 624 insertions(+) create mode 100755 tests/qemu-iotests/153 create mode 10064

[Qemu-devel] [PATCH v5 12/27] gluster: Implement .bdrv_lockf

2016-05-17 Thread Fam Zheng
Reviewed-by: Niels de Vos Signed-off-by: Fam Zheng --- block/gluster.c | 31 +++ 1 file changed, 31 insertions(+) diff --git a/block/gluster.c b/block/gluster.c index a8aaacf..517b4c3 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -723,6 +723,33 @@ static int6

[Qemu-devel] [PATCH v5 14/27] qemu-img: Add "-L" option to sub commands

2016-05-17 Thread Fam Zheng
If specified, BDRV_O_NO_LOCK flag will be set when opening the image. Signed-off-by: Fam Zheng --- qemu-img.c | 89 ++ 1 file changed, 72 insertions(+), 17 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 4792366..b13755b 100644

[Qemu-devel] [PATCH v5 18/27] mirror: Disable image locking on target backing chain

2016-05-17 Thread Fam Zheng
In sync=none the backing image of s->target is s->common.bs, which could be exclusively locked, the image locking wouldn't work here. Later we can update completion code to lock it after the replaced node has dropped its lock. Signed-off-by: Fam Zheng --- blockdev.c | 6 ++ 1 file changed,

[Qemu-devel] [PATCH v5 15/27] qemu-img: Update documentation of "-L" option

2016-05-17 Thread Fam Zheng
Signed-off-by: Fam Zheng --- qemu-img-cmds.hx | 44 ++-- qemu-img.c | 1 + qemu-img.texi| 3 +++ 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index e7cded6..fa87942 100644 --- a/qemu-img-cm

[Qemu-devel] [PATCH v5 17/27] block: Don't lock drive-backup target image in none mode

2016-05-17 Thread Fam Zheng
As a very special case, in sync=none mode, the source, as the backing image of the target, will be RO opened again, which is not accepted by image locking because the first open could be exclusive. Signed-off-by: Fam Zheng --- blockdev.c | 5 + 1 file changed, 5 insertions(+) diff --git a/b

[Qemu-devel] [PATCH v5 19/27] qemu-iotests: 140: Disable image lock for qemu-io access

2016-05-17 Thread Fam Zheng
The VM is still on, the image locking check would complain. Signed-off-by: Fam Zheng --- tests/qemu-iotests/140 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/140 b/tests/qemu-iotests/140 index 49f9df4..3be656a 100755 --- a/tests/qemu-iotests/140 +++ b/tes

[Qemu-devel] [PATCH v5 21/27] qemu-iotests: Wait for QEMU processes before checking image in 091

2016-05-17 Thread Fam Zheng
We should wait for the QEMU process to terminate and close the image before we check the data. Signed-off-by: Fam Zheng --- tests/qemu-iotests/091 | 3 +++ tests/qemu-iotests/091.out | 1 + 2 files changed, 4 insertions(+) diff --git a/tests/qemu-iotests/091 b/tests/qemu-iotests/091 index 3

[Qemu-devel] [PATCH v5 23/27] iotests: 087: Disable image lock in cases where file is shared

2016-05-17 Thread Fam Zheng
Otherwise the error handling we are expceting will be masked by the preceding image locking check, and is going to be indistinguishable because the error messages are all the same. Signed-off-by: Fam Zheng --- tests/qemu-iotests/087 | 6 ++ 1 file changed, 6 insertions(+) diff --git a/tests

[Qemu-devel] [PATCH v5 24/27] iotests: Disable image locking in 085

2016-05-17 Thread Fam Zheng
The cases is about live snapshot features. Disable image locking because otherwise a few tests are going to fail because we reuse the same images at blockdev-add. Signed-off-by: Fam Zheng --- tests/qemu-iotests/085 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemu-

[Qemu-devel] [PATCH v5 20/27] qemu-iotests: 046: Move version detection out from verify_io

2016-05-17 Thread Fam Zheng
So the image lock won't complain. Signed-off-by: Fam Zheng --- tests/qemu-iotests/046 | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotests/046 index e528b67..365658e 100755 --- a/tests/qemu-iotests/046 +++ b/test

[Qemu-devel] [PATCH v5 22/27] qemu-iotests: 030: Disable image lock when checking test image

2016-05-17 Thread Fam Zheng
The VM is running, qemu-io would fail the lock acquisition. Signed-off-by: Fam Zheng --- tests/qemu-iotests/030 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 3ac2443..fa996ef 100755 --- a/tests/qemu-iotests/030 +++ b/tes

[Qemu-devel] [PATCH v5 25/27] tests: Use null-co:// instead of /dev/null

2016-05-17 Thread Fam Zheng
With image locking, opening /dev/null can fail when multiple tests run in parallel (make -j2, for example). Use null-co:// as the null protocol doesn't do image locking. While it's arguable we could special-case /dev/null, /dev/zero, /dev/urandom etc in raw-posix driver, it is not really necessary

[Qemu-devel] [PATCH v5 26/27] block: Turn on image locking by default

2016-05-17 Thread Fam Zheng
Now that test cases are covered, we can turn it on. Signed-off-by: Fam Zheng --- blockdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 3de54f0..cd72597 100644 --- a/blockdev.c +++ b/blockdev.c @@ -384,7 +384,7 @@ static void extract_common_b

Re: [Qemu-devel] [PATCH v5 09/11] pci bridge dev: change msi property type

2016-05-17 Thread Michael S. Tsirkin
On Tue, May 17, 2016 at 03:39:14PM +0800, Cao jin wrote: > > > On 05/15/2016 09:25 PM, Marcel Apfelbaum wrote: > >On 05/06/2016 07:20 AM, Cao jin wrote: > >> From bit to enum OnOffAuto. > >> > >>cc: Michael S. Tsirkin > >>cc: Markus Armbruster > >>cc: Marcel Apfelbaum > >>Signed-off-by: Cao ji

Re: [Qemu-devel] [PATCH v5 00/16] Introduce Intel 82574 GbE Controller Emulation (e1000e)

2016-05-17 Thread Michael S. Tsirkin
On Sun, May 15, 2016 at 04:49:33PM +0300, Leonid Bloch wrote: > Hello All, > > This is v5 of e1000e series. Series: Reviewed-by: Michael S. Tsirkin > For convenience, the same patches are available at: > https://github.com/daynix/qemu-e1000e/tree/e1000e-submit-v5 > > Best regards, > Dmitry. >

Re: [Qemu-devel] [PATCH v3] pci: fix pci_requester_id()

2016-05-17 Thread Michael S. Tsirkin
On Tue, May 17, 2016 at 02:45:07PM +0800, Peter Xu wrote: > This fix SID verification failure when IOMMU IR is enabled with PCI > bridges. Existing pci_requester_id() is more like getting BDF info > only. Renaming it to pci_get_bdf(). Meanwhile, we provide the correct > implementation to get reques

Re: [Qemu-devel] [PATCH v3] pci: fix pci_requester_id()

2016-05-17 Thread Peter Xu
On Tue, May 17, 2016 at 10:46:12AM +0300, Michael S. Tsirkin wrote: > On Tue, May 17, 2016 at 02:45:07PM +0800, Peter Xu wrote: > > This fix SID verification failure when IOMMU IR is enabled with PCI > > bridges. Existing pci_requester_id() is more like getting BDF info > > only. Renaming it to pci

Re: [Qemu-devel] qcow2 resize with snapshots

2016-05-17 Thread Kevin Wolf
Am 16.05.2016 um 08:33 hat zhangzhiming geschrieben: > hi, i read some source code by your tips, and i have some conclusions: > > 1. Old version of QCOW2 image does not store the total size of snapshot, so, > we > can’t > add the function to the old version of QEMU, and the function of QCOW

[Qemu-devel] [PATCH 3/3] trace: enable tracing in qemu-nbd

2016-05-17 Thread Denis V. Lunev
Pls note, trace_init_backends() must be called in the final process, i.e. after daemonization. This is necessary to keep tracing thread in the proper process. Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Stefan Hajnoczi CC: Kevin Wolf --- qemu-nbd.c | 15 +++ 1 file changed

[Qemu-devel] [PATCH 1/3] trace: move qemu_trace_opts to trace/control.c

2016-05-17 Thread Denis V. Lunev
The patch also creates trace_opt_parse() helper in trace/control.c to reuse this code in next patches for qemu-nbd and qemu-io. The patch also makes trace_init_events() static, as this call is not used outside the module anymore. Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Stefan Hajnoc

[Qemu-devel] [PATCH 2/3] trace: enable tracing in qemu-io

2016-05-17 Thread Denis V. Lunev
Moving trace_init_backends() into trace_opt_parse() is not possible. This should be called after daemonize() in vl.c. Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Stefan Hajnoczi CC: Kevin Wolf --- qemu-io.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --g

[Qemu-devel] [PATCH 0/3] trace: enable tracing in qemu-io/qemu-nbd

2016-05-17 Thread Denis V. Lunev
Actually this is a rework of the original patch, set as a part of write-zeroes patchset. Moving it out to process via trace tree. Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Stefan Hajnoczi CC: Kevin Wolf Denis V. Lunev (3): trace: move qemu_trace_opts to trace/control.c trace: en

Re: [Qemu-devel] [PATCH CFT v3 00/50] NEED_CPU_H / cpu.h / hw/hw.h cleanups

2016-05-17 Thread Thomas Huth
On 16.05.2016 18:59, Peter Maydell wrote: > On 16 May 2016 at 17:53, Peter Maydell wrote: >> ppc64 (this is the ppc64be host in the GCC compile farm if >> you have an account there): >> >> /home/pm215/qemu/hw/intc/xics_kvm.c: In function ‘icp_get_kvm_state’: >> /home/pm215/qemu/hw/intc/xics_kvm.c:

[Qemu-devel] [PATCH] vga: add sr_vbe register set

2016-05-17 Thread Gerd Hoffmann
Commit "fd3c136 vga: make sure vga register setup for vbe stays intact (CVE-2016-3712)." causes a regression. The win7 installer is unhappy because it can't freely modify vga registers any more while in vbe mode. This patch introduces a new sr_vbe register set. The vbe_update_vgaregs will fill s

[Qemu-devel] [PATCH v2 0/5] qcow2_co_write_zeroes and related improvements

2016-05-17 Thread Denis V. Lunev
This series enables tracepoints in qemu-io and improves bdrv/qcow2_co_write_zeroes framework. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Kevin Wolf Changes from v1: - patch 1 is separated to additional patchset - grammar fixes, thank you Eric Denis V. Lunev (5): block: split write_zer

[Qemu-devel] [PATCH 3/5] qcow2: add tracepoints for qcow2_co_write_zeroes

2016-05-17 Thread Denis V. Lunev
This patch follows guidelines of all other tracepoints in qcow2, like ones in qcow2_co_writev. I think that they should dump values in the same quantities or be changed all to gather. Signed-off-by: Denis V. Lunev CC: Eric Blake CC: Kevin Wolf --- block/qcow2.c | 5 + trace-events | 2 ++

[Qemu-devel] [PATCH 4/5] qcow2: fix condition in is_zero_cluster

2016-05-17 Thread Denis V. Lunev
We should check for (res & BDRV_BLOCK_ZERO) only. The situation when we will have !(res & BDRV_BLOCK_DATA) and will not have BDRV_BLOCK_ZERO is not possible. Signed-off-by: Denis V. Lunev CC: Kevin Wolf --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/

[Qemu-devel] [PATCH 1/5] block: split write_zeroes always

2016-05-17 Thread Denis V. Lunev
We should split requests even if they are less than write_zeroes_alignment. For example we can have the following request: offset 62k size 4k write_zeroes_alignment 64k The original code sent 1 request covering 2 qcow2 clusters, and resulted in both clusters being allocated. But by splittin

[Qemu-devel] [PATCH 5/5] qcow2: merge is_zero_cluster helpers into qcow2_co_write_zeroes

2016-05-17 Thread Denis V. Lunev
They are used once only. This makes code more compact. The patch also improves comments in the code. Signed-off-by: Denis V. Lunev CC: Kevin Wolf --- block/qcow2.c | 39 +++ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/block/qcow2.c b/bloc

[Qemu-devel] [PATCH 2/5] qcow2: simplify logic in qcow2_co_write_zeroes

2016-05-17 Thread Denis V. Lunev
Unaligned requests will occupy only one cluster. This is true since the previous commit. Simplify the code taking this consideration into account. In other words, the caller is now buggy if it ever passes us an unaligned request that crosses cluster boundaries (the only requests that can cross bou

Re: [Qemu-devel] [PULL 0/4] slirp updates

2016-05-17 Thread Peter Maydell
On 16 May 2016 at 20:25, Samuel Thibault wrote: > Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20160513-1' into > staging (2016-05-13 13:39:38 +0100) > > are available in the git repository at: > > http://people.debian.org/~sthibault/qemu.git tags/samuel-thibault > > for you to f

Re: [Qemu-devel] [PATCH] vga: add sr_vbe register set

2016-05-17 Thread Thomas Lamprecht
Hi, thanks for the patch. On 05/17/2016 10:54 AM, Gerd Hoffmann wrote: > Commit "fd3c136 vga: make sure vga register setup for vbe stays intact > (CVE-2016-3712)." causes a regression. The win7 installer is unhappy > because it can't freely modify vga registers any more while in vbe mode. > > Th

Re: [Qemu-devel] [PATCH CFT v3 00/50] NEED_CPU_H / cpu.h / hw/hw.h cleanups

2016-05-17 Thread Paolo Bonzini
On 17/05/2016 10:56, Thomas Huth wrote: > On 16.05.2016 18:59, Peter Maydell wrote: >> On 16 May 2016 at 17:53, Peter Maydell wrote: >>> ppc64 (this is the ppc64be host in the GCC compile farm if >>> you have an account there): >>> >>> /home/pm215/qemu/hw/intc/xics_kvm.c: In function ‘icp_get_kvm_

Re: [Qemu-devel] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Richard W.M. Jones
On Tue, Feb 16, 2016 at 05:34:41PM +0100, Paolo Bonzini wrote: > From: "Daniel P. Berrange" > > With the new style protocol, the NBD client will currenetly > send NBD_OPT_EXPORT_NAME as the first (and indeed only) > option it wants. The problem is that the NBD protocol spec > does not allow for r

Re: [Qemu-devel] [PATCH] cpus.c: Use pthread_sigmask() rather than sigprocmask()

2016-05-17 Thread Paolo Bonzini
On 16/05/2016 19:37, Peter Maydell wrote: > The only other sigprocmask() uses are in linux-user, apart from > a couple in net/tap.c, where they're used as part of forking and > spawning the helper process. I suspect this should be using > qemu_fork() instead of doing it all by hand, wrongly... I

Re: [Qemu-devel] [PATCH] block/rbd: add .bdrv_reopen_prepare() stub

2016-05-17 Thread Sebastian Färber
Hi Kevin, > A correct reopen implementation must consider all options and flags that > .bdrv_open() looked at. > > The options are okay, as both "filename" and "password-secret" aren't > things that we want to allow a reopen to change. However, in the flags > BDRV_O_NOCACHE makes a difference: >

Re: [Qemu-devel] [PATCH v5 11/11] pci: Convert msi_init() to Error and fix callers to check it

2016-05-17 Thread Cao jin
On 05/15/2016 09:41 PM, Marcel Apfelbaum wrote: diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c index 9e31f0e..af71c98 100644 --- a/hw/pci-bridge/pci_bridge_dev.c +++ b/hw/pci-bridge/pci_bridge_dev.c @@ -53,6 +53,7 @@ static int pci_bridge_dev_initfn(PCIDevice *

[Qemu-devel] [PATCH 2/2] apb: convert init to realize

2016-05-17 Thread Wei Jiangang
Convert a device model where initialization obviously can't fail, make it implement realize() rather than init(). Signed-off-by: Wei Jiangang --- hw/pci-host/apb.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c index aaef7bb..b29789

[Qemu-devel] [PATCH 0/2] convert device initialization functions

2016-05-17 Thread Wei Jiangang
The first had been reviewed. The second had been posted last month, but no feedback. They're similar, so resend them together. Wei Jiangang (2): hw/pci-bridge: Convert pxb initialization functions to Error apb: convert init to realize hw/pci-bridge/pci_expander_bridge.c | 52

[Qemu-devel] [PATCH 1/2] hw/pci-bridge: Convert pxb initialization functions to Error

2016-05-17 Thread Wei Jiangang
Firstly, convert pxb_dev_init_common() to Error and rename it to pxb_dev_realize_common(). Actually, pxb_register_bus() is converted as well. And then, convert pxb_dev_initfn() and pxb_pcie_dev_initfn() to Error, rename them to pxb_dev_realize() and pxb_pcie_dev_realize() respectively. Signed-off

Re: [Qemu-devel] [PATCH] configure: fix error messages

2016-05-17 Thread Wei, Jiangang
ping ... Any comments? On Tue, 2016-05-10 at 18:13 +0800, Wei Jiangang wrote: > spice-server-devel is required, not spice-protocol-devel. > "spice-protocol(>=0.12.3) devel" maybe mislead user. > > when configure isn't able to find the required usb-redir, > It's better to explicitly output version

Re: [Qemu-devel] [PATCH v2 0/3] Fix recent qemu-iotests issues

2016-05-17 Thread Max Reitz
On 16.05.2016 18:43, Eric Blake wrote: > I introduced a couple of bugs in my recent qemu-io enhancements; > time to fix them back up now that the broken patches are already > part of mainline. > > in v2: > - patch 1: retitle, fix id typo, also plug a coverity leak [mreitz] > - patch 3: drop dead c

Re: [Qemu-devel] [PATCH 10/50] target-m68k: make cpu-qom.h not target specific

2016-05-17 Thread Thomas Huth
On 16.05.2016 17:35, Paolo Bonzini wrote: > Make M68KCPU an opaque type within cpu-qom.h, and move all definitions of > private methods, as well as all type definitions that require knowledge > of the layout to cpu.h. This helps making files independent of NEED_CPU_H > if they only need to pass ar

Re: [Qemu-devel] [PATCH 15/50] target-s390x: make cpu-qom.h not target specific

2016-05-17 Thread Thomas Huth
On 16.05.2016 17:35, Paolo Bonzini wrote: > Make S390XCPU an opaque type within cpu-qom.h, and move all definitions > of private methods, as well as all type definitions that require knowledge > of the layout to cpu.h. This helps making files independent of NEED_CPU_H > if they only need to pass a

Re: [Qemu-devel] [PATCH] vga: add sr_vbe register set

2016-05-17 Thread Gerd Hoffmann
Hi, > > This way we can allow guests update sr[] registers as they want, without > > allowing them disrupt vbe video modes that way. > > Just documenting my test with the patch here: > > This fixes the issue with QEMU 2.5.1.1 but only if I'm using SeaBIOS. > > OVMF leads to a almost similar r

Re: [Qemu-devel] [RFC for-2.7] block: keep AioContext pointer in BlockBackend

2016-05-17 Thread Max Reitz
On 11.04.2016 16:14, Stefan Hajnoczi wrote: > blk_get/set_aio_context() delegate to BlockDriverState without storing > the AioContext pointer in BlockBackend. > > There are two flaws: > > 1. BlockBackend falls back to the QEMU main loop AioContext when there >is no root BlockDriverState. Thi

Re: [Qemu-devel] [RFC for-2.7] block: keep AioContext pointer in BlockBackend

2016-05-17 Thread Paolo Bonzini
On 17/05/2016 12:52, Max Reitz wrote: > A trivial way to do this would be to query the BDS's AIO context in > blk_get_aio_context() and update the BB's context if they don't match. > The more correct way would probably be to make bdrv_attach_aio_context() > update its BB's (or BBs', in the future

Re: [Qemu-devel] [RFC for-2.7] block: keep AioContext pointer in BlockBackend

2016-05-17 Thread Max Reitz
On 17.05.2016 13:07, Paolo Bonzini wrote: > > > On 17/05/2016 12:52, Max Reitz wrote: >> A trivial way to do this would be to query the BDS's AIO context in >> blk_get_aio_context() and update the BB's context if they don't match. >> The more correct way would probably be to make bdrv_attach_aio_

Re: [Qemu-devel] [PATCH] vga: add sr_vbe register set

2016-05-17 Thread Thomas Lamprecht
Hi, On 05/17/2016 12:50 PM, Gerd Hoffmann wrote: > Hi, > >>> This way we can allow guests update sr[] registers as they want, without >>> allowing them disrupt vbe video modes that way. >> Just documenting my test with the patch here: >> >> This fixes the issue with QEMU 2.5.1.1 but only if I'm

Re: [Qemu-devel] [PATCH 14/50] target-ppc: make cpu-qom.h not target specific

2016-05-17 Thread Thomas Huth
On 16.05.2016 17:35, Paolo Bonzini wrote: > Make PowerPCCPU an opaque type within cpu-qom.h, and move all definitions > of private methods, as well as all type definitions that require knowledge > of the layout to cpu.h. Conversely, move all definitions needed to define > a class to cpu-qom.h. Th

[Qemu-devel] [PATCH v4] pci: fix pci_requester_id()

2016-05-17 Thread Peter Xu
This fix SID verification failure when IOMMU IR is enabled with PCI bridges. Existing pci_requester_id() is more like getting BDF info only. Renaming it to pci_get_bdf(). Meanwhile, we provide the correct implementation to get requester ID. VT-d spec 5.1.1 is a good reference to go, though it talks

[Qemu-devel] [PATCH v4] fix pci_requester_id()

2016-05-17 Thread Peter Xu
v4 changes: Introduced PCIReqIDCache struct. Since PCI bus number may be changing during time, we need to cache the device that we can fetch requester_id from. Meanwhile, we need to cache how we should extract reqid from the cache. Currently there are two kinds: - BDF: directly fetch BDF from the

[Qemu-devel] [PATCH] Remove config-devices.mak on 'make clean'

2016-05-17 Thread Peter Maydell
Our dependency mechanism works like this: * on first build there is neither a .o nor a .d * we create the .d as a side effect of creating the .o * for rebuilds we know when we need to update the .o, which also updates the .d This system requires that you're never in a situation where there i

Re: [Qemu-devel] [PATCH] Remove config-devices.mak on 'make clean'

2016-05-17 Thread Paolo Bonzini
On 17/05/2016 13:27, Peter Maydell wrote: > Our dependency mechanism works like this: > * on first build there is neither a .o nor a .d > * we create the .d as a side effect of creating the .o > * for rebuilds we know when we need to update the .o, >which also updates the .d > > This syst

  1   2   3   4   >