qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.9 0/2] commit: Fix commit_top_bs problems
@ 2017-04-06 17:14 Kevin Wolf
  2017-04-06 17:14 ` [Qemu-devel] [PATCH for-2.9 1/2] commit: Set commit_top_bs->aio_context Kevin Wolf
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kevin Wolf @ 2017-04-06 17:14 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, mreitz, famz, qemu-devel

The same problem that Fam's patch "mirror: Fix aio context of
mirror_top_bs" fixes for the mirror block job also exists for the
commit block job and the 'commit' HMP command. While comparing the
respective places in mirror.c and commit.c, I also noticed that
commit neglects to set an image size.

This series fixes both problems.

Kevin Wolf (2):
  commit: Set commit_top_bs->aio_context
  commit: Set commit_top_bs->total_sectors

 block/commit.c | 3 +++
 1 file changed, 3 insertions(+)

-- 
1.8.3.1

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

* [Qemu-devel] [PATCH for-2.9 1/2] commit: Set commit_top_bs->aio_context
  2017-04-06 17:14 [Qemu-devel] [PATCH for-2.9 0/2] commit: Fix commit_top_bs problems Kevin Wolf
@ 2017-04-06 17:14 ` Kevin Wolf
  2017-04-06 17:35   ` Eric Blake
  2017-04-06 17:14 ` [Qemu-devel] [PATCH for-2.9 2/2] commit: Set commit_top_bs->total_sectors Kevin Wolf
  2017-04-07  7:14 ` [Qemu-devel] [PATCH for-2.9 0/2] commit: Fix commit_top_bs problems Fam Zheng
  2 siblings, 1 reply; 6+ messages in thread
From: Kevin Wolf @ 2017-04-06 17:14 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, mreitz, famz, qemu-devel

The filter driver that is inserted by the commit job needs to use the
same AioContext as its parent and child nodes.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/commit.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/commit.c b/block/commit.c
index 2832482..4c38220 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -335,6 +335,7 @@ void commit_start(const char *job_id, BlockDriverState *bs,
     if (commit_top_bs == NULL) {
         goto fail;
     }
+    bdrv_set_aio_context(commit_top_bs, bdrv_get_aio_context(top));
 
     bdrv_set_backing_hd(commit_top_bs, top, &local_err);
     if (local_err) {
@@ -482,6 +483,7 @@ int bdrv_commit(BlockDriverState *bs)
         error_report_err(local_err);
         goto ro_cleanup;
     }
+    bdrv_set_aio_context(commit_top_bs, bdrv_get_aio_context(backing_file_bs));
 
     bdrv_set_backing_hd(commit_top_bs, backing_file_bs, &error_abort);
     bdrv_set_backing_hd(bs, commit_top_bs, &error_abort);
-- 
1.8.3.1

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

* [Qemu-devel] [PATCH for-2.9 2/2] commit: Set commit_top_bs->total_sectors
  2017-04-06 17:14 [Qemu-devel] [PATCH for-2.9 0/2] commit: Fix commit_top_bs problems Kevin Wolf
  2017-04-06 17:14 ` [Qemu-devel] [PATCH for-2.9 1/2] commit: Set commit_top_bs->aio_context Kevin Wolf
@ 2017-04-06 17:14 ` Kevin Wolf
  2017-04-06 17:36   ` Eric Blake
  2017-04-07  7:14 ` [Qemu-devel] [PATCH for-2.9 0/2] commit: Fix commit_top_bs problems Fam Zheng
  2 siblings, 1 reply; 6+ messages in thread
From: Kevin Wolf @ 2017-04-06 17:14 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, mreitz, famz, qemu-devel

Like in the mirror filter driver, we also need to set the image size for
the commit filter driver. This is less likely to be a problem in
practice than for the mirror because we're not at the active layer here,
but attaching new parents to a node in the middle of the chain is
possible, so the size needs to be correct anyway.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/commit.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/commit.c b/block/commit.c
index 4c38220..91d2c34 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -335,6 +335,7 @@ void commit_start(const char *job_id, BlockDriverState *bs,
     if (commit_top_bs == NULL) {
         goto fail;
     }
+    commit_top_bs->total_sectors = top->total_sectors;
     bdrv_set_aio_context(commit_top_bs, bdrv_get_aio_context(top));
 
     bdrv_set_backing_hd(commit_top_bs, top, &local_err);
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH for-2.9 1/2] commit: Set commit_top_bs->aio_context
  2017-04-06 17:14 ` [Qemu-devel] [PATCH for-2.9 1/2] commit: Set commit_top_bs->aio_context Kevin Wolf
@ 2017-04-06 17:35   ` Eric Blake
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Blake @ 2017-04-06 17:35 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: famz, qemu-devel, mreitz

[-- Attachment #1: Type: text/plain, Size: 449 bytes --]

On 04/06/2017 12:14 PM, Kevin Wolf wrote:
> The filter driver that is inserted by the commit job needs to use the
> same AioContext as its parent and child nodes.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block/commit.c | 2 ++
>  1 file changed, 2 insertions(+)
> 

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

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


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

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

* Re: [Qemu-devel] [PATCH for-2.9 2/2] commit: Set commit_top_bs->total_sectors
  2017-04-06 17:14 ` [Qemu-devel] [PATCH for-2.9 2/2] commit: Set commit_top_bs->total_sectors Kevin Wolf
@ 2017-04-06 17:36   ` Eric Blake
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Blake @ 2017-04-06 17:36 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: famz, qemu-devel, mreitz

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

On 04/06/2017 12:14 PM, Kevin Wolf wrote:
> Like in the mirror filter driver, we also need to set the image size for
> the commit filter driver. This is less likely to be a problem in
> practice than for the mirror because we're not at the active layer here,
> but attaching new parents to a node in the middle of the chain is
> possible, so the size needs to be correct anyway.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  block/commit.c | 1 +
>  1 file changed, 1 insertion(+)

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

> 
> diff --git a/block/commit.c b/block/commit.c
> index 4c38220..91d2c34 100644
> --- a/block/commit.c
> +++ b/block/commit.c
> @@ -335,6 +335,7 @@ void commit_start(const char *job_id, BlockDriverState *bs,
>      if (commit_top_bs == NULL) {
>          goto fail;
>      }
> +    commit_top_bs->total_sectors = top->total_sectors;

[I'd really like to change total_sectors to bytes in 2.10 or later, but
that's a much hairier mess to untangle. I've got some patches that I
hope to post soon that at least start the process with regards to
bdrv_is_allocated...]

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


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

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

* Re: [Qemu-devel] [PATCH for-2.9 0/2] commit: Fix commit_top_bs problems
  2017-04-06 17:14 [Qemu-devel] [PATCH for-2.9 0/2] commit: Fix commit_top_bs problems Kevin Wolf
  2017-04-06 17:14 ` [Qemu-devel] [PATCH for-2.9 1/2] commit: Set commit_top_bs->aio_context Kevin Wolf
  2017-04-06 17:14 ` [Qemu-devel] [PATCH for-2.9 2/2] commit: Set commit_top_bs->total_sectors Kevin Wolf
@ 2017-04-07  7:14 ` Fam Zheng
  2 siblings, 0 replies; 6+ messages in thread
From: Fam Zheng @ 2017-04-07  7:14 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-block, mreitz, qemu-devel

On Thu, 04/06 19:14, Kevin Wolf wrote:
> The same problem that Fam's patch "mirror: Fix aio context of
> mirror_top_bs" fixes for the mirror block job also exists for the
> commit block job and the 'commit' HMP command. While comparing the
> respective places in mirror.c and commit.c, I also noticed that
> commit neglects to set an image size.
> 
> This series fixes both problems.
> 
> Kevin Wolf (2):
>   commit: Set commit_top_bs->aio_context
>   commit: Set commit_top_bs->total_sectors
> 
>  block/commit.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> -- 
> 1.8.3.1
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

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

end of thread, other threads:[~2017-04-07  7:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-06 17:14 [Qemu-devel] [PATCH for-2.9 0/2] commit: Fix commit_top_bs problems Kevin Wolf
2017-04-06 17:14 ` [Qemu-devel] [PATCH for-2.9 1/2] commit: Set commit_top_bs->aio_context Kevin Wolf
2017-04-06 17:35   ` Eric Blake
2017-04-06 17:14 ` [Qemu-devel] [PATCH for-2.9 2/2] commit: Set commit_top_bs->total_sectors Kevin Wolf
2017-04-06 17:36   ` Eric Blake
2017-04-07  7:14 ` [Qemu-devel] [PATCH for-2.9 0/2] commit: Fix commit_top_bs problems Fam Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).