On Thu, 05/11 16:42, Paolo Bonzini wrote:
> -void block_acct_done(BlockAcctStats *stats, BlockAcctCookie *cookie)
> +static void block_account_one_io(BlockAcctStats *stats, BlockAcctCookie
> *cookie, bool failed)
This line is too long. Can be fixed when applying, though.
Fam
0 TEST_DIR/t.IMGFMT
> +0x3c0 0x110 TEST_DIR/t.IMGFMT
> +0x6a0 0x160 TEST_DIR/t.IMGFMT
> No errors were found on the image.
> *** done
> --
> 2.9.4
>
>
Reviewed-by: Fam Zheng <f...@redhat.com>
o_get_block_status(BlockDriverState *bs,
> if (be32_to_cpu(footer->type) == VHD_FIXED) {
> *pnum = nb_sectors;
> *file = bs->file->bs;
> -return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA |
> +return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID |
> (sector_num << BDRV_SECTOR_BITS);
> }
>
> --
> 2.9.4
>
>
Reviewed-by: Fam Zheng <f...@redhat.com>
On Wed, 05/24 15:28, Eric Blake wrote:
> Not all callers care about which BDS owns the mapping for a given
> range of the file. This patch merely simplifies the callers by
> consolidating the logic in the common call point, while guaranteeing
> a non-NULL file to all the driver callbacks, for no
ead 30408704/30408704 bytes at offset 80740352
> 29 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> read 23068672/23068672 bytes at offset 49056
> 22 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> +Offset Length File
> +0 0x800 blkdebug::TEST_DIR/t.IMGFMT
> No errors were found on the image.
> *** done
> --
> 2.9.4
>
Reviewed-by: Fam Zheng <f...@redhat.com>
force_share, opts);
> +openfile(NULL, flags, writethrough, force_share, opts);
> } else {
> QDECREF(opts);
> -return qemuio_command_usage(_cmd);
> + qemuio_command_usage(_cmd);
> }
> +return 0;
> }
>
> static int quit_f(BlockBackend *blk, int argc, char **argv)
> --
> 2.9.4
>
>
This is better, thanks!
Reviewed-by: Fam Zheng <f...@redhat.com>
On Thu, 05/18 21:32, Eric Blake wrote:
> Failure to open a file in qemu-io should normally return 1 on
> failure to end the command loop, on the presumption that when
> batching commands all on the command line, failure to open means
> nothing further can be attempted. But when executing qemu-io
>
On Tue, 05/23 16:01, Kevin Wolf wrote:
> Kevin Wolf (4):
> block: Fix anonymous BBs in blk_root_inactivate()
> migration: Inactivate images after .save_live_complete_precopy()
> migration/block: Clean up BBs in block_save_complete()
> qemu-iotests: Block migration test
R
crash on
virtio_scsi_ctx_check: Assertion `blk_get_aio_context(d->conf.blk) == s->ctx'
failed.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block/block-backend.c | 6 ++
1 file changed, 6 insertions(+)
Now that all BB users comply with the BLK_PERM_AIO_CONTEXT_CHANGE
rule, we can assert it.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block/block-backend.c | 4
1 file changed, 4 insertions(+)
diff --git a/block/block-backend.c b/block/block-backend.c
index dfe577d..51c62ea
-off-by: Fam Zheng <f...@redhat.com>
---
block/mirror.c | 54 --
blockdev.c | 4
2 files changed, 32 insertions(+), 26 deletions(-)
diff --git a/block/mirror.c b/block/mirror.c
index a3337ee..4eccb8d 100644
--- a/block/mirror.c
What's done in the source's context change notifier is moving the
target's context to follow the new one, so we request this permission
here.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block/mirror.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/mirror.c b/block/mirror.c
bdrv_set_aio_context can take care of children recursively, so it is
okay to pass down the perm.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block.c | 10 ++
block/vvfat.c | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/block.c b/block.c
index d
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/Makefile.include | 2 ++
tests/test-blk-perm.c | 59 ++
2 files changed, 61 insertions(+)
create mode 100644 tests/test-blk-perm.c
diff --git a/tests/Makefile.include b/tests/Makefile.i
What's done in the source's context change notifier is moving the
target's context to follow the new one, so we request this permission
here.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block/backup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/backup.c b
this through blk_set_aio_context interface, in backup_job_create()
which is a central place for both drive-backup and blockdev-backup, to
take care of the compatibility check.
Also the bdrv_set_aio_context in do_drive_backup could have been
conditional, to save a recursion when possible.
Signed-off-by: Fam
blk_set_aio_context is audited by perm API, so follow the protocol and
request for permission first.
Previously the return code in error path was hardcoded as -EPERM, but
returning 'r' is more meaningful here both for the new error and
existing ones.
Signed-off-by: Fam Zheng <f...@redhat.
The block job has the aio context change notifier, we should allow it
here as well.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block/commit.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/block/commit.c b/block/commit.c
index e2ee0ff..bbf7768 100644
--- a
Signed-off-by: Fam Zheng <f...@redhat.com>
---
blockjob.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/blockjob.c b/blockjob.c
index 6e48932..b20fb86 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -214,6 +214,9 @@ void *block_job_create(const char *job_id, const
BlockJobDriver *
This is safe because of the aio context notifier we'll register on this
node. So allow it.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
nbd/server.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/nbd/server.c b/nbd/server.c
index 924a1fe..a8f58fb 100644
---
This function tries to request, if not granted yet, for the given
permissions.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block/block-backend.c | 12
include/sysemu/block-backend.h | 1 +
2 files changed, 13 insertions(+)
diff --git a/block/block-backend.c b
The intermediate nodes do work with aio context change, so allow that
operations.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block/commit.c | 3 ++-
block/mirror.c | 3 ++-
block/stream.c | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/block/commit.c b/block/co
proper bdrv_set_aio_context().
Store the AioContext in BB and do it in blk_insert_bs. That is done by
Vladimir's patch.
Other patches are to make sure such a bdrv_set_aio_context() doesn't interfere
with other BBs using other nodes from this graph.
Fam
Fam Zheng (15):
block: Define
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block.c | 2 ++
include/block/block.h | 7 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 50ba264..d98662f 100644
--- a/block.c
+++ b/block.c
@@ -1649,6 +1649,8 @@ char *bdrv_perm
On Thu, 05/11 16:27, Stefan Hajnoczi wrote:
> On Wed, Apr 19, 2017 at 05:43:50PM +0800, Fam Zheng wrote:
> > diff --git a/blockdev.c b/blockdev.c
> > index dfd1385..53f9874 100644
> > --- a/blockdev.c
> > +++ b/blockdev.c
> > @@ -3556,8 +3556,6 @@ void qmp_dri
On Thu, 05/11 15:32, Stefan Hajnoczi wrote:
> On Wed, Apr 19, 2017 at 05:43:42PM +0800, Fam Zheng wrote:
> > This function tries to request, if not granted yet, for the given
> > permissions.
> >
> > Signed-off-by: Fam Zheng <f...@redhat.com>
> > ---
&
On Fri, 05/05 11:41, Daniel P. Berrange wrote:
> On Fri, May 05, 2017 at 06:21:53PM +0800, Fam Zheng wrote:
> > This is the case in our docker tests, as we use --net=none there. Skip
> > this method.
> >
> > Signed-off-by: Fam Zheng <f...@redhat.com>
> &
On Wed, 05/17 13:59, Kevin Wolf wrote:
> Am 17.05.2017 um 04:13 hat Fam Zheng geschrieben:
> > On Fri, 05/05 18:21, Fam Zheng wrote:
> > > This is the case in our docker tests, as we use --net=none there. Skip
> > > this method.
> >
> > Ping. Is this pa
On Fri, 05/05 18:21, Fam Zheng wrote:
> This is the case in our docker tests, as we use --net=none there. Skip
> this method.
Ping. Is this patch okay?
>
> Signed-off-by: Fam Zheng <f...@redhat.com>
> ---
> tests/qemu-iotests/147 | 7 +++
> 1 file changed, 7 in
ptions, "locking", false)) {
> > error_setg(errp, "locking=on is not supported on Windows");
> > +ret = -EINVAL;
> > goto fail;
> > }
>
>
> This is a bug fix for commit 1c3a555c.
>
> Reviewed-by: Stefan Weil <s...@weilnetz.de>
>
>
Thank you!
Reviewed-by: Fam Zheng <f...@redhat.com>
qdict_put(opts, BDRV_OPT_FORCE_SHARE, qbool_from_bool(true));
> +qdict_put_bool(opts, BDRV_OPT_FORCE_SHARE, true);
> }
> qemuio_blk = blk_new_open(name, NULL, opts, flags, _err);
> if (!qemuio_blk) {
> --
> 2.9.4
>
>
Reviewed-by: Fam Zheng <f...@redhat.com>
On Mon, 05/15 16:02, Peter Lieven wrote:
> > > do you have a pointer to the image locking mechanism?
> > It hit qemu.git master just a moment ago. See raw_check_perm.
>
> which master are you looking at?
>
> $ git fetch upstream
> $ git log upstream/master --oneline
> 3a87606 Merge tag
Reported by Coverity.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
qemu-img.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/qemu-img.c b/qemu-img.c
index b506839..8b0dfa7 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -294,6 +294,7 @@ static BlockBackend *img_open_opts(const char *
On Mon, 05/15 14:32, Peter Lieven wrote:
> Am 15.05.2017 um 14:28 schrieb Fam Zheng:
> > On Mon, 05/15 13:58, Peter Lieven wrote:
> > > Am 15.05.2017 um 13:53 schrieb Fam Zheng:
> > > > On Mon, 05/15 13:26, Peter Lieven wrote:
> > > > > Am 15.05.2017 u
On Mon, 05/15 12:02, Peter Lieven wrote:
> Hi Block developers,
>
> I would like to add a feature to Qemu to drain all traffic from a block so
> that
> I can take external snaphosts without the risk to that in the middle of a
> write
> operation. Its meant for cases where where QGA freeze/thaw
On Fri, 05/12 19:41, Max Reitz wrote:
> The fun is increased by the fact that the locking series has
> (inadvertently) removed the -B documentation from convert, so there is
> another conflict looming in the future...
Sorry about the mistake there..
I've posted a patch for that:
[Qemu-devel]
It got lost in commit a8d16f9ca "qemu-img: Update documentation for -U".
Reported-by: Max Reitz <mre...@redhat.com>
Signed-off-by: Fam Zheng <f...@redhat.com>
---
qemu-img-cmds.hx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qemu-img-cmds.hx b/
On Fri, 05/12 19:37, Max Reitz wrote:
> On 2017-05-11 16:32, Kevin Wolf wrote:
> > From: Fam Zheng <f...@redhat.com>
> >
> > Signed-off-by: Fam Zheng <f...@redhat.com>
> > Signed-off-by: Kevin Wolf <kw...@redhat.com>
> > ---
> > qemu-img
On Thu, 05/11 12:08, Kevin Wolf wrote:
> Am 02.05.2017 um 18:35 hat Fam Zheng geschrieben:
> > Signed-off-by: Fam Zheng <f...@redhat.com>
> > ---
> > tests/qemu-iotests/182 | 73
> > ++
> > tests/qemu-iot
gh, it would be
> possible to use image-opts syntax. This adds --target-image-opts
> to indicate that the target filename includes options. Currently
> this mandates use of the --skip-create flag too.
>
> Signed-off-by: Daniel P. Berrange <berra...@redhat.com>
Reviewed-by: Fam Zheng <f...@redhat.com>
v_co_get_block_status(*file, ret >> BDRV_SECTOR_BITS,
> + *pnum, pnum, file);
> goto out;
> }
>
> --
> 2.9.3
>
>
Reviewed-by: Fam Zheng <f...@redhat.com>
completes the SCSI disk will be
> unresponsive. This leads to request timeouts inside the guest.
>
> Reported-by: Qianqian Zhu <qi...@redhat.com>
> Suggested-by: Fam Zheng <f...@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com>
> ---
> v3:
>
This is the case in our docker tests, as we use --net=none there. Skip
this method.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/147 | 7 +++
1 file changed, 7 insertions(+)
diff --git a/tests/qemu-iotests/147 b/tests/qemu-iotests/147
index 32afea6..db34838
On Fri, 05/05 11:02, Stefan Hajnoczi wrote:
> diff --git a/include/block/aio.h b/include/block/aio.h
> index 406e323..b3d6f76 100644
> --- a/include/block/aio.h
> +++ b/include/block/aio.h
> @@ -454,8 +454,14 @@ static inline void aio_disable_external(AioContext *ctx)
> */
> static inline void
On Thu, 05/04 15:09, Kevin Wolf wrote:
> Am 02.05.2017 um 18:35 hat Fam Zheng geschrieben:
> > v17: Fixes addressing comments by Kevin:
> > - Rebase on top of kevin/block
> > - In test case 153, don't compile test program, just try locking=on and
> >
timeouts inside the guest.
>
> I agree this is the minimal fix and is the right thing to do. The
> bdrv_drained_begin/end device callbacks would also make it possible to
> remove disable/enable external altogether, but that's more invasive.
>
> Reviewed-by: Paolo Bonzini <pbonz...@red
emoved
> together with all temporary workarounds that have accumulated.
Thanks! I had a few nits and questions, but it's pretty good in general:
Reviewed-by: Fam Zheng <f...@redhat.com>
Fam
On Thu, 04/20 14:00, Paolo Bonzini wrote:
> @@ -400,7 +431,8 @@ BlockDirtyInfoList
> *bdrv_query_dirty_bitmaps(BlockDriverState *bs)
> return list;
> }
>
> -int bdrv_get_dirty(BlockDriverState *bs, BdrvDirtyBitmap *bitmap,
> +/* Called within bdrv_dirty_bitmap_lock..unlock */
> +int
On Thu, 04/20 14:00, Paolo Bonzini wrote:
> diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
> index 519737c..e13718e 100644
> --- a/block/dirty-bitmap.c
> +++ b/block/dirty-bitmap.c
> @@ -52,6 +52,24 @@ struct BdrvDirtyBitmapIter {
> BdrvDirtyBitmap *bitmap;
> };
>
> +static
On Thu, 04/20 14:00, Paolo Bonzini wrote:
> +static inline void stat64_rdlock(Stat64 *s)
> +{
> +/* Keep out incoming writers to avoid them starving us. */
> +atomic_add(>lock, 2);
> +
> +/* If there is a concurrent writer, wait for it. */
> +while (atomic_read(>lock) & 1) {
> +
On Thu, 04/20 14:00, Paolo Bonzini wrote:
> +if (atomic_cmpxchg(>locked, waiters, waiters + 1) != waiters) {
Is it still useful to try the fast path again if there are now even more
waiters, i.e. "atomic_cmpxchg(...) > waiters"?
> +goto retry_fast_path;
> +}
> +
> +
On Thu, 04/20 14:00, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block.c | 1 +
> block/io.c| 20 +---
> include/block/block_int.h | 12 +++-
> 3 files changed, 25 insertions(+), 8 deletions(-)
>
>
On Thu, 04/20 14:00, Paolo Bonzini wrote:
> This module provides fast paths for 64-bit atomic operations on machines
> that only have 32-bit atomic access.
Interesting patch!
Out of curiosity: what are the machines here, besides i386? It strikes me as
they are old and slow anyway, then why this
On Thu, 04/20 14:00, Paolo Bonzini wrote:
> Signed-off-by: Paolo Bonzini
> ---
> block/block-backend.c | 1 +
> block/throttle-groups.c| 11 +--
> include/sysemu/block-backend.h | 7 ++-
> 3 files changed, 12 insertions(+), 7 deletions(-)
>
>
On Wed, 05/03 00:35, Fam Zheng wrote:
> Opening the backing image for the second time is bad, especially here
> when it is also in use as the active image as the source. The
> drive-backup job itself doesn't read from target->backing for COW,
> instead it gets data from the write no
Signed-off-by: Fam Zheng <f...@redhat.com>
---
util/osdep.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/util/osdep.c b/util/osdep.c
index 3de4a18..a2863c8 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -38,6 +38,14 @@ extern int madvise(c
ing the target to NBD etc. won't work, because of the
likely stale metadata cache.
Use BDRV_O_NO_BACKING in this case and manually set up the backing
BdrvChild.
Cc: qemu-sta...@nongnu.org
Signed-off-by: Fam Zheng <f...@redhat.com>
---
blockdev.c | 15 ++-
1 file changed, 14 inserti
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/153 | 233 +++
tests/qemu-iotests/153.out | 390 +
tests/qemu-iotests/group | 1 +
3 files changed, 624 insertions(+)
create mode 100755 test
We share the same set of QAPI options with file-posix, but locking is
not supported here. So error out if it is specified as 'on' for now.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block/file-win32.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/block/file-win32.c b/bloc
Making this option available even before implementing it will let
converting tests easier: in coming patches they can specify the option
already when necessary, before we actually write code to lock the
images.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block/file-posix.c | 5 +
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/182 | 73 ++
tests/qemu-iotests/182.out | 8 +
tests/qemu-iotests/group | 1 +
3 files changed, 82 insertions(+)
create mode 100755 tests/qemu-iotests/182
create mode
The COLO block replication architecture requires one disk to be shared
between primary and secondary, in the test both processes use posix file
protocol (instead of over NBD) so it is affected by image locking.
Disable the lock.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
test
the same
permission is translated to a shared lock of a separate byte. With that,
we use 2x number of bytes of distinct permission types.
virtlockd in libvirt locks the first byte, so we do locking from a
higher offset.
Suggested-by: Kevin Wolf <kw...@redhat.com>
Signed-off-by: Fam Zheng <f...@r
They are wrappers of POSIX fcntl "file private locking", with a
convenient "try lock" wrapper implemented with F_OFD_GETLK.
Signed-off-by: Fam Zheng <f...@redhat.com>
Reviewed-by: Max Reitz <mre...@redhat.com>
---
include/qemu/osdep.h |
qemu-img and qemu-io commands when guest is running need "-U" option,
add it.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/030 | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/0
Signed-off-by: Fam Zheng <f...@redhat.com>
Reviewed-by: Max Reitz <mre...@redhat.com>
---
tests/drive_del-test.c| 2 +-
tests/nvme-test.c | 2 +-
tests/usb-hcd-uhci-test.c | 2 +-
tests/usb-hcd-xhci-test.c | 2 +-
tests/virtio-blk-test.c | 2 +-
tests/virtio-scsi
Signed-off-by: Fam Zheng <f...@redhat.com>
Reviewed-by: Max Reitz <mre...@redhat.com>
---
tests/qemu-iotests/091 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/qemu-iotests/091 b/tests/qemu-iotests/091
index 32bbd56..10ac4a8 100755
--- a/tests/qemu-iotests/091
+++
To avoid image lock failures.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/172 | 55 +-
tests/qemu-iotests/172.out | 50 +
2 files changed, 56 insertions(+), 49 deletions(-)
diff
The test scenario doesn't require the same image, instead it focuses on
the duplicated node-name, so use null-co to avoid locking conflict.
Reviewed-by: Max Reitz <mre...@redhat.com>
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/087 | 6 ++
1 file changed,
In the case where we test the expected error when a blockdev-snapshot
target already has a backing image, the backing chain is opened multiple
times. This will be a problem when we use image locking, so use a
different backing file that is not already open.
Signed-off-by: Fam Zheng &l
Signed-off-by: Fam Zheng <f...@redhat.com>
---
qemu-img-cmds.hx | 36 ++--
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx
index bf4ce59..e5bc28f 100644
--- a/qemu-img-cmds.hx
+++ b/qemu-img-cmds.hx
@@
Double attach is not a valid usage of the target image, drive-backup
will open the blockdev itself so skip the add_drive call in this case.
Signed-off-by: Fam Zheng <f...@redhat.com>
Reviewed-by: Max Reitz <mre...@redhat.com>
---
tests/qemu-iotests/055 | 32 ++-
The qemu-img info command is executed while VM is running, add -U option
to avoid the image locking error.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/046 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotes
This will force the opened images to allow sharing all permissions with other
programs.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
qemu-img.c | 154 ++---
1 file changed, 118 insertions(+), 36 deletions(-)
diff --git a/qemu-i
Add --force-share/-U to program options and -U to open subcommand.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
qemu-io.c | 42 ++
1 file changed, 34 insertions(+), 8 deletions(-)
diff --git a/qemu-io.c b/qemu-io.c
index 427cbae..cf4b876
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block.c | 32
1 file changed, 24 insertions(+), 8 deletions(-)
diff --git a/block.c b/block.c
index 710ba04..70ca7b4 100644
--- a/block.c
+++ b/block.c
@@ -1467,6 +1467,22 @@ static int bdrv_child_chec
It can be used outside of block.c for making user friendly messages.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block.c | 2 +-
include/block/block.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 6c6bb3e..d8fcad9
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block.c | 17 +
include/block/block.h | 1 +
include/block/block_int.h | 1 +
qapi/block-core.json | 3 +++
4 files changed, 22 insertions(+)
diff --git a/block.c b/block.c
index d8fcad9..710ba04
ddress Max's comments.
- Add reviewed-by from Max and Eric.
- Rebase for 2.10:
* Use op blocker API
* Add --unsafe-read for qemu-img and qemu-io
Fam Zheng (23):
block: Make bdrv_perm_names public
block: Add, parse and store "force-share" option
block: Respe
On Tue, 05/02 16:59, Kevin Wolf wrote:
> Am 02.05.2017 um 10:18 hat Fam Zheng geschrieben:
> > Signed-off-by: Fam Zheng <f...@redhat.com>
> > ---
> > tests/qemu-iotests/153 | 247
> >
On Tue, 05/02 16:15, Kevin Wolf wrote:
> > diff --git a/qapi/block-core.json b/qapi/block-core.json
> > index 1cf29a1..29d3040 100644
> > --- a/qapi/block-core.json
> > +++ b/qapi/block-core.json
> > @@ -2127,11 +2127,15 @@
> > #
> > # @filename:path to the image file
> > # @aio:
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/153 | 247
tests/qemu-iotests/153.out | 390 +
tests/qemu-iotests/group | 1 +
3 files changed, 638 insertions(+)
create mode 100755 test
The COLO block replication architecture requires one disk to be shared
between primary and secondary, in the test both processes use posix file
protocol (instead of over NBD) so it is affected by image locking.
Disable the lock.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
test
Making this option available even before implementing it will let
converting tests easier: in coming patches they can specify the option
already when necessary, before we actually write code to lock the
images.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block/file-posix.c | 5 +
In the case where we test the expected error when a blockdev-snapshot
target already has a backing image, the backing chain is opened multiple
times. This will be a problem when we use image locking, so use a
different backing file that is not already open.
Signed-off-by: Fam Zheng &l
They are wrappers of POSIX fcntl "file private locking", with a
convenient "try lock" wrapper implemented with F_OFD_GETLK.
Signed-off-by: Fam Zheng <f...@redhat.com>
Reviewed-by: Max Reitz <mre...@redhat.com>
---
include/qemu/osdep.h |
Signed-off-by: Fam Zheng <f...@redhat.com>
---
util/osdep.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/util/osdep.c b/util/osdep.c
index 3de4a18..a2863c8 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -38,6 +38,14 @@ extern int madvise(c
the same
permission is translated to a shared lock of a separate byte. With that,
we use 2x number of bytes of distinct permission types.
virtlockd in libvirt locks the first byte, so we do locking from a
higher offset.
Suggested-by: Kevin Wolf <kw...@redhat.com>
Signed-off-by: Fam Zheng <f...@r
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/182 | 73 ++
tests/qemu-iotests/182.out | 8 +
tests/qemu-iotests/group | 1 +
3 files changed, 82 insertions(+)
create mode 100755 tests/qemu-iotests/182
create mode
Signed-off-by: Fam Zheng <f...@redhat.com>
---
blockdev.c | 15 ++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/blockdev.c b/blockdev.c
index 6428206..e1facf5 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -3174,6 +3174,7 @@ static BlockJob *do_drive_backup(Drive
Signed-off-by: Fam Zheng <f...@redhat.com>
Reviewed-by: Max Reitz <mre...@redhat.com>
---
tests/drive_del-test.c| 2 +-
tests/nvme-test.c | 2 +-
tests/usb-hcd-uhci-test.c | 2 +-
tests/usb-hcd-xhci-test.c | 2 +-
tests/virtio-blk-test.c | 2 +-
tests/virtio-scsi
To avoid image lock failures.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/172 | 55 +-
tests/qemu-iotests/172.out | 50 +
2 files changed, 56 insertions(+), 49 deletions(-)
diff
Signed-off-by: Fam Zheng <f...@redhat.com>
Reviewed-by: Max Reitz <mre...@redhat.com>
---
tests/qemu-iotests/091 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/qemu-iotests/091 b/tests/qemu-iotests/091
index 32bbd56..10ac4a8 100755
--- a/tests/qemu-iotests/091
+++
The qemu-img info command is executed while VM is running, add -U option
to avoid the image locking error.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/046 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotes
This will force the opened images to allow sharing all permissions with other
programs.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
qemu-img.c | 154 ++---
1 file changed, 118 insertions(+), 36 deletions(-)
diff --git a/qemu-i
qemu-img and qemu-io commands when guest is running need "-U" option,
add it.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
tests/qemu-iotests/030 | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/0
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block.c | 17 +
include/block/block.h | 1 +
include/block/block_int.h | 1 +
qapi/block-core.json | 3 +++
4 files changed, 22 insertions(+)
diff --git a/block.c b/block.c
index dd272cb..3e77fa4
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block.c | 32
1 file changed, 24 insertions(+), 8 deletions(-)
diff --git a/block.c b/block.c
index 3e77fa4..e33f221 100644
--- a/block.c
+++ b/block.c
@@ -1467,6 +1467,22 @@ static int bdrv_child_chec
Add --force-share/-U to program options and -U to open subcommand.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
qemu-io.c | 42 ++
1 file changed, 34 insertions(+), 8 deletions(-)
diff --git a/qemu-io.c b/qemu-io.c
index 427cbae..cf4b876
It can be used outside of block.c for making user friendly messages.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
block.c | 2 +-
include/block/block.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 7b557f3..dd272cb
801 - 900 of 2965 matches
Mail list logo