[Qemu-devel] [PATCH v8 1/2] mirror: Rewrite mirror_iteration

2015-12-23 Thread Fam Zheng
The "pnum < nb_sectors" condition in deciding whether to actually copy data is unnecessarily strict, and the qiov initialization is unnecessarily for bdrv_aio_write_zeroes and bdrv_aio_discard. Rewrite mirror_iteration to fix both flaws. Signed-off-by: Fam Zheng --- block/mirror.c | 344 +++

Re: [Qemu-devel] [PATCH 1/4] net/filter: fix nf->netdev_id leak

2015-12-23 Thread Jason Wang
On 12/23/2015 03:43 PM, Li Zhijian wrote: > Cc: Jason Wang > Signed-off-by: Li Zhijian > --- > net/filter.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/net/filter.c b/net/filter.c > index 1365bad..f777ba2 100644 > --- a/net/filter.c > +++ b/net/filter.c > @@ -204,6 +204,7 @@ stati

Re: [Qemu-devel] [PATCH 2/4] net/dump: fix nfds->filename leak

2015-12-23 Thread Jason Wang
On 12/23/2015 03:43 PM, Li Zhijian wrote: > Cc: Jason Wang > Signed-off-by: Li Zhijian > --- > net/dump.c | 8 > 1 file changed, 8 insertions(+) > > diff --git a/net/dump.c b/net/dump.c > index ce16a4b..347b5ca 100644 > --- a/net/dump.c > +++ b/net/dump.c > @@ -329,6 +329,13 @@ static

Re: [Qemu-devel] [PATCH v3 4/5] qmp: Add blockdev-mirror command

2015-12-23 Thread Fam Zheng
On Thu, 12/24 01:53, Max Reitz wrote: > On 23.12.2015 06:59, Fam Zheng wrote: > > This will start a mirror job from a named device to another named > > device, its relation with drive-mirror is similar with blockdev-backup > > to drive-backup. > > > > In blockdev-mirror, the target node should be

Re: [Qemu-devel] [PATCH] change type of pci_bridge_initfn() to void

2015-12-23 Thread Cao jin
Hi mst On 12/23/2015 09:38 PM, Michael S. Tsirkin wrote: On Wed, Dec 23, 2015 at 04:53:21PM +0800, Cao jin wrote: Hi mst friendly ping again... This does not work since then this function can not be used as an init callback, and this is how dec uses it. thanks very much for your time:) I w

[Qemu-devel] [PATCH v4 0/5] qmp: Add blockdev-mirror

2015-12-23 Thread Fam Zheng
v4: 02: Add Max's rev-by. 04: buf_size -> buf-size. Add Markus' Ack-by. 05: 'node1' -> qmp_target. Fix double quotes. Add Max's Rev-by. v3: Rebase to master. v2: 01: Move bdrv_op_block_all down. [Max] 02, 04: Add Max's rev-by. 03: Check has_mode and fix "re

[Qemu-devel] [PATCH v4 1/5] block: Rename BLOCK_OP_TYPE_MIRROR to BLOCK_OP_TYPE_MIRROR_SOURCE

2015-12-23 Thread Fam Zheng
It's necessary to distinguish source and target before we can add blockdev-mirror, because we would want a concrete type of operation to check on target bs before starting. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- blockdev.c | 2 +- hw/block/dataplane/virtio-blk.

[Qemu-devel] [PATCH v4 3/5] block: Add check on mirror target

2015-12-23 Thread Fam Zheng
Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- blockdev.c| 3 +++ include/block/block.h | 1 + 2 files changed, 4 insertions(+) diff --git a/blockdev.c b/blockdev.c index 22e06ba..f42e171 100644 --- a/blockdev.c +++ b/blockdev.c @@ -3342,6 +3342,9 @@ static void blockdev_mirror

[Qemu-devel] [PATCH v4 2/5] block: Extract blockdev part of qmp_drive_mirror

2015-12-23 Thread Fam Zheng
This is the part that will be reused by blockdev-mirror. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- blockdev.c | 146 + 1 file changed, 88 insertions(+), 58 deletions(-) diff --git a/blockdev.c b/blockdev.c index bd6f68e..22e

[Qemu-devel] [PATCH v4 5/5] iotests: Add test cases for blockdev-mirror

2015-12-23 Thread Fam Zheng
Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- tests/qemu-iotests/041 | 100 ++--- tests/qemu-iotests/041.out | 4 +- 2 files changed, 79 insertions(+), 25 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 index 05b5962.

[Qemu-devel] [PATCH v4 4/5] qmp: Add blockdev-mirror command

2015-12-23 Thread Fam Zheng
This will start a mirror job from a named device to another named device, its relation with drive-mirror is similar with blockdev-backup to drive-backup. In blockdev-mirror, the target node should be prepared by blockdev-add, which will be responsible for assigning a name to the new node, so we do

Re: [Qemu-devel] [Qemu-block] [PATCH 00/10] qcow2: Implement image locking

2015-12-23 Thread Denis V. Lunev
On 12/24/2015 02:19 AM, Max Reitz wrote: On 23.12.2015 04:14, Fam Zheng wrote: On Tue, 12/22 17:46, Kevin Wolf wrote: Enough innocent images have died because users called 'qemu-img snapshot' while the VM was still running. Educating the users doesn't seem to be a working strategy, so this seri

Re: [Qemu-devel] [Qemu-block] [PATCH 00/10] qcow2: Implement image locking

2015-12-23 Thread Denis V. Lunev
On 12/24/2015 08:41 AM, Denis V. Lunev wrote: On 12/24/2015 02:19 AM, Max Reitz wrote: On 23.12.2015 04:14, Fam Zheng wrote: On Tue, 12/22 17:46, Kevin Wolf wrote: Enough innocent images have died because users called 'qemu-img snapshot' while the VM was still running. Educating the users does

Re: [Qemu-devel] [Qemu-block] [PATCH 00/10] qcow2: Implement image locking

2015-12-23 Thread Denis V. Lunev
On 12/22/2015 07:46 PM, Kevin Wolf wrote: Enough innocent images have died because users called 'qemu-img snapshot' while the VM was still running. Educating the users doesn't seem to be a working strategy, so this series adds locking to qcow2 that refuses to access the image read-write from two

[Qemu-devel] [PATCH v4 03/14] qcow2: Assign bs->file->bs to file in qcow2_co_get_block_status

2015-12-23 Thread Fam Zheng
Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2.c b/block/qcow2.c index 7096a29..da74eb7 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1348,6 +1348,7 @@ static int64_t coroutine_fn qcow2_co_get_block_st

[Qemu-devel] [PATCH v4 05/14] iscsi: Assign bs to file in iscsi_co_get_block_status

2015-12-23 Thread Fam Zheng
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/iscsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index 2d1e230..8c7f1b3 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -625,6 +625,9 @@ out: if (iTask.task

[Qemu-devel] [PATCH v4 00/14] qemu-img map: Allow driver to return file of the allocated block

2015-12-23 Thread Fam Zheng
v4: Rebase and resend, adding Eric's and Stefan's reviewed-by. Fix one typo in patch 13. Drop previous patch 14 for a later rework because it is not a hard requirement, but it is pending on Eric's QAPI-to-JSON visitor series: https://lists.gnu.org/archive/html/qemu-devel/2015-12/

[Qemu-devel] [PATCH v4 06/14] parallels: Assign bs->file->bs to file in parallels_co_get_block_status

2015-12-23 Thread Fam Zheng
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parallels.c index d83246b..129668b 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -273,6 +273,7 @@ static

[Qemu-devel] [PATCH v4 02/14] qcow: Assign bs->file->bs to file in qcow_co_get_block_status

2015-12-23 Thread Fam Zheng
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/qcow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow.c b/block/qcow.c index 558f443..b59383f 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -509,6 +509,7 @@ static int64_t coroutine_fn qco

[Qemu-devel] [PATCH v4 12/14] qemu-img: In "map", use the returned "file" from bdrv_get_block_status

2015-12-23 Thread Fam Zheng
Now all drivers should return a correct "file", we can make use of it, even with the recursion into backing chain above. Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-img.c b

[Qemu-devel] [PATCH v4 07/14] qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status

2015-12-23 Thread Fam Zheng
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/qed.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/qed.c b/block/qed.c index a6bbd8b..03af9c1 100644 --- a/block/qed.c +++ b/block/qed.c @@ -692,6 +692,7 @@ typedef struct { uint64_t pos

[Qemu-devel] [PATCH v4 08/14] sheepdog: Assign bs to file in sd_co_get_block_status

2015-12-23 Thread Fam Zheng
Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/sheepdog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/sheepdog.c b/block/sheepdog.c index 0f6789e..d5e7ff8 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -2740,6 +2740,9 @@ sd_co_get_block_status(BlockDriv

[Qemu-devel] [PATCH v4 09/14] vdi: Assign bs->file->bs to file in vdi_co_get_block_status

2015-12-23 Thread Fam Zheng
Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/vdi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/vdi.c b/block/vdi.c index 2199fd3..6b1a57b 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -550,6 +550,7 @@ static int64_t coroutine_fn vdi_co_get_block_status(BlockDriv

[Qemu-devel] [PATCH v4 13/14] qemu-img: Make MapEntry a QAPI struct

2015-12-23 Thread Fam Zheng
The "flags" bit mask is expanded to two booleans, "data" and "zero"; "bs" is replaced with "filename" string. Refactor the merge conditions in img_map() into entry_mergeable(). Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- qapi/block-core.json | 27

[Qemu-devel] [PATCH v4 01/14] block: Add "file" output parameter to block status query functions

2015-12-23 Thread Fam Zheng
The added parameter can be used to return the BDS pointer which the valid offset is referring to. It's value should be ignored unless BDRV_BLOCK_OFFSET_VALID in ret is set. Until block drivers fill in the right value, let's clear it explicitly right before calling .bdrv_get_block_status. Reviewed

[Qemu-devel] [PATCH v4 10/14] vpc: Assign bs->file->bs to file in vpc_co_get_block_status

2015-12-23 Thread Fam Zheng
Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/vpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/vpc.c b/block/vpc.c index 912f5d0..412ff41 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -588,6 +588,7 @@ static int64_t coroutine_fn vpc_co_get_block_status(BlockDr

[Qemu-devel] [PATCH v4 04/14] raw: Assign bs to file in raw_co_get_block_status

2015-12-23 Thread Fam Zheng
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/raw-posix.c | 1 + block/raw_bsd.c | 1 + 2 files changed, 2 insertions(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index 6fc0b71..344272f 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c

[Qemu-devel] [PATCH v4 14/14] iotests: Add "qemu-img map" test for VMDK extents

2015-12-23 Thread Fam Zheng
Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- tests/qemu-iotests/059 | 10 ++ tests/qemu-iotests/059.out | 38 ++ 2 files changed, 48 insertions(+) diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059 i

[Qemu-devel] [PATCH v4 11/14] vmdk: Return extent's file in bdrv_get_block_status

2015-12-23 Thread Fam Zheng
Reviewed-by: Stefan Hajnoczi Signed-off-by: Fam Zheng --- block/vmdk.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index f5a56fd..b60a5af 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1265,6 +1265,7 @@ static int64_t coroutine_fn

Re: [Qemu-devel] [PATCH v3 2/2] tests: update expected SSDT for floppy changes

2015-12-23 Thread Michael S. Tsirkin
On Wed, Dec 23, 2015 at 08:51:45PM +0300, Roman Kagan wrote: > On Wed, Dec 23, 2015 at 06:47:16PM +0100, Igor Mammedov wrote: > > On Wed, 23 Dec 2015 20:20:54 +0300 > > Roman Kagan wrote: > > > > ... two 1.44M drives with bogus geometry for q35. > > > > > > This one is a bug in my patch, indeed:

Re: [Qemu-devel] [PATCH] change type of pci_bridge_initfn() to void

2015-12-23 Thread Michael S. Tsirkin
On Thu, Dec 24, 2015 at 11:39:00AM +0800, Cao jin wrote: > Hi mst > > On 12/23/2015 09:38 PM, Michael S. Tsirkin wrote: > >On Wed, Dec 23, 2015 at 04:53:21PM +0800, Cao jin wrote: > >>Hi mst > >>friendly ping again... > > > >This does not work since then this function can not be > >used as an init

[Qemu-devel] [PATCH v4 0/7] vmxnet3: Fine-tune device capabilities

2015-12-23 Thread Shmulik Ladkani
Various fixes to what the vmxnet3 device reports in its PCI configuration space, in order to be aligned with VMware virtual hardware exposed by ESXi/Workstation. Since v3: Place back-compat flags into HW_COMPAT_2_5 Since v2: Introduce the compatability properties in separate patches, pe

[Qemu-devel] [PATCH v4 1/7] vmxnet3: Change offsets of msi/msix pci capabilities

2015-12-23 Thread Shmulik Ladkani
Place device reported PCI capabilities at the same offsets as placed by the VMware virtual hardware: MSI at [84], MSI-X at [9c]. Signed-off-by: Shmulik Ladkani --- hw/net/vmxnet3.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/hw/net/vmxnet3.c b/hw/net/v

[Qemu-devel] [PATCH v4 2/7] vmxnet3: Change the offset of the MSIX PBA table

2015-12-23 Thread Shmulik Ladkani
Place the PBA table at 0x1000, as placed by VMware virtual hardware. Signed-off-by: Shmulik Ladkani --- hw/net/vmxnet3.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index d323895..97f0aea 100644 --- a/hw/net/vmxnet3.c +++ b/hw/net/

[Qemu-devel] [PATCH v4 3/7] vmxnet3: Introduce 'x-old-msi-offsets' back-compat property

2015-12-23 Thread Shmulik Ladkani
Following the previous patches, where vmxnet3's pci's msi/msix capability offsets and msix's PBA table offsets have been changed, this patch introduces a boolean property 'x-old-msi-offsets' to vmxnet3, whose default is false. Setting 'x-old-msi-offsets' to 'on' preserves the old offsets behavior,

[Qemu-devel] [PATCH v4 7/7] vmxnet3: Report the Device Serial Number capability

2015-12-23 Thread Shmulik Ladkani
Report the DSN extended PCI capability at 0x100. DSN value is a transformation of device MAC address, as calculated by VMware virtual hardware. DSN is reported only if device is pcie. Signed-off-by: Shmulik Ladkani --- hw/net/vmxnet3.c | 28 ++-- 1 file changed, 26 inser

[Qemu-devel] [PATCH v4 4/7] vmxnet3: coding: Introduce VMXNET3Class

2015-12-23 Thread Shmulik Ladkani
Introduce a class type for vmxnet3, and the usual DEVICE_CLASS/DEVICE_GET_CLASS macros. No semantic change. Signed-off-by: Shmulik Ladkani --- hw/net/vmxnet3.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index d1fe888..14d4dcb 100644 --- a

[Qemu-devel] [PATCH v4 6/7] vmxnet3: Introduce 'x-disable-pcie' back-compat property

2015-12-23 Thread Shmulik Ladkani
Following the previous patch which changed vmxnet3 to be a pci express device, this patch introduces a boolean property 'x-disable-pcie' whose default is false. Setting 'x-disable-pcie' to 'on' preserves the old 'pci device' (non express) behavior. This allows migration to older versions. Signed-

[Qemu-devel] [PATCH v4 5/7] vmxnet3: The vmxnet3 device is a PCIE endpoint

2015-12-23 Thread Shmulik Ladkani
Report the 'express endpoint' capability if on a PCIE bus. Signed-off-by: Shmulik Ladkani --- hw/net/vmxnet3.c | 53 - 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 14d4dcb..7ded287 1006

<    1   2   3