From patchwork Fri Oct 30 20:21:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 316468 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43EFDC55178 for ; Fri, 30 Oct 2020 20:25:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A73C620739 for ; Fri, 30 Oct 2020 20:25:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BFPC9Ocq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A73C620739 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYaxr-0005LG-I3 for qemu-devel@archiver.kernel.org; Fri, 30 Oct 2020 16:25:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYau5-0000C2-LS for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35062) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kYau3-0007h9-VQ for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604089299; 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=t+iBjVC7xcw6X3t+JOTGvDiD6Rn9cdGic8J7WThIGNg=; b=BFPC9OcqBo5Pc3W2aG1IqnBZlmVnfWFZ5n1lHLFv5fHKwNf1Ea9anTl1zkAcq80hsY1+EJ kPkUDgDjkuSCIGiBRo6lEPtcvDQ2dfp7Qr3PDWHl5QkokMylM0q4QqJzbBFfQyhXoA5GxT gCOwY06Xmiqwggt/5zy07n02rU7JOOw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-595-oEECHw-IPIGvlfqNIfZITA-1; Fri, 30 Oct 2020 16:21:36 -0400 X-MC-Unique: oEECHw-IPIGvlfqNIfZITA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2245A805F12 for ; Fri, 30 Oct 2020 20:21:35 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF8325D9D2; Fri, 30 Oct 2020 20:21:34 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH 02/20] qdev: Stop using error_set_from_qdev_prop_error() for netdev property Date: Fri, 30 Oct 2020 16:21:13 -0400 Message-Id: <20201030202131.796967-3-ehabkost@redhat.com> In-Reply-To: <20201030202131.796967-1-ehabkost@redhat.com> References: <20201030202131.796967-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 16:21:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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: Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?b?w6k=?= , Markus Armbruster Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just setting a reasonable error string using error_setg() is simpler and makes error messages clearer. Before: $ qemu-system-x86_64 -device e1000,netdev=n0 qemu-system-x86_64: -device e1000,netdev=n0: Property 'e1000.netdev' can't find value 'n0' $ qemu-system-x86_64 -netdev id=n0,type=user -device e1000,netdev=n0 -device e1000,netdev=n0 qemu-system-x86_64: -device e1000,netdev=n0: Property 'e1000.netdev' can't take value 'n0', it's in use After: $ ./qemu-system-x86_64 -device e1000,netdev=n0 qemu-system-x86_64: -device e1000,netdev=n0: Property 'e1000.netdev' can't take value 'n0': netdev not found $ ./qemu-system-x86_64 -netdev id=n0,type=user -device e1000,netdev=n0 -device e1000,netdev=n0 qemu-system-x86_64: -device e1000,netdev=n0: Property 'e1000.netdev' can't take value 'n0': netdev is in use Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-properties-system.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index 232ff955fa..60be09efba 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -376,7 +376,7 @@ static void set_netdev(Object *obj, Visitor *v, const char *name, NICPeers *peers_ptr = object_static_prop_ptr(obj, prop); NetClientState **ncs = peers_ptr->ncs; NetClientState *peers[MAX_QUEUE_NUM]; - int queues, err = 0, i = 0; + int queues, i = 0; char *str; if (!visit_type_str(v, name, &str, errp)) { @@ -387,7 +387,7 @@ static void set_netdev(Object *obj, Visitor *v, const char *name, NET_CLIENT_DRIVER_NIC, MAX_QUEUE_NUM); if (queues == 0) { - err = -ENOENT; + error_setg(errp, "netdev not found"); goto out; } @@ -399,7 +399,7 @@ static void set_netdev(Object *obj, Visitor *v, const char *name, for (i = 0; i < queues; i++) { if (peers[i]->peer) { - err = -EEXIST; + error_setg(errp, "netdev is in use"); goto out; } @@ -418,7 +418,6 @@ static void set_netdev(Object *obj, Visitor *v, const char *name, peers_ptr->queues = queues; out: - error_set_from_qdev_prop_error(errp, err, obj, prop, str); g_free(str); } From patchwork Fri Oct 30 20:21:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 316469 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB49AC55178 for ; Fri, 30 Oct 2020 20:23:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6005020739 for ; Fri, 30 Oct 2020 20:23:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="S1/V9Hfk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6005020739 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:45120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYavj-00023p-94 for qemu-devel@archiver.kernel.org; Fri, 30 Oct 2020 16:23:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYau6-0000Eh-Su for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:21236) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kYau4-0007hO-Tw for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604089300; 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=IOX1B2ywU49qOzfq+/i+SXG8+eWS0AeocjQ/XNxwOzE=; b=S1/V9HfkdMVCivMrYesBPBqc1u1ctm+JvX5MvlyJ/n3RHveL0oqykmJwokl0OAS53czpl1 LbbrGxclv4sjQOHFfVSrNY97cMys+IYFGrOT0cOjAbah+Gc4fcZE/Roczzv6Jhe9vaXYWs B/4j8Z1I8BX+fSHciBV9piPzCm/r3Mw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-60-QVxOgdo8O7yVGAHeRIn0zg-1; Fri, 30 Oct 2020 16:21:38 -0400 X-MC-Unique: QVxOgdo8O7yVGAHeRIn0zg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 67FAE18A225C for ; Fri, 30 Oct 2020 20:21:37 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2AAA05C1CF; Fri, 30 Oct 2020 20:21:37 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH 04/20] qdev: Stop using error_set_from_qdev_prop_error() for mac property Date: Fri, 30 Oct 2020 16:21:15 -0400 Message-Id: <20201030202131.796967-5-ehabkost@redhat.com> In-Reply-To: <20201030202131.796967-1-ehabkost@redhat.com> References: <20201030202131.796967-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 01:22:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, RCVD_IN_MSPIKE_H5=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: Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?b?w6k=?= , Markus Armbruster Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just setting a reasonable error string using error_setg() is simpler and makes error messages clearer. Before: $ qemu-system-x86_64 -device e1000,mac=x qemu-system-x86_64: -device e1000,mac=x: Property 'e1000.mac' doesn't take value 'x' After: $ qemu-system-x86_64 -device e1000,mac=x qemu-system-x86_64: -device e1000,mac=x: Property 'e1000.mac' can't take value 'x': invalid mac address Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-properties-system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index a5a1a6ffee..fc0abcae17 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -336,7 +336,7 @@ static void set_mac(Object *obj, Visitor *v, const char *name, void *opaque, return; inval: - error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str); + error_setg(errp, "invalid mac address"); g_free(str); } From patchwork Fri Oct 30 20:21:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 316466 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47651C00A89 for ; Fri, 30 Oct 2020 20:27:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9EC9620791 for ; Fri, 30 Oct 2020 20:27:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="d7dBsoCa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EC9620791 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYb01-0000UG-Kf for qemu-devel@archiver.kernel.org; Fri, 30 Oct 2020 16:27:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53028) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYauB-0000RP-AS for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kYau9-0007i2-Kq for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604089304; 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=gW8t/u1GvE0ZZGBmo/WYAyMqpPvRNCVcucwpa4P5Mkw=; b=d7dBsoCaWoKkJdfTeeEIc4rTKtOSTOqY/XIOw5+5R/IUMaJ8DV49Xtc+j7v3ukCMoh/Tye HC/Pb3gQujIJjw0phxqHIGPl1mE6nWcdb6Xt695cXVbqUljwZoRj+FShukNs8p7LYGCI/o B6ya3w6HvnciRMY75Mpb93Cm8zuw5Gs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-527-snA03sb3P2a7Rs7GYcBFMQ-1; Fri, 30 Oct 2020 16:21:40 -0400 X-MC-Unique: snA03sb3P2a7Rs7GYcBFMQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D1D98108597C for ; Fri, 30 Oct 2020 20:21:39 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 950961002C01; Fri, 30 Oct 2020 20:21:39 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH 06/20] qdev: Stop using error_set_from_qdev_prop_error() for PCI host device property Date: Fri, 30 Oct 2020 16:21:17 -0400 Message-Id: <20201030202131.796967-7-ehabkost@redhat.com> In-Reply-To: <20201030202131.796967-1-ehabkost@redhat.com> References: <20201030202131.796967-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 16:21:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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: Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?b?w6k=?= , Markus Armbruster Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just setting a reasonable error string using error_setg() is simpler and makes error messages clearer. Before: $ qemu-system-x86_64 -device vfio-pci,host=x qemu-system-x86_64: -device vfio-pci,host=x: Property 'vfio-pci.host' doesn't take value 'x' After: $ qemu-system-x86_64 -device vfio-pci,host=x qemu-system-x86_64: -device vfio-pci,host=x: Property 'vfio-pci.host' can't take value 'x': invalid host device address Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-properties-system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index 5d3cb32708..0290d64bf1 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -859,7 +859,7 @@ static void set_pci_host_devaddr(Object *obj, Visitor *v, const char *name, return; inval: - error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str); + error_setg(errp, "invalid host device address"); g_free(str); } From patchwork Fri Oct 30 20:21:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 316463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84908C00A89 for ; Fri, 30 Oct 2020 20:31:49 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D41D72076D for ; Fri, 30 Oct 2020 20:31:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="M+F6cwqJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D41D72076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYb3r-0006CX-PB for qemu-devel@archiver.kernel.org; Fri, 30 Oct 2020 16:31:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYauF-0000by-8E for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59383) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kYauD-0007ib-N5 for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604089309; 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=/jnic1NLVi3yOaelWu2Ae/wYwDuJiLbjp5nCA3Fl1x4=; b=M+F6cwqJXA7oDgSYl+Ut09K3y+wa98PaUiz+lICkfipWkUt5MDD9P8k2ig/l1zJR4SvoG2 LiVbbQQXoHrhbAw4uHd3h6ihSXkRRC37afIK+X2Mewh8ft1i6XEWMvyveuSQWHPEyR127T yGBn+Dv4+mBJMGGR0pWXrvpQ7OIShv0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-525-NSLM91z4N6OuFujU9Tn1YQ-1; Fri, 30 Oct 2020 16:21:45 -0400 X-MC-Unique: NSLM91z4N6OuFujU9Tn1YQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E2D6B108597F; Fri, 30 Oct 2020 20:21:43 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id A55301002C01; Fri, 30 Oct 2020 20:21:40 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH 07/20] qdev: Stop using error_set_from_qdev_prop_error() for css devno property Date: Fri, 30 Oct 2020 16:21:18 -0400 Message-Id: <20201030202131.796967-8-ehabkost@redhat.com> In-Reply-To: <20201030202131.796967-1-ehabkost@redhat.com> References: <20201030202131.796967-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 16:21:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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: Thomas Huth , David Hildenbrand , Cornelia Huck , Markus Armbruster , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Just setting a reasonable error string using error_setg() is simpler and makes error messages clearer. Before: $ qemu-system-s390x -device x-terminal3270,devno=x qemu-system-s390x: -device x-terminal3270,devno=x: Property 'x-terminal3270.devno' doesn't take value 'x' After: $ qemu-system-s390x -device x-terminal3270,devno=x qemu-system-s390x: -device x-terminal3270,devno=x: Property 'x-terminal3270.devno' can't take value 'x': invalid devno Signed-off-by: Eduardo Habkost --- Cc: Cornelia Huck Cc: Thomas Huth Cc: Richard Henderson Cc: David Hildenbrand Cc: Halil Pasic Cc: Christian Borntraeger Cc: qemu-s390x@nongnu.org Cc: qemu-devel@nongnu.org --- hw/s390x/css.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/css.c b/hw/s390x/css.c index c8e7ce232a..ad631bad29 100644 --- a/hw/s390x/css.c +++ b/hw/s390x/css.c @@ -2384,7 +2384,7 @@ static void set_css_devid(Object *obj, Visitor *v, const char *name, num = sscanf(str, "%2x.%1x%n.%4x%n", &cssid, &ssid, &n1, &devid, &n2); if (num != 3 || (n2 - n1) != 5 || strlen(str) != n2) { - error_set_from_qdev_prop_error(errp, EINVAL, obj, prop, str); + error_setg(errp, "invalid devno"); goto out; } if ((cssid > MAX_CSSID) || (ssid > MAX_SSID)) { From patchwork Fri Oct 30 20:21:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 316464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B28EC00A89 for ; Fri, 30 Oct 2020 20:29:48 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 73D1020791 for ; Fri, 30 Oct 2020 20:29:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="as7XOvV1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73D1020791 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:41678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYb1u-0003mq-F4 for qemu-devel@archiver.kernel.org; Fri, 30 Oct 2020 16:29:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYauE-0000a6-Mi for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:50 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kYauC-0007iV-UX for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604089308; 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=TkzKicG/kMOdvt3TdBS42FPTR69wOOGeaV4o4fkuaW4=; b=as7XOvV14mxgb3N1AaZIVtKjN660L0K0I0DNlZhr6Ranu1piXdVzB84IKEex4JVMWH0v0D y0RcmDMQHMQeVATe/UDqX/I1xSZs5FvYDE3VZuMD2IoVSq1zWLdu5v80uXQqxtsN9cSK+3 tSfo7I+C2g5zhqVshKuwRrf4jN1WqBA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-591-tN6AolSuOVGyszaNF52clg-1; Fri, 30 Oct 2020 16:21:46 -0400 X-MC-Unique: tN6AolSuOVGyszaNF52clg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8DBDA805EF6 for ; Fri, 30 Oct 2020 20:21:45 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 02F075D9D2; Fri, 30 Oct 2020 20:21:44 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH 08/20] qdev: Delete unused error_set_from_qdev_prop_error() function Date: Fri, 30 Oct 2020 16:21:19 -0400 Message-Id: <20201030202131.796967-9-ehabkost@redhat.com> In-Reply-To: <20201030202131.796967-1-ehabkost@redhat.com> References: <20201030202131.796967-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 16:21:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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: Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?b?w6k=?= , Markus Armbruster Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- include/hw/qdev-properties.h | 2 -- hw/core/qdev-properties.c | 22 ---------------------- 2 files changed, 24 deletions(-) diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h index a4ac1e6972..cca1a2153f 100644 --- a/include/hw/qdev-properties.h +++ b/include/hw/qdev-properties.h @@ -36,8 +36,6 @@ const GlobalProperty *qdev_find_global_prop(Object *obj, const char *name); int qdev_prop_check_globals(void); void qdev_prop_set_globals(DeviceState *dev); -void error_set_from_qdev_prop_error(Error **errp, int ret, Object *obj, - Property *prop, const char *value); /** * qdev_property_add_static: diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c index c03842e89a..5fdfb3f5cd 100644 --- a/hw/core/qdev-properties.c +++ b/hw/core/qdev-properties.c @@ -85,28 +85,6 @@ static Property *qdev_prop_find(DeviceState *dev, const char *name) return NULL; } -void error_set_from_qdev_prop_error(Error **errp, int ret, Object *obj, - Property *prop, const char *value) -{ - switch (ret) { - case -EEXIST: - error_setg(errp, "Property '%s.%s' can't take value '%s', it's in use", - object_get_typename(obj), prop->name, value); - break; - default: - case -EINVAL: - error_setg(errp, QERR_PROPERTY_VALUE_BAD, - object_get_typename(obj), prop->name, value); - break; - case -ENOENT: - error_setg(errp, "Property '%s.%s' can't find value '%s'", - object_get_typename(obj), prop->name, value); - break; - case 0: - break; - } -} - void qdev_prop_set_bit(DeviceState *dev, const char *name, bool value) { object_property_set_bool(OBJECT(dev), name, value, &error_abort); From patchwork Fri Oct 30 20:21:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 316461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E2F7C388F9 for ; Fri, 30 Oct 2020 20:35:43 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF71C2076D for ; Fri, 30 Oct 2020 20:35:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TZHoNpvZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF71C2076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:57470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYb7d-00027z-NZ for qemu-devel@archiver.kernel.org; Fri, 30 Oct 2020 16:35:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYauK-0000n8-4T for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:53146) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kYauI-0007kM-DF for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604089313; 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=OM4FMHrDZwjWnZb8rYTKxC3NKos0UkCNBEmHE0+Q7Mg=; b=TZHoNpvZEig5iJQIIiJGmvXLKjIVLzJs2w3SDVPRtmvrjSQvD7LqoBWGAKlGEpMZV4TnJ5 ClMcJV2ektpJYOShwIttST/MNhH5HrzoUnJAwPOK9rFVwVRK9avLPJQYSsgNF9aqI/2q+c B9IGPxhzzNk67od2+Xpxo5YdGIHcYoo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-132-mIU7fVcXO_mut1MQsvk-kg-1; Fri, 30 Oct 2020 16:21:51 -0400 X-MC-Unique: mIU7fVcXO_mut1MQsvk-kg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B3C76760C4; Fri, 30 Oct 2020 20:21:50 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C0FD1002397; Fri, 30 Oct 2020 20:21:48 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH 11/20] tpm_util: Remove unnecessary prefix from error message Date: Fri, 30 Oct 2020 16:21:22 -0400 Message-Id: <20201030202131.796967-12-ehabkost@redhat.com> In-Reply-To: <20201030202131.796967-1-ehabkost@redhat.com> References: <20201030202131.796967-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 01:22:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, RCVD_IN_MSPIKE_H5=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: Markus Armbruster , Stefan Berger Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" object_property_parse() will add a "Property '.' can't take value ''" prefix automatically for us. Signed-off-by: Eduardo Habkost --- Cc: Stefan Berger Cc: qemu-devel@nongnu.org --- backends/tpm/tpm_util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c index 2b5f788861..012c71bc53 100644 --- a/backends/tpm/tpm_util.c +++ b/backends/tpm/tpm_util.c @@ -56,8 +56,7 @@ static void set_tpm(Object *obj, Visitor *v, const char *name, void *opaque, s = qemu_find_tpm_be(str); if (s == NULL) { - error_setg(errp, "Property '%s.%s' can't find value '%s'", - object_get_typename(obj), prop->name, str); + error_setg(errp, "tpm backend not found"); } else if (tpm_backend_init(s, TPM_IF(obj), errp) == 0) { *be = s; /* weak reference, avoid cyclic ref */ } From patchwork Fri Oct 30 20:21:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 316467 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B444C00A89 for ; Fri, 30 Oct 2020 20:26:08 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1782F20739 for ; Fri, 30 Oct 2020 20:26:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="J8EowlvL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1782F20739 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:56386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYayN-0006jR-1T for qemu-devel@archiver.kernel.org; Fri, 30 Oct 2020 16:26:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYauN-0000of-8c for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:22:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46986) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kYauK-0007kb-AF for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:21:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604089315; 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=HtAssr3+a6M+1T8evYjqF4+kuT250KbABypJsxRiXKQ=; b=J8EowlvLpTUDFRcmLud+j7OG4LpZuPN/Zn1xvGA/CkAfbAlyDX0QrTsWZOVxeT//Dar3pS NFRyY8PUF9FNjs3QHB4833MX0CeUanAAUmcuhHVaj9byhheQJ4B/jHW0WFiH7qXmZ6GD/b yb/myMvefvtvoZRQWTMYB7/HB2Op4JM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-553-ogrz7rKpMtiAv8MQp-d2QA-1; Fri, 30 Oct 2020 16:21:53 -0400 X-MC-Unique: ogrz7rKpMtiAv8MQp-d2QA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E8893107AFD0 for ; Fri, 30 Oct 2020 20:21:52 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85A3026329; Fri, 30 Oct 2020 20:21:52 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH 13/20] qdev: chardev: Remove unnecessary prefix from error message Date: Fri, 30 Oct 2020 16:21:24 -0400 Message-Id: <20201030202131.796967-14-ehabkost@redhat.com> In-Reply-To: <20201030202131.796967-1-ehabkost@redhat.com> References: <20201030202131.796967-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 16:21:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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: Paolo Bonzini , =?utf-8?q?Daniel_P=2E_Berrang?= =?utf-8?b?w6k=?= , Markus Armbruster Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" object_property_parse() will add a "Property '.' can't take value ''" prefix automatically for us. Signed-off-by: Eduardo Habkost --- Cc: Paolo Bonzini Cc: "Daniel P. Berrangé" Cc: Eduardo Habkost Cc: qemu-devel@nongnu.org --- hw/core/qdev-properties-system.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/core/qdev-properties-system.c b/hw/core/qdev-properties-system.c index 815eee8035..90799412be 100644 --- a/hw/core/qdev-properties-system.c +++ b/hw/core/qdev-properties-system.c @@ -248,11 +248,9 @@ static void set_chr(Object *obj, Visitor *v, const char *name, void *opaque, s = qemu_chr_find(str); if (s == NULL) { - error_setg(errp, "Property '%s.%s' can't find value '%s'", - object_get_typename(obj), prop->name, str); - } else if (!qemu_chr_fe_init(be, s, errp)) { - error_prepend(errp, "Property '%s.%s' can't take value '%s': ", - object_get_typename(obj), prop->name, str); + error_setg(errp, "chardev not found"); + } else { + qemu_chr_fe_init(be, s, errp); } g_free(str); } From patchwork Fri Oct 30 20:21:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 316465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF799C00A89 for ; Fri, 30 Oct 2020 20:28:30 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 554842076D for ; Fri, 30 Oct 2020 20:28:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RxDmRZHm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 554842076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:36560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYb0f-0001j7-96 for qemu-devel@archiver.kernel.org; Fri, 30 Oct 2020 16:28:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYauS-0000qM-GL for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:22:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:49640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kYauO-0007ky-Rn for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:22:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604089319; 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=mty3W0CgIANVUwhIgE6muUeVI4pQYAV+Fd6XYr8VBeU=; b=RxDmRZHmbWMlYdf2GNf6httbHh+peE8QaTBJm/1GDqi8wqwqQd/j/Calbc2jhRMi9FagY6 sKw4IIojiniyHY7zz4Hq1XCaWuZhL0DEaUXeUoIrxkch9gm4lE0/l0vqI4I9wamOmj1um5 jGMtZg4CTZP/ARybNjl5z8Zi4awu54Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-474-sZaKoXBLNEGwbFaKgU8oSA-1; Fri, 30 Oct 2020 16:21:57 -0400 X-MC-Unique: sZaKoXBLNEGwbFaKgU8oSA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3B9A7393A5 for ; Fri, 30 Oct 2020 20:21:56 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id C05685D9D2; Fri, 30 Oct 2020 20:21:55 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH 15/20] qerror: Delete unused QERR_PROPERTY_VALUE_BAD macro Date: Fri, 30 Oct 2020 16:21:26 -0400 Message-Id: <20201030202131.796967-16-ehabkost@redhat.com> In-Reply-To: <20201030202131.796967-1-ehabkost@redhat.com> References: <20201030202131.796967-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=63.128.21.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 01:22:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, RCVD_IN_MSPIKE_H5=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: Markus Armbruster Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Eduardo Habkost --- Cc: Markus Armbruster Cc: qemu-devel@nongnu.org --- include/qapi/qmp/qerror.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 7c76e24aa7..646a42c4b4 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -70,9 +70,6 @@ #define QERR_PERMISSION_DENIED \ "Insufficient permission to perform this operation" -#define QERR_PROPERTY_VALUE_BAD \ - "Property '%s.%s' doesn't take value '%s'" - #define QERR_PROPERTY_VALUE_OUT_OF_RANGE \ "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")" From patchwork Fri Oct 30 20:21:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 316460 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06FECC00A89 for ; Fri, 30 Oct 2020 20:38:05 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7558920797 for ; Fri, 30 Oct 2020 20:38:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SNcdYgpi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7558920797 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYb9v-0004GA-GY for qemu-devel@archiver.kernel.org; Fri, 30 Oct 2020 16:38:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYaua-0000uW-GI for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:22:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58704) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kYauV-0007lb-T3 for qemu-devel@nongnu.org; Fri, 30 Oct 2020 16:22:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604089326; 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=HSOOxfNhrZ9l5ZrJ8GMDAt4DHKLA5YsaRSPlCu3byRQ=; b=SNcdYgpiTLNAPFLy6ScFif/bQxb4m/Gtu51n0eT7qv0eE+STnYcPCgXyLQSLi3nMCl9gKW c/WI6rhKmW5OKN0CRLkzz0J3wCZAwNyFD8FE8bG/l2owm/bTt+MlZX3bJJCA/nZQpQKGI6 /8PLy9NQ9uRkGxSkmBgfHcTo3Lsw1Ss= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-45-HPeGaDuTN2ilc2nQhs-VrQ-1; Fri, 30 Oct 2020 16:22:04 -0400 X-MC-Unique: HPeGaDuTN2ilc2nQhs-VrQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1A7D107AFB2; Fri, 30 Oct 2020 20:22:03 +0000 (UTC) Received: from localhost (ovpn-114-68.rdu2.redhat.com [10.10.114.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 21F1B6198D; Fri, 30 Oct 2020 20:22:02 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Subject: [PATCH 17/20] colo-compare: Remove unnecessary prefix from error message Date: Fri, 30 Oct 2020 16:21:28 -0400 Message-Id: <20201030202131.796967-18-ehabkost@redhat.com> In-Reply-To: <20201030202131.796967-1-ehabkost@redhat.com> References: <20201030202131.796967-1-ehabkost@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ehabkost@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass client-ip=216.205.24.124; envelope-from=ehabkost@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/30 16:21:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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: Zhang Chen , Jason Wang , Markus Armbruster , Li Zhijian Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" object_property_parse() will add a "Property '.' can't take value ''" prefix automatically for us. Signed-off-by: Eduardo Habkost --- Cc: Zhang Chen Cc: Li Zhijian Cc: Jason Wang Cc: qemu-devel@nongnu.org --- net/colo-compare.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/net/colo-compare.c b/net/colo-compare.c index 3a45d64175..ae61e32c5b 100644 --- a/net/colo-compare.c +++ b/net/colo-compare.c @@ -1097,8 +1097,7 @@ static void compare_set_timeout(Object *obj, Visitor *v, return; } if (!value) { - error_setg(errp, "Property '%s.%s' requires a positive value", - object_get_typename(obj), name); + error_setg(errp, "timeout can't be zero"); return; } s->compare_timeout = value; @@ -1125,8 +1124,7 @@ static void compare_set_expired_scan_cycle(Object *obj, Visitor *v, return; } if (!value) { - error_setg(errp, "Property '%s.%s' requires a positive value", - object_get_typename(obj), name); + error_setg(errp, "expired_scan_cycle can't be zero"); return; } s->expired_scan_cycle = value; @@ -1153,8 +1151,7 @@ static void set_max_queue_size(Object *obj, Visitor *v, goto out; } if (!value) { - error_setg(&local_err, "Property '%s.%s' requires a positive value", - object_get_typename(obj), name); + error_setg(errp, "queue size can't be zero"); goto out; } max_queue_size = value;