From nobody Tue Nov 18 16:07:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716809599; cv=none; d=zohomail.com; s=zohoarc; b=JR2eRvpRC9MYTeg+VLEqF7LbPnb6cTbmCnR81c/uzfqzyJc9UYUsBpEEBJsZ9igxJbJMB/Gic6mTdGP1dcX0+2LKVNvOjhGxCA+pYWXIutK9+BQ3qHF20xsoJUP8MJozovnrS6pwVD+VnEAncoh90Rd0luDiL/S132D12bilc4c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716809599; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZnzXyt0cmnHw8rN/o3Hoy8TS+O/qAabN70CVCwHfMJo=; b=T9vd0e2o9FDD8QWmoKYZLobSXUqITKOsC9RC//Dwv/BcuQHkp5P1b3il18HRSdkHFqquEWeYNkB2IueEOm+uK0Ckcj/616Kxsq/D1/KII5jc67b2gcVQermyDi9x3BPdzhCceh9xIlYTcEhUZpmFfepXUlKzL5akyrPtxPstxgo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716809599740937.6000650748391; Mon, 27 May 2024 04:33:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBYZr-0004uL-Jz; Mon, 27 May 2024 07:31:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZo-0004s5-K7 for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZm-0001Oq-0L for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:40 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-630-Ub8ZMoziOQ60daeLloew-w-1; Mon, 27 May 2024 07:31:33 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1FA6381227E; Mon, 27 May 2024 11:31:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.193.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA2F52026D68; Mon, 27 May 2024 11:31:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E3D3221E6757; Mon, 27 May 2024 13:31:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716809497; 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=ZnzXyt0cmnHw8rN/o3Hoy8TS+O/qAabN70CVCwHfMJo=; b=iCQCUmnTBOKzOdCZhmQ67hrC/0v04a0Ul3tul0DqVSc1HXvOpLb4GsxH4IC69/o0ITGaSY YfQRaF5AsogJiXl8ojyCj1ryothNsH+zY7TiA9wccI0lLKpDv8JDfl8IVwB3hnm/RKITed MRVs77RFWZwyP7ivLYBcaqo/i8in3ls= X-MC-Unique: Ub8ZMoziOQ60daeLloew-w-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 1/9] block: Improve error message when external snapshot can't flush Date: Mon, 27 May 2024 13:31:23 +0200 Message-ID: <20240527113131.2054486-2-armbru@redhat.com> In-Reply-To: <20240527113131.2054486-1-armbru@redhat.com> References: <20240527113131.2054486-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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.034, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1716809600488100001 external_snapshot_action() reports bdrv_flush() failure to its caller as An IO error has occurred The errno code returned by bdrv_flush() is lost. Improve this to Write to node '' failed: Signed-off-by: Markus Armbruster Message-ID: <20240513141703.549874-2-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- blockdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blockdev.c b/blockdev.c index 08eccc9052..528db3452f 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1406,8 +1406,10 @@ static void external_snapshot_action(TransactionActi= on *action, } =20 if (!bdrv_is_read_only(state->old_bs)) { - if (bdrv_flush(state->old_bs)) { - error_setg(errp, QERR_IO_ERROR); + ret =3D bdrv_flush(state->old_bs); + if (ret < 0) { + error_setg_errno(errp, -ret, "Write to node '%s' failed", + bdrv_get_device_or_node_name(state->old_bs)); return; } } --=20 2.45.0 From nobody Tue Nov 18 16:07:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716809561; cv=none; d=zohomail.com; s=zohoarc; b=KQkpsdWVIyRTBJScsnCH75pKEZ+Cy24RGAbYzm+TcMQKgShnIgc+aMIsowtb606McrvornQ5aWY/+u0PkSyj8OMnKPLgADIaxDOa7IRAnHOOyErl2ziaYq6kf8NaJp/M3KC8PJaZ67h46bWBv+U8wpm/6osZ+65yjPf0wR2lrCY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716809561; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=60cRWFZoJmzp2R5J/UmL7L3ILwxklIPSAGWkNk9aSCA=; b=jZWMhrK/siPZVEGflIA+VA7LNugz2DgYa/lV72JounET6bML6hIUdOC9OGp6W4q6NdGY2GtFqsg+87Al6i4KhVD922o7ygyuW3HpEZ53rOsKIaNcpJ9NjgKmlkG+7+QJO7NnFFBtIbqaKxNKJkhRmrwO6ByoOYYBM9bSLJVEtkQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716809561614145.22014814285615; Mon, 27 May 2024 04:32:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBYa7-00051k-BP; Mon, 27 May 2024 07:31:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZo-0004s6-KJ for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZl-0001Oe-Pw for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:40 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-617-FJt7BHfvN7SqxcNFt03SjQ-1; Mon, 27 May 2024 07:31:33 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C183380670C; Mon, 27 May 2024 11:31:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.193.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9D2140004D; Mon, 27 May 2024 11:31:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E6CB221E6697; Mon, 27 May 2024 13:31:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716809496; 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=60cRWFZoJmzp2R5J/UmL7L3ILwxklIPSAGWkNk9aSCA=; b=bfo69NdL+95fwkMO18vE8ztvkoSfLvtoJkzKC4v5Ho8BYytFEt79ZAILk2ruaXxTjmIAZ7 hHdBBUMeBNRHLYIJC/HjcBlTD6dYUWKiytbN8GzGnbLPm1uqHYTkpY7xV27yFpbbVG0+Pr 10JslvbwbrRqKNdz3mJzMj/2dk2jYKQ= X-MC-Unique: FJt7BHfvN7SqxcNFt03SjQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 2/9] dump/win_dump: Improve error messages on write error Date: Mon, 27 May 2024 13:31:24 +0200 Message-ID: <20240527113131.2054486-3-armbru@redhat.com> In-Reply-To: <20240527113131.2054486-1-armbru@redhat.com> References: <20240527113131.2054486-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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.034, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1716809562328100001 create_win_dump() and write_run report qemu_write_full() failure to their callers as An IO error has occurred The errno set by qemu_write_full() is lost. Improve this to win-dump: failed to write header: and win-dump: failed to save memory: This matches how dump.c reports similar errors. Signed-off-by: Markus Armbruster Message-ID: <20240513141703.549874-3-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- dump/win_dump.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dump/win_dump.c b/dump/win_dump.c index b7bfaff379..0e4fe692ce 100644 --- a/dump/win_dump.c +++ b/dump/win_dump.c @@ -12,7 +12,6 @@ #include "sysemu/dump.h" #include "qapi/error.h" #include "qemu/error-report.h" -#include "qapi/qmp/qerror.h" #include "exec/cpu-defs.h" #include "hw/core/cpu.h" #include "qemu/win_dump_defs.h" @@ -52,6 +51,7 @@ static size_t write_run(uint64_t base_page, uint64_t page= _count, uint64_t addr =3D base_page << TARGET_PAGE_BITS; uint64_t size =3D page_count << TARGET_PAGE_BITS; uint64_t len, l; + int eno; size_t total =3D 0; =20 while (size) { @@ -65,9 +65,10 @@ static size_t write_run(uint64_t base_page, uint64_t pag= e_count, } =20 l =3D qemu_write_full(fd, buf, len); + eno =3D errno; cpu_physical_memory_unmap(buf, addr, false, len); if (l !=3D len) { - error_setg(errp, QERR_IO_ERROR); + error_setg_errno(errp, eno, "win-dump: failed to save memory"); return 0; } =20 @@ -459,7 +460,7 @@ void create_win_dump(DumpState *s, Error **errp) =20 s->written_size =3D qemu_write_full(s->fd, h, hdr_size); if (s->written_size !=3D hdr_size) { - error_setg(errp, QERR_IO_ERROR); + error_setg_errno(errp, errno, "win-dump: failed to write header"); goto out_restore; } =20 --=20 2.45.0 From nobody Tue Nov 18 16:07:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716809560; cv=none; d=zohomail.com; s=zohoarc; b=BmdghM9NdH81QqeXsOi7K1hXvsjQ92uZihaA+Ec1SUj/qj0MCTjeZ/YstBnfxgdR54gMXSqzQFo/Z4BJ4NRZzkzAyw7Rh6a8IhBGwTs+HBncwn777kLk4oHvaHIafnAk2O6AG8eZYCEotKIXIEWuMgpi8B9PIjLzOIpiYQS1IkQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716809560; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=LVl/3RlbGuSyK2JmZR32QsIwXQ4iTQ3frlv9Hx6VZq0=; b=hGz4p1e5RwD2wuCP9ZO3F1csQEfwK22OQ0UZzRF08c/FNv7npanu8O9oQ/7Q6eba7pa9ruRE6PzPaqgbWp2QSJ0FmE5KKM5tAy0PGr5m7W/Q7PbZgwJ7Ks4fNvI7Hgt2IIMzUxCLxdRt8z5F4eXwFDEFX25O+aLYfNIkJdkPFvU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 171680956097142.87032314731971; Mon, 27 May 2024 04:32:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBYZq-0004sq-6t; Mon, 27 May 2024 07:31:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZn-0004rU-9L for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZl-0001Ok-Q6 for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:39 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-516-n9DC4fGMPhC1S7M_BmXAuw-1; Mon, 27 May 2024 07:31:33 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1EF25185A783; Mon, 27 May 2024 11:31:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.193.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E9ABEC15BED; Mon, 27 May 2024 11:31:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E99DD21E6601; Mon, 27 May 2024 13:31:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716809497; 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=LVl/3RlbGuSyK2JmZR32QsIwXQ4iTQ3frlv9Hx6VZq0=; b=UhetkfGFGJe46sBQZ3gwg3Ew1m/c75GtpsiE8rd8M7UAFjZdnFS7ah/Tzfdw04mKtKNqkm VjNC7Fw143zIT+Sc5313+I7eSdLUfzlCKAqRYbSUSVpcjdf1toKtqQEhCnnU5Aom0FkCDK x47UxAvFC5AZuwBwb04F7rgYYnkAbSI= X-MC-Unique: n9DC4fGMPhC1S7M_BmXAuw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 3/9] block/vmdk: Improve error messages on extent write error Date: Mon, 27 May 2024 13:31:25 +0200 Message-ID: <20240527113131.2054486-4-armbru@redhat.com> In-Reply-To: <20240527113131.2054486-1-armbru@redhat.com> References: <20240527113131.2054486-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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.034, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1716809562343100002 vmdk_init_extent() reports blk_co_pwrite() failure to its caller as An IO error has occurred The errno code returned by blk_co_pwrite() is lost. Improve this to failed to write VMDK : Signed-off-by: Markus Armbruster Message-ID: <20240513141703.549874-4-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- block/vmdk.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 3b82979fdf..78f6433607 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -28,7 +28,6 @@ #include "block/block_int.h" #include "sysemu/block-backend.h" #include "qapi/qmp/qdict.h" -#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "qemu/module.h" #include "qemu/option.h" @@ -2278,12 +2277,12 @@ vmdk_init_extent(BlockBackend *blk, int64_t filesiz= e, bool flat, bool compress, /* write all the data */ ret =3D blk_co_pwrite(blk, 0, sizeof(magic), &magic, 0); if (ret < 0) { - error_setg(errp, QERR_IO_ERROR); + error_setg_errno(errp, -ret, "failed to write VMDK magic"); goto exit; } ret =3D blk_co_pwrite(blk, sizeof(magic), sizeof(header), &header, 0); if (ret < 0) { - error_setg(errp, QERR_IO_ERROR); + error_setg_errno(errp, -ret, "failed to write VMDK header"); goto exit; } =20 @@ -2303,7 +2302,7 @@ vmdk_init_extent(BlockBackend *blk, int64_t filesize,= bool flat, bool compress, ret =3D blk_co_pwrite(blk, le64_to_cpu(header.rgd_offset) * BDRV_SECTO= R_SIZE, gd_buf_size, gd_buf, 0); if (ret < 0) { - error_setg(errp, QERR_IO_ERROR); + error_setg_errno(errp, -ret, "failed to write VMDK grain directory= "); goto exit; } =20 @@ -2315,7 +2314,8 @@ vmdk_init_extent(BlockBackend *blk, int64_t filesize,= bool flat, bool compress, ret =3D blk_co_pwrite(blk, le64_to_cpu(header.gd_offset) * BDRV_SECTOR= _SIZE, gd_buf_size, gd_buf, 0); if (ret < 0) { - error_setg(errp, QERR_IO_ERROR); + error_setg_errno(errp, -ret, + "failed to write VMDK backup grain directory"); } =20 ret =3D 0; --=20 2.45.0 From nobody Tue Nov 18 16:07:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716809595; cv=none; d=zohomail.com; s=zohoarc; b=XHX4P+fVnBIxrfH6UMfYCZzxJIKbcwac0DX/CO+p2xCcJWNM2cS8IZW42ymhTcnfLsnbBQerReN/IWlKbW5L1YybNXMf1v26kM9H8VoCNyx4omoQB0C0I4crgpw/sNa1ySZsS50OjDbkHg379VN8iwmAzO06rgUAHWrK06WhSlc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716809595; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QMe3xoRfhlbrn7+cU2DEI0M9zVaVux7lPHRkOkmjutQ=; b=lQJlPLzyDGqcBKGmo1pSDQiveOi+oCeZhgRDEJWNUq2CZOqKt4B9NT/ZTaS6AacTDk0f9bSp4rl6Z8c7qDF3y2C7UKpYKVd4NBYOUwIJW/aOOWrjzjUiwiVGmTpGmSR38SoWOUaYUS0G4RNWrk6MfkVwZ94dwaPChINPgDHK1pQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716809595485550.3054926646917; Mon, 27 May 2024 04:33:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBYZq-0004tO-J7; Mon, 27 May 2024 07:31:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZm-0004rQ-2H for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZk-0001OQ-0W for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:37 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-630-0h2tdGpjMnSy4_V6r6cx7A-1; Mon, 27 May 2024 07:31:33 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1FA71812296; Mon, 27 May 2024 11:31:33 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.193.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EA3112026D6E; Mon, 27 May 2024 11:31:32 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id ECA9E21E6692; Mon, 27 May 2024 13:31:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716809494; 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=QMe3xoRfhlbrn7+cU2DEI0M9zVaVux7lPHRkOkmjutQ=; b=J1ukr/e4P7tEpYpehKIQcfqX5koP1nxgcPHdhld9577M4iUgPeGXnlrBG60P5nnjathKbq ma8wT2Xd79USx/3XUME71eMl/XG/O4sWOS1+2RWxc5EBoaSD9ymI+lF4nMIbjHZktTzyba BLhQkFVxUt6/t5zCC/utMjbT5GQHYUo= X-MC-Unique: 0h2tdGpjMnSy4_V6r6cx7A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 4/9] cpus: Improve error messages on memsave, pmemsave write error Date: Mon, 27 May 2024 13:31:26 +0200 Message-ID: <20240527113131.2054486-5-armbru@redhat.com> In-Reply-To: <20240527113131.2054486-1-armbru@redhat.com> References: <20240527113131.2054486-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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.034, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1716809596485100001 qmp_memsave() and qmp_pmemsave() report fwrite() error as An IO error has occurred Improve this to writing memory to '' failed Signed-off-by: Markus Armbruster Message-ID: <20240513141703.549874-5-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- system/cpus.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/cpus.c b/system/cpus.c index 68d161d96b..f8fa78f33d 100644 --- a/system/cpus.c +++ b/system/cpus.c @@ -813,7 +813,8 @@ void qmp_memsave(int64_t addr, int64_t size, const char= *filename, goto exit; } if (fwrite(buf, 1, l, f) !=3D l) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "writing memory to '%s' failed", + filename); goto exit; } addr +=3D l; @@ -843,7 +844,8 @@ void qmp_pmemsave(int64_t addr, int64_t size, const cha= r *filename, l =3D size; cpu_physical_memory_read(addr, buf, l); if (fwrite(buf, 1, l, f) !=3D l) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "writing memory to '%s' failed", + filename); goto exit; } addr +=3D l; --=20 2.45.0 From nobody Tue Nov 18 16:07:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716809565; cv=none; d=zohomail.com; s=zohoarc; b=DN+THoXL/JyD6kLsm1hMw2mIKSANO4R4r0l7s3DmSA0YDVbAldlHlb7uEJvGxOwpzggTKNGA6Uw2ZtJom2c+2JXsPavSSFpPk1hE4sWZIm85TZ3qB6eOvuY3kqzkapyiRXTYlrSMc9UMSojpnETF0WZ0FgZO0i9iFvav6OIoOKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716809565; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=M+8/H9NOh8n2UM5Lr6aYAIQUv69S7Q2wZ9lQ5/X0zyg=; b=kbaimOoJrwj5OlgUh6YXBOvvWZAu+bmhxm75QIhCf9DJv0x73WsET0FY2htsfy+ZWplJQVams6oZqrm+OHqcoU4QGh2ey6kNImfC9QXoOTqUHBtecm8VxGeEF74bBJorNNn8mYQdadrUKky+wdd1h08zMb5Oy2j6vaRUHuGU8hg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716809565269749.5606449147976; Mon, 27 May 2024 04:32:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBYZv-0004uV-Cc; Mon, 27 May 2024 07:31:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZo-0004s8-La for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZm-0001P4-CR for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:40 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-518-nE33EuImNqaet5XpWd8vvQ-1; Mon, 27 May 2024 07:31:34 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 48BA529AA3A2; Mon, 27 May 2024 11:31:34 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.193.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2828B492BC6; Mon, 27 May 2024 11:31:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id EF9EC21E65D7; Mon, 27 May 2024 13:31:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716809497; 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=M+8/H9NOh8n2UM5Lr6aYAIQUv69S7Q2wZ9lQ5/X0zyg=; b=SUPnBiC6eX4rimR493U19ChDAphQF0G4IPNBRsuUwPsxEsiqCY0tkGvQopwGzJD+9v7n/J JRyU2mQifyNicqaEjErVqr1K9dInSdRgs5bv4B0RNQVme7zqlXvN9ELlyiuIl+qy/0KRho GOGnFX9lLJVnMxIOI5I1Hw+n87rtvXQ= X-MC-Unique: nE33EuImNqaet5XpWd8vvQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Fabiano Rosas , Peter Xu Subject: [PULL 5/9] migration: Rephrase message on failure to save / load Xen device state Date: Mon, 27 May 2024 13:31:27 +0200 Message-ID: <20240527113131.2054486-6-armbru@redhat.com> In-Reply-To: <20240527113131.2054486-1-armbru@redhat.com> References: <20240527113131.2054486-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.9 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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.034, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1716809566339100017 Functions that use an Error **errp parameter to return errors should not also report them to the user, because reporting is the caller's job. When the caller does, the error is reported twice. When it doesn't (because it recovered from the error), there is no error to report, i.e. the report is bogus. qmp_xen_save_devices_state() and qmp_xen_load_devices_state() violate this principle: they call qemu_save_device_state() and qemu_loadvm_state(), which call error_report_err(). I wish I could clean this up now, but migration's error reporting is too complicated (confused?) for me to mess with it. Instead, I'm merely improving the error reported by qmp_xen_load_devices_state() and qmp_xen_load_devices_state() to the QMP core from An IO error has occurred to saving Xen device state failed and loading Xen device state failed respectively. Signed-off-by: Markus Armbruster Message-ID: <20240513141703.549874-6-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Fabiano Rosas Acked-by: Peter Xu --- migration/savevm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/migration/savevm.c b/migration/savevm.c index 6c789bd54b..c621f2359b 100644 --- a/migration/savevm.c +++ b/migration/savevm.c @@ -45,7 +45,6 @@ #include "qapi/qapi-commands-migration.h" #include "qapi/clone-visitor.h" #include "qapi/qapi-builtin-visit.h" -#include "qapi/qmp/qerror.h" #include "qemu/error-report.h" #include "sysemu/cpus.h" #include "exec/memory.h" @@ -3203,7 +3202,7 @@ void qmp_xen_save_devices_state(const char *filename,= bool has_live, bool live, object_unref(OBJECT(ioc)); ret =3D qemu_save_device_state(f); if (ret < 0 || qemu_fclose(f) < 0) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "saving Xen device state failed"); } else { /* libxl calls the QMP command "stop" before calling * "xen-save-devices-state" and in case of migration failure, libxl @@ -3252,7 +3251,7 @@ void qmp_xen_load_devices_state(const char *filename,= Error **errp) ret =3D qemu_loadvm_state(f); qemu_fclose(f); if (ret < 0) { - error_setg(errp, QERR_IO_ERROR); + error_setg(errp, "loading Xen device state failed"); } migration_incoming_state_destroy(); } --=20 2.45.0 From nobody Tue Nov 18 16:07:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716809523; cv=none; d=zohomail.com; s=zohoarc; b=X3G00NA6I6VElFxI9ZfA/+2VNEj+wA4wpX9TR5vkIjiZxCJUNGiS/Y2Z//g/ZZa7M1PENbxuxXON0GlF3ZQp3C9z+3XWrywkPBGWzwOELSKDw4u56uJ3eVpG9NeEqapCm6cJmpEumhHyQ8L1jscpTBr5UWC5PaPW0xF8h5CCC/Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716809523; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VlkSbhWWfyYHdURDQ5axl/8+M5ihkPY4gsaR9m7oEWg=; b=IOkzO095q6hsMEs7VyeoT3eaFsQr/OHYjKnm7q9ZdHZnyI/J5J6tsGzw2ieRs46/+R2sIebZsLSCeyy5B2+uRh+9ctQ5E08KzywHifIRkC0zAEeLr9C1kJj8lp2WGenIw/jv1JJVjqKMkDAMOyMY7gGekO1M/XrVHBTHtLuRfqo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716809523744422.1722967588512; Mon, 27 May 2024 04:32:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBYZp-0004se-IX; Mon, 27 May 2024 07:31:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZn-0004rT-6N for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZl-0001OZ-OU for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:38 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-518-Kz_peoWzMQ6nhdHgCbBj9Q-1; Mon, 27 May 2024 07:31:34 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4822C1C0512D; Mon, 27 May 2024 11:31:34 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.193.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27E2F40C6CB2; Mon, 27 May 2024 11:31:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F262221E5E5F; Mon, 27 May 2024 13:31:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716809496; 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=VlkSbhWWfyYHdURDQ5axl/8+M5ihkPY4gsaR9m7oEWg=; b=eNtaCdlYzZlhHwrfesIELVN4HW33PJid/CMaXWKewsxuCAOOTWAYuBpiPWmAf2vJ+oIDYj pb2/dOCMC+SJje21QcYo0o9cX9get4AyUsog0kyabpwTIkay5FRP5DAG1xqXnXgzEf4Wpx y1FNKwUyd/sZb6zknf00Phg6FNejKQA= X-MC-Unique: Kz_peoWzMQ6nhdHgCbBj9Q-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 6/9] qerror: QERR_IO_ERROR is no longer used, drop Date: Mon, 27 May 2024 13:31:28 +0200 Message-ID: <20240527113131.2054486-7-armbru@redhat.com> In-Reply-To: <20240527113131.2054486-1-armbru@redhat.com> References: <20240527113131.2054486-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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.034, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1716809524203100001 Signed-off-by: Markus Armbruster Message-ID: <20240513141703.549874-7-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 00b18e9082..bc9116f76a 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -20,9 +20,6 @@ #define QERR_INVALID_PARAMETER_VALUE \ "Parameter '%s' expects %s" =20 -#define QERR_IO_ERROR \ - "An IO error has occurred" - #define QERR_MISSING_PARAMETER \ "Parameter '%s' is missing" =20 --=20 2.45.0 From nobody Tue Nov 18 16:07:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716809562; cv=none; d=zohomail.com; s=zohoarc; b=fia/Hzyo93zOTzbuw+sY1G9lD2ZOrCmD+hf+GFfp+yBmEj7AIcsCasf4rI843mEVfAEuiecbpIp7XQ+5busGUKn3yNMpC5JbVdusYGlWI3MQF4xPjcl9iF6WGcml2O11rQCWB6XqEt3abLe9KxBzWkLJByQop8UgF0CRuiM6xec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716809562; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=EGY12TvDYRsXDrV+AiadmkOXCGM+jTMJF5RWbRMojhc=; b=WGiBZz6hoAX4CFboT/WjAC6Ar0SRlX+PNRuhmsoNQWfQHwjBld612p44/xzRZGfyt4oLUleqVPc9vIq5eUbSOzP0L09aMDUy31ooCyfkCylnBnn2Ou/WBQCG5AydDxlYtblujaMoaxWZ+gXl9rF1LL02bgOO8Rux7PNPqihK8fw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716809562858195.71548237404875; Mon, 27 May 2024 04:32:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBYaG-0005Dt-Bu; Mon, 27 May 2024 07:32:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZq-0004sn-0h for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZo-0001PR-C4 for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:41 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-625-gCMyWl2ENxeKSl0FyuMQaw-1; Mon, 27 May 2024 07:31:34 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4847A8058D1; Mon, 27 May 2024 11:31:34 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.193.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27E0D40C6EB7; Mon, 27 May 2024 11:31:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0117621E5E60; Mon, 27 May 2024 13:31:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716809499; 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=EGY12TvDYRsXDrV+AiadmkOXCGM+jTMJF5RWbRMojhc=; b=LfmEIVbjr15rSIxnCJCZPfvPmgdyLo5jU6ybJMD+Lu41jqnUD1o0xJETABnQeQ00rqc/fE 9HKWN5hm52AS+q22pAI1BFAbWrCssAlXzl3JWP3f0Km1hFlh5ELPQF7qsnY56essH1Wd++ 9iJsfk2AG9jDgKPwABVYMeACE3Igdhc= X-MC-Unique: gCMyWl2ENxeKSl0FyuMQaw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Konstantin Kostiuk Subject: [PULL 7/9] qga-win32: Improve guest-set-user-password, guest-file-open errors Date: Mon, 27 May 2024 13:31:29 +0200 Message-ID: <20240527113131.2054486-8-armbru@redhat.com> In-Reply-To: <20240527113131.2054486-1-armbru@redhat.com> References: <20240527113131.2054486-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 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=170.10.129.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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.034, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1716809564342100013 When guest-set-user-password's argument @password can't be converted from UTF-8 to UTF-16, we report something like Guest agent command failed, error was 'Invalid sequence in conversion i= nput' Improve this to can't convert 'password' to UTF-16: Invalid sequence in conversion input Likewise for argument @username, and guest-file-open argument @path, even though I'm not sure you can actually get invalid input past the QMP core there. Signed-off-by: Markus Armbruster Message-ID: <20240514105829.729342-2-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Konstantin Kostiuk --- qga/commands-win32.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 6fee0e1e6f..ed31077457 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -217,6 +217,9 @@ int64_t qmp_guest_file_open(const char *path, const cha= r *mode, Error **errp) =20 w_path =3D g_utf8_to_utf16(path, -1, NULL, NULL, &gerr); if (!w_path) { + error_setg(errp, "can't convert 'path' to UTF-16: %s", + gerr->message); + g_error_free(gerr); goto done; } =20 @@ -244,10 +247,6 @@ int64_t qmp_guest_file_open(const char *path, const ch= ar *mode, Error **errp) slog("guest-file-open, handle: % " PRId64, fd); =20 done: - if (gerr) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, gerr->message); - g_error_free(gerr); - } g_free(w_path); return fd; } @@ -1946,11 +1945,17 @@ void qmp_guest_set_user_password(const char *userna= me, =20 user =3D g_utf8_to_utf16(username, -1, NULL, NULL, &gerr); if (!user) { + error_setg(errp, "can't convert 'username' to UTF-16: %s", + gerr->message); + g_error_free(gerr); goto done; } =20 wpass =3D g_utf8_to_utf16(rawpasswddata, -1, NULL, NULL, &gerr); if (!wpass) { + error_setg(errp, "can't convert 'password' to UTF-16: %s", + gerr->message); + g_error_free(gerr); goto done; } =20 @@ -1966,10 +1971,6 @@ void qmp_guest_set_user_password(const char *usernam= e, } =20 done: - if (gerr) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, gerr->message); - g_error_free(gerr); - } g_free(user); g_free(wpass); g_free(rawpasswddata); --=20 2.45.0 From nobody Tue Nov 18 16:07:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716809561; cv=none; d=zohomail.com; s=zohoarc; b=m0/rcuQNqq3g8nCNhmiBYooHOr5OfTX6EgKYQxRysbXf5OxCWPAygIgJgoC1ncxHEJQfmNg5EprctZkWk9shcCvAZeZpJRtwsfSrOa1c0qYUao9cwEOqFPetG+pmxHZGX7vVZONo1Czid8VdF9bcZtr58MrrQrn0ZpD1NIacpu4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716809561; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hRro5uvvSf+BoekEFg3pHrFSW00kEySLafCn7wMsXUA=; b=HUO1/TvYd1COs+ISdGDOMHAk+IZEnqyBzVnrhLPk4slHw3HIVx9h4W5m4MxgNkQZ8JS1g9m5cQ3LwWUv1cTB4YwMmGluF3YxYymwyeL/IS4cmnFJHnx40hSoLNhHu42KAF/zcxgbRuTfz6P9D2PmfuBb+DcIfkSOEKDxIETzQbc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716809561469894.4616685656206; Mon, 27 May 2024 04:32:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBYaB-00055U-MV; Mon, 27 May 2024 07:32:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZo-0004sD-Pz for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZl-0001Om-Qg for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:40 -0400 Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-156-r8zRDUSpMHa8cmiWl8vEnw-1; Mon, 27 May 2024 07:31:34 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 622B43C025BE; Mon, 27 May 2024 11:31:34 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.193.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 280521C00A8E; Mon, 27 May 2024 11:31:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 03F7421E5E61; Mon, 27 May 2024 13:31:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716809497; 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=hRro5uvvSf+BoekEFg3pHrFSW00kEySLafCn7wMsXUA=; b=JIvqom3zYLXqWSDXTMgZYSVsq1y62ImwOhtC6kAvfqObWpgPcLiv2I+qCNte5HgX1qPHw/ aNbj9aRCF2kuwbUZ40yjIwo6Rap9SX72+IqAildV/bfnibnAYk+rVRNQdn1Ky540gPuU+y jvHkDqmbj4SaqAMvMkcgbliNpiWzXjA= X-MC-Unique: r8zRDUSpMHa8cmiWl8vEnw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Konstantin Kostiuk Subject: [PULL 8/9] qga: Shorten several error messages Date: Mon, 27 May 2024 13:31:30 +0200 Message-ID: <20240527113131.2054486-9-armbru@redhat.com> In-Reply-To: <20240527113131.2054486-1-armbru@redhat.com> References: <20240527113131.2054486-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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.034, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1716809562357100003 Some, but not all error messages are of the form Guest agent command failed, error was '' For instance, command guest-exec can fail with an error message like Guest agent command failed, error was 'Failed to execute child process = =E2=80=9C/bin/invalid-cmd42=E2=80=9D (No such file or directory)' Shorten this to just just the actual error message. The guest-exec example becomes Failed to execute child process =E2=80=9C/bin/invalid-cmd42=E2=80=9D (N= o such file or directory) Signed-off-by: Markus Armbruster Message-ID: <20240514105829.729342-3-armbru@redhat.com> [Superfluous #include "qapi/qmp/qerror.h" deleted] Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Konstantin Kostiuk --- qga/commands-win32.c | 24 ++++++++---------------- qga/commands.c | 6 ++---- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index ed31077457..0d1b836e87 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -278,8 +278,7 @@ static void acquire_privilege(const char *name, Error *= *errp) TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) { if (!LookupPrivilegeValue(NULL, name, &priv.Privileges[0].Luid)) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "no luid for requested privilege"); + error_setg(errp, "no luid for requested privilege"); goto out; } =20 @@ -287,14 +286,12 @@ static void acquire_privilege(const char *name, Error= **errp) priv.Privileges[0].Attributes =3D SE_PRIVILEGE_ENABLED; =20 if (!AdjustTokenPrivileges(token, FALSE, &priv, 0, NULL, 0)) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "unable to acquire requested privilege"); + error_setg(errp, "unable to acquire requested privilege"); goto out; } =20 } else { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "failed to open privilege token"); + error_setg(errp, "failed to open privilege token"); } =20 out: @@ -308,8 +305,7 @@ static void execute_async(DWORD WINAPI (*func)(LPVOID),= LPVOID opaque, { HANDLE thread =3D CreateThread(NULL, 0, func, opaque, 0, NULL); if (!thread) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "failed to dispatch asynchronous command"); + error_setg(errp, "failed to dispatch asynchronous command"); } } =20 @@ -1418,22 +1414,19 @@ static void check_suspend_mode(GuestSuspendMode mod= e, Error **errp) =20 ZeroMemory(&sys_pwr_caps, sizeof(sys_pwr_caps)); if (!GetPwrCapabilities(&sys_pwr_caps)) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "failed to determine guest suspend capabilities"); + error_setg(errp, "failed to determine guest suspend capabilities"); return; } =20 switch (mode) { case GUEST_SUSPEND_MODE_DISK: if (!sys_pwr_caps.SystemS4) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "suspend-to-disk not supported by OS"); + error_setg(errp, "suspend-to-disk not supported by OS"); } break; case GUEST_SUSPEND_MODE_RAM: if (!sys_pwr_caps.SystemS3) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "suspend-to-ram not supported by OS"); + error_setg(errp, "suspend-to-ram not supported by OS"); } break; default: @@ -2175,8 +2168,7 @@ static void ga_get_win_version(RTL_OSVERSIONINFOEXW *= info, Error **errp) HMODULE module =3D GetModuleHandle("ntdll"); PVOID fun =3D GetProcAddress(module, "RtlGetVersion"); if (fun =3D=3D NULL) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "Failed to get address of RtlGetVersion"); + error_setg(errp, "Failed to get address of RtlGetVersion"); return; } =20 diff --git a/qga/commands.c b/qga/commands.c index 88c1c99fe5..5a5fad31f8 100644 --- a/qga/commands.c +++ b/qga/commands.c @@ -15,7 +15,6 @@ #include "guest-agent-core.h" #include "qga-qapi-commands.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qemu/base64.h" #include "qemu/cutils.h" #include "commands-common.h" @@ -475,7 +474,7 @@ GuestExec *qmp_guest_exec(const char *path, guest_exec_task_setup, &has_merge, &pid, input_data ? &in_fd := NULL, has_output ? &out_fd : NULL, has_output ? &err_fd : NULL, &ger= r); if (!ret) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, gerr->message); + error_setg(errp, "%s", gerr->message); g_error_free(gerr); goto done; } @@ -586,8 +585,7 @@ GuestTimezone *qmp_guest_get_timezone(Error **errp) info =3D g_new0(GuestTimezone, 1); tz =3D g_time_zone_new_local(); if (tz =3D=3D NULL) { - error_setg(errp, QERR_QGA_COMMAND_FAILED, - "Couldn't retrieve local timezone"); + error_setg(errp, "Couldn't retrieve local timezone"); goto error; } =20 --=20 2.45.0 From nobody Tue Nov 18 16:07:22 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1716809549; cv=none; d=zohomail.com; s=zohoarc; b=UNVtvrH2rVzX8bRpWjeqpbMq02trOEKJHkQMKMR2eodT72ffRJrlvjGj4SJ0iuhW2j+HT3c99nnBNm1Cbad5gtJd2GcO19Lp3a8fbHloSLINwQybk8FlI96/FR91rnPWklK9vJjRhqtjRoTFEPoM2Y1GiHbfTEUIl5kiyYnuY9c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1716809549; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=C094t+1awvDHIlWsn9+2j8kJMuED7HZo7+UvZ3b0EQE=; b=XZl9B8mXS52NGigEgPZ20hBTXpIy5iRGbjdNDbAn7ycROANA+BanEE/wELkQtCdY8zMl09mhkf1FkwfZoW30SU9pFDeVMfRLVFh8l+zRlO8Z1n108PAf3xGppnAzIPTV8bnCuGOFvVx9v2XVWZob9Oci2qYgIpG/Cdx/vKluDBg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1716809549774868.9666404054313; Mon, 27 May 2024 04:32:29 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBYZv-0004vU-Vo; Mon, 27 May 2024 07:31:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZo-0004s7-LN for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sBYZn-0001PC-5z for qemu-devel@nongnu.org; Mon, 27 May 2024 07:31:40 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-674-tfqlofhhMTigC1NpqM0CrA-1; Mon, 27 May 2024 07:31:34 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 48724185AD2C; Mon, 27 May 2024 11:31:34 +0000 (UTC) Received: from blackfin.pond.sub.org (unknown [10.39.193.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27F153C27; Mon, 27 May 2024 11:31:34 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0702621E5E62; Mon, 27 May 2024 13:31:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716809498; 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=C094t+1awvDHIlWsn9+2j8kJMuED7HZo7+UvZ3b0EQE=; b=aYo/F4SOerfKAd5+hqIIfprHqm6PhGu9nHhX1/e9GnHFl3+F/si9SNhUxIBAdsl461lSd3 OBLQ+YQk1bE+kRXoTkbJbwb7xRshqXjd+ERyDi8K8pX8i6KAuaQaWSx5Lwi2k6mgUrc66/ N/+60K3EGkbS4CTuM3ZEe0GHFVht2iM= X-MC-Unique: tfqlofhhMTigC1NpqM0CrA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Konstantin Kostiuk Subject: [PULL 9/9] qerror: QERR_QGA_COMMAND_FAILED is no longer used, drop Date: Mon, 27 May 2024 13:31:31 +0200 Message-ID: <20240527113131.2054486-10-armbru@redhat.com> In-Reply-To: <20240527113131.2054486-1-armbru@redhat.com> References: <20240527113131.2054486-1-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 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=170.10.133.124; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-124.mimecast.com 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.034, 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1716809550250100001 Signed-off-by: Markus Armbruster Message-ID: <20240514105829.729342-4-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Konstantin Kostiuk --- 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 bc9116f76a..38e89762b3 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -26,9 +26,6 @@ #define QERR_PROPERTY_VALUE_OUT_OF_RANGE \ "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", = maximum: %" PRId64 ")" =20 -#define QERR_QGA_COMMAND_FAILED \ - "Guest agent command failed, error was '%s'" - #define QERR_UNSUPPORTED \ "this feature or command is not currently supported" =20 --=20 2.45.0