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

2016-05-17 Thread Jeff Cody
On Tue, May 17, 2016 at 12:03:53PM +0200, Sebastian Färber wrote: > 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

[Qemu-devel] [PATCH 12/12] vfio: add 'aer' property to expose aercap

2016-05-17 Thread Zhou Jie
From: Chen Fan add 'aer' property to let user able to decide whether expose the aer capability. by default we should disable aer feature, because it needs configuration restrictions. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 2 ++

[Qemu-devel] [PATCH 05/12] vfio: refine function vfio_pci_host_match

2016-05-17 Thread Zhou Jie
From: Chen Fan Signed-off-by: Chen Fan --- hw/vfio/pci.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 0516d94..5b23a86 100644 --- a/hw/vfio/pci.c +++

[Qemu-devel] [PATCH 04/12] vfio: add aer support for vfio device

2016-05-17 Thread Zhou Jie
From: Chen Fan Calling pcie_aer_init to initilize aer related registers for vfio device, then reload physical related registers to expose device capability. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 83

Re: [Qemu-devel] [Qemu-block] [PATCH] block: clarify error message for qmp-eject

2016-05-17 Thread Markus Armbruster
Fam Zheng writes: > On Tue, 05/17 20:42, John Snow wrote: >> If you use HMP's eject but the CDROM tray is locked, you may get a >> confusing error message informing you that the "tray isn't open." >> >> As this is the point of eject, we can do a little better and help >>

[Qemu-devel] [PATCH 0/2] block/nfs: add support for libnfs pagecache

2016-05-17 Thread Peter Lieven
this adds support for the upcoming libnfs cachepage to Qemu. While at it neglect to use readahead if cache.direct is on. Peter Lieven (2): block/nfs: add support for libnfs pagecache block/nfs: refuse readahead if cache.direct is on block/nfs.c | 45

[Qemu-devel] [PATCH] backup: Fail early if cannot determine cluster size

2016-05-17 Thread Fam Zheng
Otherwise the job is orphaned and block_job_cancel_sync in bdrv_close_all() when quiting will hang. A simple reproducer is running blockdev-backup from null-co:// to null-co://. Cc: qemu-sta...@nongnu.org Signed-off-by: Fam Zheng --- block/backup.c | 34

[Qemu-devel] [PATCH 09/12] vfio: vote the function 0 to do host bus reset when aer occurred

2016-05-17 Thread Zhou Jie
From: Chen Fan Due to all devices assigned to VM on the same way as host if enable aer, so we can easily do the hot reset by selecting the function #0 to do the hot reset. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 14 ++

[Qemu-devel] [PATCH 10/12] vfio-pci: pass the aer error to guest

2016-05-17 Thread Zhou Jie
From: Chen Fan when the vfio device encounters an uncorrectable error in host, the vfio_pci driver will signal the eventfd registered by this vfio device, resulting in the qemu eventfd handler getting invoked. this patch is to pass the error to guest and let the

Re: [Qemu-devel] [PATCH] net: vl: Move default_net to vl.c

2016-05-17 Thread Jason Wang
On 2016年05月16日 23:21, Paolo Bonzini wrote: On 12/05/2016 16:17, Eduardo Habkost wrote: All handling of defaults (default_* variables) is inside vl.c, move default_net there too, so we can more easily refactor that code later. Signed-off-by: Eduardo Habkost ---

Re: [Qemu-devel] [PATCH] block: clarify error message for qmp-eject

2016-05-17 Thread Eric Blake
On 05/17/2016 06:42 PM, John Snow wrote: > If you use HMP's eject but the CDROM tray is locked, you may get a > confusing error message informing you that the "tray isn't open." > > As this is the point of eject, we can do a little better and help > clarify that the tray was locked and that it

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

2016-05-17 Thread Jason Wang
On 2016年05月15日 21:49, Leonid Bloch wrote: Hello All, This is v5 of e1000e series. For convenience, the same patches are available at: https://github.com/daynix/qemu-e1000e/tree/e1000e-submit-v5 Best regards, Dmitry. Applied to -net. There's still some work need to be done on top: - add

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

2016-05-17 Thread Wei, Jiangang
received hint that Message to <*@redhat.com> was undeliverable. ping to confirm my message had been sent successfully. On Tue, 2016-05-17 at 18:18 +0800, Wei Jiangang wrote: > The first had been reviewed. > The second had been posted last month, but no feedback. > They're similar, so resend them

[Qemu-devel] [PATCH 1/2] block/nfs: add support for libnfs pagecache

2016-05-17 Thread Peter Lieven
upcoming libnfs will have support for a read cache that can significantly help to speed up requests since libnfs by design circumvents the kernel cache. Example: qemu -cdrom nfs://127.0.0.1/iso/my.iso?pagecache=1024 The pagecache parameters takes the maximum amount of pages to cache. A page in

[Qemu-devel] [PATCH] block/iscsi: allow caching of the allocation map

2016-05-17 Thread Peter Lieven
until now the allocation map was used only as a hint if a cluster is allocated or not. If a block was not allocated (or Qemu had no info about the allocation status) a get_block_status call was issued to check the allocation status and possibly avoid a subsequent read of unallocated sectors. If a

[Qemu-devel] [PATCH 2/2] block/nfs: refuse readahead if cache.direct is on

2016-05-17 Thread Peter Lieven
Signed-off-by: Peter Lieven --- block/nfs.c | 5 + 1 file changed, 5 insertions(+) diff --git a/block/nfs.c b/block/nfs.c index 975510f..8b73a35 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -331,6 +331,11 @@ static int64_t nfs_client_open(NFSClient *client, const char

Re: [Qemu-devel] [Qemu-block] [PATCH] block: clarify error message for qmp-eject

2016-05-17 Thread Eric Blake
On 05/17/2016 08:18 PM, Fam Zheng wrote: > On Tue, 05/17 20:42, John Snow wrote: >> If you use HMP's eject but the CDROM tray is locked, you may get a >> confusing error message informing you that the "tray isn't open." >> >> As this is the point of eject, we can do a little better and help >>

Re: [Qemu-devel] [PATCH v3 0/5] Add Ethernet device for i.MX6 SOC

2016-05-17 Thread Jason Wang
On 2016年05月17日 21:00, Peter Maydell wrote: On 8 May 2016 at 20:40, Jean-Christophe Dubois wrote: This patch series adds Gb ENET Ethernet device to the i.MX6 SOC. The ENET device is an evolution of the FEC device present on the i.MX25 SOC and is backward compatible with

[Qemu-devel] [PATCH 03/12] vfio: add pcie extended capability support

2016-05-17 Thread Zhou Jie
From: Chen Fan For vfio pcie device, we could expose the extended capability on PCIE bus. due to add a new pcie capability at the tail of the chain, in order to avoid config space overwritten, we introduce a copy config for parsing extended caps. and rebuild the

[Qemu-devel] [PATCH 06/12] vfio: add check host bus reset is support or not

2016-05-17 Thread Zhou Jie
From: Chen Fan When assigning a vfio device with AER enabled, we must check whether the device supports a host bus reset (ie. hot reset) as this may be used by the guest OS in order to recover the device from an AER error. QEMU must therefore have the ability to

[Qemu-devel] [PATCH 11/12] vfio: register aer resume notification handler for aer resume

2016-05-17 Thread Zhou Jie
From: Chen Fan For supporting aer recovery, host and guest would run the same aer recovery code, that would do the secondary bus reset if the error is fatal, the aer recovery process: 1. error_detected 2. reset_link (if fatal) 3. slot_reset/mmio_enabled 4.

[Qemu-devel] [PATCH 02/12] vfio: squeeze out vfio_pci_do_hot_reset for support bus reset

2016-05-17 Thread Zhou Jie
From: Chen Fan Squeeze out vfio_pci_do_hot_reset to do host bus reset when AER recovery. Signed-off-by: Chen Fan --- hw/vfio/pci.c | 75 +++ 1 file changed, 44 insertions(+), 31

[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

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

[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

[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

[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

[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

[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

[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

[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 ---

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

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

[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

[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

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

[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

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

[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

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

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

[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

[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:

[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 @@

[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

[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

[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

[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 +++

[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 ++

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

[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

[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:

[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,

[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

[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 -

[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

[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

[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

[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

[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

[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(+)

[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

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

[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

[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

[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

[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 ---

[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 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

[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

[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 +++

[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

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

[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

[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

[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

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’: >>

[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

[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 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

[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,

[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

[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

[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

[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

[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

[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

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. > >

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: >

[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

[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

[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 ---

[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 ---

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

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

[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

[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

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...

[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

  1   2   3   4   >