From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 56772C982D1 for ; Thu, 17 Sep 2026 13:24:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1x7C5t-0006mu-GN; Thu, 17 Sep 2026 09:24:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1x7C5r-0006mX-UW for qemu-devel@nongnu.org; Thu, 17 Sep 2026 09:24:03 -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 1x7C5q-0001Vn-Ax for qemu-devel@nongnu.org; Thu, 17 Sep 2026 09:24:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1789651439; 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=ChCY5TX3UCrRlMx5zsM7smij0veR3PzOkYQ5oXFAkmk=; b=Gcc832RubmEPmfdWmjrW6RkxEDgSOBJR+dnhyYkNl3KGzUTejc0eobjzq2iRD6NDYjHLSf pSshjjv1A11jAU7VJCVe0bJunktlb5HiRMIVHZG9CTQorSBeEqFpeZ0hbs9bDjc4q4xWuE mEUwvkVVAQacWEnW/kgVyWCZ6LmvuPE= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-352-qBT4C-vwMEeO3AiMQR_-IQ-1; Thu, 17 Sep 2026 09:23:55 -0400 X-MC-Unique: qBT4C-vwMEeO3AiMQR_-IQ-1 X-Mimecast-MFC-AGG-ID: qBT4C-vwMEeO3AiMQR_-IQ_1789651434 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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 mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C7CF8180A9E0; Thu, 17 Sep 2026 13:23:53 +0000 (UTC) Received: from redhat.com (unknown [10.44.48.111]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 175C61956049; Thu, 17 Sep 2026 13:23:50 +0000 (UTC) Date: Thu, 17 Sep 2026 15:23:48 +0200 From: Kevin Wolf To: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau Cc: qemu-devel@nongnu.org, richard.henderson@linaro.org, Hanna Reitz , Eric Blake , Vladimir Sementsov-Ogievskiy , qemu-block@nongnu.org Subject: Re: [GIT PULL 21/50] qemu-io: propagate errors through Error API instead of printf Message-ID: References: <20260829-nohmp-v1-0-4dcc2b4b0055@redhat.com> <20260829-nohmp-v1-21-4dcc2b4b0055@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260829-nohmp-v1-21-4dcc2b4b0055@redhat.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 Received-SPF: pass client-ip=170.10.133.124; envelope-from=kwolf@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.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_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Am 28.08.2026 um 22:42 hat Marc-André Lureau geschrieben: > Convert the qemu-io command infrastructure to use QEMU's Error API > (Error **errp) for error propagation instead of printing directly to > stdout/stderr via printf/fprintf. > > The cfunc_t typedef, all ~35 command functions, the dispatcher chain > (command/init_check_command/qemuio_command), and helper functions > (parse_pattern, create_iovec, qemu_io_alloc_from_file) all gain an > Error **errp parameter. Async completion callbacks (aio_read_done, > aio_write_done, aio_discard_done) use error_report() since they have > no Error path back to the caller. > > Update tests: > - error_report_err() prepends qemu-io: prefix > - copy-before-write: check the HMP return value, rather than stdio > - other tests: update to check JSON {"return": "Error: error text"} > > Reviewed-by: Philippe Mathieu-Daudé > Reviewed-by: Daniel P. Berrangé > Signed-off-by: Marc-André Lureau > Message-ID: <20260828-qemu-no-hmp-v5-21-9227de146347@redhat.com> This was not a great change, it results in a mess for qemu-io output. When used from HMP, success output still ends up on stdout, but (some) errors go to the monitor instead now. Some commands may even get their output split across both stdout and the monitor. The old experience wasn't great (everything should have gone to the monitor instead of having everything in the terminal), but the new one is terrible. Please fix the inconsistency or revert. > diff --git a/tests/qemu-iotests/004.out b/tests/qemu-iotests/004.out > index fb8593289f51..37da6024809f 100644 > --- a/tests/qemu-iotests/004.out > +++ b/tests/qemu-iotests/004.out > @@ -6,36 +6,36 @@ wrote 1048576/1048576 bytes at offset 133169152 > 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > > write into image boundary > -write failed: Input/output error > +qemu-io: write failed: Input/output error > [...] Instead changing the output of all test outputs to include an unnecessary and inconsistently applied "qemu-io" prefix, it would have been better to disable the prefix after command line parsing. qemu-io is still primarily an interactive program, and constantly printing the name of the program you're interacting with has little value. Kevin