Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2217157/?format=api
{ "id": 2217157, "url": "http://patchwork.ozlabs.org/api/patches/2217157/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260327180905.378560-3-kkostiuk@redhat.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "name": "QEMU Development", "link_name": "qemu-devel", "list_id": "qemu-devel.nongnu.org", "list_email": "qemu-devel@nongnu.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260327180905.378560-3-kkostiuk@redhat.com>", "list_archive_url": null, "date": "2026-03-27T18:09:04", "name": "[PULL,2/3] scripts/qemu-guest-agent/fsfreeze-hook: Avoid use of PIPESTATUS", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "cfdfa509826f0c9b10b7962f10e9ffeda8c24b32", "submitter": { "id": 83198, "url": "http://patchwork.ozlabs.org/api/people/83198/?format=api", "name": "Kostiantyn Kostiuk", "email": "kkostiuk@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260327180905.378560-3-kkostiuk@redhat.com/mbox/", "series": [ { "id": 497816, "url": "http://patchwork.ozlabs.org/api/series/497816/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=497816", "date": "2026-03-27T18:09:03", "name": "[PULL,1/3] scripts/qemu-guest-agent/fsfreeze-hook: Avoid bash-isms", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497816/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2217157/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2217157/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=BCFw5Vc3;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fj7wl6F82z1y1P\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 05:10:31 +1100 (AEDT)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w6Bct-0003zC-HD; Fri, 27 Mar 2026 14:09:47 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <kkostiuk@redhat.com>)\n id 1w6Bcb-0003x6-53\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 14:09:30 -0400", "from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <kkostiuk@redhat.com>)\n id 1w6BcY-0002SW-OS\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 14:09:24 -0400", "from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-488-zWMIcIRRMXSIz7lwFpzZsw-1; Fri,\n 27 Mar 2026 14:09:14 -0400", "from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 1ACD81800345; Fri, 27 Mar 2026 18:09:13 +0000 (UTC)", "from srv1.redhat.com (unknown [10.44.32.150])\n by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id E8FFE1800763; Fri, 27 Mar 2026 18:09:11 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1774634959;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=sr+/JG3n/S4Z1brMvv8Rm72w4ChyR/gR5Pw29+Ls2ss=;\n b=BCFw5Vc3S6XxiNXNia+5ENkKi9Z5a91KJPBirAyG36qmmfSMutFupDURdA+TYow8KBOEmX\n dgBXHPU4PdamqzYFWxmxgTetgvpImoNtpz5Ve5XWBYxQxs4FznWOR+A7nxHavod0PTCHtp\n 1LttW/dR/MqLOoI2uuagevrl9Vi5oII=", "X-MC-Unique": "zWMIcIRRMXSIz7lwFpzZsw-1", "X-Mimecast-MFC-AGG-ID": "zWMIcIRRMXSIz7lwFpzZsw_1774634953", "From": "Kostiantyn Kostiuk <kkostiuk@redhat.com>", "To": "qemu-devel@nongnu.org,\n\tPeter Maydell <peter.maydell@linaro.org>", "Cc": "qemu-stable@nongnu.org", "Subject": "[PULL 2/3] scripts/qemu-guest-agent/fsfreeze-hook: Avoid use of\n PIPESTATUS", "Date": "Fri, 27 Mar 2026 20:09:04 +0200", "Message-ID": "<20260327180905.378560-3-kkostiuk@redhat.com>", "In-Reply-To": "<20260327180905.378560-1-kkostiuk@redhat.com>", "References": "<20260327180905.378560-1-kkostiuk@redhat.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.93", "Received-SPF": "pass client-ip=170.10.133.124;\n envelope-from=kkostiuk@redhat.com;\n 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,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-0.001,\n 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.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://lists.nongnu.org/archive/html/qemu-devel>", "List-Post": "<mailto:qemu-devel@nongnu.org>", "List-Help": "<mailto:qemu-devel-request@nongnu.org?subject=help>", "List-Subscribe": "<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "From: Peter Maydell <peter.maydell@linaro.org>\n\nPIPESTATUS is a bash-specific construct, and this script is supposed\nto be POSIX shell. We only use it in one place, to capture the exit\nstatus of a command whose output we are piping to 'logger'.\n\nReplace the PIPESTATUS usage with the trick described in\nhttps://unix.stackexchange.com/questions/14270/get-exit-status-of-process-thats-piped-to-another/70675#70675\nwhich uses a command-group to capture the status of the\nfirst process in the pipeline.\n\nCc: qemu-stable@nongnu.org\nFixes: 85978dfb6b1c133 (\"qemu-ga: Optimize freeze-hook script logic of logging error\")\nResolves: https://gitlab.com/qemu-project/qemu/-/work_items/3339\nSigned-off-by: Peter Maydell <peter.maydell@linaro.org>\nReviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>\nLink: https://lore.kernel.org/qemu-devel/20260317094806.1944053-3-peter.maydell@linaro.org\nSigned-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>\n---\n scripts/qemu-guest-agent/fsfreeze-hook | 19 +++++++++++++++++--\n 1 file changed, 17 insertions(+), 2 deletions(-)", "diff": "diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook\nindex 6e2d7588af..21eb5c5145 100755\n--- a/scripts/qemu-guest-agent/fsfreeze-hook\n+++ b/scripts/qemu-guest-agent/fsfreeze-hook\n@@ -47,8 +47,23 @@ for file in \"$FSFREEZE_D\"/* ; do\n \"$file\" \"$@\" >>\"$LOGFILE\" 2>&1\n STATUS=$?\n else\n- \"$file\" \"$@\" 2>&1 | logger -t qemu-ga-freeze-hook\n- STATUS=${PIPESTATUS[0]}\n+ # We want to pipe the output of $file through 'logger' and also\n+ # capture its exit status. Since we are a POSIX script we can't\n+ # use PIPESTATUS, so instead this is a trick borrowed from\n+ # https://unix.stackexchange.com/questions/14270/get-exit-status-of-process-thats-piped-to-another/70675#70675\n+ # which uses command-groups and redirection to get the exit status.\n+ # This is equivalent to\n+ # \"$file\" \"$@\" 2>&1 | logger -t qemu-ga-freeze-hook\n+ # plus setting the exit status of the pipe to the exit\n+ # status of the first command rather than the last one.\n+ { { { {\n+ \"$file\" \"$@\" 2>&1 3>&- 4>&-\n+ echo $? >&3\n+ } | logger -t qemu-ga-freeze-hook >&4\n+ } 3>&1\n+ } | { read -r xs ; exit \"$xs\"; }\n+ } 4>&1\n+ STATUS=$?\n fi\n \n if [ \"$STATUS\" -ne 0 ]; then\n", "prefixes": [ "PULL", "2/3" ] }