get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2217158/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2217158,
    "url": "http://patchwork.ozlabs.org/api/patches/2217158/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260327180905.378560-4-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-4-kkostiuk@redhat.com>",
    "list_archive_url": null,
    "date": "2026-03-27T18:09:05",
    "name": "[PULL,3/3] scripts/qemu-guest-agent/fsfreeze-hook: Fix syslog-fallback logic",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c850c07eb3808f991e8e5d46efb34a8e86f75b09",
    "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-4-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/2217158/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217158/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=VLQUKjyE;\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 4fj7xN1tGsz1y1P\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 05:11:04 +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-0003zD-Gs; 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-0003x7-65\n for qemu-devel@nongnu.org; Fri, 27 Mar 2026 14:09:29 -0400",
            "from us-smtp-delivery-124.mimecast.com ([170.10.129.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-0002SS-Ie\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-503-TmqwS21QPmaQ67-GF_w7FQ-1; Fri,\n 27 Mar 2026 14:09:16 -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 DD925180034E; Fri, 27 Mar 2026 18:09:14 +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 86B161800761; Fri, 27 Mar 2026 18:09:13 +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:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=fIAaJAjcvFaLvDqLLXrGMVTN6RSpPKshiiUuUkR1Gcs=;\n b=VLQUKjyEmcP6zrX6i9g95jI7o/zwEBpEuieyxU3nz3rdV3KNv6qzfflNYOo5Cd6NMf9cqg\n of+GmEm/EUkV7+ygf1/wLQkvhqnhuWgJjOXfD7xFwoDgnRMaOkFLQwsg7Px+4VpvKuNohF\n u3NQyKONszxnPS7WRT1gqFCfaHbUMbA=",
        "X-MC-Unique": "TmqwS21QPmaQ67-GF_w7FQ-1",
        "X-Mimecast-MFC-AGG-ID": "TmqwS21QPmaQ67-GF_w7FQ_1774634955",
        "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 3/3] scripts/qemu-guest-agent/fsfreeze-hook: Fix\n syslog-fallback logic",
        "Date": "Fri, 27 Mar 2026 20:09:05 +0200",
        "Message-ID": "<20260327180905.378560-4-kkostiuk@redhat.com>",
        "In-Reply-To": "<20260327180905.378560-1-kkostiuk@redhat.com>",
        "References": "<20260327180905.378560-1-kkostiuk@redhat.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.93",
        "Received-SPF": "pass client-ip=170.10.129.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, 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 <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\nIn the fsfreeze script we attempt to implement \"log to a file if we\ncan, and fall back to syslog if we cannot\".  We do this with:\n\n  [ ! -w \"$LOGFILE\" ] && USE_SYSLOG=1\n  touch \"$LOGFILE\" >/dev/null 2>&1 || USE_SYSLOG=1\n\nThis has a weird behaviour if it is run in a setup where we have\npermissions that would allow us to write to $LOGFILE but it does not\ncurrently exist.  On the first execution, the '-w' fails and so we\nset USE_SYSLOG=1.  But since we also do the \"touch $LOGFILE\" step we\ncreate an empty logfile.  Then on the second time the script is\nexecuted, we see a writeable logfile and will use it.  The effect is\n\"log to syslog once, then to the logfile thereafter\", which is not\nlikely to be what anybody wants.\n\nUpdate the condition of the first check to only pick syslog if\nthe logfile exists but is not writable. This means that:\n * if the logfile doesn't exist but we are able to create it,\n   we will create it and use it\n * if the logfile already exists and we can write to it,\n   we will use it\n * if the logfile already exists but we can't write to it,\n   we will fall back to syslog\n * if the logfile doesn't exist and we can't create it,\n   we will fall back to syslog\n\nCc: qemu-stable@nongnu.org\nFixes: 85978dfb6b1c133 (\"qemu-ga: Optimize freeze-hook script logic of logging error\")\nSigned-off-by: Peter Maydell <peter.maydell@linaro.org>\nReviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>\nReviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>\nLink: https://lore.kernel.org/qemu-devel/20260317094806.1944053-4-peter.maydell@linaro.org\nSigned-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>\n---\n scripts/qemu-guest-agent/fsfreeze-hook | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook\nindex 21eb5c5145..76669f5caf 100755\n--- a/scripts/qemu-guest-agent/fsfreeze-hook\n+++ b/scripts/qemu-guest-agent/fsfreeze-hook\n@@ -21,8 +21,8 @@ is_ignored_file() {\n }\n \n USE_SYSLOG=0\n-# if log file is not writable, fallback to syslog\n-[ ! -w \"$LOGFILE\" ] && USE_SYSLOG=1\n+# if log file exists but is not writable, fallback to syslog\n+[ -e \"$LOGFILE\" ] && [ ! -w \"$LOGFILE\" ] && USE_SYSLOG=1\n # try to update log file and fallback to syslog if it fails\n touch \"$LOGFILE\" >/dev/null 2>&1 || USE_SYSLOG=1\n \n",
    "prefixes": [
        "PULL",
        "3/3"
    ]
}