Re: [Qemu-block] [Qemu-devel] internal snapshots with sheepdog

2015-09-18 Thread Kevin Wolf
Am 11.09.2015 um 17:49 hat Vasiliy Tolstov geschrieben: > Hi! qcow2 have abilit to store vm state inside qcow2 file in space > that not allocated to guest, but if i want to store vm state inside > sheepdog storage with raw image what is the preferred place to store > memory data? > I simply can

[Qemu-block] [PATCH v4 3/4] qmp: add monitor command to add/remove a child

2015-09-18 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- blockdev.c | 48 ++ qapi/block-core.json | 34

[Qemu-block] [PATCH v4 0/4] qapi: child add/delete support

2015-09-18 Thread Wen Congyang
If quorum's child is broken, we can use mirror job to replace it. But sometimes, the user only need to remove the broken child, and add it later when the problem is fixed. It is based on the following patch: http://lists.nongnu.org/archive/html/qemu-devel/2015-09/msg04579.html ChangLog: v4: 1.

[Qemu-block] [PATCH v4 1/4] Add new block driver interface to add/delete a BDS's child

2015-09-18 Thread Wen Congyang
In some cases, we want to take a quorum child offline, and take another child online. Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei --- block.c | 50

[Qemu-block] [PATCH v4 4/4] hmp: add monitor command to add/remove a child

2015-09-18 Thread Wen Congyang
Signed-off-by: Wen Congyang Signed-off-by: zhanghailiang Signed-off-by: Gonglei Cc: Luiz Capitulino --- hmp-commands.hx | 28 hmp.c | 20

Re: [Qemu-block] [Qemu-devel] internal snapshots with sheepdog

2015-09-18 Thread Vasiliy Tolstov
2015-09-18 12:02 GMT+03:00 Kevin Wolf : > Doesn't sheepdog already support storing snapshots in the same image? > I thought it would just work; at least, there's some code there for it. Yes, qemu and sheepdog have ability to create internal snapshot, i miss that, but when i'm

Re: [Qemu-block] [Qemu-devel] internal snapshots with sheepdog

2015-09-18 Thread Kevin Wolf
Am 18.09.2015 um 11:03 hat Vasiliy Tolstov geschrieben: > 2015-09-18 12:02 GMT+03:00 Kevin Wolf : > > Doesn't sheepdog already support storing snapshots in the same image? > > I thought it would just work; at least, there's some code there for it. > > Yes, qemu and sheepdog have

Re: [Qemu-block] [PATCH v5 22/38] block: Prepare for NULL BDS

2015-09-18 Thread Eric Blake
On 09/18/2015 09:22 AM, Max Reitz wrote: > blk_bs() will not necessarily return a non-NULL value any more (unless > blk_is_available() is true or it can be assumed to otherwise, e.g. > because it is called immediately after a successful blk_new_with_bs() or > blk_new_open()). > > Signed-off-by:

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

2015-09-18 Thread Max Reitz
On 14.09.2015 18:01, Alberto Garcia wrote: > 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

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

2015-09-18 Thread Max Reitz
On 14.09.2015 18:01, Alberto Garcia wrote: > Signed-off-by: Alberto Garcia > --- > tests/qemu-iotests/085 | 102 > ++--- > tests/qemu-iotests/085.out | 34 ++- > 2 files changed, 128 insertions(+), 8 deletions(-) Looks

Re: [Qemu-block] [PATCH 00/16] block: Get rid of bdrv_swap()

2015-09-18 Thread Alberto Garcia
On Thu 17 Sep 2015 03:48:04 PM CEST, Kevin Wolf wrote: > bdrv_swap() has always been an ugly hack that we would rather have > avoided. When it was introduced, we simply didn't have the > infrastructure to update pointers instead of transplanting the > contents of BDS object,

Re: [Qemu-block] [PATCH 13/16] block: Implement bdrv_append() without bdrv_swap()

2015-09-18 Thread Alberto Garcia
On Thu 17 Sep 2015 03:48:17 PM CEST, Kevin Wolf wrote: > +static void swap_feature_fields(BlockDriverState *bs_top, > +BlockDriverState *bs_new) > +{ > +BlockDriverState tmp; > + > +bdrv_move_feature_fields(, bs_top); > +bdrv_move_feature_fields(bs_top,

Re: [Qemu-block] [PATCH 13/16] block: Implement bdrv_append() without bdrv_swap()

2015-09-18 Thread Kevin Wolf
Am 18.09.2015 um 13:45 hat Alberto Garcia geschrieben: > On Thu 17 Sep 2015 03:48:17 PM CEST, Kevin Wolf wrote: > > > +static void swap_feature_fields(BlockDriverState *bs_top, > > +BlockDriverState *bs_new) > > +{ > > +BlockDriverState tmp; > > + > > +

Re: [Qemu-block] [sheepdog] [Qemu-devel] internal snapshots with sheepdog

2015-09-18 Thread Hitoshi Mitake
On Fri, Sep 18, 2015 at 6:49 PM, Kevin Wolf wrote: > Am 18.09.2015 um 11:03 hat Vasiliy Tolstov geschrieben: >> 2015-09-18 12:02 GMT+03:00 Kevin Wolf : >> > Doesn't sheepdog already support storing snapshots in the same image? >> > I thought it would just work;

Re: [Qemu-block] [Qemu-devel] internal snapshots with sheepdog

2015-09-18 Thread Eric Blake
On 09/18/2015 03:03 AM, Vasiliy Tolstov wrote: > 2015-09-18 12:02 GMT+03:00 Kevin Wolf : >> Doesn't sheepdog already support storing snapshots in the same image? >> I thought it would just work; at least, there's some code there for it. > > > Yes, qemu and sheepdog have ability

Re: [Qemu-block] [PATCH v5 0/4] Add 'blockdev-snapshot' command

2015-09-18 Thread Eric Blake
On 09/18/2015 07:16 AM, Alberto Garcia wrote: > This fixes the problem detect by Fam: the previous series was deleting > the 'backing' option for 'blockdev-add' even if it contained a > non-empty string. > > The code is also rebased on top of the current master. In particular > the test output

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

2015-09-18 Thread Eric Blake
On 09/14/2015 10:01 AM, Alberto Garcia wrote: > 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

Re: [Qemu-block] [PATCH v4 1/4] Add new block driver interface to add/delete a BDS's child

2015-09-18 Thread Eric Blake
On 09/18/2015 04:13 AM, Wen Congyang wrote: > In some cases, we want to take a quorum child offline, and take > another child online. > > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei

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

2015-09-18 Thread Eric Blake
On 09/18/2015 04:13 AM, Wen Congyang wrote: > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei Commit message should probably mention the name of the new commands. Also, if you

Re: [Qemu-block] [PATCH v4 4/4] hmp: add monitor command to add/remove a child

2015-09-18 Thread Eric Blake
On 09/18/2015 04:13 AM, Wen Congyang wrote: > Signed-off-by: Wen Congyang > Signed-off-by: zhanghailiang > Signed-off-by: Gonglei > Cc: Luiz Capitulino > --- > hmp-commands.hx | 28

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

2015-09-18 Thread Eric Blake
On 09/15/2015 12:42 AM, Alberto Garcia wrote: > On Tue 15 Sep 2015 04:27:21 AM CEST, Fam Zheng wrote: > >>> +backing = qdict_get_try_str(options, "backing"); >>> +if (backing && *backing == '\0') { >>> +flags |= BDRV_O_NO_BACKING; >>> +} >>> +

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/2] Auto-generated IDs

2015-09-18 Thread Markus Armbruster
Jeff Cody writes: > Changes from RFC v1: > > Patch 1: Several typos / grammatical errors (thanks Eric, John) > Make id_subsys_str[] const pointer to const strings (thanks Eric) > Moved id_subsys_str[] out from id_generate() (thanks John) >

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

2015-09-18 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 Reviewed-by: Max Reitz

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/2] block: auto-generated node-names

2015-09-18 Thread Markus Armbruster
Jeff Cody writes: > If a node-name is not specified, automatically generate the node-name. > > Generated node-names will use the "block" sub-system identifier. > > Reviewed-by: Eric Blake > Reviewed-by: John Snow > Signed-off-by: Jeff Cody

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

2015-09-18 Thread Alberto Garcia
This fixes the problem detect by Fam: the previous series was deleting the 'backing' option for 'blockdev-add' even if it contained a non-empty string. The code is also rebased on top of the current master. In particular the test output had to be adapted because of fe646693. Again, this depends

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

2015-09-18 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 v2 1/2] util - add automated ID generation utility

2015-09-18 Thread Markus Armbruster
Jeff Cody writes: > Multiple sub-systems in QEMU may find it useful to generate IDs > for objects that a user may reference via QMP or HMP. This patch > presents a standardized way to do it, so that automatic ID generation > follows the same rules. > > This patch enforces the

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

2015-09-18 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 v5 4/4] block: add tests for the 'blockdev-snapshot' command

2015-09-18 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] [PATCH 13/16] block: Implement bdrv_append() without bdrv_swap()

2015-09-18 Thread Alberto Garcia
On Fri 18 Sep 2015 02:24:21 PM CEST, Kevin Wolf wrote: >> > +static void swap_feature_fields(BlockDriverState *bs_top, >> > +BlockDriverState *bs_new) >> > +{ >> > +BlockDriverState tmp; >> > + >> > +bdrv_move_feature_fields(, bs_top); >> > +

Re: [Qemu-block] [PATCH v5 08/38] block/raw_bsd: Drop raw_is_inserted()

2015-09-18 Thread Eric Blake
On 09/18/2015 09:22 AM, Max Reitz wrote: > With the new automatically-recursive implementation of > bdrv_is_inserted() checking by default whether all the children of a BDS > are inserted, we can drop raw's own implementation. > > Signed-off-by: Max Reitz > --- >

[Qemu-block] [PATCH v5 19/38] block: Fail requests to empty BlockBackend

2015-09-18 Thread Max Reitz
If there is no BlockDriverState in a BlockBackend or if the tray of the guest device is open, fail all requests (where that is possible) with -ENOMEDIUM. The reason the status of the guest device is taken into account is because once the guest device's tray is opened, any request on the same

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

2015-09-18 Thread Max Reitz
On 18.09.2015 15:16, 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 v5 10/38] hw/block/fdc: Implement tray status

2015-09-18 Thread Eric Blake
On 09/18/2015 09:22 AM, Max Reitz wrote: > The tray of an FDD is open iff there is no medium inserted (there are > only two states for an FDD: "medium inserted" or "no medium inserted"). > > Signed-off-by: Max Reitz > --- > hw/block/fdc.c | 20 >

[Qemu-block] [PATCH v5 24/38] blockdev: Pull out blockdev option extraction

2015-09-18 Thread Max Reitz
Extract some of the blockdev option extraction code from blockdev_init() into its own function. This simplifies blockdev_init() and will allow reusing the code in a different function added in a follow-up patch. Signed-off-by: Max Reitz --- blockdev.c | 209

[Qemu-block] [PATCH v5 25/38] blockdev: Allow more options for BB-less BDS tree

2015-09-18 Thread Max Reitz
Most of the options which blockdev_init() parses for both the BlockBackend and the root BDS are valid for just the root BDS as well (e.g. read-only). This patch allows specifying these options even if not creating a BlockBackend. Signed-off-by: Max Reitz --- blockdev.c | 160

[Qemu-block] [PATCH v5 27/38] blockdev: Add blockdev-open-tray

2015-09-18 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 49 + qapi/block-core.json | 23 +++ qmp-commands.hx | 39 +++ 3 files changed, 111 insertions(+) diff --git

[Qemu-block] [PATCH v5 36/38] blockdev: read-only-mode for blockdev-change-medium

2015-09-18 Thread Max Reitz
Add an option to qmp_blockdev_change_medium() which allows changing the read-only status of the block device whose medium is changed. Some drives do not have a inherently fixed read-only status; for instance, floppy disks can be set read-only or writable independently of the drive. Some users may

[Qemu-block] [PATCH v5 22/38] block: Prepare for NULL BDS

2015-09-18 Thread Max Reitz
blk_bs() will not necessarily return a non-NULL value any more (unless blk_is_available() is true or it can be assumed to otherwise, e.g. because it is called immediately after a successful blk_new_with_bs() or blk_new_open()). Signed-off-by: Max Reitz --- block.c

Re: [Qemu-block] [PATCH v5 07/38] block: Make bdrv_is_inserted() recursive

2015-09-18 Thread Eric Blake
On 09/18/2015 09:22 AM, Max Reitz wrote: > If bdrv_is_inserted() is called on the top level BDS, it should make > sure all nodes in the BDS tree are actually inserted. > > Signed-off-by: Max Reitz > --- > block.c | 12 +--- > 1 file changed, 9 insertions(+), 3

Re: [Qemu-block] [PATCH v5 09/38] block: Invoke change media CB before NULLing drv

2015-09-18 Thread Eric Blake
On 09/18/2015 09:22 AM, Max Reitz wrote: > In order to handle host device passthrough, some guest device models > may call blk_is_inserted() to check whether the medium is inserted on > the host, when checking the guest tray status. > > This tray status is inquired by blk_dev_change_media_cb();

[Qemu-block] [PATCH v5 26/38] block: Add blk_remove_bs()

2015-09-18 Thread Max Reitz
This function removes the BlockDriverState associated with the given BlockBackend from that BB and sets the BDS pointer in the BB to NULL. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/block-backend.c | 22 +-

[Qemu-block] [PATCH v5 33/38] block: Inquire tray state before tray-moved events

2015-09-18 Thread Max Reitz
blk_dev_change_media_cb() is called for all potential tray movements; however, it is possible to request closing the tray but nothing actually happening (on a floppy disk drive without a medium). Thus, the actual tray status should be inquired before sending a tray-moved event (and an event

Re: [Qemu-block] [PATCH] throttle: test that snapshots move the throttling configuration

2015-09-18 Thread Max Reitz
On 17.09.2015 16:33, Alberto Garcia wrote: > If a snapshot is performed on a device that has I/O limits they should > be moved to the target image (the new active layer). > > Signed-off-by: Alberto Garcia > --- > tests/qemu-iotests/096 | 69 >

[Qemu-block] [PATCH v5 29/38] blockdev: Add blockdev-remove-medium

2015-09-18 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 30 ++ qapi/block-core.json | 15 +++ qmp-commands.hx | 45 + 3 files changed, 90 insertions(+) diff --git a/blockdev.c b/blockdev.c

[Qemu-block] [PATCH v5 35/38] hmp: Use blockdev-change-medium for change command

2015-09-18 Thread Max Reitz
Use separate code paths for the two overloaded functions of the 'change' HMP command, and invoke the 'blockdev-change-medium' QMP command if used on a block device (by calling qmp_blockdev_change_medium()). Signed-off-by: Max Reitz Reviewed-by: Eric Blake

[Qemu-block] [PATCH v5 34/38] qmp: Introduce blockdev-change-medium

2015-09-18 Thread Max Reitz
Introduce a new QMP command 'blockdev-change-medium' which is intended to replace the 'change' command for block devices. The existing function qmp_change_blockdev() is accordingly renamed to qmp_blockdev_change_medium(). Signed-off-by: Max Reitz --- blockdev.c

[Qemu-block] [PATCH v5 38/38] iotests: Add test for change-related QMP commands

2015-09-18 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- tests/qemu-iotests/118 | 638 + tests/qemu-iotests/118.out | 5 + tests/qemu-iotests/group | 1 + 3 files changed, 644 insertions(+) create mode

[Qemu-block] [PATCH v5 30/38] blockdev: Add blockdev-insert-medium

2015-09-18 Thread Max Reitz
And a helper function for that, which directly takes a pointer to the BDS to be inserted instead of its node-name (which will be used for implementing 'change' using blockdev-insert-medium). Signed-off-by: Max Reitz --- blockdev.c | 48

[Qemu-block] [PATCH v5 03/38] blockdev: Allow creation of BDS trees without BB

2015-09-18 Thread Max Reitz
If the "id" field is missing from the options given to blockdev-add, just omit the BlockBackend and create the BlockDriverState tree alone. However, if "id" is missing, "node-name" must be specified; otherwise, the BDS tree would no longer be accessible. Many BDS options which are not parsed by

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

2015-09-18 Thread Max Reitz
On 18.09.2015 15:16, Alberto Garcia wrote: > Signed-off-by: Alberto Garcia > --- > tests/qemu-iotests/085 | 102 > ++--- > tests/qemu-iotests/085.out | 34 ++- > 2 files changed, 128 insertions(+), 8 deletions(-)

[Qemu-block] [PATCH v5 23/38] blockdev: Do not create BDS for empty drive

2015-09-18 Thread Max Reitz
Do not use "rudimentary" BDSs for empty drives any longer (for freshly created drives). After a follow-up patch, empty drives will generally use a NULL BDS, not only the freshly created drives. Signed-off-by: Max Reitz --- blockdev.c | 72

[Qemu-block] [PATCH v5 05/38] block: Make bdrv_is_inserted() return a bool

2015-09-18 Thread Max Reitz
Make bdrv_is_inserted(), blk_is_inserted(), and the callback BlockDriver.bdrv_is_inserted() return a bool. Suggested-by: Eric Blake Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia ---

[Qemu-block] [PATCH v5 06/38] block: Add blk_is_available()

2015-09-18 Thread Max Reitz
blk_is_available() returns true iff the BDS is inserted (which means blk_bs() is not NULL and bdrv_is_inserted() returns true) and if the tray of the guest device is closed. blk_is_inserted() is changed to return true only if blk_bs() is not NULL. Signed-off-by: Max Reitz

[Qemu-block] [PATCH v5 04/38] iotests: Only create BB if necessary

2015-09-18 Thread Max Reitz
Tests 071 and 081 test giving references in blockdev-add. It is not necessary to create a BlockBackend here, so omit it. While at it, fix up some blockdev-add invocations in the vicinity (s/raw/$IMGFMT/ in 081, drop the format BDS for blkverify's raw child in 071). Signed-off-by: Max Reitz

[Qemu-block] [PATCH v5 11/38] hw/usb-storage: Check whether BB is inserted

2015-09-18 Thread Max Reitz
Only call bdrv_add_key() on the BlockDriverState if it is not NULL. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia --- hw/usb/dev-storage.c | 30 -- 1 file changed, 16

[Qemu-block] [PATCH v5 12/38] block: Fix BB AIOCB AioContext without BDS

2015-09-18 Thread Max Reitz
Fix the BlockBackend's AIOCB AioContext for aborting AIO in case there is no BDS. If there is no implementation of AIOCBInfo::get_aio_context() the AioContext is derived from the BDS the AIOCB belongs to. If that BDS is NULL (because it has been removed from the BB) this will not work. This patch

[Qemu-block] [PATCH v5 07/38] block: Make bdrv_is_inserted() recursive

2015-09-18 Thread Max Reitz
If bdrv_is_inserted() is called on the top level BDS, it should make sure all nodes in the BDS tree are actually inserted. Signed-off-by: Max Reitz --- block.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index

[Qemu-block] [PATCH v5 14/38] block: Remove wr_highest_sector from BlockAcctStats

2015-09-18 Thread Max Reitz
BlockAcctStats contains statistics about the data transferred from and to the device; wr_highest_sector does not fit in with the rest. Furthermore, those statistics are supposed to be specific for a certain device and not necessarily for a BDS (see the comment above bdrv_get_stats()); on the

[Qemu-block] [PATCH v5 02/38] block: Set BDRV_O_INCOMING in bdrv_fill_options()

2015-09-18 Thread Max Reitz
This flag should not be set for the root BDS only, but for any BDS that is being created while incoming migration is pending, so setting it is moved from blockdev_init() to bdrv_fill_options(). Signed-off-by: Max Reitz --- block.c| 4 blockdev.c | 4 2 files

[Qemu-block] [PATCH v5 15/38] block: Move BlockAcctStats into BlockBackend

2015-09-18 Thread Max Reitz
As the comment above bdrv_get_stats() says, BlockAcctStats is something which belongs to the device instead of each BlockDriverState. This patch therefore moves it into the BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto

[Qemu-block] [PATCH v5 18/38] block: Make some BB functions fall back to BBRS

2015-09-18 Thread Max Reitz
If there is no BDS tree attached to a BlockBackend, functions that can do so should fall back to the BlockBackendRootState structure (which are blk_is_read_only() and blk_get_flags(), because the read-only status and the "open flags" are part of the BBRS). Signed-off-by: Max Reitz

[Qemu-block] [PATCH v5 20/38] block: Prepare remaining BB functions for NULL BDS

2015-09-18 Thread Max Reitz
There are several BlockBackend functions which, in theory, cannot fail. This patch makes them cope with the BlockDriverState pointer being NULL by making them fall back to some default action like ignoring the value in setters and returning the default in getters. Signed-off-by: Max Reitz

[Qemu-block] [PATCH v5 17/38] block: Add BlockBackendRootState

2015-09-18 Thread Max Reitz
This structure will store some of the state of the root BDS if the BDS tree is removed, so that state can be restored once a new BDS tree is inserted. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/block-backend.c | 37

[Qemu-block] [PATCH v5 10/38] hw/block/fdc: Implement tray status

2015-09-18 Thread Max Reitz
The tray of an FDD is open iff there is no medium inserted (there are only two states for an FDD: "medium inserted" or "no medium inserted"). Signed-off-by: Max Reitz --- hw/block/fdc.c | 20 tests/fdc-test.c | 4 +--- 2 files changed, 17

[Qemu-block] [PATCH v5 16/38] block: Move I/O status and error actions into BB

2015-09-18 Thread Max Reitz
These options are only relevant for the user of a whole BDS tree (like a guest device or a block job) and should thus be moved into the BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block.c| 125

[Qemu-block] [PATCH v5 13/38] block: Move guest_block_size into BlockBackend

2015-09-18 Thread Max Reitz
guest_block_size is a guest device property so it should be moved into the interface between block layer and guest devices, which is the BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia ---

[Qemu-block] [PATCH v5 28/38] blockdev: Add blockdev-close-tray

2015-09-18 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 23 +++ qapi/block-core.json | 16 qmp-commands.hx | 35 +++ 3 files changed, 74 insertions(+) diff --git a/blockdev.c b/blockdev.c index

[Qemu-block] [PATCH v5 21/38] block: Add blk_insert_bs()

2015-09-18 Thread Max Reitz
This function associates the given BlockDriverState with the given BlockBackend. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia --- block/block-backend.c | 16

Re: [Qemu-block] [PATCH v5 01/38] block: Remove host floppy support

2015-09-18 Thread Eric Blake
On 09/18/2015 09:22 AM, Max Reitz wrote: > It has been deprecated as of 2.3, so we can now remove it. > > Signed-off-by: Max Reitz > --- > block/raw-posix.c| 222 > ++- > qapi/block-core.json | 9 +-- > 2 files changed, 9

Re: [Qemu-block] [PATCH v5 04/38] iotests: Only create BB if necessary

2015-09-18 Thread Eric Blake
On 09/18/2015 09:22 AM, Max Reitz wrote: > Tests 071 and 081 test giving references in blockdev-add. It is not > necessary to create a BlockBackend here, so omit it. > > While at it, fix up some blockdev-add invocations in the vicinity > (s/raw/$IMGFMT/ in 081, drop the format BDS for blkverify's

Re: [Qemu-block] [PATCH v5 14/38] block: Remove wr_highest_sector from BlockAcctStats

2015-09-18 Thread Eric Blake
On 09/18/2015 09:22 AM, Max Reitz wrote: > BlockAcctStats contains statistics about the data transferred from and > to the device; wr_highest_sector does not fit in with the rest. > > Furthermore, those statistics are supposed to be specific for a certain > device and not necessarily for a BDS