From nobody Sat Feb 7 07:09:46 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1568111685; cv=none; d=zoho.com; s=zohoarc; b=WYtu4yJSWkXLdj0Ss51nYbX3y1X3MQLuo6LLzps3sIhTBdk/hYAP3yo7+LxqzTLR3jJBttYbsfxZyvHX1a4jr1myKojRdsJDDeROTSbUSXNnZnM6BD08y/DDfukbDlCANOhqbs6DYPOTBeJysMFGlXtXX9aKyjSK1X7UX217gFI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568111685; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Q7v2+eP56lRPYTHORJZKDC2HwQdNu3VeJ0g8bmY8hlg=; b=KNk0xlmM3qovt1N2UdDDlOpuPO5cjFRPwax1tRDvS4bxYZ+H+ZD+K890lYlg9tjzyI68Rns0J23YoJRKjKzXtIPICdPXABZFgpQX1gLw0zL4uD3U614QMrU4z/HvUNvpdXT58y6blH8+ObKb5EsRVkJgwuNpu0TGpWxj63rpGJY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156811168569785.24399149561975; Tue, 10 Sep 2019 03:34:45 -0700 (PDT) Received: from localhost ([::1]:37642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7dTv-0002y6-Ky for importer@patchew.org; Tue, 10 Sep 2019 06:34:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56613) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i7dJL-0000SM-01 for qemu-devel@nongnu.org; Tue, 10 Sep 2019 06:23:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i7dJI-0001v2-I1 for qemu-devel@nongnu.org; Tue, 10 Sep 2019 06:23:46 -0400 Received: from relay.sw.ru ([185.231.240.75]:60032) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i7dJB-0001oB-CK; Tue, 10 Sep 2019 06:23:37 -0400 Received: from [10.94.3.0] (helo=kvm.qa.sw.ru) by relay.sw.ru with esmtp (Exim 4.92) (envelope-from ) id 1i7dJ7-0007it-Nz; Tue, 10 Sep 2019 13:23:33 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Date: Tue, 10 Sep 2019 13:23:27 +0300 Message-Id: <20190910102332.20560-10-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190910102332.20560-1-vsementsov@virtuozzo.com> References: <20190910102332.20560-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v11 09/14] iotests: 257: drop unused Drive.device field X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com, wencongyang2@huawei.com, xiechanglong.d@gmail.com, qemu-devel@nongnu.org, armbru@redhat.com, jsnow@redhat.com, stefanha@redhat.com, den@openvz.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" After previous commit Drive.device is actually unused. Drop it together with .name property. While being here reuse .node in qmp commands instead of writing 'drive0' twice. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/257 | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/tests/qemu-iotests/257 b/tests/qemu-iotests/257 index 6b368e1e70..5d77202157 100755 --- a/tests/qemu-iotests/257 +++ b/tests/qemu-iotests/257 @@ -148,11 +148,6 @@ class Drive: self.fmt =3D None self.size =3D None self.node =3D None - self.device =3D None - - @property - def name(self): - return self.node or self.device =20 def img_create(self, fmt, size): self.fmt =3D fmt @@ -201,7 +196,7 @@ def blockdev_backup(vm, device, target, sync, **kwargs): def blockdev_backup_mktarget(drive, target_id, filepath, sync, **kwargs): target_drive =3D Drive(filepath, vm=3Ddrive.vm) target_drive.create_target(target_id, drive.fmt, drive.size) - blockdev_backup(drive.vm, drive.name, target_id, sync, **kwargs) + blockdev_backup(drive.vm, drive.node, target_id, sync, **kwargs) =20 def reference_backup(drive, n, filepath): log("--- Reference Backup #{:d} ---\n".format(n)) @@ -229,7 +224,7 @@ def perform_writes(drive, n): pattern.offset, pattern.size) log(cmd) - log(drive.vm.hmp_qemu_io(drive.name, cmd)) + log(drive.vm.hmp_qemu_io(drive.node, cmd)) bitmaps =3D drive.vm.query_bitmaps() log({'bitmaps': bitmaps}, indent=3D2) log('') @@ -324,18 +319,17 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap= ', failure=3DNone): }] } =20 + drive0.node =3D 'drive0' vm.qmp_log('blockdev-add', filters=3D[iotests.filter_qmp_testfiles], - node_name=3D"drive0", + node_name=3Ddrive0.node, driver=3Ddrive0.fmt, file=3Dfile_config) - drive0.node =3D 'drive0' - drive0.device =3D 'device0' # Use share-rw to allow writes directly to the node; # The anonymous block-backend for this configuration prevents us # from using HMP's qemu-io commands to address the device. - vm.qmp_log("device_add", id=3Ddrive0.device, - drive=3Ddrive0.name, driver=3D"scsi-hd", + vm.qmp_log("device_add", id=3D'device0', + drive=3Ddrive0.node, driver=3D"scsi-hd", share_rw=3DTrue) log('') =20 @@ -343,7 +337,7 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap',= failure=3DNone): perform_writes(drive0, 0) reference_backup(drive0, 0, fbackup0) log('--- Add Bitmap ---\n') - vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.name, + vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.node, name=3D"bitmap0", granularity=3DGRANULARITY) log('') ebitmap =3D EmulatedBitmap() @@ -358,7 +352,7 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap',= failure=3DNone): # 1 - Test Backup (w/ Optional induced failure) if failure =3D=3D 'intermediate': # Activate blkdebug induced failure for second-to-next read - log(vm.hmp_qemu_io(drive0.name, 'flush')) + log(vm.hmp_qemu_io(drive0.node, 'flush')) log('') job =3D backup(drive0, 1, bsync1, msync_mode, bitmap=3D"bitmap0", bitmap_mode=3Dbsync_mode) @@ -426,7 +420,7 @@ def test_bitmap_sync(bsync_mode, msync_mode=3D'bitmap',= failure=3DNone): =20 log('--- Cleanup ---\n') vm.qmp_log("block-dirty-bitmap-remove", - node=3Ddrive0.name, name=3D"bitmap0") + node=3Ddrive0.node, name=3D"bitmap0") bitmaps =3D vm.query_bitmaps() log({'bitmaps': bitmaps}, indent=3D2) vm.shutdown() @@ -467,22 +461,21 @@ def test_backup_api(): 'filename': drive0.path } =20 + drive0.node =3D 'drive0' vm.qmp_log('blockdev-add', filters=3D[iotests.filter_qmp_testfiles], - node_name=3D"drive0", + node_name=3Ddrive0.node, driver=3Ddrive0.fmt, file=3Dfile_config) - drive0.node =3D 'drive0' - drive0.device =3D 'device0' - vm.qmp_log("device_add", id=3Ddrive0.device, - drive=3Ddrive0.name, driver=3D"scsi-hd") + vm.qmp_log("device_add", id=3D'device0', + drive=3Ddrive0.node, driver=3D"scsi-hd") log('') =20 target0 =3D Drive(backup_path, vm=3Dvm) target0.create_target("backup_target", drive0.fmt, drive0.size) log('') =20 - vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.name, + vm.qmp_log("block-dirty-bitmap-add", node=3Ddrive0.node, name=3D"bitmap0", granularity=3DGRANULARITY) log('') =20 @@ -521,7 +514,7 @@ def test_backup_api(): log("-- Sync mode {:s} tests --\n".format(sync_mode)) for bitmap in (None, 'bitmap404', 'bitmap0'): for policy in error_cases[sync_mode][bitmap]: - blockdev_backup(drive0.vm, drive0.name, "backup_target= ", + blockdev_backup(drive0.vm, drive0.node, "backup_target= ", sync_mode, job_id=3D'api_job', bitmap=3Dbitmap, bitmap_mode=3Dpolicy) log('') --=20 2.18.0