From nobody Mon May 20 23:50:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614958111; cv=none; d=zohomail.com; s=zohoarc; b=mWrwopTw69BjdupvGWTgYqVBdlTb8uFAATM8jLsJILsIIaxkjJ4Ou2KPnTBf7zHpKq9X74KYRlDCZ2LQZ9hcLrz4ODn4aDp3H/9xbr5c89kOP54/e7OeFRNh8UkF8O/9NwptFzQP1eD5Ei34PAw8hQSSKrBBNgeTpOdW7bOeNts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614958111; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6LhMQZaqZVqOri3ge1/W4AbN/h5rdQ1gYPD2tuVbPkQ=; b=GUB1cBlATSG1feddJRyegzhO8CBsKD6x3PYN7yuKBY3EivdbnOgQYlL0BPtYjemfbJacDjNnVbY0tZsuP0AAFihwMduurmaCmIptJjlT8N7OAJ3ybqJM3NQl4F5aZguL0iw+aACk/6y57d+Y6IxFDTTQBasSAPExAWBioPLvqHU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1614958111712964.6344960433058; Fri, 5 Mar 2021 07:28:31 -0800 (PST) Received: from localhost ([::1]:41128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lICNS-0006Xp-EL for importer@patchew.org; Fri, 05 Mar 2021 10:28:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lICEu-0001Np-Ur for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:19:40 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50104) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lICEr-0003rR-BW for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:19:40 -0500 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-466-g43Qj__ANPWFQfQ6g1aesQ-1; Fri, 05 Mar 2021 10:19:34 -0500 Received: by mail-oo1-f72.google.com with SMTP id h10so1327041ooj.11 for ; Fri, 05 Mar 2021 07:19:34 -0800 (PST) Received: from redhat.redhat.com (ip68-103-222-6.ks.ok.cox.net. [68.103.222.6]) by smtp.gmail.com with ESMTPSA id y34sm651085ota.12.2021.03.05.07.19.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 07:19:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614957576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6LhMQZaqZVqOri3ge1/W4AbN/h5rdQ1gYPD2tuVbPkQ=; b=a+5/gJRiMVgl7GDQwYIqWiwFI6dNMVZlC3O0bZe8f0XaiIIi7j4GflfERI9iAcyb0ccEfy /d2+CecSgFd/hq0WXo1XzrLithJs4QUcS3i/tzA3ddCyqoHj09dmJ2UERTimgYMd/icJ9b ChUXQ4/zyj1LRoAyIQDElrYKBRluK+c= X-MC-Unique: g43Qj__ANPWFQfQ6g1aesQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6LhMQZaqZVqOri3ge1/W4AbN/h5rdQ1gYPD2tuVbPkQ=; b=QsY4s4ZHng2SF2cXXB7fMkWxHZBfH3Fu9EiM3OZV8a+DNwwOHWSjoOZysenpD1zftG y6DZIAklHGCBESXtTl7jVEyw+PmZH6mfQBvuNSWRDWp1DV4kpqmB361oTQ2G8PhTKbcH 6PREZTPnT4+tdvGvfPKNWOly21+vOcABFEJUKWj9GtLW5huGg9AeXBJ2gK9BQfGnqnWl AO9x5wEDuLayLnNIeOo9aVCMCOaT4kosIuh3aUWWP/IcXWzTFEN7qa24K84KUyIKxNSP Fh8y8jULnZ1LOKz6//LODzFHUMclaUNhpX/THDJcDTVfhFn8+OLLk3+pp2sVviEYyxSE VCpw== X-Gm-Message-State: AOAM531y4964Qxj4poopxUqzf6FFuSWNs/nS50Nnq9aMV2p2rEWtGbnI Cs6VtlgbEJykpezmXqC79KX/e6l5hJw+pzh7EcrDCiXlS0RJJNkKb5wYiqbtvfdtSCaQcuhJZYM xGf2Jld+3mwXTfuc= X-Received: by 2002:a9d:344a:: with SMTP id v68mr8271139otb.214.1614957573219; Fri, 05 Mar 2021 07:19:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtR0Wc2oW/KOCrGkB3oue8bc1rrG6vIWXm9J0UI7jFKFTLhh44HYTx6KY6MAv76EoKCVmlHA== X-Received: by 2002:a9d:344a:: with SMTP id v68mr8271121otb.214.1614957572928; Fri, 05 Mar 2021 07:19:32 -0800 (PST) From: Connor Kuehl To: qemu-block@nongnu.org Subject: [PATCH v2 1/2] block: Clarify error messages pertaining to 'node-name' Date: Fri, 5 Mar 2021 09:19:28 -0600 Message-Id: <20210305151929.1947331-2-ckuehl@redhat.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210305151929.1947331-1-ckuehl@redhat.com> References: <20210305151929.1947331-1-ckuehl@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ckuehl@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ckuehl@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: kwolf@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Some error messages contain ambiguous representations of the 'node-name' parameter. This can be particularly confusing when exchanging QMP messages (C =3D client, S =3D server): C: {"execute": "block_resize", "arguments": { "device": "my_file", "size": = 26843545600 }} S: {"error": {"class": "GenericError", "desc": "Cannot find device=3Dmy_fil= e nor node_name=3D"}} = ^^^^^^^^^ This error message suggests one could send a message with a key called 'node_name': C: {"execute": "block_resize", "arguments": { "node_name": "my_file", "size= ": 26843545600 }} ^^^^^^^^^ but using the underscore is actually incorrect, the parameter should be 'node-name': S: {"error": {"class": "GenericError", "desc": "Parameter 'node_name' is un= expected"}} This behavior was uncovered in bz1651437, but I ended up going down a rabbit hole looking for other areas where this miscommunication might occur and changing those accordingly as well. Fixes: https://bugzilla.redhat.com/1651437 Signed-off-by: Connor Kuehl --- block.c | 8 ++++---- tests/qemu-iotests/030 | 4 ++-- tests/qemu-iotests/040 | 4 ++-- tests/qemu-iotests/051.pc.out | 6 +++--- tests/qemu-iotests/081.out | 2 +- tests/qemu-iotests/085.out | 6 +++--- tests/qemu-iotests/087.out | 2 +- tests/qemu-iotests/206.out | 2 +- tests/qemu-iotests/210.out | 2 +- tests/qemu-iotests/211.out | 2 +- tests/qemu-iotests/212.out | 2 +- tests/qemu-iotests/213.out | 2 +- tests/qemu-iotests/223.out | 4 ++-- tests/qemu-iotests/237.out | 2 +- tests/qemu-iotests/245 | 4 ++-- tests/qemu-iotests/249.out | 2 +- tests/qemu-iotests/300 | 4 ++-- 17 files changed, 29 insertions(+), 29 deletions(-) diff --git a/block.c b/block.c index a1f3cecd75..2daff6d29a 100644 --- a/block.c +++ b/block.c @@ -1440,7 +1440,7 @@ static void bdrv_assign_node_name(BlockDriverState *b= s, * Check for empty string or invalid characters, but not if it is * generated (generated names use characters not available to the = user) */ - error_setg(errp, "Invalid node name"); + error_setg(errp, "Invalid node-name: '%s'", node_name); return; } =20 @@ -1453,7 +1453,7 @@ static void bdrv_assign_node_name(BlockDriverState *b= s, =20 /* takes care of avoiding duplicates node names */ if (bdrv_find_node(node_name)) { - error_setg(errp, "Duplicate node name"); + error_setg(errp, "Duplicate nodes with node-name=3D'%s'", node_nam= e); goto out; } =20 @@ -5432,7 +5432,7 @@ BlockDriverState *bdrv_lookup_bs(const char *device, } } =20 - error_setg(errp, "Cannot find device=3D%s nor node_name=3D%s", + error_setg(errp, "Cannot find device=3D\'%s\' nor node-name=3D\'%s\'", device ? device : "", node_name ? node_name : ""); return NULL; @@ -6752,7 +6752,7 @@ BlockDriverState *check_to_replace_node(BlockDriverSt= ate *parent_bs, AioContext *aio_context; =20 if (!to_replace_bs) { - error_setg(errp, "Node name '%s' not found", node_name); + error_setg(errp, "Failed to find node with node-name=3D'%s'", node= _name); return NULL; } =20 diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 index 12aa9ed37e..5fb65b4bef 100755 --- a/tests/qemu-iotests/030 +++ b/tests/qemu-iotests/030 @@ -153,7 +153,7 @@ class TestSingleDrive(iotests.QMPTestCase): def test_device_not_found(self): result =3D self.vm.qmp('block-stream', device=3D'nonexistent') self.assert_qmp(result, 'error/desc', - 'Cannot find device=3Dnonexistent nor node_name=3Dnonexistent') + 'Cannot find device=3D\'nonexistent\' nor node-name=3D\'nonexi= stent\'') =20 def test_job_id_missing(self): result =3D self.vm.qmp('block-stream', device=3D'mid') @@ -507,7 +507,7 @@ class TestParallelOps(iotests.QMPTestCase): # Error: the base node does not exist result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'none', job_id=3D'stream') self.assert_qmp(result, 'error/desc', - 'Cannot find device=3D nor node_name=3Dnone') + 'Cannot find device=3D\'\' nor node-name=3D\'none\'') =20 # Error: the base node is not a backing file of the top node result =3D self.vm.qmp('block-stream', device=3D'node4', base_node= =3D'node6', job_id=3D'stream') diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 index 7ebc9ed825..336ff7c4f2 100755 --- a/tests/qemu-iotests/040 +++ b/tests/qemu-iotests/040 @@ -175,13 +175,13 @@ class TestSingleDrive(ImageCommitTestCase): self.assert_no_active_block_jobs() result =3D self.vm.qmp('block-commit', device=3D'drive0', top_node= =3D'badfile', base_node=3D'base') self.assert_qmp(result, 'error/class', 'GenericError') - self.assert_qmp(result, 'error/desc', "Cannot find device=3D nor n= ode_name=3Dbadfile") + self.assert_qmp(result, 'error/desc', "Cannot find device=3D'' nor= node-name=3D'badfile'") =20 def test_base_node_invalid(self): self.assert_no_active_block_jobs() result =3D self.vm.qmp('block-commit', device=3D'drive0', top_node= =3D'mid', base_node=3D'badfile') self.assert_qmp(result, 'error/class', 'GenericError') - self.assert_qmp(result, 'error/desc', "Cannot find device=3D nor n= ode_name=3Dbadfile") + self.assert_qmp(result, 'error/desc', "Cannot find device=3D'' nor= node-name=3D'badfile'") =20 def test_top_path_and_node(self): self.assert_no_active_block_jobs() diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index f707471fb0..f570610f64 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -61,13 +61,13 @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) quit =20 Testing: -drive file=3DTEST_DIR/t.qcow2,node-name=3D123foo -QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3D123foo: Invalid node= name +QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3D123foo: Invalid node= -name: '123foo' =20 Testing: -drive file=3DTEST_DIR/t.qcow2,node-name=3D_foo -QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3D_foo: Invalid node n= ame +QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3D_foo: Invalid node-n= ame: '_foo' =20 Testing: -drive file=3DTEST_DIR/t.qcow2,node-name=3Dfoo#12 -QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3Dfoo#12: Invalid node= name +QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3Dfoo#12: Invalid node= -name: 'foo#12' =20 =20 =3D=3D=3D Device without drive =3D=3D=3D diff --git a/tests/qemu-iotests/081.out b/tests/qemu-iotests/081.out index 1974262fac..615c083549 100644 --- a/tests/qemu-iotests/081.out +++ b/tests/qemu-iotests/081.out @@ -140,7 +140,7 @@ Testing: QMP_VERSION {"return": {}} {"error": {"class": "GenericError", "desc": "blkverify=3Don can only be se= t if there are exactly two files and vote-threshold is 2"}} -{"error": {"class": "GenericError", "desc": "Cannot find device=3Ddrive0-q= uorum nor node_name=3Ddrive0-quorum"}} +{"error": {"class": "GenericError", "desc": "Cannot find device=3D'drive0-= quorum' nor node-name=3D'drive0-quorum'"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} =20 diff --git a/tests/qemu-iotests/085.out b/tests/qemu-iotests/085.out index 32a193f2c2..1d4c565b6d 100644 --- a/tests/qemu-iotests/085.out +++ b/tests/qemu-iotests/085.out @@ -24,7 +24,7 @@ Formatting 'TEST_DIR/1-snapshot-v0.qcow2', fmt=3Dqcow2 cl= uster_size=3D65536 extended { 'execute': 'blockdev-snapshot-sync', 'arguments': { 'snapshot-file':'TEST_DIR/1-snapsh= ot-v0.IMGFMT', 'format': 'IMGFMT' } } -{"error": {"class": "GenericError", "desc": "Cannot find device=3D nor nod= e_name=3D"}} +{"error": {"class": "GenericError", "desc": "Cannot find device=3D'' nor n= ode-name=3D''"}} =20 =3D=3D=3D Invalid command - missing snapshot-file =3D=3D=3D =20 @@ -222,10 +222,10 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1= 34217728 backing_file=3DTEST_DIR/ { 'execute': 'blockdev-snapshot', 'arguments': { 'node': 'virtio0', 'overlay':'snap_14' } } -{"error": {"class": "GenericError", "desc": "Cannot find device=3Dsnap_14 = nor node_name=3Dsnap_14"}} +{"error": {"class": "GenericError", "desc": "Cannot find device=3D'snap_14= ' nor node-name=3D'snap_14'"}} { 'execute': 'blockdev-snapshot', 'arguments': { 'node':'nodevice', 'overlay':'snap_13' } } -{"error": {"class": "GenericError", "desc": "Cannot find device=3Dnodevice= nor node_name=3Dnodevice"}} +{"error": {"class": "GenericError", "desc": "Cannot find device=3D'nodevic= e' nor node-name=3D'nodevice'"}} *** done diff --git a/tests/qemu-iotests/087.out b/tests/qemu-iotests/087.out index b61ba638af..e1c23a6983 100644 --- a/tests/qemu-iotests/087.out +++ b/tests/qemu-iotests/087.out @@ -17,7 +17,7 @@ Testing: -drive driver=3DIMGFMT,id=3Ddisk,node-name=3Dtes= t-node,file=3DTEST_DIR/t.IMGFMT QMP_VERSION {"return": {}} {"error": {"class": "GenericError", "desc": "node-name=3Ddisk is conflicti= ng with a device id"}} -{"error": {"class": "GenericError", "desc": "Duplicate node name"}} +{"error": {"class": "GenericError", "desc": "Duplicate nodes with node-nam= e=3D'test-node'"}} {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}} =20 diff --git a/tests/qemu-iotests/206.out b/tests/qemu-iotests/206.out index 5dd589d14e..b68c443867 100644 --- a/tests/qemu-iotests/206.out +++ b/tests/qemu-iotests/206.out @@ -155,7 +155,7 @@ Format specific information: =20 {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "qcow2", "file": "this doesn't exist", "size": 33554432}}} {"return": {}} -Job failed: Cannot find device=3Dthis doesn't exist nor node_name=3Dthis d= oesn't exist +Job failed: Cannot find device=3D'this doesn't exist' nor node-name=3D'thi= s doesn't exist' {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 diff --git a/tests/qemu-iotests/210.out b/tests/qemu-iotests/210.out index 2e9fc596eb..55c0844370 100644 --- a/tests/qemu-iotests/210.out +++ b/tests/qemu-iotests/210.out @@ -108,7 +108,7 @@ Format specific information: =20 {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "luks", "file": "this doesn't exist", "size": 67108864}}} {"return": {}} -Job failed: Cannot find device=3Dthis doesn't exist nor node_name=3Dthis d= oesn't exist +Job failed: Cannot find device=3D'this doesn't exist' nor node-name=3D'thi= s doesn't exist' {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 diff --git a/tests/qemu-iotests/211.out b/tests/qemu-iotests/211.out index b83384deea..3bc092a8a8 100644 --- a/tests/qemu-iotests/211.out +++ b/tests/qemu-iotests/211.out @@ -62,7 +62,7 @@ cluster_size: 1048576 =20 {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "vdi", "file": "this doesn't exist", "size": 33554432}}} {"return": {}} -Job failed: Cannot find device=3Dthis doesn't exist nor node_name=3Dthis d= oesn't exist +Job failed: Cannot find device=3D'this doesn't exist' nor node-name=3D'thi= s doesn't exist' {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 diff --git a/tests/qemu-iotests/212.out b/tests/qemu-iotests/212.out index 1538d679be..8102033488 100644 --- a/tests/qemu-iotests/212.out +++ b/tests/qemu-iotests/212.out @@ -52,7 +52,7 @@ virtual size: 32 MiB (33554432 bytes) =20 {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "parallels", "file": "this doesn't exist", "size": 33554432}}} {"return": {}} -Job failed: Cannot find device=3Dthis doesn't exist nor node_name=3Dthis d= oesn't exist +Job failed: Cannot find device=3D'this doesn't exist' nor node-name=3D'thi= s doesn't exist' {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 diff --git a/tests/qemu-iotests/213.out b/tests/qemu-iotests/213.out index be4ae85180..3cdce4d790 100644 --- a/tests/qemu-iotests/213.out +++ b/tests/qemu-iotests/213.out @@ -55,7 +55,7 @@ cluster_size: 268435456 =20 {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "vhdx", "file": "this doesn't exist", "size": 33554432}}} {"return": {}} -Job failed: Cannot find device=3Dthis doesn't exist nor node_name=3Dthis d= oesn't exist +Job failed: Cannot find device=3D'this doesn't exist' nor node-name=3D'thi= s doesn't exist' {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 diff --git a/tests/qemu-iotests/223.out b/tests/qemu-iotests/223.out index bbc85289e3..083b62d053 100644 --- a/tests/qemu-iotests/223.out +++ b/tests/qemu-iotests/223.out @@ -53,7 +53,7 @@ exports available: 0 {"return": {}} {"execute":"nbd-server-add", "arguments":{"device":"nosuch"}} -{"error": {"class": "GenericError", "desc": "Cannot find device=3Dnosuch n= or node_name=3Dnosuch"}} +{"error": {"class": "GenericError", "desc": "Cannot find device=3D'nosuch'= nor node-name=3D'nosuch'"}} {"execute":"nbd-server-add", "arguments":{"device":"n"}} {"error": {"class": "GenericError", "desc": "Block export id 'n' is alread= y in use"}} @@ -154,7 +154,7 @@ exports available: 0 {"return": {}} {"execute":"nbd-server-add", "arguments":{"device":"nosuch"}} -{"error": {"class": "GenericError", "desc": "Cannot find device=3Dnosuch n= or node_name=3Dnosuch"}} +{"error": {"class": "GenericError", "desc": "Cannot find device=3D'nosuch'= nor node-name=3D'nosuch'"}} {"execute":"nbd-server-add", "arguments":{"device":"n"}} {"error": {"class": "GenericError", "desc": "Block export id 'n' is alread= y in use"}} diff --git a/tests/qemu-iotests/237.out b/tests/qemu-iotests/237.out index a8c800bfad..aa94986803 100644 --- a/tests/qemu-iotests/237.out +++ b/tests/qemu-iotests/237.out @@ -85,7 +85,7 @@ Format specific information: =20 {"execute": "blockdev-create", "arguments": {"job-id": "job0", "options": = {"driver": "vmdk", "file": "this doesn't exist", "size": 33554432}}} {"return": {}} -Job failed: Cannot find device=3Dthis doesn't exist nor node_name=3Dthis d= oesn't exist +Job failed: Cannot find device=3D'this doesn't exist' nor node-name=3D'thi= s doesn't exist' {"execute": "job-dismiss", "arguments": {"id": "job0"}} {"return": {}} =20 diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245 index cfdeb902be..f8eba7719a 100755 --- a/tests/qemu-iotests/245 +++ b/tests/qemu-iotests/245 @@ -187,8 +187,8 @@ class TestBlockdevReopen(iotests.QMPTestCase): self.reopen(opts, {'backing': backing_node_name}) =20 # We can't use a non-existing or empty (non-NULL) node as the back= ing image - self.reopen(opts, {'backing': 'not-found'}, "Cannot find device=3D= nor node_name=3Dnot-found") - self.reopen(opts, {'backing': ''}, "Cannot find device=3D nor node= _name=3D") + self.reopen(opts, {'backing': 'not-found'}, "Cannot find device=3D= \'\' nor node-name=3D\'not-found\'") + self.reopen(opts, {'backing': ''}, "Cannot find device=3D\'\' nor = node-name=3D\'\'") =20 # We can reopen the image just fine if we specify the backing opti= ons opts['backing'] =3D {'driver': iotests.imgfmt, diff --git a/tests/qemu-iotests/249.out b/tests/qemu-iotests/249.out index 92ec81db03..d2bf9be85e 100644 --- a/tests/qemu-iotests/249.out +++ b/tests/qemu-iotests/249.out @@ -18,7 +18,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D10485= 76 backing_file=3DTEST_DIR/t. 'filter-node-name': '1234'}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "job0"}} -{"error": {"class": "GenericError", "desc": "Invalid node name"}} +{"error": {"class": "GenericError", "desc": "Invalid node-name: '1234'"}} =20 =3D=3D=3D Send a write command to a drive opened in read-only mode (2) =20 diff --git a/tests/qemu-iotests/300 b/tests/qemu-iotests/300 index 63036f6a6e..0f278731ce 100755 --- a/tests/qemu-iotests/300 +++ b/tests/qemu-iotests/300 @@ -189,8 +189,8 @@ class TestAliasMigration(TestDirtyBitmapMigration): # Check for error message on the destination if self.src_node_name !=3D self.dst_node_name: self.verify_dest_error(f"Cannot find " - f"device=3D{self.src_node_name} nor " - f"node_name=3D{self.src_node_name}") + f"device=3D'{self.src_node_name}' nor " + f"node-name=3D'{self.src_node_name}'") else: self.verify_dest_error(None) =20 --=20 2.29.2 From nobody Mon May 20 23:50:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614958448; cv=none; d=zohomail.com; s=zohoarc; b=DXYbuw3SJPKhuOrjWU6lUikCNldrmmMIiIFOdr7ZXaXWsmAP/mQ06kQgFdfetxAuN0MeogzyIev80zJw/tVyoYLROmSLGKQ6qQMXNIkENM3iYfZkv2Vlw3UszJ8vRij5ue1v4KjKcI/KLlnQjDsSFK9sbrthKLtZ6pUXkB7kDLQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614958448; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=jhlX3r98D/CKlTP0w34nlkTSjsO3bUJiOTT6Sz9KeP4=; b=UnLBRbGovrZxN11ykyKDObs6yipzkwq/jMQc8DHp/Z1XB0XBvt0PS0OV5t0iXqB91OYKLG9gmOuAzTWI5P58g//JU1mI04fRkDqftC1PD1RW0MJ46JsaTNdljkx1OmJvzPykQXrc2babEy/0Wk4/GlyMZSfYm+N6qJsjUoKYSX0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 1614958448497590.2607605422022; Fri, 5 Mar 2021 07:34:08 -0800 (PST) Received: from localhost ([::1]:60056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lICSt-00068F-Cu for importer@patchew.org; Fri, 05 Mar 2021 10:34:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lICEs-0001Ha-NS for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:19:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58652) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lICEq-0003r9-TE for qemu-devel@nongnu.org; Fri, 05 Mar 2021 10:19:38 -0500 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-580-eBEADCvtOU-E6BYwL-zffw-1; Fri, 05 Mar 2021 10:19:34 -0500 Received: by mail-oo1-f72.google.com with SMTP id t23so1342690oou.5 for ; Fri, 05 Mar 2021 07:19:34 -0800 (PST) Received: from redhat.redhat.com (ip68-103-222-6.ks.ok.cox.net. [68.103.222.6]) by smtp.gmail.com with ESMTPSA id y34sm651085ota.12.2021.03.05.07.19.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 07:19:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614957576; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jhlX3r98D/CKlTP0w34nlkTSjsO3bUJiOTT6Sz9KeP4=; b=WkA894EoLkmLXebAzIzJ9S27vQLmovEcsvhjhQO6K3KUc8+0bdWdg1HnLUtQC+6navdwVJ 3O/6vzGVwJo2u7IPetENRYer9F4qyAOCyey8f2YYOPDaaLfLG0h81pflooClhaB0MzFQLd /5In/t1VrumCm+pRoL+SVKyMUv+NODI= X-MC-Unique: eBEADCvtOU-E6BYwL-zffw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jhlX3r98D/CKlTP0w34nlkTSjsO3bUJiOTT6Sz9KeP4=; b=lXvTtY1LJ2KSM11vGGs1X7YbYHWP8ptzojWJiCQBD9lSr2ZUvfDrjQhO5svn1ej3wi lVrT8uO4cBAN1uP8+q8g7/KsYfJClVOYFgR0mPSC/6H5FNE0hmwHct++5DLnYaj2DxHY 8P/dAvPErr0ULkknO9V75Le//k0NXMzn/oZUcrh6v0RrRFzRlBSr4qMtM6bpvymQrC2q HlWxfrasVTxoPdHdjv9Bc2j2QW2NH+fKAt5MFCy3mgyMN+vZSDfZ60j40cyA8UmCm+Mb NJosgzWJTx+aNW1wDS8xGyVsm1EbjFV9lWd1pdPzmQ6wiqRPyQv3p/BHardMmRIn52hZ wr0Q== X-Gm-Message-State: AOAM531B1s09Axz5eeNHhTgpzYcYa87DS/Ezj1HXJjmHvtZBacEv2n5w WDZrkzTVVONWuc1bBGg+rPcWS2LadIqYb3U2PNQFQji0DmqgDQgea3bgf2D4JPNKdWL/NSxEKBe 7lkQLX6PfZMQ8SsA= X-Received: by 2002:a9d:825:: with SMTP id 34mr8755895oty.280.1614957573974; Fri, 05 Mar 2021 07:19:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyRKBY2M2Jurn3RGot2RAW07QYEDOHDRh9vVHWgrdPfQ90PA6Prpqkd/izaFZgvogJeIWsKGQ== X-Received: by 2002:a9d:825:: with SMTP id 34mr8755881oty.280.1614957573816; Fri, 05 Mar 2021 07:19:33 -0800 (PST) From: Connor Kuehl To: qemu-block@nongnu.org Subject: [PATCH v2 2/2] blockdev: Clarify error messages pertaining to 'node-name' Date: Fri, 5 Mar 2021 09:19:29 -0600 Message-Id: <20210305151929.1947331-3-ckuehl@redhat.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210305151929.1947331-1-ckuehl@redhat.com> References: <20210305151929.1947331-1-ckuehl@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ckuehl@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=63.128.21.124; envelope-from=ckuehl@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: kwolf@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Connor Kuehl --- blockdev.c | 13 +++++++------ tests/qemu-iotests/245 | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/blockdev.c b/blockdev.c index cd438e60e3..7c7ab2b386 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1515,13 +1515,13 @@ static void external_snapshot_prepare(BlkActionStat= e *common, s->has_snapshot_node_name ? s->snapshot_node_name : NULL; =20 if (node_name && !snapshot_node_name) { - error_setg(errp, "New overlay node name missing"); + error_setg(errp, "New overlay node-name missing"); goto out; } =20 if (snapshot_node_name && bdrv_lookup_bs(snapshot_node_name, snapshot_node_name, NULL)) { - error_setg(errp, "New overlay node name already in use"); + error_setg(errp, "New overlay node-name already in use"); goto out; } =20 @@ -3598,13 +3598,14 @@ void qmp_x_blockdev_reopen(BlockdevOptions *options= , Error **errp) =20 /* Check for the selected node name */ if (!options->has_node_name) { - error_setg(errp, "Node name not specified"); + error_setg(errp, "node-name not specified"); goto fail; } =20 bs =3D bdrv_find_node(options->node_name); if (!bs) { - error_setg(errp, "Cannot find node named '%s'", options->node_name= ); + error_setg(errp, "Failed to find node with node-name=3D'%s'", + options->node_name); goto fail; } =20 @@ -3635,7 +3636,7 @@ void qmp_blockdev_del(const char *node_name, Error **= errp) =20 bs =3D bdrv_find_node(node_name); if (!bs) { - error_setg(errp, "Cannot find node %s", node_name); + error_setg(errp, "Failed to find node with node-name=3D'%s'", node= _name); return; } if (bdrv_has_blk(bs)) { @@ -3758,7 +3759,7 @@ void qmp_x_blockdev_set_iothread(const char *node_nam= e, StrOrNull *iothread, =20 bs =3D bdrv_find_node(node_name); if (!bs) { - error_setg(errp, "Cannot find node %s", node_name); + error_setg(errp, "Failed to find node with node-name=3D'%s'", node= _name); return; } =20 diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245 index f8eba7719a..a2a0482469 100755 --- a/tests/qemu-iotests/245 +++ b/tests/qemu-iotests/245 @@ -140,8 +140,8 @@ class TestBlockdevReopen(iotests.QMPTestCase): self.reopen(opts, {'file': 'hd0-file'}) =20 # We cannot change any of these - self.reopen(opts, {'node-name': 'not-found'}, "Cannot find node na= med 'not-found'") - self.reopen(opts, {'node-name': ''}, "Cannot find node named ''") + self.reopen(opts, {'node-name': 'not-found'}, "Failed to find node= with node-name=3D'not-found'") + self.reopen(opts, {'node-name': ''}, "Failed to find node with nod= e-name=3D''") self.reopen(opts, {'node-name': None}, "Invalid parameter type for= 'node-name', expected: string") self.reopen(opts, {'driver': 'raw'}, "Cannot change the option 'dr= iver'") self.reopen(opts, {'driver': ''}, "Invalid parameter ''") @@ -158,7 +158,7 @@ class TestBlockdevReopen(iotests.QMPTestCase): =20 # node-name is optional in BlockdevOptions, but x-blockdev-reopen = needs it del opts['node-name'] - self.reopen(opts, {}, "Node name not specified") + self.reopen(opts, {}, "node-name not specified") =20 # Check that nothing has changed self.check_node_graph(original_graph) --=20 2.29.2