qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Reitz <hreitz@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Vladimir Sementsov-Ogievskiy" <vsementsov@virtuozzo.com>,
	qemu-block@nongnu.org, "Cleber Rosa" <crosa@redhat.com>,
	"Willian Rampazzo" <wrampazz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, John Snow <jsnow@redhat.com>,
	qemu-devel@nongnu.org, Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH v4 4/5] mirror-top-perms: Fix AbnormalShutdown path
Date: Tue, 7 Sep 2021 11:57:08 +0200	[thread overview]
Message-ID: <8c608d35-55e9-070e-7a69-ed661ea71d45@redhat.com> (raw)
In-Reply-To: <12a9bfd7-d302-f157-f88a-ff441470278e@redhat.com>

On 02.09.21 12:15, Philippe Mathieu-Daudé wrote:
> On 9/2/21 11:58 AM, Vladimir Sementsov-Ogievskiy wrote:
>> 02.09.2021 12:40, Hanna Reitz wrote:
>>> The AbnormalShutdown exception class is not in qemu.machine, but in
>>> qemu.machine.machine.  (qemu.machine.AbnormalShutdown was enough for
>>> Python to find it in order to run this test, but pylint complains about
>>> it.)
>>>
>>> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
>>> ---
>>>    tests/qemu-iotests/tests/mirror-top-perms | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tests/qemu-iotests/tests/mirror-top-perms
>>> b/tests/qemu-iotests/tests/mirror-top-perms
>>> index 451a0666f8..2fc8dd66e0 100755
>>> --- a/tests/qemu-iotests/tests/mirror-top-perms
>>> +++ b/tests/qemu-iotests/tests/mirror-top-perms
>>> @@ -47,7 +47,7 @@ class TestMirrorTopPerms(iotests.QMPTestCase):
>>>        def tearDown(self):
>>>            try:
>>>                self.vm.shutdown()
>>> -        except qemu.machine.AbnormalShutdown:
>>> +        except qemu.machine.machine.AbnormalShutdown:
>>>                pass
>>>              if self.vm_b is not None:
>>>
>> Hmm, interesting.. May be that bad that module has same name as subpackage?
> Confusing indeed. Could this be improved?

I think if we want to improve something, it would be that we make the 
exception public in the qemu.machine namespace, like so:

diff --git a/python/qemu/machine/__init__.py 
b/python/qemu/machine/__init__.py
index 9ccd58ef14..48bbb0530b 100644
--- a/python/qemu/machine/__init__.py
+++ b/python/qemu/machine/__init__.py
@@ -25,7 +25,7 @@
  # pylint: disable=import-error
  # see: https://github.com/PyCQA/pylint/issues/3624
  # see: https://github.com/PyCQA/pylint/issues/3651
-from .machine import QEMUMachine
+from .machine import AbnormalShutdown, QEMUMachine
  from .qtest import QEMUQtestMachine, QEMUQtestProtocol

But, well.  I don’t mind a qemu.machine.machine too much, personally.

Hanna



  reply	other threads:[~2021-09-07  9:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02  9:40 [PATCH v4 0/5] iotests/297: Cover tests/ Hanna Reitz
2021-09-02  9:40 ` [PATCH v4 1/5] iotests/297: Drop 169 and 199 from the skip list Hanna Reitz
2021-09-02  9:40 ` [PATCH v4 2/5] migrate-bitmaps-postcopy-test: Fix pylint warnings Hanna Reitz
2021-09-02  9:40 ` [PATCH v4 3/5] migrate-bitmaps-test: " Hanna Reitz
2021-09-02  9:53   ` Vladimir Sementsov-Ogievskiy
2021-09-02  9:40 ` [PATCH v4 4/5] mirror-top-perms: Fix AbnormalShutdown path Hanna Reitz
2021-09-02  9:58   ` Vladimir Sementsov-Ogievskiy
2021-09-02 10:15     ` Philippe Mathieu-Daudé
2021-09-07  9:57       ` Hanna Reitz [this message]
2021-09-07 10:23         ` Philippe Mathieu-Daudé
2021-09-02  9:40 ` [PATCH v4 5/5] iotests/297: Cover tests/ Hanna Reitz
2021-09-07  9:50 ` [PATCH v4 0/5] " 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=8c608d35-55e9-070e-7a69-ed661ea71d45@redhat.com \
    --to=hreitz@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    --cc=wrampazz@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).