All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] mirror: fix the inconsistent AioContext problem in the backing BDSs during mirroring.
@ 2017-06-26 11:04 sochin.jiang
  2017-06-28 22:33 ` Max Reitz
  0 siblings, 1 reply; 3+ messages in thread
From: sochin.jiang @ 2017-06-26 11:04 UTC (permalink / raw)
  To: kwolf, mreitz
  Cc: qemu-block, qemu-devel, sochin.jiang, eric.fangyi, subo7,
	xieyingtai, lina.lulina, zhangshuai13, lizhengui

From: "sochin.jiang" <sochin.jiang@huawei.com>

 mirror_complete opens the backings, BDSs of the new open backings should have a
 same AioContext with the top when using iothreads, fix the code to guarantee this,
 also avoiding unexpected qemu exit(assert fails in bdrv_attach_child).

Signed-off-by: sochin.jiang <sochin.jiang@huawei.com>
---
 block.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block.c b/block.c
index 6943962..b312fe6 100644
--- a/block.c
+++ b/block.c
@@ -2185,6 +2185,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
         ret = -EINVAL;
         goto free_exit;
     }
+    bdrv_set_aio_context(backing_hd, bdrv_get_aio_context(bs));
 
     /* Hook up the backing file link; drop our reference, bs owns the
      * backing_hd reference now */
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH] mirror: fix the inconsistent AioContext problem in the backing BDSs during mirroring.
  2017-06-26 11:04 [Qemu-devel] [PATCH] mirror: fix the inconsistent AioContext problem in the backing BDSs during mirroring sochin.jiang
@ 2017-06-28 22:33 ` Max Reitz
  2017-06-29  1:12   ` sochin.jiang
  0 siblings, 1 reply; 3+ messages in thread
From: Max Reitz @ 2017-06-28 22:33 UTC (permalink / raw)
  To: sochin.jiang, kwolf
  Cc: qemu-block, qemu-devel, eric.fangyi, subo7, xieyingtai,
	lina.lulina, zhangshuai13, lizhengui

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

On 2017-06-26 13:04, sochin.jiang wrote:
> From: "sochin.jiang" <sochin.jiang@huawei.com>
> 
>  mirror_complete opens the backings, BDSs of the new open backings should have a
>  same AioContext with the top when using iothreads, fix the code to guarantee this,
>  also avoiding unexpected qemu exit(assert fails in bdrv_attach_child).

Thanks! The functional change looks good to me. I'll see to add an
iotest to cover this case.

Some notes: There shouldn't be any spaces at the front of these lines,
and every line should be limited to 72 characters.

Also, the commit message should not end in a full stop (and it's good to
keep it short).

I've reworded a bit of the commit message (and shortened the title*) and
applied it to my block branch:

https://github.com/XanClic/qemu/commits/block

Max

[1] I've shortened it to "mirror: Fix inconsistent backing AioContext
for after mirroring". I usually try to fit the title into 50 characters
(because that's what the default vim highlighting is proposing...), so
for reference, I would have made it something like "block: Align backing
BDS's AioContext with overlay" -- if it had been my patch. Since it was
yours, I'm fine with commit titles longer than 50 characters (although
they really should not exceed 72).

> Signed-off-by: sochin.jiang <sochin.jiang@huawei.com>
> ---
>  block.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/block.c b/block.c
> index 6943962..b312fe6 100644
> --- a/block.c
> +++ b/block.c
> @@ -2185,6 +2185,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
>          ret = -EINVAL;
>          goto free_exit;
>      }
> +    bdrv_set_aio_context(backing_hd, bdrv_get_aio_context(bs));
>  
>      /* Hook up the backing file link; drop our reference, bs owns the
>       * backing_hd reference now */
> 



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

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

* Re: [Qemu-devel] [PATCH] mirror: fix the inconsistent AioContext problem in the backing BDSs during mirroring.
  2017-06-28 22:33 ` Max Reitz
@ 2017-06-29  1:12   ` sochin.jiang
  0 siblings, 0 replies; 3+ messages in thread
From: sochin.jiang @ 2017-06-29  1:12 UTC (permalink / raw)
  To: Max Reitz, kwolf
  Cc: qemu-block, qemu-devel, eric.fangyi, subo7, xieyingtai,
	lina.lulina, zhangshuai13, lizhengui

Oh,I got it, thanks.


Sochin


On 2017/6/29 6:33, Max Reitz wrote:
> On 2017-06-26 13:04, sochin.jiang wrote:
>> From: "sochin.jiang" <sochin.jiang@huawei.com>
>>
>>  mirror_complete opens the backings, BDSs of the new open backings should have a
>>  same AioContext with the top when using iothreads, fix the code to guarantee this,
>>  also avoiding unexpected qemu exit(assert fails in bdrv_attach_child).
> Thanks! The functional change looks good to me. I'll see to add an
> iotest to cover this case.
>
> Some notes: There shouldn't be any spaces at the front of these lines,
> and every line should be limited to 72 characters.
>
> Also, the commit message should not end in a full stop (and it's good to
> keep it short).
>
> I've reworded a bit of the commit message (and shortened the title*) and
> applied it to my block branch:
>
> https://github.com/XanClic/qemu/commits/block
>
> Max
>
> [1] I've shortened it to "mirror: Fix inconsistent backing AioContext
> for after mirroring". I usually try to fit the title into 50 characters
> (because that's what the default vim highlighting is proposing...), so
> for reference, I would have made it something like "block: Align backing
> BDS's AioContext with overlay" -- if it had been my patch. Since it was
> yours, I'm fine with commit titles longer than 50 characters (although
> they really should not exceed 72).
>
>> Signed-off-by: sochin.jiang <sochin.jiang@huawei.com>
>> ---
>>  block.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/block.c b/block.c
>> index 6943962..b312fe6 100644
>> --- a/block.c
>> +++ b/block.c
>> @@ -2185,6 +2185,7 @@ int bdrv_open_backing_file(BlockDriverState *bs, QDict *parent_options,
>>          ret = -EINVAL;
>>          goto free_exit;
>>      }
>> +    bdrv_set_aio_context(backing_hd, bdrv_get_aio_context(bs));
>>  
>>      /* Hook up the backing file link; drop our reference, bs owns the
>>       * backing_hd reference now */
>>
>

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

end of thread, other threads:[~2017-06-29  1:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26 11:04 [Qemu-devel] [PATCH] mirror: fix the inconsistent AioContext problem in the backing BDSs during mirroring sochin.jiang
2017-06-28 22:33 ` Max Reitz
2017-06-29  1:12   ` sochin.jiang

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.