Statistics
| Branch: | Revision:

root / blockdev.c @ feature-archipelago

History | View | Annotate | Download (70.5 kB)

# Date Author Comment
ddf5636d 02/21/2014 10:02 pm Max Reitz

block: Add reference parameter to bdrv_open()

Allow bdrv_open() to handle references to existing block devices just as
bdrv_file_open() is already capable of.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

f67503e5 02/21/2014 10:02 pm Max Reitz

block: Change BDS parameter of bdrv_open() to **

Make bdrv_open() take a pointer to a BDS pointer, similarly to
bdrv_file_open(). If a pointer to a NULL pointer is given, bdrv_open()
will create a new BDS with an empty name; if the BDS pointer is not
NULL, that existing BDS will be reused (in the same way as bdrv_open()...

61e8a923 02/20/2014 03:05 pm Peter Maydell

Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging

QOM infrastructure fixes and device conversions

  • QTest cleanups and test cases for PCI NICs
  • NAND fix for "info qtree"
  • Cleanup and extension of QOM machine tests...
4c0c9bbe 02/20/2014 02:10 pm Peter Maydell

Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging

  • remotes/qmp-unstable/queue/qmp:
    monitor: Add object_add class argument completion.
    monitor: Add object_del id argument completion.
    monitor: Add device_add device argument completion....
84d18f06 02/17/2014 06:57 pm Markus Armbruster

Use error_is_set() only when necessary

error_is_set(&var) is the same as var != NULL, but it takes
whole-program analysis to figure that out. Unnecessarily hard for
optimizers, static checkers, and human readers. Dumb it down to
obvious.

Gets rid of several dozen Coverity false positives....

f31c41ff 02/14/2014 10:12 pm Paolo Bonzini

block: Handle "rechs" and "large" translation options

Sure, CHS translation is an obscure topic, and legacy options for
hard-disk geometries are obscure as well. But since QEMU does nothing
with it except telling the BIOS, and since there "large" and "rechs"...

57b6bdf3 02/14/2014 07:05 pm Benoît Canet

blockdev: Fix wrong usage of QDECREF causing snapshoted quorum to crash on close.

As bdrv_open() documentation states:
"The reference to the QDict belongs to the block layer * after the call (even on failure), so if the caller intends to reuse the * dictionary, it needs to use QINCREF before calling bdrv_open."...

0c5e94ee 02/14/2014 07:05 pm Benoît Canet

block: Open by reference will try device then node_name.

Since we introduced node_name for named bs of the graph modify the opening by
reference to use it as a fallback.

This patch also enforce the separation of the device id and graph node
namespaces.
...

ee13ed1c 02/14/2014 02:04 pm Kevin Wolf

blockdev: Remove 'type' parameter from blockdev_init()

blockdev-add doesn't know about the device that the backend will be
attached to, this is a legacy -drive concept. Move the remaining checks
that use it to drive_init().

[Fam Zheng <> suggested line-wrapping to 80 chars as...

c13163fb 01/24/2014 05:07 pm Benoît Canet

qmp: Add QMP query-named-block-nodes to list the named BlockDriverState nodes.

Signed-off-by: Benoit Canet <>
Reviewed-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

12d3ba82 01/24/2014 05:07 pm Benoît Canet

qmp: Allow to change password on named block driver states.

Signed-off-by: Benoit Canet <>
Reviewed-by: Fam Zheng <>

There was two candidate ways to implement named node manipulation:

1) { 'command': 'block_passwd', 'data': {'*device': 'str',...

212a5a8f 01/24/2014 05:07 pm Benoît Canet

block: Create authorizations mechanism for external snapshot and resize.

Signed-off-by: Benoit Canet <>
Signed-off-by: Kevin Wolf <>

3b1dbd11 01/24/2014 05:07 pm Benoît Canet

qmp: Allow block_resize to manipulate bs graph nodes.

Signed-off-by: Benoit Canet <>
Reviewed-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

0901f67e 01/24/2014 05:07 pm Benoît Canet

qmp: Allow to take external snapshots on bs graphs node.

Signed-off-by: Benoit Canet <>
Reviewed-by: Fam Zheng <>
Signed-off-by: Kevin Wolf <>

d095b465 01/22/2014 01:07 pm Max Reitz

blockdev: Move "file" to legacy_opts

Specifying the image filename through the "file" option is a legacy
option and should not be supported by blockdev-add (in that case, giving
a string for "file" references an existing block device).

Signed-off-by: Max Reitz <>...

133fe774 01/14/2014 04:10 am Edgar E. Iglesias

Merge remote branch 'luiz/queue/qmp' into qmpq

  • luiz/queue/qmp:
    migration: qmp_migrate(): keep working after syntax error
    qerror: Remove assert_no_error()
    qemu-option: Remove qemu_opts_create_nofail
    target-i386: Remove assert_no_error usage
    hw: Remove assert_no_error usages...
87ea75d5 01/06/2014 10:02 pm Peter Crosthwaite

qemu-option: Remove qemu_opts_create_nofail

This is a boiler-plate _nofail variant of qemu_opts_create. Remove and
use error_abort in call sites.

null/0 arguments needs to be added for the id and fail_if_exists fields
in affected callsites due to argument inconsistency between the normal and...

20a63d2c 12/20/2013 05:26 pm Fam Zheng

commit: Support commit active layer

If active is top, it will be mirrored to base, (with block/mirror.c
code), then the image is switched when user completes the block job.

QMP documentation is updated.

Signed-off-by: Fam Zheng <>
Signed-off-by: Stefan Hajnoczi <>

314f7ea7 12/16/2013 11:12 am Marc-André Lureau

qmp_change_blockdev() remove unused has_format

Signed-off-by: Marc-André Lureau <>
Signed-off-by: Gerd Hoffmann <>

117e0c82 11/27/2013 05:53 pm Max Reitz

block/drive-mirror: Reuse backing HD for sync=none

For "none" sync mode in "absolute-paths" mode, the current image should
be used as the backing file for the newly created image.

The current behavior is:
a) If the image to be mirrored has a backing file, use that (which is...

968854c8 11/14/2013 02:09 pm Amos Kong

qmp: access the local QemuOptsLists for drive option

Currently we have three QemuOptsList (qemu_common_drive_opts,
qemu_legacy_drive_opts, and qemu_drive_opts), only qemu_drive_opts
is added to vm_config_groups[].

This patch changes query-command-line-options to access three local...

14526864 11/14/2013 02:09 pm Max Reitz

block/drive-mirror: Check for NULL backing_hd

It should be possible to execute the QMP "drive-mirror" command in
"none" sync mode and "absolute-paths" mode even for block devices
lacking a backing file.

"absolute-paths" does in fact not require a backing file to be present,...

ec9c10d2 11/07/2013 02:53 pm Stefan Hajnoczi

blockdev: fix drive_init() opts and bs_opts leaks

These memory leaks also make drive_add if=none,id=drive0 without a file=
option leak the options list. This keeps ID "drive0" around forever.

Signed-off-by: Stefan Hajnoczi <>
Reviewed-by: Eric Blake <>

a7fdbcf0 10/17/2013 11:19 am Fam Zheng

blockdev: fix cdrom read_only flag

Since 0ebd24e0, cdrom doesn't have read-only on by default, which will
error out when using an read only image. Fix it by setting the default
value when parsing opts.

Reported-by: Edivaldo de Araujo Pereira <>...

e34ef046 10/11/2013 05:50 pm Kevin Wolf

blockdev: Remove 'media' parameter from blockdev_init()

The remaining users shouldn't be there with blockdev-add and are easy to
move to drive_init().

Bonus bug fix: As a side effect, CD-ROM drives can now use block drivers
on the read-only whitelist without explicitly specifying read-only=on,...

0ebd24e0 10/11/2013 05:50 pm Kevin Wolf

blockdev: Don't disable COR automatically with blockdev-add

If a read-only device is configured with copy-on-read=on, the old code
only prints a warning and automatically disables copy on read. Make it
a real error for blockdev-add.

Signed-off-by: Kevin Wolf <>...

b681072d 10/11/2013 05:50 pm Kevin Wolf

blockdev: blockdev_init() error conversion

This gives us meaningful error messages for the blockdev-add QMP
command.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Max Reitz <>
Reviewed-by: Eric Blake <>

2d246f01 10/11/2013 05:50 pm Kevin Wolf

blockdev: Introduce DriveInfo.enable_auto_del

BlockDriverStates shouldn't be affected by an unplugged guest device,
except if created with the legacy -drive command line option or the
drive_add HMP command.

Make the automatic deletion as well as cancelling of jobs conditional on...

d26c9a15 10/11/2013 05:50 pm Kevin Wolf

blockdev: 'blockdev-add' QMP command

For examples see the changes to qmp-commands.hx.

Signed-off-by: Kevin Wolf <>

326642bc 10/11/2013 05:50 pm Kevin Wolf

blockdev: Separate ID generation from DriveInfo creation

blockdev-add shouldn't automatically generate IDs, but will keep most of
the DriveInfo creation code.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Max Reitz <>
Reviewed-by: Wenchao Xia <>...

f298d071 10/11/2013 05:50 pm Kevin Wolf

blockdev: Pass QDict to blockdev_init()

Working on a QDict instead of a QemuOpts that accepts anything is more
in line with bdrv_open(). A QDict is what qmp_blockdev_add() already has
anyway, so this saves additional conversions. And last, but not least,...

33cb7dc8 10/11/2013 05:50 pm Kevin Wolf

blockdev: Move parsing of 'media' option to drive_init

This moves as much as possible of the processing of the 'media' option
to drive_init so that it can only be accessed using legacy functions,
but never with anything blockdev-add related.

Signed-off-by: Kevin Wolf <>...

593d464b 10/11/2013 05:50 pm Kevin Wolf

blockdev: Move parsing of 'if' option to drive_init

It's always IF_NONE for blockdev-add.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Benoit Canet <>
Reviewed-by: Eric Blake <>

b41a7338 10/11/2013 05:50 pm Kevin Wolf

blockdev: Moving parsing of geometry options to drive_init

This moves all of the geometry options (cyls/heads/secs/trans) to
drive_init so that they can only be accessed using legacy functions, but
never with anything blockdev-add related.

Signed-off-by: Kevin Wolf <>...

26929298 10/11/2013 05:50 pm Kevin Wolf

blockdev: Move parsing of 'boot' option to drive_init

It's already ignored and only prints a deprecation message. No use in
making it available in new interfaces.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>

87a899c5 10/11/2013 05:50 pm Kevin Wolf

blockdev: Move bus/unit/index processing to drive_init

This requires moving the automatic ID generation at the same time, so
let's do that as well.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Max Reitz <>
Reviewed-by: Eric Blake <>

394c7d4d 10/11/2013 05:50 pm Kevin Wolf

blockdev: Move virtio-blk device creation to drive_init

Signed-off-by: Kevin Wolf <>
Reviewed-by: Max Reitz <>
Reviewed-by: Eric Blake <>

4f8a066b 10/11/2013 05:50 pm Kevin Wolf

blockdev: Remove IF_* check for read-only blockdev_init

IF_NONE allows read-only, which makes forbidding it in this place
for other types pretty much pointless.

Instead, make sure that all devices for which the check would have
errored out check in their init function that they don't get a read-only...

8f94a6e4 10/11/2013 05:50 pm Kevin Wolf

block: Improve driver whitelist checks

The main intent of this patch is to consolidate the whitelist checks to
a single point in the code instead of spreading it everywhere. This adds
a nicer error message for read-only whitelisting, too, in places where...

f6186f49 10/11/2013 05:49 pm Benoît Canet

block: Add BlockDriver.bdrv_check_ext_snapshot.

This field is used by blkverify to disable external snapshots creation.
It will also be used by block filters like quorum to disable external
snapshot creation.

Signed-off-by: Benoit Canet <>...

3a6f2703 10/02/2013 09:55 pm Stefan Weil

block: Remove unused assignment (fixes warning from clang)

blockdev.c:1929:13: warning: Value stored to 'ret' is never read
ret = 0;
^ ~

Signed-off-by: Stefan Weil <>
Signed-off-by: Michael Tokarev <>

1df6fa4b 09/20/2013 08:27 pm Paolo Bonzini

blockdev: do not default cache.no-flush to true

That's why all my VMs were so fast lately. :)

This changed in 1.6.0 by mistake in patch 29c4e2b (blockdev: Split up
'cache' option, 2013-07-18).

Cc:
Signed-off-by: Paolo Bonzini <>...

aa3fe714 09/12/2013 05:28 pm Max Reitz

block: Assert validity of BdrvActionOps

In qmp_transaction, assert that the BdrvActionOps to be used is actually
valid.

This assertion failing is very improbable, however, it might happen, if
a new TransactionActionKind is introduced "out of order" and the...

34b5d2c6 09/12/2013 11:12 am Max Reitz

block: Error parameter for open functions

Add an Error ** parameter to bdrv_open, bdrv_file_open and associated
functions to allow more specific error messages.

Signed-off-by: Max Reitz <>

bbe86010 09/12/2013 11:12 am Wenchao Xia

qmp: add internal snapshot support in qmp_transaction

Unlike savevm, the qmp_transaction interface will not generate
snapshot name automatically, saving trouble to return information
of the new created snapshot.

Although qcow2 support storing multiple snapshots with same name...

f323bc9e 09/12/2013 11:12 am Wenchao Xia

qmp: add interface blockdev-snapshot-internal-sync

Snapshot ID can't be specified in this interface.

Signed-off-by: Wenchao Xia <>
Signed-off-by: Kevin Wolf <>

44e3e053 09/12/2013 11:12 am Wenchao Xia

qmp: add interface blockdev-snapshot-delete-internal-sync

This interface use id and name as optional parameters, to handle the
case that one image contain multiple snapshots with same name which
may be '', but with different id.

Adding parameter id is for historical compatiability reason, and...

4f6fd349 09/06/2013 04:25 pm Fam Zheng

block: make bdrv_delete() static

Manage BlockDriverState lifecycle with refcnt, so bdrv_delete() is no
longer public and should be called by bdrv_unref() if refcnt is
decreased to 0.

This is an identical change because effectively, there's no multiple
reference of BDS now: no caller of bdrv_ref() yet, only bdrv_new() sets...

fa510ebf 09/06/2013 04:25 pm Fam Zheng

block: use BDS ref for block jobs

Block jobs used drive_get_ref(drive_get_by_blockdev(bs)) to avoid BDS
being deleted. Now we have BDS reference count, and block jobs don't
care about dinfo, so replace them to get cleaner code. It is also the
safe way when BDS has no drive info....

cc0681c4 09/06/2013 04:25 pm Benoît Canet

block: Enable the new throttling code in the block layer.

Signed-off-by: Benoit Canet <>
Signed-off-by: Stefan Hajnoczi <>

3e9fab69 09/06/2013 04:25 pm Benoît Canet

block: Add support for throttling burst max in QMP and the command line.

The max parameter of the leaky bucket throttling algorithm can be used to
allow the guest to do bursts.
The max value is a pool of I/O that the guest can use without being throttled...

2024c1df 09/06/2013 04:25 pm Benoît Canet

block: Add iops_size to do the iops accounting for a given io size.

This feature can be used in case where users are avoiding the iops limit by
doing jumbo I/Os hammering the storage backend.

Signed-off-by: Benoit Canet <>
Signed-off-by: Stefan Hajnoczi <>

c0447d87 08/30/2013 04:28 pm Kevin Wolf

Revert "block: Disable driver-specific options for 1.6"

This reverts commit 8afaefb8919dc8746a57c450a758717c516c7b0a.

Signed-off-by: Kevin Wolf <>

bc72ad67 08/22/2013 08:14 pm Alex Bligh

aio / timers: Switch entire codebase to the new timer API

This is an autogenerated patch using scripts/switch-timer-api.

Switch the entire code base to using the new timer API.

Note this patch may introduce some line length issues.

Signed-off-by: Alex Bligh <>...

7780d472 08/22/2013 03:30 pm Fam Zheng

block: better error message for read only format name

When user tries to use read-only whitelist format in the command line
option, failure message was "'foo' invalid format". It might be invalid
only for writable, but valid for read-only, so it is confusing. Give the...

8b7a5415 08/14/2013 04:34 pm M. Mohan Kumar

block: Dont ignore previously set bdrv_flags

bdrv_flags is set by bdrv_parse_discard_flags(), but later it is reset
to zero.

Signed-off-by: M. Mohan Kumar <>
Message-id:
Signed-off-by: Anthony Liguori <>

6db5f5d6 08/09/2013 08:33 pm Mike Qiu

block: Bugfix 'format' and 'snapshot' used in drive option

When use -drive file='xxx',format=qcow2,snapshot=on the error
message "Can't use snapshot=on with driver-specific options"
can be show, and fail to start the qemu.

This should not be happened, and there is no file.driver option...

8afaefb8 08/02/2013 07:21 pm Kevin Wolf

block: Disable driver-specific options for 1.6

We don't want to commit to the API yet before everything is worked out.
Like already for 1.5, disable it again for the 1.6 release. This commit
is meant to be reverted after the 1.6 release.

The disabling of the driver-specific options is achieved by applying the...

dfc6f865 07/27/2013 10:22 am Stefan Weil

misc: Use g_assert_not_reached for code which is expected to be unreachable

The macro g_assert_not_reached is a better self documenting replacement
for assert(0) or assert(false).

Signed-off-by: Stefan Weil <>
Signed-off-by: Michael Tokarev <>

29c4e2b5 07/26/2013 11:01 pm Kevin Wolf

blockdev: Split up 'cache' option

The old 'cache' option really encodes three different boolean flags into
a cache mode name, without providing all combinations. Make them three
separate options instead and translate the old option to the new ones
for drive_init()....

fc5d3f84 07/26/2013 11:01 pm Ian Main

Implement sync modes for drive-backup.

This patch adds sync-modes to the drive-backup interface and
implements the FULL, NONE and TOP modes of synchronization.

FULL performs as before copying the entire contents of the drive
while preserving the point-in-time using CoW....

0f227a94 07/26/2013 11:01 pm Kevin Wolf

blockdev: Rename 'readonly' option to 'read-only'

Option name cleanup before it becomes a QMP API.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>

74fe54f2 07/26/2013 10:10 pm Kevin Wolf

block: Allow "driver" option on the top level

This is traditionally -drive format=..., which is now translated into
the new driver option. This gives us a more consistent way to select the
driver of BlockDriverStates that can be used in QMP context, too....

57975222 07/26/2013 10:10 pm Kevin Wolf

blockdev: Rename I/O throttling options for QMP

In QMP, we want to use dashes instead of underscores in QMP argument
names, and use nested options for throttling.

The new option names affect the command line as well, but for
compatibility drive_init() will convert the old option names before...

b53169ea 07/15/2013 10:49 am Stefan Hajnoczi

blockdev: add sync mode to drive-backup QMP command

The drive-backup command is similar to the drive-mirror command, except
no guest data written after the command executes gets copied. Add a
sync mode argument which determines whether the entire disk is copied,...

3037f364 06/28/2013 10:20 am Stefan Hajnoczi

blockdev: add DriveBackup transaction

This patch adds a transactional version of the drive-backup QMP command.
It allows atomic snapshots of multiple drives along with automatic
cleanup if there is a failure to start one of the backup jobs.

Note that QMP events are emitted for block job completion/cancellation...

78b18b78 06/28/2013 10:20 am Stefan Hajnoczi

blockdev: add Abort transaction

The Abort action can be used to test QMP 'transaction' failure. Add it
as the last action to exercise the .abort() and .cleanup() code paths
for all previous actions.

Reviewed-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>...

cb78466e 06/28/2013 10:20 am Stefan Hajnoczi

blockdev: drop redundant proto_drv check

It is not necessary to check that we can find a protocol block driver
since we create or open the image file. This produces the error that we
need anyway.

Besides, the QERR_INVALID_BLOCK_FORMAT is inappropriate since the...

ac3c5d83 06/28/2013 10:20 am Stefan Hajnoczi

blockdev: use bdrv_getlength() in qmp_drive_mirror()

Use bdrv_getlength() for its byte units and error return instead of
bdrv_get_geometry().

Reported-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>
Reviewed-by: Kevin Wolf <>...

99a9addf 06/28/2013 10:20 am Stefan Hajnoczi

block: add drive-backup QMP command

@drive-backup

Start a point-in-time copy of a block device to a new destination. The
status of ongoing drive-backup operations can be checked with
query-block-jobs where the BlockJobInfo.type field has the value 'backup'....

ba5d6ab6 06/28/2013 10:20 am Stefan Hajnoczi

blockdev: rename BlkTransactionStates to singular

The QMP 'transaction' command keeps a list of in-flight transactions.
The transaction state structure is called BlkTransactionStates even
though it only deals with a single transaction. The only plural thing...

f9ea81e8 06/28/2013 10:20 am Stefan Hajnoczi

blockdev: allow BdrvActionOps->commit() to be NULL

Some QMP 'transaction' types don't need to do anything on .commit().
Make .commit() optional just like .abort().

The "drive-backup" action will take advantage of this, it only needs to
cancel the block job on .abort(). Other block job actions will probably...

492fdc6f 06/24/2013 11:25 am Kevin Wolf

Revert "block: Disable driver-specific options for 1.5"

This reverts commit 8ec7d390b0d50b5e5b4b1d8dba7ba40d64a70875.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>

0eef407c 06/17/2013 06:01 pm Luiz Capitulino

blockdev: use error_setg_file_open()

Signed-off-by: Luiz Capitulino <>
Reviewed-by: Stefan Hajnoczi <>
Acked-by: Kevin Wolf <>

293c51a6 06/05/2013 05:39 pm Stefan Hajnoczi

blockdev: reset werror/rerror on drive_del

Paolo Bonzini <> suggested the following test case:

1. Launch a guest and wait at the GRUB boot menu:

qemu-system-x86_64 -enable-kvm -m 1024 \
-drive if=none,cache=none,file=test.img,id=foo,werror=stop,rerror=stop...
b64ec4e4 06/04/2013 01:11 pm Fam Zheng

block: add block driver read only whitelist

We may want to include a driver in the whitelist for read only tasks
such as diagnosing or exporting guest data (with libguestfs as a good
example). This patch introduces a readonly whitelist option, and for
backward compatibility, the old configure option --block-drv-whitelist...

9b9877ee 05/24/2013 05:17 pm Wenchao Xia

block: package preparation code in qmp_transaction()

The code before really committing is moved into a function. Most
code is simply moved from qmp_transaction(), except that on fail it
just returns now. Other code such as input parsing is not touched,
to make it easier in review....

e2a31e87 05/24/2013 05:17 pm Wenchao Xia

block: move input parsing code in qmp_transaction()

The code is moved into preparation function, and changed
a bit to tip more clearly what it is doing.

Signed-off-by: Wenchao Xia <>
Reviewed-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>...

3b0047e8 05/24/2013 05:17 pm Wenchao Xia

block: package committing code in qmp_transaction()

The code is simply moved into a separate function.

Signed-off-by: Wenchao Xia <>
Reviewed-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>
Reviewed-by: Eric Blake <>...

96b86bf7 05/24/2013 05:17 pm Wenchao Xia

block: package rollback code in qmp_transaction()

Signed-off-by: Wenchao Xia <>
Reviewed-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>
Reviewed-by: Eric Blake <>
Signed-off-by: Kevin Wolf <>

ba0c86a3 05/24/2013 05:17 pm Wenchao Xia

block: make all steps in qmp_transaction() as callback

Make it easier to add other operations to qmp_transaction() by using
callbacks, with external snapshots serving as an example implementation
of the callbacks.

Signed-off-by: Wenchao Xia <>...

c8a83e85 05/24/2013 05:17 pm Kevin Wolf

blockdev: Rename BlockdevAction -> TransactionAction

There's no reason to restrict transactions to operations related to
block devices, so rename the type now before schema introspection stops
us from doing so.

Also change the schema documentation of 'transaction' to not refer to...

8732901e 05/03/2013 11:31 am Kevin Wolf

blockdev: Replace "undefined error" in qmp_block_resize

We have an errno value that can be displayed, so we should just do that.
An easy way to reproduce this case is to resize a raw image to a size
that is too large for the host file system.

Signed-off-by: Kevin Wolf <>...

8ec7d390 04/26/2013 02:26 pm Kevin Wolf

block: Disable driver-specific options for 1.5

We don't want to commit to the API yet before everything is worked out.
Disable it for the 1.5 release. This commit is meant to be reverted
after the 1.5 release.

The disabling of the driver-specific options is achieved by applying the...

0d09e41a 04/08/2013 07:13 pm Paolo Bonzini

hw: move headers to include/

Many of these should be cleaned up with proper qdev-/QOM-ification.
Right now there are many catch-all headers in include/hw/ARCH depending
on cpu.h, and this makes it necessary to compile these files per-target.
However, fixing this does not belong in these patches....

ae29d6c6 04/05/2013 07:58 pm Stefan Hajnoczi

block: keep I/O throttling slice time constant

It is not necessary to adjust the slice time at runtime. We already
extend the current slice in order to carry over accounting into the next
slice. Changing the actual slice time value introduces oscillations....

c2ad1b0c 03/22/2013 06:51 pm Kevin Wolf

block: Allow omitting the file name when using driver-specific options

After this patch, using -drive with an empty file name continues to open
the file if driver-specific options are used. If no driver-specific
options are specified, the semantics stay as it was: It defines a drive...

92b7a08d 03/22/2013 06:51 pm Peter Lieven

block: complete all IOs before resizing a device

this patch ensures that all pending IOs are completed
before a device is resized. this is especially important
if a device is shrinked as it the bdrv_check_request()
result is invalidated.

Signed-off-by: Peter Lieven <>...

3618a094 03/15/2013 05:07 pm Markus Armbruster

blockdev: Fix up copyright and permission notice

Screwed up in commit 666daa68. Thanks to Kevin Wolf for reminding me
to fix this.

Signed-off-by: Markus Armbruster <>
Signed-off-by: Stefan Hajnoczi <>

de9c0cec 03/15/2013 05:07 pm Kevin Wolf

block: Add options QDict to bdrv_open() prototype

It doesn't do anything yet except storing the options QDict in the
BlockDriverState.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>
Reviewed-by: Stefan Hajnoczi <>...

bb44619b 03/15/2013 05:07 pm Kevin Wolf

blockdev: Keep a copy of DriveInfo.serial

Pointing to a QemuOpts element is surprising and can lead to subtle
use-after-free errors when the QemuOpts is freed after all options are
parsed.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>

0006383e 03/15/2013 05:07 pm Kevin Wolf

block: Support driver specific options in drive_init()

Any non-default -drive options are now passed down to the block drivers.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>
Reviewed-by: Stefan Hajnoczi <>...

a9384aff 02/22/2013 10:29 pm Paolo Bonzini

blockdev: add discard suboption to -drive

Add support for BDRV_O_UNMAP from the QEMU command-line.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

c546194f 02/22/2013 10:21 pm Stefan Hajnoczi

block: use Error in do_check_io_limits()

The do_check_io_limits() function returns false when I/O limits are
invalid but it doesn't set an Error to indicate why. The two
do_check_io_limits() callers duplicate error reporting. Solve this by
passing an Error pointer into do_check_io_limits()....

7d81c141 02/22/2013 10:21 pm Stefan Hajnoczi

block: refuse negative iops and bps values

Negative I/O throttling iops and bps values do not make sense so reject
them with an error message.

Reviewed-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>

f382d43a 02/22/2013 10:21 pm Miroslav Rezanina

qemu-img: Add "Quiet mode" option

There can be a need to turn output to stdout off. This patch adds a -q option
that enable "Quiet mode". In Quiet mode, only errors are printed out.

Signed-off-by: Miroslav Rezanina <>
Reviewed-by: Kevin Wolf <>...

503cb22e 01/28/2013 10:46 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

  1. By Paolo Bonzini (14) and others
  2. Via Kevin Wolf
    • kwolf/for-anthony: (24 commits)
      ide: Add fall through annotations
      block: Create proper size file for disk mirror
      ahci: Add migration support...
86899072 01/25/2013 07:18 pm Vishvananda Ishaya

block: Create proper size file for disk mirror

The qmp monitor command to mirror a disk was passing -1 for size
along with the disk's backing file. This size of the resulting disk
is the size of the backing file, which is incorrect if the disk
has been resized. Therefore we should always pass in the size of...

02582abd 01/25/2013 07:18 pm Stefan Weil

block: Add special error code for wrong format

The block drivers need a special error code for "wrong format".
From the available error codes EMEDIUMTYPE fits best.
It is not available on all platforms, so a definition in
qemu-common.h and a specific error report are needed....

08e4ed6c 01/25/2013 07:18 pm Paolo Bonzini

mirror: add buf-size argument to drive-mirror

This makes sense when the next commit starts using the extra buffer space
to perform many I/O operations asynchronously.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>