qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Reitz <hreitz@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH 2/3] iotests: Allow using QMP with the QSD
Date: Wed, 16 Feb 2022 10:43:46 +0100	[thread overview]
Message-ID: <0a3bd4ed-8918-1f03-1c40-8df4c8a042c6@redhat.com> (raw)
In-Reply-To: <20220215221914.2g4w7f7aol7ge3wy@redhat.com>

On 15.02.22 23:19, Eric Blake wrote:
> On Tue, Feb 15, 2022 at 02:57:26PM +0100, Hanna Reitz wrote:
>> Add a parameter to optionally open a QMP connection when creating a
>> QemuStorageDaemon instance.
>>
>> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
>> ---
>>   tests/qemu-iotests/iotests.py | 29 ++++++++++++++++++++++++++++-
>>   1 file changed, 28 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
>> index 6ba65eb1ff..47e3808ab9 100644
>> --- a/tests/qemu-iotests/iotests.py
>> +++ b/tests/qemu-iotests/iotests.py
>> @@ -39,6 +39,7 @@
>>   
>>   from qemu.machine import qtest
>>   from qemu.qmp import QMPMessage
>> +from qemu.aqmp.legacy import QEMUMonitorProtocol
> I thought we were trying to get rid of aqmp.legacy usage, so this
> feels like a temporary regression.  Oh well, not the end of the
> testing world.

I fiddled around with the non-legacy interface and wasn’t very 
successful...  I thought since machine.py still uses qemu.aqmp.legacy 
for QEMUMachine, when one is reworked to get rid of it (if that ever 
becomes necessary), then we can just do it here, too.

>
>>       def stop(self, kill_signal=15):
>>           self._p.send_signal(kill_signal)
>>           self._p.wait()
>>           self._p = None
>>   
>> +        if self._qmp:
>> +            self._qmp.close()
>> +
>>           try:
>> +            if self._qmpsock is not None:
>> +                os.remove(self._qmpsock)
>>               os.remove(self.pidfile)
>>           except OSError:
>>               pass
> Do we need two try: blocks here, to remove self.pidfile even if
> os.remove(self._qmpsock) failed?

Honestly, no reason not to use two blocks except it being longer. You’re 
right, I should’ve just done that.

> Otherwise, makes sense to me.

Thanks for reviewing!

Hanna



  reply	other threads:[~2022-02-16  9:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 13:57 [PATCH 0/3] block: Make bdrv_refresh_limits() non-recursive Hanna Reitz
2022-02-15 13:57 ` [PATCH 1/3] " Hanna Reitz
2022-02-15 22:16   ` Eric Blake
2022-02-15 13:57 ` [PATCH 2/3] iotests: Allow using QMP with the QSD Hanna Reitz
2022-02-15 22:19   ` Eric Blake
2022-02-16  9:43     ` Hanna Reitz [this message]
2022-02-15 13:57 ` [PATCH 3/3] iotests/graph-changes-while-io: New test Hanna Reitz
2022-02-15 22:22   ` Eric Blake
2022-02-16  9:53     ` Hanna Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0a3bd4ed-8918-1f03-1c40-8df4c8a042c6@redhat.com \
    --to=hreitz@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).