[Qemu-block] [PATCH for-2.6 4/7] block/vpc: Use the correct max sector count for VHD images

2016-03-22 Thread Jeff Cody
The old VHD_MAX_SECTORS value is incorrect, and is a throwback to the CHS calculations. The VHD specification allows images up to 2040 GiB, which (using 512 byte sectors) corresponds to a maximum number of sectors of 0xff00, rather than the old value of 0xfe0001ff. Update VHD_MAX_SECTORS to r

[Qemu-block] [PATCH for-2.6 5/7] block/vpc: make checks on max table size a bit more lax

2016-03-22 Thread Jeff Cody
The check on the max_table_size field not being larger than required is valid, and in accordance with the VHD spec. However, there have been VHD images encountered in the wild that have an out-of-spec max table size that is technically too large. There is no issue in allowing this larger table si

[Qemu-block] [PATCH for-2.6 7/7] block/vpc: update comments to be compliant w/coding guidelines

2016-03-22 Thread Jeff Cody
Signed-off-by: Jeff Cody --- block/vpc.c | 70 ++--- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index 5dd9950..0b48cf4 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -36,7 +36,7 @@ #define HEA

[Qemu-block] [PATCH for-2.6 3/7] block/vpc: use current_size field for XenConverter VHD images

2016-03-22 Thread Jeff Cody
XenConverter VHD images are another VHD image where current_size is different from the CHS values in the the format header. Use current_size as the default, by looking at the creator_app signature field. Signed-off-by: Jeff Cody --- block/vpc.c | 2 ++ 1 file changed, 2 insertions(+) diff --gi

[Qemu-block] [PATCH for-2.6 2/7] vpc: use current_size field for XenServer VHD images

2016-03-22 Thread Jeff Cody
From: Stefan Hajnoczi The vpc driver has two methods of determining virtual disk size. The correct one to use depends on the software that generated the image file. Add the XenServer creator_app signature so that image size is correctly detected for those images. Reported-by: Grant Wu Reporte

[Qemu-block] [PATCH for-2.6 1/7] block/vpc: fix VPC 'qemu-img create' regression

2016-03-22 Thread Jeff Cody
Commit 'b8f45cdf7827e39f9a1e6cc446f5972cc6144237' switched VPC over to using blk_pwrite() instead of bdrv_pwrite_sync(). The return value of bdrv_pwrite_sync() was always 0 for success, and create_dynamic_disk() in one instance checked for a non-zero return value to indicate error. However, blk_p

[Qemu-block] [PATCH for-2.6 6/7] block/vpc: set errp in vpc_open

2016-03-22 Thread Jeff Cody
Add more useful error information to failure paths in vpc_open Signed-off-by: Jeff Cody --- block/vpc.c | 9 + 1 file changed, 9 insertions(+) diff --git a/block/vpc.c b/block/vpc.c index 67ab376..5dd9950 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -237,6 +237,7 @@ static int vpc_open

[Qemu-block] [PATCH for-2.6 0/7] block: VHD format fixes

2016-03-22 Thread Jeff Cody
Fixes for a regression in vpc_create(), as well as a few issues with VHD format compatibility. Jeff Cody (6): block/vpc: fix VPC 'qemu-img create' regression block/vpc: use current_size field for XenConverter VHD images block/vpc: Use the correct max sector count for VHD images block/vpc:

Re: [Qemu-block] [Qemu-devel] [PATCH 03/12] block: Introduce BlockBackendPublic

2016-03-22 Thread Eric Blake
On 03/22/2016 09:33 AM, Kevin Wolf wrote: > Some features, like I/O throttling, are implemented outside > block-backend.c, but still want to keep BlockBackends in a list. In > order to avoid exposing the whole struct layout in the public header > file, this patch introduces an embedded public struc

Re: [Qemu-block] [Qemu-devel] [PATCH 06/22] hbitmap: load/store

2016-03-22 Thread John Snow
On 03/15/2016 04:04 PM, Vladimir Sementsov-Ogievskiy wrote: > Add functions for load/store HBitmap to BDS, using clusters table: > Last level of the bitmap is splitted into chunks of 'cluster_size' > size. Each cell of the table contains offset in bds, to load/store > corresponding chunk. > > Al

Re: [Qemu-block] [Qemu-devel] [PATCH 02/12] block: Make sure throttled BDSes always have a BB

2016-03-22 Thread Eric Blake
On 03/22/2016 09:33 AM, Kevin Wolf wrote: > It was already true in principle that a throttled BDS always has a BB > attached, except that the order of operations while attaching or > detaching a BDS to/from a BB wasn't careful enough. > > This commit breaks graph manipulations while I/O throttling

Re: [Qemu-block] [Qemu-devel] [PATCH 01/12] block: Don't disable I/O throttling on sync requests

2016-03-22 Thread Eric Blake
On 03/22/2016 09:33 AM, Kevin Wolf wrote: > We had to disable I/O throttling with synchronous requests because we > didn't use to run timers in nested event loops when the code was > introduced. This isn't true any more, and throttling works just fine > even when using the synchronous API. > > The

Re: [Qemu-block] [PATCH v3 10/10] vnc: allow specifying a custom ACL object name

2016-03-22 Thread Eric Blake
On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > The VNC server has historically had support for ACLs to check > both the SASL username and the TLS x509 distinguished name. > The VNC server was responsible for creating the initial ACL, > and the client app was then responsible for populating it

Re: [Qemu-block] [PATCH 0/9] block: Remove BlockDriverState.blk

2016-03-22 Thread Paolo Bonzini
On 22/03/2016 20:36, Kevin Wolf wrote: > This is the final patch series that is required before we can start allowing > setups with more than one BlockBackend per BlockDriverState. > > My current plan is to put the patches up to (and including) this series into > 2.6 so that we have a relatively

Re: [Qemu-block] [PATCH 00/12] block: Move I/O throttling to BlockBackend

2016-03-22 Thread Paolo Bonzini
On 22/03/2016 16:33, Kevin Wolf wrote: > This is another feature that was "logically" part of the BlockBackend, but > implemented as a BlockDriverState feature. It was always kept on top using > swap_feature_fields(). > > This series moves it to be actually implemented in the BlockBackend, removin

Re: [Qemu-block] [PATCH v3 09/10] chardev: add support for ACLs for TLS clients

2016-03-22 Thread Eric Blake
On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > Currently any client which can complete the TLS handshake > is able to use a chardev server. The server admin can turn > on the 'verify-peer' option for the x509 creds to require > the client to provide a x509 certificate. This means the > client

[Qemu-block] [PATCH 9/9] block: Remove BlockDriverState.blk

2016-03-22 Thread Kevin Wolf
This patch removes the remaining users of bs->blk, which will allow us to have multiple BBs on top of a single BDS. All checks that are currently in place to prevent the user from creating such setups. Future patches can allow them and e.g. enable users to mirror to a block device that already has

[Qemu-block] [PATCH 8/9] block: Don't return throttling info in query-named-block-nodes

2016-03-22 Thread Kevin Wolf
query-named-block-nodes should not return information that is related to the attached BlockBackend rather than the node itself, so throttling information needs to be removed from it. Signed-off-by: Kevin Wolf --- block/qapi.c | 6 +++--- tests/qemu-iotests/096 | 3 ++- 2 files changed,

[Qemu-block] [PATCH 5/9] block: Avoid BDS.blk in bdrv_next()

2016-03-22 Thread Kevin Wolf
We just want to know whether a BDS has at least one BB attached in order to avoid enumerating it twice. This doesn't depend on the exact BB that is attached and is still a valid question when more than one BB can be attached, so just answer it by checking the parents list. Signed-off-by: Kevin Wol

[Qemu-block] [PATCH 6/9] block: Remove bdrv_move_feature_fields()

2016-03-22 Thread Kevin Wolf
bdrv_move_feature_fields() and swap_feature_fields() are empty now, they can be removed. Signed-off-by: Kevin Wolf --- block.c | 30 -- 1 file changed, 30 deletions(-) diff --git a/block.c b/block.c index 66f918e..3770fb0 100644 --- a/block.c +++ b/block.c @@ -,1

[Qemu-block] [PATCH 4/9] block: Remove bdrv_aio_multiwrite()

2016-03-22 Thread Kevin Wolf
Since virtio-blk implements request merging itself these days, the only remaining users are test cases for the function. That doesn't make the function exactly useful any more. Signed-off-by: Kevin Wolf --- block/block-backend.c | 14 --- block/io.c | 194 --

[Qemu-block] [PATCH 2/9] block: User BdrvChild callback for device name

2016-03-22 Thread Kevin Wolf
In order to get rid of bs->blk for bdrv_get_device_name() and bdrv_get_device_or_node_name(), ask all parents for their name and simply pick the first one. Signed-off-by: Kevin Wolf --- block.c | 22 -- block/block-backend.c | 6 ++ include/block/bl

[Qemu-block] [PATCH 3/9] block jobs: Use BdrvChild callbacks for iostatus operations

2016-03-22 Thread Kevin Wolf
The block jobs currently modify the target BB's error handling options and require that the source BB's iostatus is enabled in order to implement the per-job error options. It's obvious that this is something between ugly, adventurous and plain wrong, so we should ideally fix this instead of thinki

[Qemu-block] [PATCH 7/9] block: Avoid bs->blk in bdrv_next()

2016-03-22 Thread Kevin Wolf
We need to introduce a separate BdrvNextIterator struct that can keep more state than just the current BDS in order to avoid using the bs->blk pointer. Signed-off-by: Kevin Wolf --- block.c| 34 +--- block/block-backend.c | 44

[Qemu-block] [PATCH 0/9] block: Remove BlockDriverState.blk

2016-03-22 Thread Kevin Wolf
This is the final patch series that is required before we can start allowing setups with more than one BlockBackend per BlockDriverState. My current plan is to put the patches up to (and including) this series into 2.6 so that we have a relatively consistent block layer state in the release that i

[Qemu-block] [PATCH 1/9] block: Use BdrvChild callbacks for change_media/resize

2016-03-22 Thread Kevin Wolf
We want to get rid of BlockDriverState.blk in order to allow multiple BlockBackends per BDS. Converting the device callbacks in block.c (which assume a single BlockBackend) to per-child callbacks gets us rid of the first few instances. Signed-off-by: Kevin Wolf --- block.c | 38

Re: [Qemu-block] [PATCH 22/22] qcow2-dirty-bitmap: add EXTRA_DATA_COMPATIBLE flag

2016-03-22 Thread Eric Blake
On 03/15/2016 02:04 PM, Vladimir Sementsov-Ogievskiy wrote: > If this flag is unset and exta data present the bitmap should be s/exta/extra/ s/present/is present/ > read-only. For now just return error for this case. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/qcow2-dirty-bit

Re: [Qemu-block] [PATCH 18/22] qcow2-dirty-bitmaps: disallow stroing bitmap to other bs

2016-03-22 Thread Eric Blake
On 03/15/2016 02:04 PM, Vladimir Sementsov-Ogievskiy wrote: In the subject: s/stroing/storing/ > Check, that bitmap is stored to the owning bs. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libv

Re: [Qemu-block] [PATCH 12/22] qcow2-dirty-bitmap: add qcow2_bitmap_load_check()

2016-03-22 Thread Eric Blake
On 03/15/2016 02:04 PM, Vladimir Sementsov-Ogievskiy wrote: > The function checks existing of the bitmap without loading it. s/existing/the existence/ > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http

Re: [Qemu-block] [PATCH 10/22] qcow2-dirty-bitmap: add qcow2_bitmap_store()

2016-03-22 Thread Eric Blake
On 03/15/2016 02:04 PM, Vladimir Sementsov-Ogievskiy wrote: > This function stores block dirty bitmap to qcow2. If the bitmap with > the same name, size and granularity already exists, it will be > rewritten, if the bitmap with the same name exists but granularity or > size does not match, an error

Re: [Qemu-block] [PATCH 20/22] iotests: test internal persistent dirty bitmap

2016-03-22 Thread Eric Blake
On 03/15/2016 02:04 PM, Vladimir Sementsov-Ogievskiy wrote: > Add simple test cases for testing persistent dirty bitmaps. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > tests/qemu-iotests/160| 112 > ++ > tests/qemu-iotests/160.out|

Re: [Qemu-block] [PATCH 19/22] iotests: add VM.test_launcn()

2016-03-22 Thread Eric Blake
On 03/15/2016 02:04 PM, Vladimir Sementsov-Ogievskiy wrote: in subject: s/launcn/launch/ > Test vm can launch and print output in case of fail. This function is > needed for testing erroneous cases > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > tests/qemu-iotests/iotests.py | 20 +

Re: [Qemu-block] [PATCH v3 08/10] nbd: allow an ACL to be set with nbd-server-start QMP command

2016-03-22 Thread Eric Blake
On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > As with the previous patch to qemu-nbd, the nbd-server-start > QMP command also needs to be able to specify an ACL when > enabling TLS encryption. > > First the client must create a QAuthZ object instance using > the 'object-add' command: > > S

Re: [Qemu-block] [PATCH v3 07/10] qemu-nbd: add support for ACLs for TLS clients

2016-03-22 Thread Eric Blake
On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > Currently any client which can complete the TLS handshake > is able to use the NBD server. The server admin can turn > on the 'verify-peer' option for the x509 creds to require > the client to provide a x509 certificate. This means the > client wi

Re: [Qemu-block] [Qemu-devel] [PATCH 04/22] iotests: add default node-name

2016-03-22 Thread John Snow
On 03/15/2016 04:04 PM, Vladimir Sementsov-Ogievskiy wrote: > When testing migration, auto-generated by qemu node-names differs in > source and destination qemu and migration fails. After this patch, > auto-generated by iotest nodenames will be the same. > > Signed-off-by: Vladimir Sementsov-Ogi

Re: [Qemu-block] [Qemu-devel] [PATCH 01/22] block: Add two dirty bitmap getters

2016-03-22 Thread John Snow
On 03/15/2016 04:08 PM, Vladimir Sementsov-Ogievskiy wrote: > On 15.03.2016 23:04, Vladimir Sementsov-Ogievskiy wrote: >> From: Fam Zheng >> >> For dirty bitmap users to get the size and the name of a >> BdrvDirtyBitmap. >> >> Signed-off-by: Fam Zheng >> Reviewed-by: John Snow >> Signed-off-by

Re: [Qemu-block] [PATCH 4/4] virtio-blk: Clean up start/stop with mutex and BH

2016-03-22 Thread Paolo Bonzini
On 22/03/2016 13:52, Fam Zheng wrote: >> You're right. After unrealizing virtio_blk_data_plane_stop has set of >> vblk->dataplane_started = false, so that's covered. However, you still >> need an object_ref/object_object_unref pair. > > Is it safe to call object_unref outside BQL? Hmm, no. H

Re: [Qemu-block] [PATCH v3 06/10] acl: delete existing ACL implementation

2016-03-22 Thread Eric Blake
On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > The 'qemu_acl' type was a previous non-QOM based attempt to > provide an authorization facility in QEMU. Because it is > non-QOM based it cannot be created via the command line and > requires special monitor commands to manipulate it. > > The new

Re: [Qemu-block] [PATCH v3 05/10] util: add QAuthZSimple object type for a simple access control list

2016-03-22 Thread Eric Blake
On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > Add a QAuthZSimple object type that implements the QAuthZ > interface. This simple built-in implementation maintains > a trivial access control list with a sequence of match > rules and a final default policy. This replicates the > functionality c

Re: [Qemu-block] [Qemu-devel] [PATCH 0/2] block/qapi: trivial fixes

2016-03-22 Thread Kevin Wolf
Am 22.03.2016 um 16:50 hat Markus Armbruster geschrieben: > Peter Xu writes: > > > One is to use literal printf format when possible. > > > > One is to fix an unbounded usage of stack. > > I lack the time to take this through my tree before my Easter vacation. > Kevin, can you stick it into your

Re: [Qemu-block] [PATCH v3 04/10] util: add QAuthZ object as an authorization base class

2016-03-22 Thread Daniel P. Berrange
On Tue, Mar 22, 2016 at 10:33:42AM -0600, Eric Blake wrote: > On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > > The current qemu_acl module provides a simple access control > > list facility inside QEMU, which is used via a set of monitor > > commands acl_show, acl_policy, acl_add, acl_remove &

Re: [Qemu-block] [PATCH 01/22] block: Add two dirty bitmap getters

2016-03-22 Thread Eric Blake
On 03/15/2016 02:08 PM, Vladimir Sementsov-Ogievskiy wrote: > On 15.03.2016 23:04, Vladimir Sementsov-Ogievskiy wrote: >> From: Fam Zheng >> >> For dirty bitmap users to get the size and the name of a >> BdrvDirtyBitmap. >> >> Signed-off-by: Fam Zheng >> Reviewed-by: John Snow >> Signed-off-by:

Re: [Qemu-block] [PATCH v3 04/10] util: add QAuthZ object as an authorization base class

2016-03-22 Thread Daniel P. Berrange
On Tue, Mar 22, 2016 at 10:33:42AM -0600, Eric Blake wrote: > On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > > The current qemu_acl module provides a simple access control > > list facility inside QEMU, which is used via a set of monitor > > commands acl_show, acl_policy, acl_add, acl_remove &

Re: [Qemu-block] [PATCH v3 04/10] util: add QAuthZ object as an authorization base class

2016-03-22 Thread Eric Blake
On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > The current qemu_acl module provides a simple access control > list facility inside QEMU, which is used via a set of monitor > commands acl_show, acl_policy, acl_add, acl_remove & acl_reset. > > Note there is no ability to create ACLs - the netwo

Re: [Qemu-block] [PATCH v3 02/10] qapi: allow QmpInputVisitor to auto-cast types

2016-03-22 Thread Eric Blake
On 03/22/2016 09:49 AM, Daniel P. Berrange wrote: > On Mon, Mar 21, 2016 at 05:18:01PM -0600, Eric Blake wrote: >> On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: >>> Currently the QmpInputVisitor assumes that all scalar >>> values are directly represented as their final types. >>> ie it assumes

Re: [Qemu-block] [Qemu-devel] [PATCH] block: Remove blk_set_bs()

2016-03-22 Thread Eric Blake
On 03/22/2016 06:55 AM, Kevin Wolf wrote: > The function is unused since commit f21d96d0 ('block: Use BdrvChild in > BlockBackend'). > > Signed-off-by: Kevin Wolf > --- > block/block-backend.c | 17 - > include/block/block_int.h | 2 -- > 2 files changed, 19 deletions(-) Re

Re: [Qemu-block] [PATCH v3 03/10] qom: support arbitrary non-scalar properties with -object

2016-03-22 Thread Daniel P. Berrange
On Mon, Mar 21, 2016 at 05:27:24PM -0600, Eric Blake wrote: > On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > > The current -object command line syntax only allows for > > creation of objects with scalar properties, or a list > > with a fixed scalar element type. Objects which have > > properti

Re: [Qemu-block] [Qemu-devel] [PATCH 0/2] block/qapi: trivial fixes

2016-03-22 Thread Markus Armbruster
Peter Xu writes: > One is to use literal printf format when possible. > > One is to fix an unbounded usage of stack. I lack the time to take this through my tree before my Easter vacation. Kevin, can you stick it into your next pull request for me? Note trivial fixup on PATCH 2.

Re: [Qemu-block] [PATCH v3 02/10] qapi: allow QmpInputVisitor to auto-cast types

2016-03-22 Thread Daniel P. Berrange
On Mon, Mar 21, 2016 at 05:18:01PM -0600, Eric Blake wrote: > On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > > Currently the QmpInputVisitor assumes that all scalar > > values are directly represented as their final types. > > ie it assumes an 'int' is using QInt, and a 'bool' is > > using QBo

Re: [Qemu-block] [Qemu-devel] [PATCH 2/2] block/qapi: fix unbounded stack for dump_qdict

2016-03-22 Thread Markus Armbruster
Peter Xu writes: > Using heap instead of stack for better safety. > > Signed-off-by: Peter Xu > --- > block/qapi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/block/qapi.c b/block/qapi.c > index c4c2115..b798e35 100644 > --- a/block/qapi.c > +++ b/block/qapi.c >

Re: [Qemu-block] [Qemu-devel] [PATCH 1/2] block/qapi: make two printf() formats literal

2016-03-22 Thread Markus Armbruster
Peter Xu writes: > Fix two places to use literal printf format when possible. > > Signed-off-by: Peter Xu Reviewed-by: Markus Armbruster

Re: [Qemu-block] [PATCH v3 01/10] qdict: implement a qdict_crumple method for un-flattening a dict

2016-03-22 Thread Daniel P. Berrange
On Mon, Mar 21, 2016 at 04:45:39PM -0600, Eric Blake wrote: > On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > > +/* Unescape the '..' sequence into '.' */ > > +for (i = 0, j = 0; (*prefix)[i] != '\0'; i++, j++) { > > +if ((*prefix)[i] == '.' && > > +(*prefix)[i + 1]

[Qemu-block] [PATCH 03/12] block: Introduce BlockBackendPublic

2016-03-22 Thread Kevin Wolf
Some features, like I/O throttling, are implemented outside block-backend.c, but still want to keep BlockBackends in a list. In order to avoid exposing the whole struct layout in the public header file, this patch introduces an embedded public struct where list entry structs can be added and a pair

[Qemu-block] [PATCH 12/12] block: Don't check throttled reqs in bdrv_requests_pending()

2016-03-22 Thread Kevin Wolf
Checking whether there are throttled requests requires going to the associated BlockBackend, which we want to avoid. All users of bdrv_requests_pending() already call bdrv_flush_io_queue() first, which restarts throttled requests. We just have to use the return value of that callback (which tells u

[Qemu-block] [PATCH 10/12] block: Drain throttling queue with BdrvChild callback

2016-03-22 Thread Kevin Wolf
This removes the last part of I/O throttling from block/io.c and moves it to the BlockBackend. When draining the queue of a BlockDriverState, we must make sure that no new requests can come in for it. Request sources from outside the block layer are disabled with aio_disable_external(), but the th

[Qemu-block] [PATCH 09/12] block: Introduce BdrvChild.opaque

2016-03-22 Thread Kevin Wolf
BlockBackends use it to get a back pointer from BdrvChild to BlockBackend in any BdrvChildRole callbacks. Signed-off-by: Kevin Wolf --- block/block-backend.c | 2 ++ include/block/block_int.h | 1 + 2 files changed, 3 insertions(+) diff --git a/block/block-backend.c b/block/block-backend.c

[Qemu-block] [PATCH 08/12] block: Move I/O throttling configuration functions to BlockBackend

2016-03-22 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block.c | 2 +- block/block-backend.c | 49 +++-- block/io.c | 47 +-- block/qapi.c| 2 +- block/throttle-groups.c

[Qemu-block] [PATCH 07/12] block: Move actual I/O throttling to BlockBackend

2016-03-22 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block/block-backend.c | 10 ++ block/io.c | 10 -- block/throttle-groups.c | 5 ++--- include/block/throttle-groups.h | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/block/block-backend

[Qemu-block] [PATCH 05/12] block: Convert throttle_group_get_name() to BlockBackend

2016-03-22 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- block/block-backend.c | 2 +- block/io.c | 2 +- block/qapi.c| 2 +- block/throttle-groups.c | 12 ++-- include/block/throttle-groups.h | 2 +- tests/test-throttle.c | 4 ++-- 6 files c

[Qemu-block] [PATCH 11/12] block: Decouple throttling from BlockDriverState

2016-03-22 Thread Kevin Wolf
This moves the throttling related part of the BDS life cycle management to BlockBackend. The throttling group reference is now kept even when no medium is inserted. With this commit, throttling isn't disabled and then re-enabled any more during graph reconfiguration. This fixes the temporary break

[Qemu-block] [PATCH 06/12] block: Move throttling fields from BDS to BB

2016-03-22 Thread Kevin Wolf
This patch changes where the throttling state is stored (used to be the BlockDriverState, now it is the BlockBackend), but it doesn't actually make it a BB level feature yet. For example, throttling is still disabled when the BDS is detached from the BB. Signed-off-by: Kevin Wolf --- block.c

[Qemu-block] [PATCH 01/12] block: Don't disable I/O throttling on sync requests

2016-03-22 Thread Kevin Wolf
We had to disable I/O throttling with synchronous requests because we didn't use to run timers in nested event loops when the code was introduced. This isn't true any more, and throttling works just fine even when using the synchronous API. The removed code is in fact dead code since commit a8823a

[Qemu-block] [PATCH 00/12] block: Move I/O throttling to BlockBackend

2016-03-22 Thread Kevin Wolf
This is another feature that was "logically" part of the BlockBackend, but implemented as a BlockDriverState feature. It was always kept on top using swap_feature_fields(). This series moves it to be actually implemented in the BlockBackend, removing another obstacle for removing bs->blk and allow

[Qemu-block] [PATCH 04/12] block: throttle-groups: Use BlockBackend pointers internally

2016-03-22 Thread Kevin Wolf
As a first step towards moving I/O throttling to the BlockBackend level, this patch changes all pointers in struct ThrottleGroup from referencing a BlockDriverState to referencing a BlockBackend. This change is valid because we made sure that throttling can only be enabled on BDSes which have a BB

[Qemu-block] [PATCH 02/12] block: Make sure throttled BDSes always have a BB

2016-03-22 Thread Kevin Wolf
It was already true in principle that a throttled BDS always has a BB attached, except that the order of operations while attaching or detaching a BDS to/from a BB wasn't careful enough. This commit breaks graph manipulations while I/O throttling is enabled. It would have been possible, but quite

Re: [Qemu-block] [PATCH] vpc: use current_size field for XenServer VHD images

2016-03-22 Thread Grant Wu
root@storage-4:~# hexdump -C -n 512 -s 512 /dev/vgstorage/tartanfsbackup 0200 63 78 73 70 61 72 73 65 ff ff ff ff ff ff ff ff |cxsparse| 0210 00 00 00 00 00 00 06 00 00 01 00 00 00 10 00 00 || 0220 00 20 00 00 ff ff f4 67 00 00 00 00 00 00 00 00 |. .

Re: [Qemu-block] [Qemu-devel] [PATCH 06/20] xen_disk: Call blk_set_enable_write_cache() explicitly

2016-03-22 Thread Stefano Stabellini
On Fri, 18 Mar 2016, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > hw/block/xen_disk.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/hw/block/xen_disk.c b/hw/block/xen_disk.c > index 635328f..c358709 100644 > --- a/hw/block/xen_disk.c > +++ b/hw/block/xen_d

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop

2016-03-22 Thread Cornelia Huck
On Tue, 22 Mar 2016 13:11:05 +0100 Paolo Bonzini wrote: > On 22/03/2016 12:59, Cornelia Huck wrote: > >> > They can be fixed with just an extra object_ref/object_unref. > >> > > >> > I didn't understand that Tu Bo also needed the BH fix, and with that > >> > information it makes sense. Passing

[Qemu-block] [PATCH] block: Remove blk_set_bs()

2016-03-22 Thread Kevin Wolf
The function is unused since commit f21d96d0 ('block: Use BdrvChild in BlockBackend'). Signed-off-by: Kevin Wolf --- block/block-backend.c | 17 - include/block/block_int.h | 2 -- 2 files changed, 19 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c i

Re: [Qemu-block] [PATCH 4/4] virtio-blk: Clean up start/stop with mutex and BH

2016-03-22 Thread Fam Zheng
On Thu, 03/17 16:07, Paolo Bonzini wrote: > > > On 17/03/2016 16:00, Stefan Hajnoczi wrote: > >> > +data = g_new(VirtIOBlockStartData, 1); > >> > +data->vblk = vblk; > >> > +data->bh = aio_bh_new(s->ctx, virtio_blk_data_plane_start_bh_cb, > >> > data); > >> > +qemu_bh_schedule(da

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop

2016-03-22 Thread Paolo Bonzini
On 22/03/2016 12:59, Cornelia Huck wrote: >> > They can be fixed with just an extra object_ref/object_unref. >> > >> > I didn't understand that Tu Bo also needed the BH fix, and with that >> > information it makes sense. Passing the assign value ensures that >> > ioeventfd remains always assign

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop

2016-03-22 Thread Cornelia Huck
On Tue, 22 Mar 2016 10:46:58 +0100 Paolo Bonzini wrote: > On 22/03/2016 10:07, Cornelia Huck wrote: > > So far, we had the best results with my refactoring + the mutex/bh > > change. Two problems: > > > > - We don't really understand yet why my refactoring helps, but passing > > the assign value

Re: [Qemu-block] [Qemu-devel] [PATCH 06/22] hbitmap: load/store

2016-03-22 Thread Vladimir Sementsov-Ogievskiy
On 22.03.2016 01:42, John Snow wrote: On 03/15/2016 04:04 PM, Vladimir Sementsov-Ogievskiy wrote: Add functions for load/store HBitmap to BDS, using clusters table: Last level of the bitmap is splitted into chunks of 'cluster_size' size. Each cell of the table contains offset in bds, to load/st

Re: [Qemu-block] [PATCH] vpc: use current_size field for XenServer VHD images

2016-03-22 Thread Stefan Hajnoczi
On Mon, Mar 21, 2016 at 02:37:46PM -0400, Spencer Baugh wrote: > Stefan Hajnoczi writes: > > What output did you get from "qemu-img info /dev/dm-1"? > > After the patching: > > root@storage-4:~# hexdump -C -n 512 /dev/vgstorage/tartanfsbackup > 63 6f 6e 65 63 74 69 78 00 00 00 02 00 0

Re: [Qemu-block] [PATCH v6 08/11] block: add support for --image-opts in block I/O tests

2016-03-22 Thread Daniel P. Berrange
On Mon, Mar 21, 2016 at 02:08:16PM -0600, Eric Blake wrote: > On 03/21/2016 08:11 AM, Daniel P. Berrange wrote: > > Currently all block tests use the traditional syntax for images > > just specifying a filename. To support the LUKS driver without > > resorting to JSON, the tests need to be able to

Re: [Qemu-block] [Qemu-devel] [PATCH v3 03/10] qom: support arbitrary non-scalar properties with -object

2016-03-22 Thread Daniel P. Berrange
On Tue, Mar 22, 2016 at 10:07:42AM +0100, Markus Armbruster wrote: > Eric Blake writes: > > > On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: > >> The current -object command line syntax only allows for > >> creation of objects with scalar properties, or a list > >> with a fixed scalar element

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop

2016-03-22 Thread Paolo Bonzini
On 22/03/2016 10:07, Cornelia Huck wrote: > So far, we had the best results with my refactoring + the mutex/bh > change. Two problems: > > - We don't really understand yet why my refactoring helps, but passing > the assign value is a good canditate (and it's agreed that this fixes a > bug, I thi

Re: [Qemu-block] [Qemu-devel] [PATCH v3 03/10] qom: support arbitrary non-scalar properties with -object

2016-03-22 Thread Markus Armbruster
Eric Blake writes: > On 03/10/2016 11:59 AM, Daniel P. Berrange wrote: >> The current -object command line syntax only allows for >> creation of objects with scalar properties, or a list >> with a fixed scalar element type. Objects which have >> properties that are represented as structs in the Q

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop

2016-03-22 Thread Cornelia Huck
(re-adding cc:s) On Tue, 22 Mar 2016 15:18:05 +0800 Fam Zheng wrote: > On Tue, 03/22 15:10, tu bo wrote: > > Hi Fam: > > > > On 03/21/2016 06:57 PM, Fam Zheng wrote: > > >On Thu, 03/17 19:03, tu bo wrote: > > >> > > >>On 03/17/2016 08:39 AM, Fam Zheng wrote: > > >>>On Wed, 03/16 14:45, Paolo Bo

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] Tweaks around virtio-blk start/stop

2016-03-22 Thread Cornelia Huck
On Tue, 22 Mar 2016 07:45:19 +0800 Fam Zheng wrote: > On Mon, 03/21 14:02, Cornelia Huck wrote: > > On Mon, 21 Mar 2016 20:45:27 +0800 > > Fam Zheng wrote: > > > > > On Mon, 03/21 12:15, Cornelia Huck wrote: > > > > On Mon, 21 Mar 2016 18:57:18 +0800 > > > > Fam Zheng wrote: > > > > > > > > >