Re: [Qemu-devel] [PATCH] hw/i386: check if nvdimm is enabled before plugging

2017-01-19 Thread Haozhong Zhang
On 01/16/17 11:00 +, Stefan Hajnoczi wrote: On Mon, Jan 16, 2017 at 01:55:34PM +0800, Xiao Guangrong wrote: On 01/14/2017 02:02 AM, Eduardo Habkost wrote: > On Fri, Jan 13, 2017 at 01:17:27PM +, Stefan Hajnoczi wrote: > > On Fri, Jan 13, 2017 at 07:56:51PM +0800, Haozhong Zhang wrote: >

Re: [Qemu-devel] [PATCH v7 05/27] tcg: add options for enabling MTTCG

2017-01-19 Thread Pranith Kumar
Alex Bennée writes: > From: KONRAD Frederic > > We know there will be cases where MTTCG won't work until additional work > is done in the front/back ends to support. It will however be useful to > be able to turn it on. > > As a result MTTCG will default to off unless the combination is > suppor

Re: [Qemu-devel] [PATCH v10 14/16] file-posix: Implement image locking

2017-01-19 Thread Fam Zheng
On Thu, 01/19 15:49, Daniel P. Berrange wrote: > On Thu, Jan 19, 2017 at 10:38:14PM +0800, Fam Zheng wrote: > > This implements open flag sensible image locking for local file > > and host device protocol. > > > > virtlockd in libvirt locks the first byte, so we start looking at the > > file bytes

Re: [Qemu-devel] [PATCH] bitmap: assert that start and nr are non negative

2017-01-19 Thread Fam Zheng
On Thu, 01/19 17:43, Peter Lieven wrote: > commit e1123a3b introduced a data corruption regression > in the iscsi driver because it passed -1 as nr to bitmap_set > and bitmap_clear. Add an assertion to catch such flaws earlier. > > Suggested-by: Fam Zheng > Signed-off-by: Peter Lieven > --- > u

Re: [Qemu-devel] [PATCH RFC] vfio error recovery: kernel support

2017-01-19 Thread Michael S. Tsirkin
On Thu, Jan 19, 2017 at 03:57:34PM -0700, Alex Williamson wrote: > On Fri, 20 Jan 2017 00:21:02 +0200 > "Michael S. Tsirkin" wrote: > > > On Thu, Jan 19, 2017 at 03:10:56PM -0700, Alex Williamson wrote: > > > On Thu, 19 Jan 2017 22:16:03 +0200 > > > "Michael S. Tsirkin" wrote: > > > > > > > T

Re: [Qemu-devel] [PATCH RFC v2 1/6] docs/block-replication: Add description for shared-disk case

2017-01-19 Thread Hailiang Zhang
On 2017/1/20 0:41, Stefan Hajnoczi wrote: On Thu, Jan 19, 2017 at 10:50:19AM +0800, Hailiang Zhang wrote: On 2017/1/13 21:41, Stefan Hajnoczi wrote: On Mon, Dec 05, 2016 at 04:34:59PM +0800, zhanghailiang wrote: +Issue qmp command: + { 'execute': 'blockdev-add', +'arguments': { +'

[Qemu-devel] [PATCH] virtio: Fix no interrupt when not creating msi controller

2017-01-19 Thread Shannon Zhao
From: Shannon Zhao For ARM virt machine, if we use virt-2.7 which will not create ITS node, the virtio-net can not recieve interrupts so it can't get ip address through dhcp. This fixes commit 83d768b(virtio: set ISR on dataplane notifications). Signed-off-by: Shannon Zhao --- hw/virtio/virtio

[Qemu-devel] [PULL 1/6] docs: Fix description of the sentence

2017-01-19 Thread Jason Wang
From: Zhang Chen Say it in another way to make it easier to understand. Signed-off-by: Zhang Chen Signed-off-by: Eric Blake Signed-off-by: Stefan Weil Signed-off-by: Jason Wang --- docs/colo-proxy.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/colo-proxy.txt

[Qemu-devel] [PULL 2/6] net: optimize checksum computation

2017-01-19 Thread Jason Wang
From: Ladi Prosek Very simple loop optimization with a significant performance impact. Microbenchmark results, modern x86-64: buffer size | speed up +- 1500| 1.7x 64 | 1.5x 8 | 1.15x Microbenchmark results, POWER7: buffer size | speed up

[Qemu-devel] [PULL 0/6] Net patches

2017-01-19 Thread Jason Wang
The following changes since commit 0f6bcf68a99efdc531b209551f2b760b0bdcc554: Merge remote-tracking branch 'remotes/artyom/tags/pull-sun4v-20170118' into staging (2017-01-19 18:34:13 +) are available in the git repository at: https://github.com/jasowang/qemu.git tags/net-pull-request fo

[Qemu-devel] [PULL 3/6] m68k: QOMify the MCF Fast Ethernet Controller device

2017-01-19 Thread Jason Wang
From: Thomas Huth When running qemu-system-m68k with the "-net" parameter (for example simply "-net nic -net user"), there is currently a confusing warning message saying: Warning: requested NIC (anonymous, model mcf_fec) was not created (not supported by this machine?) This seems to happen b

[Qemu-devel] [PULL 4/6] hw/net/dp8393x: Avoid unintentional sign extensions on addresses

2017-01-19 Thread Jason Wang
From: Peter Maydell The dp8393x has several 32-bit values which are formed by concatenating two 16 bit device register values. Attempting to do these inline with ((s->reg[HI] << 16) | s->reg[LO]) can result in an unintended sign extension because "x << 16" is of type 'int' even though s->reg is u

[Qemu-devel] [PULL 5/6] hw/pci: use-after-free in pci_nic_init_nofail when nic device fails to initialize

2017-01-19 Thread Jason Wang
From: Alex Kompel object_property_set_bool(OBJECT(dev), true, "realized", &err) in pci_nic_init_nofail may release the object if device fails to initialize which leads to use-after-free in error handling block. qdev_init_nofail does the same thing while holding the reference. (gdb) run -net nic

[Qemu-devel] [PULL 6/6] tap: fix memory leak on failure in net_init_tap()

2017-01-19 Thread Jason Wang
From: Peter Maydell Commit 091a6b2ac fixed most of the memory leaks in failure paths in net_init_tap() reported by Coverity (CID 1356216), but missed one. Fix it by deferring the allocation of fds and vhost_fds until after the error check. Signed-off-by: Peter Maydell Signed-off-by: Jason Wang

Re: [Qemu-devel] [PATCH] virtio: force VIRTIO_F_IOMMU_PLATFORM

2017-01-19 Thread Jason Wang
On 2017年01月20日 06:27, Michael S. Tsirkin wrote: On Thu, Jan 19, 2017 at 11:12:21AM +0800, Jason Wang wrote: On 2017年01月19日 01:50, Michael S. Tsirkin wrote: On Wed, Jan 18, 2017 at 10:42:48AM +0800, Jason Wang wrote: On 2017年01月17日 22:44, Michael S. Tsirkin wrote: On Tue, Jan 17, 2017 at 12

Re: [Qemu-devel] [RFC 05/13] pc: move pcms->possible_cpus init out of pc_cpus_init()

2017-01-19 Thread Dou Liyang
At 01/19/2017 01:13 AM, Igor Mammedov wrote: possible_cpus could be initialized earlier then cpu objects, s/then/than/ i.e. when -smp is parsed so move init code to possible_cpu_arch_ids() [...]

Re: [Qemu-devel] [PATCH RFC 0/3] vfio: allow to notify unmap for very big region

2017-01-19 Thread Peter Xu
On Thu, Jan 19, 2017 at 10:54:37AM -0700, Alex Williamson wrote: > On Thu, 19 Jan 2017 17:25:29 +0800 > Peter Xu wrote: > > > This requirement originates from the VT-d vfio series: > > > > https://lists.nongnu.org/archive/html/qemu-devel/2017-01/msg03495.html > > > > The goal of this series i

[Qemu-devel] [PATCH v3 1/6] docs/block-replication: Add description for shared-disk case

2017-01-19 Thread zhanghailiang
Introuduce the scenario of shared-disk block replication and how to use it. Reviewed-by: Changlong Xie Reviewed-by: Stefan Hajnoczi Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang Signed-off-by: Zhang Chen --- docs/block-replication.txt | 139

[Qemu-devel] [PATCH v3 6/6] nbd/replication: implement .bdrv_get_info() for nbd and replication driver

2017-01-19 Thread zhanghailiang
Without this callback, there will be an error reports in the primary side: "qemu-system-x86_64: Couldn't determine the cluster size of the target image, which has no backing file: Operation not supported Aborting, since this may create an unusable destination image" For nbd driver, it doesn't have

[Qemu-devel] [PATCH v3 0/6] COLO block replication supports shared disk case

2017-01-19 Thread zhanghailiang
COLO block replication doesn't support the shared disk case, Here we try to implement it and this is the third version. Last posted series patches: https://lists.gnu.org/archive/html/qemu-block/2016-12/msg00039.html You can refer to the above link if want to test it. I have uploaded the new versi

[Qemu-devel] [PATCH v3 3/6] replication: Split out backup_do_checkpoint() from secondary_do_checkpoint()

2017-01-19 Thread zhanghailiang
The helper backup_do_checkpoint() will be used for primary related codes. Here we split it out from secondary_do_checkpoint(). Besides, it is unnecessary to call backup_do_checkpoint() in replication starting and normally stop replication path. We only need call it while do real checkpointing. Re

[Qemu-devel] [PATCH v3 2/6] replication: add shared-disk and shared-disk-id options

2017-01-19 Thread zhanghailiang
We use these two options to identify which disk is shared Cc: Eric Blake Signed-off-by: zhanghailiang Signed-off-by: Wen Congyang Signed-off-by: Zhang Chen --- v3: - Move g_free(s->shared_disk_id) to the common fail process place (Stefan) - Fix comments for these two options --- block/replica

[Qemu-devel] [PATCH v3 5/6] replication: Implement block replication for shared disk case

2017-01-19 Thread zhanghailiang
Just as the scenario of non-shared disk block replication, we are going to implement block replication from many basic blocks that are already in QEMU. The architecture is: virtio-blk || .-- /

[Qemu-devel] [PATCH v3 4/6] replication: fix code logic with the new shared_disk option

2017-01-19 Thread zhanghailiang
Some code logic only be needed in non-shared disk, here we adjust these codes to prepare for shared disk scenario. Reviewed-by: Stefan Hajnoczi Signed-off-by: zhanghailiang --- block/replication.c | 47 --- 1 file changed, 28 insertions(+), 19 deletio

Re: [Qemu-devel] [PATCH RFC 0/3] vfio: allow to notify unmap for very big region

2017-01-19 Thread Alex Williamson
On Fri, 20 Jan 2017 11:43:28 +0800 Peter Xu wrote: > On Thu, Jan 19, 2017 at 10:54:37AM -0700, Alex Williamson wrote: > > On Thu, 19 Jan 2017 17:25:29 +0800 > > Peter Xu wrote: > > > > > This requirement originates from the VT-d vfio series: > > > > > > https://lists.nongnu.org/archive/htm

Re: [Qemu-devel] [PATCH RFC 0/3] vfio: allow to notify unmap for very big region

2017-01-19 Thread Peter Xu
On Thu, Jan 19, 2017 at 09:21:10PM -0700, Alex Williamson wrote: > On Fri, 20 Jan 2017 11:43:28 +0800 > Peter Xu wrote: > > > On Thu, Jan 19, 2017 at 10:54:37AM -0700, Alex Williamson wrote: > > > On Thu, 19 Jan 2017 17:25:29 +0800 > > > Peter Xu wrote: > > > > > > > This requirement originat

Re: [Qemu-devel] [PATCH RFC v11 2/4] vfio: new function to init aer cap for vfio device

2017-01-19 Thread Cao jin
On 01/19/2017 06:09 AM, Alex Williamson wrote: > On Sat, 31 Dec 2016 17:13:06 +0800 > Cao jin wrote: > >> From: Chen Fan >> >> Introduce new function to initilize AER capability registers >> for vfio-pci device. >> >> Signed-off-by: Chen Fan >> Signed-off-by: Dou Liyang >> Signed-off-by: Cao

Re: [Qemu-devel] [PATCH RFC v11 4/4] vfio: add 'aer' property to expose aercap

2017-01-19 Thread Cao jin
On 01/19/2017 06:36 AM, Alex Williamson wrote: > On Sat, 31 Dec 2016 17:13:08 +0800 > Cao jin wrote: > >> From: Chen Fan >> >> Add 'aer' property, let user choose whether expose the aer capability >> or not. > > But that's not what it does, it only controls the behavior in response > to non-f

[Qemu-devel] [PATCH] intel_iommu: fix and simplify size calculation in process_device_iotlb_desc()

2017-01-19 Thread Jason Wang
We don't use 1ULL which is wrong during size calculation. Fix it, and while at it, switch to use cto64() and adds a comments to make it simpler and easier to be understood. Reported-by: Paolo Bonzini Cc: Paolo Bonzini Signed-off-by: Jason Wang --- hw/i386/intel_iommu.c | 10 +- 1 file

Re: [Qemu-devel] [PATCH RFC v11 3/4] vfio-pci: pass the aer error to guest

2017-01-19 Thread Cao jin
On 01/19/2017 06:31 AM, Alex Williamson wrote: > On Sat, 31 Dec 2016 17:13:07 +0800 > Cao jin wrote: > >> From: Chen Fan >> >> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c >> index 76a8ac3..9861f72 100644 >> --- a/hw/vfio/pci.c >> +++ b/hw/vfio/pci.c >> @@ -2470,21 +2470,55 @@ static void vfio_

Re: [Qemu-devel] [PATCH RFC v11 3/4] vfio-pci: pass the aer error to guest

2017-01-19 Thread Tian, Kevin
> From: Alex Williamson > Sent: Thursday, January 19, 2017 6:32 AM > > On Sat, 31 Dec 2016 17:13:07 +0800 > Cao jin wrote: > > > From: Chen Fan > > > > When physical device has uncorrectable error hanppened, the vfio_pci > > driver will signal the uncorrectable error status register value to >

Re: [Qemu-devel] [PATCH v2 6/6] qapi: Promote blockdev-change-medium arguments to QAPI type

2017-01-19 Thread Markus Armbruster
Eric Blake writes: > On 01/19/2017 03:48 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> Having a named rather than anonymous C type will make it easier >>> to improve the testsuite in a later patch. >> >> Post it together with said later patch then. > > It was that way in the v1 ser

Re: [Qemu-devel] [PATCH v2 3/4] compiler: expression version of QEMU_BUILD_BUG_ON

2017-01-19 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > On Thu, Jan 19, 2017 at 02:33:40PM +0100, Markus Armbruster wrote: >> Paolo Bonzini writes: >> >> > On 19/01/2017 09:12, Markus Armbruster wrote: >> >> "Michael S. Tsirkin" writes: >> >> >> >>> QEMU_BUILD_BUG_ON uses a typedef in order to be safe >> >>> to use o

[Qemu-devel] [PATCH v11 00/16] block: Image locking series

2017-01-19 Thread Fam Zheng
v11: Move lock bytes from 1-2 to 0x10-0x12. [Daniel] v10: While we still don't have comprehensive propagation mechanism that will be provided by new op blocker system for "permissive modes", the locking enabled by default is regardlessly useful and long overdue. So I think we should merge this for

[Qemu-devel] [PATCH v11 02/16] block: Define BDRV_O_SHARE_RW

2017-01-19 Thread Fam Zheng
Signed-off-by: Fam Zheng --- include/block/block.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/block/block.h b/include/block/block.h index 8b0dcda..243839d 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -97,6 +97,8 @@ typedef struct HDGeometry {

[Qemu-devel] [PATCH v11 08/16] iotests: 087: Don't attach test image twice

2017-01-19 Thread Fam Zheng
The test scenario doesn't require the same image, instead it focuses on the duplicated node-name, so use null-co to avoid locking conflict. Signed-off-by: Fam Zheng --- tests/qemu-iotests/087 | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/087 b/tests

[Qemu-devel] [PATCH v11 07/16] iotests: 030: Read-only open image for getting map

2017-01-19 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/030 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 54db54a..fe0c73f 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -114,7 +114,7 @@ class TestSingleD

[Qemu-devel] [PATCH v11 04/16] qemu-img: Set "share-rw" flag in read-only commands

2017-01-19 Thread Fam Zheng
Checking the status of an image when it is being used by guest is usually useful, and there is no risk of corrupting data, so don't let the upcoming image locking feature limit this use case. Signed-off-by: Fam Zheng --- qemu-img.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-)

[Qemu-devel] [PATCH v11 10/16] iotests: 091: Quit QEMU before checking image

2017-01-19 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/091 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemu-iotests/091 b/tests/qemu-iotests/091 index 32bbd56..10ac4a8 100755 --- a/tests/qemu-iotests/091 +++ b/tests/qemu-iotests/091 @@ -95,7 +95,9 @@ echo "vm2: qemu process running succe

[Qemu-devel] [PATCH v11 01/16] osdep: Add qemu_lock_fd and qemu_unlock_fd

2017-01-19 Thread Fam Zheng
They are wrappers of POSIX fcntl "file private locking", with a convenient "try lock" wrapper implemented with F_OFD_GETLK. Signed-off-by: Fam Zheng --- include/qemu/osdep.h | 3 +++ util/osdep.c | 48 2 files changed, 51 insertions(+) d

[Qemu-devel] [PATCH v11 13/16] tests: Disable image lock in test-replication

2017-01-19 Thread Fam Zheng
The COLO block replication architecture requires one disk to be shared between primary and secondary, in the test both processes use posix file protocol (instead of over NBD) so it is affected by image locking. Disable the lock. Signed-off-by: Fam Zheng --- tests/test-replication.c | 9 +++--

[Qemu-devel] [PATCH v11 14/16] file-posix: Implement image locking

2017-01-19 Thread Fam Zheng
This implements open flag sensible image locking for local file and host device protocol. virtlockd in libvirt locks the first byte, so we start looking at the file bytes from 1. Quoting what was proposed by Kevin Wolf , there are four locking modes by combining two bits (BDRV_O_RDWR and BDRV_O_S

[Qemu-devel] [PATCH v11 12/16] tests: Use null-co:// instead of /dev/null as the dummy image

2017-01-19 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/drive_del-test.c| 2 +- tests/nvme-test.c | 2 +- tests/usb-hcd-uhci-test.c | 2 +- tests/usb-hcd-xhci-test.c | 2 +- tests/virtio-blk-test.c | 2 +- tests/virtio-scsi-test.c | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a

[Qemu-devel] [PATCH v11 03/16] qemu-io: Set "share-rw" flag together with read-only

2017-01-19 Thread Fam Zheng
qemu-io is a low level tool to read or modify guest visible data, which implies the user knows very well what is being done. Allowing reading from a locked image is harmless in most cases, so do it. Signed-off-by: Fam Zheng --- qemu-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu

[Qemu-devel] [PATCH v11 11/16] iotests: 172: Use separate images for multiple devices

2017-01-19 Thread Fam Zheng
To avoid image lock failures. Signed-off-by: Fam Zheng --- tests/qemu-iotests/172 | 53 -- tests/qemu-iotests/172.out | 50 ++- 2 files changed, 54 insertions(+), 49 deletions(-) diff --git a/tests/qemu-iote

Re: [Qemu-devel] [PATCH v3 4/4] ARRAY_SIZE: check that argument is an array

2017-01-19 Thread Markus Armbruster
Eric Blake writes: > On 01/19/2017 04:11 PM, Michael S. Tsirkin wrote: > +#define QEMU_IS_ARRAY(x) (!__builtin_types_compatible_p(typeof(x), \ +typeof(&(x)[0]))) #ifndef ARRAY_SIZE -#define ARRAY_SIZE(x) (sizeof(x) / siz

[Qemu-devel] [PATCH v11 05/16] block: Set "share-rw" flag in drive-backup when sync=none

2017-01-19 Thread Fam Zheng
In this case we may open the source's backing image chain multiple times. Setting share flag means the new open won't try to acquire or check any lock, once we implement image locking. Signed-off-by: Fam Zheng --- blockdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blockdev.c b/blo

[Qemu-devel] [PATCH v11 06/16] iotests: 055: Don't attach the drive to vm for drive-backup

2017-01-19 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/qemu-iotests/055 | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055 index 1d3fd04..20a7596 100755 --- a/tests/qemu-iotests/055 +++ b/tests/qemu-iotests/055 @@ -45

[Qemu-devel] [PATCH v11 09/16] iotests: 085: Avoid image locking conflict

2017-01-19 Thread Fam Zheng
In the case where we test the expected error when a blockdev-snapshot target already has a backing image, backing chain is opened multiple times. This will be a problem when we use image locking, so use a different backing file that is not already open. Signed-off-by: Fam Zheng --- tests/qemu-io

Re: [Qemu-devel] [PATCH v3 2/4] compiler: rework BUG_ON using a struct

2017-01-19 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > There are theoretical concerns that some compilers might not trigger > build failures on attempts to define an array of size -1 and make it a > variable sized array instead. Let rewrite using a struct with a negative > bit field size instead as there are no dynamic

Re: [Qemu-devel] [PATCH v3 2/4] compiler: rework BUG_ON using a struct

2017-01-19 Thread Markus Armbruster
Eric Blake writes: > On 01/19/2017 03:07 PM, Michael S. Tsirkin wrote: >> There are theoretical concerns that some compilers might not trigger >> build failures on attempts to define an array of size -1 and make it a >> variable sized array instead. > > Rather, the concern is that if someone chan

[Qemu-devel] [PATCH v11 15/16] qcow2: Force "no other writer" lock on bs->file

2017-01-19 Thread Fam Zheng
Writing to the same qcow2 file from two QEMU processes at the same time will never work correctly, so disable it even when the caller specifies BDRV_O_RDWR. Other formats are less vulnerable because they don't have internal snapshots thus qemu-img is less often misused to create live snapshot. Si

[Qemu-devel] [PATCH v11 16/16] tests: Add test-image-lock

2017-01-19 Thread Fam Zheng
Signed-off-by: Fam Zheng --- tests/Makefile.include | 2 + tests/test-image-lock.c | 200 +++ tests/test-replication.c | 6 +- 3 files changed, 205 insertions(+), 3 deletions(-) create mode 100644 tests/test-image-lock.c diff --git a/tests/Make

Re: [Qemu-devel] [PATCH v3 0/4] ARRAY_SIZE fixups

2017-01-19 Thread Markus Armbruster
"Michael S. Tsirkin" writes: > Turns out virtio kept using ARRAY_SIZE on fields which stopped > being arrays, this was noticed by a coverity scan. > I fixed this up, this patchset fixes up the ARRAY_SIZE macro so that this > bug does not reappear in any other place. Preferably with the tweaks I

<    1   2   3   4