hmp: acquire aio_context in hmp_qemu_io
PATCH 1/1 hmp: acquire aio_context in hmp_qemu_io
From: Vladimir Sementsov-Ogievskiy <[email protected]>
Acquire aio context before run command, this is mandatory for unit tests.
--- hmp.c | 5 +++++ 1 file changed, 5 insertions(+)
hmp.c +5 -0
@@ -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);
Signature · 1 line
2.1.4
Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
Quoted 8 lines
From: Vladimir Sementsov-Ogievskiy <[email protected]>
Acquire aio context before run command, this is mandatory for unit tests.
Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Paolo Bonzini <[email protected]>
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
Quoted 13 lines · Kevin Wolf
Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
Quoted 8 lines
From: Vladimir Sementsov-Ogievskiy <[email protected]>
Acquire aio context before run command, this is mandatory for unit tests.
Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Paolo Bonzini <[email protected]>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.
Quoted 5 lines
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
Quoted 13 lines · Kevin Wolf
Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
Quoted 8 lines
From: Vladimir Sementsov-Ogievskiy <[email protected]>
Acquire aio context before run command, this is mandatory for unit tests.
Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Paolo Bonzini <[email protected]>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.
Quoted 5 lines
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
Am 14.06.2016 um 10:34 hat Denis V. Lunev geschrieben:
Quoted 19 lines · Kevin Wolf
Quoted 13 lines
Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
Quoted 8 lines
From: Vladimir Sementsov-Ogievskiy <[email protected]>
Acquire aio context before run command, this is mandatory for unit tests.
Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Paolo Bonzini <[email protected]>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.
Quoted 5 lines
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
Quoted 8 lines
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
Quoted 28 lines · Kevin Wolf
Am 14.06.2016 um 10:34 hat Denis V. Lunev geschrieben:
Quoted 19 lines · Kevin Wolf
Quoted 13 lines
Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
Quoted 8 lines
From: Vladimir Sementsov-Ogievskiy <[email protected]>
Acquire aio context before run command, this is mandatory for unit tests.
Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Paolo Bonzini <[email protected]>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.
Quoted 5 lines
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
Quoted 8 lines
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.
Quoted 7 lines
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
Quoted 28 lines · Kevin Wolf
Am 14.06.2016 um 10:34 hat Denis V. Lunev geschrieben:
Quoted 19 lines · Kevin Wolf
Quoted 13 lines
Am 08.06.2016 um 11:39 hat Denis V. Lunev geschrieben:
Quoted 8 lines
From: Vladimir Sementsov-Ogievskiy <[email protected]>
Acquire aio context before run command, this is mandatory for unit tests.
Signed-off-by Vladimir Sementsov-Ogievskiy <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Kevin Wolf <[email protected]>CC Paolo Bonzini <[email protected]>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.
Quoted 5 lines
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
Quoted 8 lines
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.
Quoted 8 lines
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