All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly
@ 2020-04-29 14:11 Max Reitz
  2020-04-29 14:11 ` [PATCH v2 1/4] block: Add bdrv_make_empty() Max Reitz
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Max Reitz @ 2020-04-29 14:11 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, qemu-devel, Max Reitz

v1: https://lists.nongnu.org/archive/html/qemu-block/2020-04/msg01245.html

Branch: https://github.com/XanClic/qemu.git fix-bdrv_make_empty-v2
Branch: https://git.xanclic.moe/XanClic/qemu.git fix-bdrv_make_empty-v2

Based-on: <20200428192648.749066-1-eblake@redhat.com>
          (“qcow2: Allow resize of images with internal snapshots”)

Hi,

As described in v1’s cover letter (linked above), this series ensures
that all calls to BlockDriver.bdrv_make_empty() go through a wrapper
bdrv_make_empty() function that ensures the caller does have the
necessary permissions.


Changes in v2 (thanks for the quick reviews, I didn’t expect this series
to get attention so quickly :)):
- Added Based-on here in the cover letter [Eric]
- Patch 1: WRITE_UNCHANGED is sufficient [Kevin]
- Patch 3: Check whether blk->root is actually present with
           blk_is_available() [Kevin]
- Patch 4: Let bdrv_commit() only take the WRITE_UNCHANGED permission,
           and take it from the moment the @src BB is created and @bs is
           inserted [Kevin];
           then drop the drv->bdrv_make_empty check, just call
           blk_make_empty() and ignore -ENOTSUP [Eric]


git-backport-diff against v1:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/4:[0002] [FC] 'block: Add bdrv_make_empty()'
002/4:[----] [--] 'block: Use bdrv_make_empty() where possible'
003/4:[0005] [FC] 'block: Add blk_make_empty()'
004/4:[0020] [FC] 'block: Use blk_make_empty() after commits'


Max Reitz (4):
  block: Add bdrv_make_empty()
  block: Use bdrv_make_empty() where possible
  block: Add blk_make_empty()
  block: Use blk_make_empty() after commits

 include/block/block.h          |  1 +
 include/sysemu/block-backend.h |  2 ++
 block.c                        | 23 +++++++++++++++++++++++
 block/block-backend.c          | 10 ++++++++++
 block/commit.c                 | 16 +++++++++-------
 block/replication.c            |  6 ++----
 block/vvfat.c                  |  4 +---
 qemu-img.c                     | 19 ++++++++++++++-----
 8 files changed, 62 insertions(+), 19 deletions(-)

-- 
2.25.4



^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v2 1/4] block: Add bdrv_make_empty()
  2020-04-29 14:11 [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly Max Reitz
@ 2020-04-29 14:11 ` Max Reitz
  2020-04-29 14:51   ` Eric Blake
  2020-04-29 14:11 ` [PATCH v2 2/4] block: Use bdrv_make_empty() where possible Max Reitz
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 16+ messages in thread
From: Max Reitz @ 2020-04-29 14:11 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, qemu-devel, Max Reitz

Right now, all users of bdrv_make_empty() call the BlockDriver method
directly.  That is not only bad style, it is also wrong, unless the
caller has a BdrvChild with a WRITE or WRITE_UNCHANGED permission.
(WRITE_UNCHANGED suffices, because callers generally use this function
to clear a node with a backing file after a commit operation.)

Introduce bdrv_make_empty() that verifies that it does.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 include/block/block.h |  1 +
 block.c               | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/include/block/block.h b/include/block/block.h
index 8b62429aa4..1dee50419c 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -352,6 +352,7 @@ BlockMeasureInfo *bdrv_measure(BlockDriver *drv, QemuOpts *opts,
 void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr);
 void bdrv_refresh_limits(BlockDriverState *bs, Error **errp);
 int bdrv_commit(BlockDriverState *bs);
+int bdrv_make_empty(BdrvChild *c, Error **errp);
 int bdrv_change_backing_file(BlockDriverState *bs,
     const char *backing_file, const char *backing_fmt);
 void bdrv_register(BlockDriver *bdrv);
diff --git a/block.c b/block.c
index 03cc5813a2..d6580db0e2 100644
--- a/block.c
+++ b/block.c
@@ -6792,3 +6792,26 @@ void bdrv_del_child(BlockDriverState *parent_bs, BdrvChild *child, Error **errp)
 
     parent_bs->drv->bdrv_del_child(parent_bs, child, errp);
 }
+
+int bdrv_make_empty(BdrvChild *c, Error **errp)
+{
+    BlockDriver *drv = c->bs->drv;
+    int ret;
+
+    assert(c->perm & (BLK_PERM_WRITE | BLK_PERM_WRITE_UNCHANGED));
+
+    if (!drv->bdrv_make_empty) {
+        error_setg(errp, "%s does not support emptying nodes",
+                   drv->format_name);
+        return -ENOTSUP;
+    }
+
+    ret = drv->bdrv_make_empty(c->bs);
+    if (ret < 0) {
+        error_setg_errno(errp, -ret, "Failed to empty %s",
+                         c->bs->filename);
+        return ret;
+    }
+
+    return 0;
+}
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 2/4] block: Use bdrv_make_empty() where possible
  2020-04-29 14:11 [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly Max Reitz
  2020-04-29 14:11 ` [PATCH v2 1/4] block: Add bdrv_make_empty() Max Reitz
@ 2020-04-29 14:11 ` Max Reitz
  2020-04-29 14:11 ` [PATCH v2 3/4] block: Add blk_make_empty() Max Reitz
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: Max Reitz @ 2020-04-29 14:11 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, qemu-devel, Max Reitz

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
---
 block/replication.c | 6 ++----
 block/vvfat.c       | 4 +---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/block/replication.c b/block/replication.c
index da013c2041..cc6a40d577 100644
--- a/block/replication.c
+++ b/block/replication.c
@@ -331,9 +331,8 @@ static void secondary_do_checkpoint(BDRVReplicationState *s, Error **errp)
         return;
     }
 
-    ret = s->active_disk->bs->drv->bdrv_make_empty(s->active_disk->bs);
+    ret = bdrv_make_empty(s->active_disk, errp);
     if (ret < 0) {
-        error_setg(errp, "Cannot make active disk empty");
         return;
     }
 
@@ -343,9 +342,8 @@ static void secondary_do_checkpoint(BDRVReplicationState *s, Error **errp)
         return;
     }
 
-    ret = s->hidden_disk->bs->drv->bdrv_make_empty(s->hidden_disk->bs);
+    ret = bdrv_make_empty(s->hidden_disk, errp);
     if (ret < 0) {
-        error_setg(errp, "Cannot make hidden disk empty");
         return;
     }
 }
diff --git a/block/vvfat.c b/block/vvfat.c
index 6d5c090dec..34c121c07a 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -2960,9 +2960,7 @@ static int do_commit(BDRVVVFATState* s)
         return ret;
     }
 
-    if (s->qcow->bs->drv && s->qcow->bs->drv->bdrv_make_empty) {
-        s->qcow->bs->drv->bdrv_make_empty(s->qcow->bs);
-    }
+    bdrv_make_empty(s->qcow, NULL);
 
     memset(s->used_clusters, 0, sector2cluster(s, s->sector_count));
 
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 3/4] block: Add blk_make_empty()
  2020-04-29 14:11 [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly Max Reitz
  2020-04-29 14:11 ` [PATCH v2 1/4] block: Add bdrv_make_empty() Max Reitz
  2020-04-29 14:11 ` [PATCH v2 2/4] block: Use bdrv_make_empty() where possible Max Reitz
@ 2020-04-29 14:11 ` Max Reitz
  2020-04-29 14:52   ` Eric Blake
  2020-04-29 14:11 ` [PATCH v2 4/4] block: Use blk_make_empty() after commits Max Reitz
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 16+ messages in thread
From: Max Reitz @ 2020-04-29 14:11 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, qemu-devel, Max Reitz

Two callers of BlockDriver.bdrv_make_empty() remain that should not call
this method directly.  Both do not have access to a BdrvChild, but they
can use a BlockBackend, so we add this function that lets them use it.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 include/sysemu/block-backend.h |  2 ++
 block/block-backend.c          | 10 ++++++++++
 2 files changed, 12 insertions(+)

diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 0917663d89..8203d7f6f9 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -266,4 +266,6 @@ int coroutine_fn blk_co_copy_range(BlockBackend *blk_in, int64_t off_in,
 
 const BdrvChild *blk_root(BlockBackend *blk);
 
+int blk_make_empty(BlockBackend *blk, Error **errp);
+
 #endif
diff --git a/block/block-backend.c b/block/block-backend.c
index f4944861fa..47bd56244d 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -2402,3 +2402,13 @@ const BdrvChild *blk_root(BlockBackend *blk)
 {
     return blk->root;
 }
+
+int blk_make_empty(BlockBackend *blk, Error **errp)
+{
+    if (!blk_is_available(blk)) {
+        error_setg(errp, "No medium inserted");
+        return -ENOMEDIUM;
+    }
+
+    return bdrv_make_empty(blk->root, errp);
+}
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v2 4/4] block: Use blk_make_empty() after commits
  2020-04-29 14:11 [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly Max Reitz
                   ` (2 preceding siblings ...)
  2020-04-29 14:11 ` [PATCH v2 3/4] block: Add blk_make_empty() Max Reitz
@ 2020-04-29 14:11 ` Max Reitz
  2020-04-29 14:17   ` Max Reitz
  2020-04-29 14:55   ` Eric Blake
  2020-04-29 19:07 ` [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly no-reply
                   ` (5 subsequent siblings)
  9 siblings, 2 replies; 16+ messages in thread
From: Max Reitz @ 2020-04-29 14:11 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, qemu-devel, Max Reitz

bdrv_commit() already has a BlockBackend pointing to the BDS that we
want to empty, it just has the wrong permissions.

qemu-img commit has no BlockBackend pointing to the old backing file
yet, but introducing one is simple.

After this commit, bdrv_make_empty() is the only remaining caller of
BlockDriver.bdrv_make_empty().

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/commit.c | 16 +++++++++-------
 qemu-img.c     | 19 ++++++++++++++-----
 2 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/block/commit.c b/block/commit.c
index 87f6096d90..ba60fb7955 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -414,7 +414,9 @@ int bdrv_commit(BlockDriverState *bs)
     }
 
     ctx = bdrv_get_aio_context(bs);
-    src = blk_new(ctx, BLK_PERM_CONSISTENT_READ, BLK_PERM_ALL);
+    /* WRITE_UNCHANGED is required for bdrv_make_empty() */
+    src = blk_new(ctx, BLK_PERM_CONSISTENT_READ | BLK_PERM_WRITE_UNCHANGED,
+                  BLK_PERM_ALL);
     backing = blk_new(ctx, BLK_PERM_WRITE | BLK_PERM_RESIZE, BLK_PERM_ALL);
 
     ret = blk_insert_bs(src, bs, &local_err);
@@ -492,14 +494,14 @@ int bdrv_commit(BlockDriverState *bs)
         }
     }
 
-    if (drv->bdrv_make_empty) {
-        ret = drv->bdrv_make_empty(bs);
-        if (ret < 0) {
-            goto ro_cleanup;
-        }
-        blk_flush(src);
+    ret = blk_make_empty(src, NULL);
+    /* Ignore -ENOTSUP */
+    if (ret < 0 && ret != -ENOTSUP) {
+        goto ro_cleanup;
     }
 
+    blk_flush(src);
+
     /*
      * Make sure all data we wrote to the backing device is actually
      * stable on disk.
diff --git a/qemu-img.c b/qemu-img.c
index 7f52742ef2..77f3575538 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1065,11 +1065,20 @@ static int img_commit(int argc, char **argv)
         goto unref_backing;
     }
 
-    if (!drop && bs->drv->bdrv_make_empty) {
-        ret = bs->drv->bdrv_make_empty(bs);
-        if (ret) {
-            error_setg_errno(&local_err, -ret, "Could not empty %s",
-                             filename);
+    if (!drop) {
+        BlockBackend *old_backing_blk;
+
+        old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
+                                          &local_err);
+        if (!old_backing_blk) {
+            goto unref_backing;
+        }
+        ret = blk_make_empty(old_backing_blk, &local_err);
+        blk_unref(old_backing_blk);
+        if (ret == -ENOTSUP) {
+            error_free(local_err);
+            local_err = NULL;
+        } else if (ret < 0) {
             goto unref_backing;
         }
     }
-- 
2.25.4



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 4/4] block: Use blk_make_empty() after commits
  2020-04-29 14:11 ` [PATCH v2 4/4] block: Use blk_make_empty() after commits Max Reitz
@ 2020-04-29 14:17   ` Max Reitz
  2020-04-29 14:55   ` Eric Blake
  1 sibling, 0 replies; 16+ messages in thread
From: Max Reitz @ 2020-04-29 14:17 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 1786 bytes --]

On 29.04.20 16:11, Max Reitz wrote:
> bdrv_commit() already has a BlockBackend pointing to the BDS that we
> want to empty, it just has the wrong permissions.
> 
> qemu-img commit has no BlockBackend pointing to the old backing file
> yet, but introducing one is simple.
> 
> After this commit, bdrv_make_empty() is the only remaining caller of
> BlockDriver.bdrv_make_empty().
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  block/commit.c | 16 +++++++++-------
>  qemu-img.c     | 19 ++++++++++++++-----
>  2 files changed, 23 insertions(+), 12 deletions(-)

[...]

> diff --git a/qemu-img.c b/qemu-img.c
> index 7f52742ef2..77f3575538 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -1065,11 +1065,20 @@ static int img_commit(int argc, char **argv)
>          goto unref_backing;
>      }
>  
> -    if (!drop && bs->drv->bdrv_make_empty) {
> -        ret = bs->drv->bdrv_make_empty(bs);
> -        if (ret) {
> -            error_setg_errno(&local_err, -ret, "Could not empty %s",
> -                             filename);
> +    if (!drop) {
> +        BlockBackend *old_backing_blk;
> +
> +        old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
> +                                          &local_err);
> +        if (!old_backing_blk) {
> +            goto unref_backing;
> +        }
> +        ret = blk_make_empty(old_backing_blk, &local_err);
> +        blk_unref(old_backing_blk);
> +        if (ret == -ENOTSUP) {
> +            error_free(local_err);
> +            local_err = NULL;
> +        } else if (ret < 0) {
>              goto unref_backing;
>          }
>      }

This patch should also include a %s/Could not empty/Failed to empty/ on
tests/qemu-iotests/098.out...

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 1/4] block: Add bdrv_make_empty()
  2020-04-29 14:11 ` [PATCH v2 1/4] block: Add bdrv_make_empty() Max Reitz
@ 2020-04-29 14:51   ` Eric Blake
  0 siblings, 0 replies; 16+ messages in thread
From: Eric Blake @ 2020-04-29 14:51 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: Kevin Wolf, qemu-devel

On 4/29/20 9:11 AM, Max Reitz wrote:
> Right now, all users of bdrv_make_empty() call the BlockDriver method
> directly.  That is not only bad style, it is also wrong, unless the
> caller has a BdrvChild with a WRITE or WRITE_UNCHANGED permission.
> (WRITE_UNCHANGED suffices, because callers generally use this function
> to clear a node with a backing file after a commit operation.)
> 
> Introduce bdrv_make_empty() that verifies that it does.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   include/block/block.h |  1 +
>   block.c               | 23 +++++++++++++++++++++++
>   2 files changed, 24 insertions(+)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 3/4] block: Add blk_make_empty()
  2020-04-29 14:11 ` [PATCH v2 3/4] block: Add blk_make_empty() Max Reitz
@ 2020-04-29 14:52   ` Eric Blake
  0 siblings, 0 replies; 16+ messages in thread
From: Eric Blake @ 2020-04-29 14:52 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: Kevin Wolf, qemu-devel

On 4/29/20 9:11 AM, Max Reitz wrote:
> Two callers of BlockDriver.bdrv_make_empty() remain that should not call
> this method directly.  Both do not have access to a BdrvChild, but they
> can use a BlockBackend, so we add this function that lets them use it.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   include/sysemu/block-backend.h |  2 ++
>   block/block-backend.c          | 10 ++++++++++
>   2 files changed, 12 insertions(+)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 4/4] block: Use blk_make_empty() after commits
  2020-04-29 14:11 ` [PATCH v2 4/4] block: Use blk_make_empty() after commits Max Reitz
  2020-04-29 14:17   ` Max Reitz
@ 2020-04-29 14:55   ` Eric Blake
  1 sibling, 0 replies; 16+ messages in thread
From: Eric Blake @ 2020-04-29 14:55 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: Kevin Wolf, qemu-devel

On 4/29/20 9:11 AM, Max Reitz wrote:
> bdrv_commit() already has a BlockBackend pointing to the BDS that we
> want to empty, it just has the wrong permissions.
> 
> qemu-img commit has no BlockBackend pointing to the old backing file
> yet, but introducing one is simple.
> 
> After this commit, bdrv_make_empty() is the only remaining caller of
> BlockDriver.bdrv_make_empty().
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>   block/commit.c | 16 +++++++++-------
>   qemu-img.c     | 19 ++++++++++++++-----
>   2 files changed, 23 insertions(+), 12 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly
  2020-04-29 14:11 [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly Max Reitz
                   ` (3 preceding siblings ...)
  2020-04-29 14:11 ` [PATCH v2 4/4] block: Use blk_make_empty() after commits Max Reitz
@ 2020-04-29 19:07 ` no-reply
  2020-04-29 19:11 ` no-reply
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: no-reply @ 2020-04-29 19:07 UTC (permalink / raw)
  To: mreitz; +Cc: kwolf, qemu-devel, qemu-block, mreitz

Patchew URL: https://patchew.org/QEMU/20200429141126.85159-1-mreitz@redhat.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  LINK    qemu-storage-daemon
  LINK    qemu-io
/tmp/qemu-test/src/qemu-img.c: In function 'img_commit':
/tmp/qemu-test/src/qemu-img.c:1071:9: error: implicit declaration of function 'blk_new_with_bs' [-Werror=implicit-function-declaration]
         old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
         ^
/tmp/qemu-test/src/qemu-img.c:1071:9: error: nested extern declaration of 'blk_new_with_bs' [-Werror=nested-externs]
/tmp/qemu-test/src/qemu-img.c:1071:25: error: assignment makes pointer from integer without a cast [-Werror]
         old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
                         ^
cc1: all warnings being treated as errors
make: *** [qemu-img.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** wait: No child processes.  Stop.
Traceback (most recent call last):
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=54c1e8d7f38d491c879a9f7fd70b93fd', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-j98lpee6/src/docker-src.2020-04-29-15.04.21.16547:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=54c1e8d7f38d491c879a9f7fd70b93fd
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-j98lpee6/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    2m41.192s
user    0m8.095s


The full log is available at
http://patchew.org/logs/20200429141126.85159-1-mreitz@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly
  2020-04-29 14:11 [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly Max Reitz
                   ` (4 preceding siblings ...)
  2020-04-29 19:07 ` [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly no-reply
@ 2020-04-29 19:11 ` no-reply
  2020-04-29 19:15 ` no-reply
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: no-reply @ 2020-04-29 19:11 UTC (permalink / raw)
  To: mreitz; +Cc: kwolf, qemu-devel, qemu-block, mreitz

Patchew URL: https://patchew.org/QEMU/20200429141126.85159-1-mreitz@redhat.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

  BUILD   pc-bios/optionrom/linuxboot_dma.raw
  BUILD   pc-bios/optionrom/kvmvapic.raw
  LINK    qemu-edid
/tmp/qemu-test/src/qemu-img.c:1071:27: error: implicit declaration of function 'blk_new_with_bs' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
                          ^
/tmp/qemu-test/src/qemu-img.c:1071:27: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
/tmp/qemu-test/src/qemu-img.c:1071:25: error: incompatible integer to pointer conversion assigning to 'BlockBackend *' (aka 'struct BlockBackend *') from 'int' [-Werror,-Wint-conversion]
        old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
---
  SIGN    pc-bios/optionrom/linuxboot.bin
  SIGN    pc-bios/optionrom/linuxboot_dma.bin
  SIGN    pc-bios/optionrom/kvmvapic.bin
make: *** [/tmp/qemu-test/src/rules.mak:69: qemu-img.o] Error 1
make: *** Waiting for unfinished jobs....
  BUILD   pc-bios/optionrom/pvh.img
  BUILD   pc-bios/optionrom/pvh.raw
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=d13b024a2281417b9c8a863d2bbcfec3', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-j487_kuh/src/docker-src.2020-04-29-15.07.32.27231:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=d13b024a2281417b9c8a863d2bbcfec3
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-j487_kuh/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    3m51.019s
user    0m7.947s


The full log is available at
http://patchew.org/logs/20200429141126.85159-1-mreitz@redhat.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly
  2020-04-29 14:11 [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly Max Reitz
                   ` (5 preceding siblings ...)
  2020-04-29 19:11 ` no-reply
@ 2020-04-29 19:15 ` no-reply
  2020-04-29 23:37 ` no-reply
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 16+ messages in thread
From: no-reply @ 2020-04-29 19:15 UTC (permalink / raw)
  To: mreitz; +Cc: kwolf, qemu-devel, qemu-block, mreitz

Patchew URL: https://patchew.org/QEMU/20200429141126.85159-1-mreitz@redhat.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  LINK    qemu-edid.exe
  LINK    qemu-ga.exe
/tmp/qemu-test/src/qemu-img.c: In function 'img_commit':
/tmp/qemu-test/src/qemu-img.c:1071:27: error: implicit declaration of function 'blk_new_with_bs'; did you mean 'blk_get_stats'? [-Werror=implicit-function-declaration]
         old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
                           ^~~~~~~~~~~~~~~
                           blk_get_stats
/tmp/qemu-test/src/qemu-img.c:1071:27: error: nested extern declaration of 'blk_new_with_bs' [-Werror=nested-externs]
/tmp/qemu-test/src/qemu-img.c:1071:25: error: assignment to 'BlockBackend *' {aka 'struct BlockBackend *'} from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
         old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
                         ^
cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:69: qemu-img.o] Error 1
make: *** Waiting for unfinished jobs....
  GEN     x86_64-softmmu/hmp-commands.h
  GEN     x86_64-softmmu/hmp-commands-info.h
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=e0a16b2399774bccbf7cf068081a9efd', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-etm7bld6/src/docker-src.2020-04-29-15.12.17.3885:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=e0a16b2399774bccbf7cf068081a9efd
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-etm7bld6/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    2m47.092s
user    0m7.752s


The full log is available at
http://patchew.org/logs/20200429141126.85159-1-mreitz@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly
  2020-04-29 14:11 [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly Max Reitz
                   ` (6 preceding siblings ...)
  2020-04-29 19:15 ` no-reply
@ 2020-04-29 23:37 ` no-reply
  2020-04-29 23:41 ` no-reply
  2020-05-14 13:08 ` Kevin Wolf
  9 siblings, 0 replies; 16+ messages in thread
From: no-reply @ 2020-04-29 23:37 UTC (permalink / raw)
  To: mreitz; +Cc: kwolf, qemu-devel, qemu-block, mreitz

Patchew URL: https://patchew.org/QEMU/20200429141126.85159-1-mreitz@redhat.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  BUILD   pc-bios/optionrom/pvh.raw
  SIGN    pc-bios/optionrom/pvh.bin
/tmp/qemu-test/src/qemu-img.c: In function 'img_commit':
/tmp/qemu-test/src/qemu-img.c:1071:9: error: implicit declaration of function 'blk_new_with_bs' [-Werror=implicit-function-declaration]
         old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
         ^
/tmp/qemu-test/src/qemu-img.c:1071:9: error: nested extern declaration of 'blk_new_with_bs' [-Werror=nested-externs]
/tmp/qemu-test/src/qemu-img.c:1071:25: error: assignment makes pointer from integer without a cast [-Werror]
         old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
                         ^
cc1: all warnings being treated as errors
make: *** [qemu-img.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** wait: No child processes.  Stop.
Traceback (most recent call last):
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=70ea0da52ca941ecafb5efd2e18dfe6a', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-2faaaxl7/src/docker-src.2020-04-29-19.35.24.5998:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=70ea0da52ca941ecafb5efd2e18dfe6a
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-2faaaxl7/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    2m24.697s
user    0m7.953s


The full log is available at
http://patchew.org/logs/20200429141126.85159-1-mreitz@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly
  2020-04-29 14:11 [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly Max Reitz
                   ` (7 preceding siblings ...)
  2020-04-29 23:37 ` no-reply
@ 2020-04-29 23:41 ` no-reply
  2020-05-14 13:08 ` Kevin Wolf
  9 siblings, 0 replies; 16+ messages in thread
From: no-reply @ 2020-04-29 23:41 UTC (permalink / raw)
  To: mreitz; +Cc: kwolf, qemu-devel, qemu-block, mreitz

Patchew URL: https://patchew.org/QEMU/20200429141126.85159-1-mreitz@redhat.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

  LINK    qemu-nbd
  LINK    qemu-storage-daemon
  LINK    qemu-io
/tmp/qemu-test/src/qemu-img.c:1071:27: error: implicit declaration of function 'blk_new_with_bs' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
                          ^
/tmp/qemu-test/src/qemu-img.c:1071:27: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
/tmp/qemu-test/src/qemu-img.c:1071:25: error: incompatible integer to pointer conversion assigning to 'BlockBackend *' (aka 'struct BlockBackend *') from 'int' [-Werror,-Wint-conversion]
        old_backing_blk = blk_new_with_bs(bs, BLK_PERM_WRITE, BLK_PERM_ALL,
                        ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 errors generated.
make: *** [/tmp/qemu-test/src/rules.mak:69: qemu-img.o] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=0c317bc0372e46baa5e530cb5bffad05', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=x86_64-softmmu', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-mhzkjux4/src/docker-src.2020-04-29-19.38.18.14298:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-debug']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=0c317bc0372e46baa5e530cb5bffad05
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-mhzkjux4/src'
make: *** [docker-run-test-debug@fedora] Error 2

real    3m19.927s
user    0m8.122s


The full log is available at
http://patchew.org/logs/20200429141126.85159-1-mreitz@redhat.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly
  2020-04-29 14:11 [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly Max Reitz
                   ` (8 preceding siblings ...)
  2020-04-29 23:41 ` no-reply
@ 2020-05-14 13:08 ` Kevin Wolf
  2020-05-15 10:36   ` Kevin Wolf
  9 siblings, 1 reply; 16+ messages in thread
From: Kevin Wolf @ 2020-05-14 13:08 UTC (permalink / raw)
  To: Max Reitz; +Cc: qemu-devel, qemu-block

Am 29.04.2020 um 16:11 hat Max Reitz geschrieben:
> v1: https://lists.nongnu.org/archive/html/qemu-block/2020-04/msg01245.html
> 
> Branch: https://github.com/XanClic/qemu.git fix-bdrv_make_empty-v2
> Branch: https://git.xanclic.moe/XanClic/qemu.git fix-bdrv_make_empty-v2
> 
> Based-on: <20200428192648.749066-1-eblake@redhat.com>
>           (“qcow2: Allow resize of images with internal snapshots”)
> 
> Hi,
> 
> As described in v1’s cover letter (linked above), this series ensures
> that all calls to BlockDriver.bdrv_make_empty() go through a wrapper
> bdrv_make_empty() function that ensures the caller does have the
> necessary permissions.

Thanks, fixed up the test output in patch 4 and applied to the block
branch.

Kevin



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly
  2020-05-14 13:08 ` Kevin Wolf
@ 2020-05-15 10:36   ` Kevin Wolf
  0 siblings, 0 replies; 16+ messages in thread
From: Kevin Wolf @ 2020-05-15 10:36 UTC (permalink / raw)
  To: Max Reitz; +Cc: qemu-devel, qemu-block

Am 14.05.2020 um 15:08 hat Kevin Wolf geschrieben:
> Am 29.04.2020 um 16:11 hat Max Reitz geschrieben:
> > v1: https://lists.nongnu.org/archive/html/qemu-block/2020-04/msg01245.html
> > 
> > Branch: https://github.com/XanClic/qemu.git fix-bdrv_make_empty-v2
> > Branch: https://git.xanclic.moe/XanClic/qemu.git fix-bdrv_make_empty-v2
> > 
> > Based-on: <20200428192648.749066-1-eblake@redhat.com>
> >           (“qcow2: Allow resize of images with internal snapshots”)
> > 
> > Hi,
> > 
> > As described in v1’s cover letter (linked above), this series ensures
> > that all calls to BlockDriver.bdrv_make_empty() go through a wrapper
> > bdrv_make_empty() function that ensures the caller does have the
> > necessary permissions.
> 
> Thanks, fixed up the test output in patch 4 and applied to the block
> branch.

Hmm, replication is doing criminal things and this results in:

test-replication: block.c:6899: bdrv_make_empty: Assertion `c->perm & (BLK_PERM_WRITE | BLK_PERM_WRITE_UNCHANGED)' failed.

Not your bug, but it breaks 'make check', so it needs to be fixed before
I can send a pull request. I'll see what I can do...

Kevin



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-05-15 10:37 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29 14:11 [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly Max Reitz
2020-04-29 14:11 ` [PATCH v2 1/4] block: Add bdrv_make_empty() Max Reitz
2020-04-29 14:51   ` Eric Blake
2020-04-29 14:11 ` [PATCH v2 2/4] block: Use bdrv_make_empty() where possible Max Reitz
2020-04-29 14:11 ` [PATCH v2 3/4] block: Add blk_make_empty() Max Reitz
2020-04-29 14:52   ` Eric Blake
2020-04-29 14:11 ` [PATCH v2 4/4] block: Use blk_make_empty() after commits Max Reitz
2020-04-29 14:17   ` Max Reitz
2020-04-29 14:55   ` Eric Blake
2020-04-29 19:07 ` [PATCH v2 0/4] block: Do not call BlockDriver.bdrv_make_empty() directly no-reply
2020-04-29 19:11 ` no-reply
2020-04-29 19:15 ` no-reply
2020-04-29 23:37 ` no-reply
2020-04-29 23:41 ` no-reply
2020-05-14 13:08 ` Kevin Wolf
2020-05-15 10:36   ` Kevin Wolf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.