* [Qemu-devel] [PATCH 1/1] hmp: acquire aio_context in hmp_qemu_io
@ 2016-06-08 9:39 Denis V. Lunev
2016-06-08 11:23 ` Kevin Wolf
0 siblings, 1 reply; 7+ messages in thread
From: Denis V. Lunev @ 2016-06-08 9:39 UTC (permalink / raw)
To: qemu-devel; +Cc: den, Vladimir Sementsov-Ogievskiy, Kevin Wolf, Paolo Bonzini
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Acquire aio context before run command, this is mandatory for unit tests.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Kevin Wolf <kwolf@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
---
hmp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hmp.c b/hmp.c
index a4b1d3d..36df0a7 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1951,7 +1951,12 @@ void hmp_qemu_io(Monitor *mon, const QDict *qdict)
blk = blk_by_name(device);
if (blk) {
+ AioContext *aio_context = blk_get_aio_context(blk);
+ aio_context_acquire(aio_context);
+
qemuio_command(blk, command);
+
+ aio_context_release(aio_context);
} else {
error_set(&err, ERROR_CLASS_DEVICE_NOT_FOUND,
"Device '%s' not found", device);
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] hmp: acquire aio_context in hmp_qemu_io
2016-06-08 9:39 [Qemu-devel] [PATCH 1/1] hmp: acquire aio_context in hmp_qemu_io Denis V. Lunev
@ 2016-06-08 11:23 ` Kevin Wolf
2016-06-08 11:31 ` Denis V. Lunev
2016-06-14 8:34 ` Denis V. Lunev
0 siblings, 2 replies; 7+ messages in thread
From: Kevin Wolf @ 2016-06-08 11:23 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: qemu-devel, Vladimir Sementsov-Ogievskiy, Paolo Bonzini
Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
> From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>
> Acquire aio context before run command, this is mandatory for unit tests.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> Signed-off-by: Denis V. Lunev <den@openvz.org>
> CC: Kevin Wolf <kwolf@redhat.com>
> CC: Paolo Bonzini <pbonzini@redhat.com>
Looks right to me, but why "mandatory for unit tests"? Does this fix an
observable bug in unit tests? If so, we should be more specific in the
commit message.
But in fact, I would only expect it to make a difference for dataplane
and I don't think we have test cases that use both the 'qemu-io' HMP
command and dataplane.
Kevin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] hmp: acquire aio_context in hmp_qemu_io
2016-06-08 11:23 ` Kevin Wolf
@ 2016-06-08 11:31 ` Denis V. Lunev
2016-06-14 8:34 ` Denis V. Lunev
1 sibling, 0 replies; 7+ messages in thread
From: Denis V. Lunev @ 2016-06-08 11:31 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, Vladimir Sementsov-Ogievskiy, Paolo Bonzini
On 06/08/2016 02:23 PM, Kevin Wolf wrote:
> Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
>> From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>
>> Acquire aio context before run command, this is mandatory for unit tests.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>> CC: Kevin Wolf <kwolf@redhat.com>
>> CC: Paolo Bonzini <pbonzini@redhat.com>
> Looks right to me, but why "mandatory for unit tests"? Does this fix an
> observable bug in unit tests? If so, we should be more specific in the
> commit message.
>
> But in fact, I would only expect it to make a difference for dataplane
> and I don't think we have test cases that use both the 'qemu-io' HMP
> command and dataplane.
>
> Kevin
we have failures in backup test, where dirty bitmap is protected with
aio_context_acquire. This test is not committed yet, but present in the
mail list.
As far as I know this command is used mostly for tests thus I have
written commit message this way. This change is separate and I think
definitely right.
Den
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] hmp: acquire aio_context in hmp_qemu_io
2016-06-08 11:23 ` Kevin Wolf
2016-06-08 11:31 ` Denis V. Lunev
@ 2016-06-14 8:34 ` Denis V. Lunev
2016-06-14 8:44 ` Kevin Wolf
1 sibling, 1 reply; 7+ messages in thread
From: Denis V. Lunev @ 2016-06-14 8:34 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, Vladimir Sementsov-Ogievskiy, Paolo Bonzini
On 06/08/2016 02:23 PM, Kevin Wolf wrote:
> Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
>> From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>
>> Acquire aio context before run command, this is mandatory for unit tests.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>> CC: Kevin Wolf <kwolf@redhat.com>
>> CC: Paolo Bonzini <pbonzini@redhat.com>
> Looks right to me, but why "mandatory for unit tests"? Does this fix an
> observable bug in unit tests? If so, we should be more specific in the
> commit message.
>
> But in fact, I would only expect it to make a difference for dataplane
> and I don't think we have test cases that use both the 'qemu-io' HMP
> command and dataplane.
>
> Kevin
the problem is that it is usually difficult to understand that
the problem is in locking and find where the locking is missed.
Here we do have a place, which is used by unit testing, with
a locking missed.
May be now tests are not failing, but IMHO these tests MUST
be fixed to accommodate future changes and thus this patch
is mandatory for them.
Den
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] hmp: acquire aio_context in hmp_qemu_io
2016-06-14 8:34 ` Denis V. Lunev
@ 2016-06-14 8:44 ` Kevin Wolf
2016-06-14 9:00 ` Denis V. Lunev
2016-06-15 20:31 ` Denis V. Lunev
0 siblings, 2 replies; 7+ messages in thread
From: Kevin Wolf @ 2016-06-14 8:44 UTC (permalink / raw)
To: Denis V. Lunev; +Cc: qemu-devel, Vladimir Sementsov-Ogievskiy, Paolo Bonzini
Am 14.06.2016 um 10:34 hat Denis V. Lunev geschrieben:
> On 06/08/2016 02:23 PM, Kevin Wolf wrote:
> >Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
> >>From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> >>
> >>Acquire aio context before run command, this is mandatory for unit tests.
> >>
> >>Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> >>Signed-off-by: Denis V. Lunev <den@openvz.org>
> >>CC: Kevin Wolf <kwolf@redhat.com>
> >>CC: Paolo Bonzini <pbonzini@redhat.com>
> >Looks right to me, but why "mandatory for unit tests"? Does this fix an
> >observable bug in unit tests? If so, we should be more specific in the
> >commit message.
> >
> >But in fact, I would only expect it to make a difference for dataplane
> >and I don't think we have test cases that use both the 'qemu-io' HMP
> >command and dataplane.
> >
> >Kevin
> the problem is that it is usually difficult to understand that
> the problem is in locking and find where the locking is missed.
> Here we do have a place, which is used by unit testing, with
> a locking missed.
>
> May be now tests are not failing, but IMHO these tests MUST
> be fixed to accommodate future changes and thus this patch
> is mandatory for them.
I was never objecting to the patch, but just curious about the details
of a possible failure you were seeing because I didn't see how to hit
it in practice without dataplane.
Sorry for forgetting about the patch, I've applied it now.
Kevin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] hmp: acquire aio_context in hmp_qemu_io
2016-06-14 8:44 ` Kevin Wolf
@ 2016-06-14 9:00 ` Denis V. Lunev
2016-06-15 20:31 ` Denis V. Lunev
1 sibling, 0 replies; 7+ messages in thread
From: Denis V. Lunev @ 2016-06-14 9:00 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, Vladimir Sementsov-Ogievskiy, Paolo Bonzini
On 06/14/2016 11:44 AM, Kevin Wolf wrote:
> Am 14.06.2016 um 10:34 hat Denis V. Lunev geschrieben:
>> On 06/08/2016 02:23 PM, Kevin Wolf wrote:
>>> Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
>>>> From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>>>
>>>> Acquire aio context before run command, this is mandatory for unit tests.
>>>>
>>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>>>> CC: Kevin Wolf <kwolf@redhat.com>
>>>> CC: Paolo Bonzini <pbonzini@redhat.com>
>>> Looks right to me, but why "mandatory for unit tests"? Does this fix an
>>> observable bug in unit tests? If so, we should be more specific in the
>>> commit message.
>>>
>>> But in fact, I would only expect it to make a difference for dataplane
>>> and I don't think we have test cases that use both the 'qemu-io' HMP
>>> command and dataplane.
>>>
>>> Kevin
>> the problem is that it is usually difficult to understand that
>> the problem is in locking and find where the locking is missed.
>> Here we do have a place, which is used by unit testing, with
>> a locking missed.
>>
>> May be now tests are not failing, but IMHO these tests MUST
>> be fixed to accommodate future changes and thus this patch
>> is mandatory for them.
> I was never objecting to the patch, but just curious about the details
> of a possible failure you were seeing because I didn't see how to hit
> it in practice without dataplane.
>
> Sorry for forgetting about the patch, I've applied it now.
>
> Kevin
thank you ;)
Den
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH 1/1] hmp: acquire aio_context in hmp_qemu_io
2016-06-14 8:44 ` Kevin Wolf
2016-06-14 9:00 ` Denis V. Lunev
@ 2016-06-15 20:31 ` Denis V. Lunev
1 sibling, 0 replies; 7+ messages in thread
From: Denis V. Lunev @ 2016-06-15 20:31 UTC (permalink / raw)
To: Kevin Wolf, Denis V. Lunev
Cc: Paolo Bonzini, Vladimir Sementsov-Ogievskiy, qemu-devel
On 06/14/2016 11:44 AM, Kevin Wolf wrote:
> Am 14.06.2016 um 10:34 hat Denis V. Lunev geschrieben:
>> On 06/08/2016 02:23 PM, Kevin Wolf wrote:
>>> Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
>>>> From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>>>
>>>> Acquire aio context before run command, this is mandatory for unit tests.
>>>>
>>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>>> Signed-off-by: Denis V. Lunev <den@openvz.org>
>>>> CC: Kevin Wolf <kwolf@redhat.com>
>>>> CC: Paolo Bonzini <pbonzini@redhat.com>
>>> Looks right to me, but why "mandatory for unit tests"? Does this fix an
>>> observable bug in unit tests? If so, we should be more specific in the
>>> commit message.
>>>
>>> But in fact, I would only expect it to make a difference for dataplane
>>> and I don't think we have test cases that use both the 'qemu-io' HMP
>>> command and dataplane.
>>>
>>> Kevin
>> the problem is that it is usually difficult to understand that
>> the problem is in locking and find where the locking is missed.
>> Here we do have a place, which is used by unit testing, with
>> a locking missed.
>>
>> May be now tests are not failing, but IMHO these tests MUST
>> be fixed to accommodate future changes and thus this patch
>> is mandatory for them.
> I was never objecting to the patch, but just curious about the details
> of a possible failure you were seeing because I didn't see how to hit
> it in practice without dataplane.
>
> Sorry for forgetting about the patch, I've applied it now.
>
> Kevin
>
FYI: I have faced today the problematic case in current QEMU.
Test number 132 could suffer from this issue. It performs
'discard' through qemu-io HMP command and have drive-mirror
running, which uses dirty-bitmap.
Den
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-06-15 20:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-08 9:39 [Qemu-devel] [PATCH 1/1] hmp: acquire aio_context in hmp_qemu_io Denis V. Lunev
2016-06-08 11:23 ` Kevin Wolf
2016-06-08 11:31 ` Denis V. Lunev
2016-06-14 8:34 ` Denis V. Lunev
2016-06-14 8:44 ` Kevin Wolf
2016-06-14 9:00 ` Denis V. Lunev
2016-06-15 20:31 ` Denis V. Lunev
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).