qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/4] migrate-bitmaps-postcopy-test: Fix pylint warnings


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH 2/4] migrate-bitmaps-postcopy-test: Fix pylint warnings
Date: Tue, 30 Mar 2021 20:36:03 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0

30.03.2021 20:18, Max Reitz wrote:
On 30.03.21 18:47, Vladimir Sementsov-Ogievskiy wrote:
29.03.2021 16:26, Max Reitz wrote:
pylint complains that discards1_sha256 and all_discards_sha256 are first
set in non-__init__ methods.  Let's make it happy.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
  tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test 
b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test
index 584062b412..013e94fc39 100755
--- a/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test
+++ b/tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test
@@ -76,6 +76,9 @@ def check_bitmaps(vm, count):
  class TestDirtyBitmapPostcopyMigration(iotests.QMPTestCase):
+    discards1_sha256 = None
+    all_discards_sha256 = None
+
      def tearDown(self):
          if debug:
              self.vm_a_events += self.vm_a.get_qmp_events()


I'd prefer not making them class-variables. I think initializing them in setUp 
should work (as a lot of other variables are initialized in setUp() and pylint 
doesn't complain). And better thing is return it together with event_resume 
from start_postcopy(), as actually it's a kind of result of the function.

Oh, that sounds good.  Is a list fine, i.e. return (event_resume, 
discards1_sha256, all_discards_sha256)?


I think list is fine for now. If in future we'll want more logic in this place, 
we'll refactor it to some object or something.


--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]