This patch allows specifying the interface to be used for the drive, and
makes specifying a path optional (if the path is None, the file option
will be omitted, thus creating an empty drive).
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
---
Make use of qcow2_change_refcount_order() to support changing the
refcount order with qemu-img amend.
Signed-off-by: Max Reitz mre...@redhat.com
---
block/qcow2.c | 44 +++-
1 file changed, 35 insertions(+), 9 deletions(-)
diff --git a/block/qcow2.c
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
Reviewed-by: Stefan Hajnoczi stefa...@redhat.com
---
block/qcow2.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 0b514f9..c444960 100644
---
If the image version should be upgraded, that is the first we should do;
if it should be downgraded, that is the last we should do. So split the
version change block into an upgrade part at the start and a downgrade
part at the end.
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric
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 mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
---
block.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git
It has been deprecated as of 2.3, so we can now remove it.
Signed-off-by: Max Reitz mre...@redhat.com
---
block/raw-posix.c| 228 ++-
qapi/block-core.json | 9 +-
2 files changed, 11 insertions(+), 226 deletions(-)
diff --git
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 mre...@redhat.com
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
---
blockdev.c | 48
qapi/block-core.json | 23 +++
qmp-commands.hx | 39 +++
3 files
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 mre...@redhat.com
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 mre...@redhat.com
Reviewed-by: Eric Blake
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 mre...@redhat.com
---
block.c | 11 ---
If there is more than one time-consuming operation to be performed for
qcow2_amend_options(), we need an intermediate CB which coordinates the
progress of the individual operations and passes the result to the
original status callback.
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric
On 06/03/2015 01:43 PM, 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();
Tests 071 and 081 test giving references in blockdev-add. It is not
necessary to create a BlockBackend here, so omit it.
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
---
tests/qemu-iotests/071 | 50 ++
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
On 06/03/2015 01:43 PM, 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 (see
Add an opaque value which is to be passed to the bdrv_amend_options()
status callback.
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
Reviewed-by: Stefan Hajnoczi stefa...@redhat.com
---
block.c | 4 ++--
block/qcow2-cluster.c | 14
On 06/03/2015 01:43 PM, Max Reitz wrote:
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
This series reworks a lot regarding BlockBackend and media. Basically,
it allows empty BlockBackends, that is BBs without a BDS tree.
Before this series, empty drives are represented by a BlockBackend with
an empty BDS attached to it (a BDS with a NULL driver). However, now we
have BlockBackends,
This function associates the given BlockDriverState with the given
BlockBackend.
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
---
block/block-backend.c | 16
include/sysemu/block-backend.h | 1 +
2 files changed, 17 insertions(+)
Add a function qcow2_change_refcount_order() which allows changing the
refcount order of a qcow2 image.
Signed-off-by: Max Reitz mre...@redhat.com
---
block/qcow2-refcount.c | 447 +
block/qcow2.h | 4 +
2 files changed, 451
bdrv_is_inserted() should be invoked recursively on the children of
quorum.
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
---
block/quorum.c | 16
1 file changed, 16 insertions(+)
diff --git a/block/quorum.c b/block/quorum.c
index
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(); because
bdrv_is_inserted() (invoked by
Implement 'change' on block devices by calling blockdev-open-tray,
blockdev-remove-medium, blockdev-insert-medium (a variation of that
which does not need a node-name) and blockdev-close-tray.
Signed-off-by: Max Reitz mre...@redhat.com
---
blockdev.c | 185
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
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 mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
---
blockdev.c
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 mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
---
block/block-backend.c | 26
Make bdrv_is_inserted(), blk_is_inserted(), and the callback
BlockDriver.bdrv_is_inserted() return a bool.
Suggested-by: Eric Blake ebl...@redhat.com
Signed-off-by: Max Reitz mre...@redhat.com
---
block.c| 12 +++-
block/block-backend.c | 2 +-
On 06/03/2015 01:43 PM, Max Reitz wrote:
Only call bdrv_add_key() on the BlockDriverState if it is not NULL.
Signed-off-by: Max Reitz mre...@redhat.com
---
hw/usb/dev-storage.c | 30 --
1 file changed, 16 insertions(+), 14 deletions(-)
diff --git
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
Expose the new read-only-mode option of 'blockdev-change-medium' for the
'change' HMP command.
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
---
hmp-commands.hx | 20 +---
hmp.c | 22 +-
2 files changed, 38
Add tests for conversion between different refcount widths.
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
---
tests/qemu-iotests/112 | 109 +
tests/qemu-iotests/112.out | 71 +
2
On 06/03/2015 01:43 PM, Max Reitz wrote:
Make bdrv_is_inserted(), blk_is_inserted(), and the callback
BlockDriver.bdrv_is_inserted() return a bool.
Suggested-by: Eric Blake ebl...@redhat.com
Signed-off-by: Max Reitz mre...@redhat.com
---
block.c| 12 +++-
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 mre...@redhat.com
Reviewed-by: Eric Blake
On 06/03/2015 01:43 PM, Max Reitz wrote:
It has been deprecated as of 2.3, so we can now remove it.
Signed-off-by: Max Reitz mre...@redhat.com
---
block/raw-posix.c| 228
++-
qapi/block-core.json | 9 +-
2 files changed, 11
If a reference count is not representable with the current refcount
order, the image check should point to qemu-img amend for increasing the
refcount order. However, qemu-img amend needs write access to the image
which cannot be provided if the image is marked corrupt; and the image
check will not
On 06/03/2015 01:43 PM, Max Reitz wrote:
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.
On 06/03/2015 01:43 PM, 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).
This results in the tray being reported as open if qemu has been started
with the default floppy drive, which
On 06/03/2015 01:44 PM, Max Reitz wrote:
Signed-off-by: Max Reitz mre...@redhat.com
Reviewed-by: Eric Blake ebl...@redhat.com
---
blockdev.c | 48
qapi/block-core.json | 23 +++
qmp-commands.hx | 39
On 06/03/2015 01:44 PM, Max Reitz wrote:
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
On 06/03/2015 02:13 PM, Max Reitz wrote:
Add a function qcow2_change_refcount_order() which allows changing the
refcount order of a qcow2 image.
Signed-off-by: Max Reitz mre...@redhat.com
---
block/qcow2-refcount.c | 447
+
block/qcow2.h
On 06/03/2015 01:44 PM, Max Reitz wrote:
Signed-off-by: Max Reitz mre...@redhat.com
---
tests/qemu-iotests/118 | 638
+
tests/qemu-iotests/118.out | 5 +
tests/qemu-iotests/group | 1 +
3 files changed, 644 insertions(+)
create mode
On 06/03/2015 01:44 PM, Max Reitz wrote:
Implement 'change' on block devices by calling blockdev-open-tray,
blockdev-remove-medium, blockdev-insert-medium (a variation of that
which does not need a node-name) and blockdev-close-tray.
Signed-off-by: Max Reitz mre...@redhat.com
---
On 06/03/2015 02:13 PM, Max Reitz wrote:
Make use of qcow2_change_refcount_order() to support changing the
refcount order with qemu-img amend.
Signed-off-by: Max Reitz mre...@redhat.com
---
block/qcow2.c | 44 +++-
1 file changed, 35 insertions(+),
On Tue, May 19, 2015 at 03:24:28PM +0300, Alberto Garcia wrote:
The previous series no longer applies after all the code that was
moved to block/io.c in 61007b316c, so I rebased it.
Other than that there are no changes.
V8:
- Rebased against the current master.
V7:
On 02/06/2015 18:43, ronnie sahlberg wrote:
If we change this to iSCSI, we can actually avoid this by using task
management functions:
guest - QEMUwrite A to sector 1
QEMU - iSCSIwrite A to sector 1
... timeout...
QEMU - iSCSI task management:
On Tue, 06/02 11:28, Eric Blake wrote:
On 05/27/2015 11:29 PM, Fam Zheng wrote:
If specified as true, it allows discarding on target sectors where source
is
not allocated.
Signed-off-by: Fam Zheng f...@redhat.com
---
+++ b/qapi/block-core.json
@@ -954,6 +954,11 @@
#
On Tue, 06/02 17:21, Stefan Hajnoczi wrote:
On Tue, May 19, 2015 at 10:51:03AM +, Fam Zheng wrote:
-while (qemu_can_send_packet(s-nc)) {
+while (true) {
+bool can_send;
uint8_t *buf = s-buf;
+can_send = qemu_can_send_packet(s-nc);
+
On Fri, May 29, 2015 at 03:29:57PM +0200, Alberto Garcia wrote:
On Fri 29 May 2015 02:32:45 PM CEST, Stefan Hajnoczi stefa...@gmail.com
wrote:
def setUp(self):
-self.vm = iotests.VM().add_drive(self.test_img)
+self.vm = iotests.VM()
+for i in range(0,
Am 03.06.2015 um 15:46 schrieb Alexander Yarygin:
After the commit 9b536adc (block: acquire AioContext in
bdrv_drain_all()) the aio_poll() function got called for every
BlockDriverState, in assumption that every device may have its own
AioContext. If we have thousands of disks attached, there
Am 03.06.2015 um 15:46 schrieb Alexander Yarygin:
Each call of the virtio_blk_reset() function calls blk_drain_all(),
which works for all existing BlockDriverStates, while only one
BlockDriverState needs to be drained.
This patch introduces the blk_drain() function and replaces
On 03/06/2015 15:46, Alexander Yarygin wrote:
Each call of the virtio_blk_reset() function calls blk_drain_all(),
which works for all existing BlockDriverStates, while only one
BlockDriverState needs to be drained.
This patch introduces the blk_drain() function and replaces
On 06/03/2015 07:40 AM, Alberto Garcia wrote:
Hello,
I would like to retake the work that Benoît was about to start last
year and extend the I/O accounting in QEMU. I was reading the past
discussions and I will try to summarize all the ideas.
The current accounting code collects the
Hello,
I would like to retake the work that Benoît was about to start last
year and extend the I/O accounting in QEMU. I was reading the past
discussions and I will try to summarize all the ideas.
The current accounting code collects the following information:
typedef struct BlockAcctStats {
Each call of the virtio_blk_reset() function calls blk_drain_all(),
which works for all existing BlockDriverStates, while only one
BlockDriverState needs to be drained.
This patch introduces the blk_drain() function and replaces
blk_drain_all() on it in virtio_blk_reset().
Cc: Christian
55 matches
Mail list logo