[Qemu-block] [PATCH v3 1/2] qcow2: Make size_to_clusters() return uint64_t

2015-09-14 Thread Max Reitz
Sadly, some images may have more clusters than what can be represented using a plain int. We should be prepared for that case (in qcow2_check_refcounts() we actually were trying to catch that case, but since size_to_clusters() truncated the returned value, that check never did anything useful).

Re: [Qemu-block] [Qemu-devel] [PATCH v3 4/5] qmp: add monitor command to add/remove a child

2015-09-14 Thread Markus Armbruster
Wen Congyang writes: > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > --- > blockdev.c | 47 ++ >

[Qemu-block] [PATCH v3 0/2] qcow2: Make size_to_clusters() return uint64_t

2015-09-14 Thread Max Reitz
Some callers actually expected that function to return uint64_t. As it turns out, it doesn't. Fix that. v3: - Patch 1: Fix build for sizeof(void *) < 8 machines [Peter] git-backport-diff against v2: Key: [] : patches are identical [] : number of functional differences between

Re: [Qemu-block] [Qemu-devel] [PATCH] iscsi: Add chap and "initiator-name" etc as per drive options

2015-09-14 Thread Eric Blake
On 09/14/2015 12:50 AM, Peter Lieven wrote: It would be nice to also add a matching BlockdevOptionsIscsi to qapi/block-core.json, to allow setting these structured options from QMP. Separate patch is fine, but we need to do the work for ALL of the remaining block devices

[Qemu-block] [PULL v2 20/23] qcow2: Make size_to_clusters() return uint64_t

2015-09-14 Thread Kevin Wolf
From: Max Reitz Sadly, some images may have more clusters than what can be represented using a plain int. We should be prepared for that case (in qcow2_check_refcounts() we actually were trying to catch that case, but since size_to_clusters() truncated the returned value, that

[Qemu-block] [PULL v2 00/23] Block layer patches

2015-09-14 Thread Kevin Wolf
The following changes since commit 2b750d9d261bda7f75b39dfc1e1e5f22502929d5: Merge remote-tracking branch 'remotes/aurel/tags/pull-sh4-next-20150913' into staging (2015-09-14 10:46:38 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/5] support nbd driver in blockdev-add

2015-09-14 Thread Eric Blake
On 09/14/2015 08:27 AM, Markus Armbruster wrote: > Wen Congyang writes: > >> The NBD driver needs: filename, path or (host, port, exportname). >> It checks which key exists and decides use unix or inet socket. >> It doesn't recognize the key type, so we can't use union, and

[Qemu-block] [PATCH v4 0/4] Add 'blockdev-snapshot' command

2015-09-14 Thread Alberto Garcia
This version uses 'backing': '' instead of 'ignore-backing' as discussed in the previous thread. Regards, Berto v4: - Implement the support for 'backing': '', drop 'ignore-backing', and update iotest 085 accordingly. - Include sample 'blockdev-add' call in the 'blockdev-snapshot'

[Qemu-block] [PATCH v3 2/2] iotests: Add test for checking large image files

2015-09-14 Thread Max Reitz
Add a test for checking a qcow2 file with a multiple of 2^32 clusters. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/138 | 73 ++ tests/qemu-iotests/138.out | 9 ++

Re: [Qemu-block] [Qemu-devel] [PATCH v3 4/5] qmp: add monitor command to add/remove a child

2015-09-14 Thread Kevin Wolf
Am 14.09.2015 um 16:36 hat Markus Armbruster geschrieben: > Wen Congyang writes: > > diff --git a/qmp-commands.hx b/qmp-commands.hx > > index 495670b..139a23b 100644 > > --- a/qmp-commands.hx > > +++ b/qmp-commands.hx > > @@ -4053,6 +4053,59 @@ Example: > > EQMP > > > >

[Qemu-block] [PATCH v4 2/4] block: support passing 'backing': '' to 'blockdev-add'

2015-09-14 Thread Alberto Garcia
Passing an empty string allows opening an image but not its backing file. This was already described in the API documentation, only the implementation was missing. This is useful for creating snapshots using images opened with blockdev-add, since they are not supposed to have a backing image

[Qemu-block] [PATCH v4 1/4] block: rename BlockdevSnapshot to BlockdevSnapshotSync

2015-09-14 Thread Alberto Garcia
We will introduce the 'blockdev-snapshot' command that will require its own struct for the parameters, so we need to rename this one in order to avoid name clashes. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake --- blockdev.c | 2 +-

[Qemu-block] [PATCH v4 4/4] block: add tests for the 'blockdev-snapshot' command

2015-09-14 Thread Alberto Garcia
Signed-off-by: Alberto Garcia --- tests/qemu-iotests/085 | 102 ++--- tests/qemu-iotests/085.out | 34 ++- 2 files changed, 128 insertions(+), 8 deletions(-) diff --git a/tests/qemu-iotests/085 b/tests/qemu-iotests/085

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/1] atapi: abort transfers with 0 byte limits

2015-09-14 Thread John Snow
On 09/10/2015 11:11 PM, Fam Zheng wrote: > On Thu, 09/10 19:20, John Snow wrote: >> >> +/* Nondata commands permit the byte_count_limit to be 0. >> + * If this is a data-transferring PIO command and BCL is 0, >> + * we abort at the /ATA/ level, not the ATAPI level. >> + * See

[Qemu-block] [PATCH v4 3/4] block: add a 'blockdev-snapshot' QMP command

2015-09-14 Thread Alberto Garcia
One of the limitations of the 'blockdev-snapshot-sync' command is that it does not allow passing BlockdevOptions to the newly created snapshots, so they are always opened using the default values. Extending the command to allow passing options is not a practical solution because there is overlap

Re: [Qemu-block] [Qemu-devel] [PATCH v4 2/4] block: support passing 'backing': '' to 'blockdev-add'

2015-09-14 Thread Fam Zheng
On Mon, 09/14 19:01, Alberto Garcia wrote: > Passing an empty string allows opening an image but not its backing > file. This was already described in the API documentation, only the > implementation was missing. > > This is useful for creating snapshots using images opened with > blockdev-add,

Re: [Qemu-block] [PATCH v3 4/5] qmp: add monitor command to add/remove a child

2015-09-14 Thread Wen Congyang
On 09/14/2015 11:37 PM, Kevin Wolf wrote: > Am 10.09.2015 um 11:55 hat Wen Congyang geschrieben: >> +## >> +# @x-child-add >> +# >> +# Add a new child to the parent BDS. Currently only the Quorum driver >> +# implements this feature. This is useful to fix a broken quorum child. >> +# >> +#

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/5] support nbd driver in blockdev-add

2015-09-14 Thread Wen Congyang
On 09/15/2015 10:20 AM, Wen Congyang wrote: > On 09/14/2015 11:47 PM, Eric Blake wrote: >> On 09/14/2015 08:27 AM, Markus Armbruster wrote: >>> Wen Congyang writes: >>> The NBD driver needs: filename, path or (host, port, exportname). It checks which key exists and

Re: [Qemu-block] [Qemu-devel] [PATCH v3 4/5] qmp: add monitor command to add/remove a child

2015-09-14 Thread Wen Congyang
On 09/14/2015 10:36 PM, Markus Armbruster wrote: > Wen Congyang writes: > >> Signed-off-by: Wen Congyang >> Signed-off-by: zhanghailiang >> Signed-off-by: Gonglei >> --- >> blockdev.c

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/5] support nbd driver in blockdev-add

2015-09-14 Thread Eric Blake
On 09/14/2015 08:27 PM, Wen Congyang wrote: >> Building fails: >> GEN qmp-commands.h >> In file included from /work/src/qemu/qapi-schema.json:9: >> In file included from /work/src/qemu/qapi/block.json:6: >> /work/src/qemu/qapi/block-core.json:1844: Flat union 'BlockdevOptionsNBD' >> must have

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/5] support nbd driver in blockdev-add

2015-09-14 Thread Wen Congyang
On 09/14/2015 11:47 PM, Eric Blake wrote: > On 09/14/2015 08:27 AM, Markus Armbruster wrote: >> Wen Congyang writes: >> >>> The NBD driver needs: filename, path or (host, port, exportname). >>> It checks which key exists and decides use unix or inet socket. >>> It doesn't

Re: [Qemu-block] [Qemu-devel] [PATCH v3 1/5] support nbd driver in blockdev-add

2015-09-14 Thread Wen Congyang
On 09/15/2015 11:46 AM, Eric Blake wrote: > On 09/14/2015 08:27 PM, Wen Congyang wrote: >>> Building fails: >>> GEN qmp-commands.h >>> In file included from /work/src/qemu/qapi-schema.json:9: >>> In file included from /work/src/qemu/qapi/block.json:6: >>>

Re: [Qemu-block] [Qemu-devel] [PATCH] iscsi: Add chap and "initiator-name" etc as per drive options

2015-09-14 Thread Peter Lieven
> Am 14.09.2015 um 08:38 schrieb Fam Zheng : > >> On Fri, 09/11 08:27, ronnie sahlberg wrote: >>> On Fri, Sep 11, 2015 at 8:20 AM, Eric Blake wrote: On 09/11/2015 12:00 AM, Fam Zheng wrote: Previously we use "-iscsi

Re: [Qemu-block] [Qemu-devel] [PATCH v2 00/11] aio: Introduce handler type to fix nested aio_poll for dataplane

2015-09-14 Thread Fam Zheng
On Fri, 09/11 14:22, Kevin Wolf wrote: > Am 11.09.2015 um 13:46 hat Fam Zheng geschrieben: > > On Fri, 09/11 12:39, Kevin Wolf wrote: > > > Am 29.07.2015 um 06:42 hat Fam Zheng geschrieben: > > > > v2: Switch to disable/enable model. [Paolo] > > > > > > > > Most existing nested aio_poll()'s in

[Qemu-block] [PATCH v3 1/1] atapi: abort transfers with 0 byte limits

2015-09-14 Thread John Snow
We're supposed to abort on transfers like this, unless we fill Word 125 of our IDENTIFY data with a default transfer size, which we don't currently do. This is an ATA error, not a SCSI/ATAPI one. See ATA8-ACS3 sections 7.17.6.49 or 7.21.5. If we don't do this, QEMU will loop forever trying to

[Qemu-block] [PATCH v3 0/1] atapi: abort transfers with 0 byte limits

2015-09-14 Thread John Snow
v3: Sigh, fix my thinko: "if (!(...))", not "if !(...)" v2: Make sure we only abort PIO commands if BCL is zero, not DMA. For convenience, this branch is available at: https://github.com/jnsnow/qemu.git branch

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/4] ide: simple ATAPI tests

2015-09-14 Thread John Snow
On 09/10/2015 07:09 PM, John Snow wrote: > We don't have any CDROM tests yet. > So, add some for the PCI/BMDMA HBA. > > === > v2: > === > > - Some readability feedback from Markus > - Added an IRQ poll for the DRQ read loop > >

Re: [Qemu-block] [Qemu-devel] [PATCH] ide: fix ATAPI command permissions

2015-09-14 Thread John Snow
On 09/11/2015 02:56 AM, Michael Tokarev wrote: > 09.09.2015 19:28, John Snow wrote: >> We're a little too lenient with what we'll let an ATAPI drive handle. >> Clamp down on the IDE command execution table to remove CD_OK permissions >> from commands that are not and have never been ATAPI

Re: [Qemu-block] [Qemu-devel] [PATCH] iscsi: Add chap and "initiator-name" etc as per drive options

2015-09-14 Thread Fam Zheng
On Fri, 09/11 08:27, ronnie sahlberg wrote: > On Fri, Sep 11, 2015 at 8:20 AM, Eric Blake wrote: > > On 09/11/2015 12:00 AM, Fam Zheng wrote: > >> Previously we use "-iscsi id=target-iqn,user=foo,password=bar,..." to > >> specify iscsi connection parameters, unfortunately it

Re: [Qemu-block] [Qemu-devel] [PATCH v2 00/11] aio: Introduce handler type to fix nested aio_poll for dataplane

2015-09-14 Thread Kevin Wolf
Am 14.09.2015 um 09:27 hat Fam Zheng geschrieben: > On Fri, 09/11 14:22, Kevin Wolf wrote: > > Am 11.09.2015 um 13:46 hat Fam Zheng geschrieben: > > > On Fri, 09/11 12:39, Kevin Wolf wrote: > > > > Am 29.07.2015 um 06:42 hat Fam Zheng geschrieben: > > > > > v2: Switch to disable/enable model.

Re: [Qemu-block] [Qemu-devel] [PULL 00/23] Block layer patches

2015-09-14 Thread Peter Maydell
On 11 September 2015 at 20:40, Kevin Wolf wrote: > The following changes since commit 30c38c90bd3f1bb105ebc069ac1821067c980b7c: > > scripts/qemu-gdb: Add brief comment describing usage (2015-09-11 17:14:50 > +0100) > > are available in the git repository at: > >

Re: [Qemu-block] [PATCH v3 2/4] block: Add 'ignore-backing' field to BlockdevOptionsGenericCOWFormat

2015-09-14 Thread Kevin Wolf
Am 14.09.2015 um 07:54 hat Alberto Garcia geschrieben: > On Fri 11 Sep 2015 07:33:41 PM CEST, Max Reitz wrote: > > >>> So why do we need the new flag? Because "backing: ''" is ugly? > >> > >> I guess it's just because you're the only one who actually reads the > >>

Re: [Qemu-block] [Qemu-devel] [PULL 00/23] Block layer patches

2015-09-14 Thread Kevin Wolf
Am 14.09.2015 um 11:46 hat Peter Maydell geschrieben: > On 11 September 2015 at 20:40, Kevin Wolf wrote: > > The following changes since commit 30c38c90bd3f1bb105ebc069ac1821067c980b7c: > > > > scripts/qemu-gdb: Add brief comment describing usage (2015-09-11 17:14:50 > >