From nobody Thu May 2 23:34:51 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641761987287585.3576366755008; Sun, 9 Jan 2022 12:59:47 -0800 (PST) Received: from localhost ([::1]:56642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6fI2-0007cx-As for importer@patchew.org; Sun, 09 Jan 2022 15:59:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6fGH-0004xa-VE for qemu-devel@nongnu.org; Sun, 09 Jan 2022 15:58:03 -0500 Received: from [2a00:1450:4864:20::129] (port=41747 helo=mail-lf1-x129.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n6fGF-0004MF-8i for qemu-devel@nongnu.org; Sun, 09 Jan 2022 15:57:56 -0500 Received: by mail-lf1-x129.google.com with SMTP id x7so37392244lfu.8 for ; Sun, 09 Jan 2022 12:57:52 -0800 (PST) Received: from ubuntu-focal.. ([2a01:4f9:3a:1e26::2]) by smtp.gmail.com with ESMTPSA id s10sm763544lfr.45.2022.01.09.12.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jan 2022 12:57:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=I/sIwKo4ZoCICzz9LmlojMKy+Zj7qObGKmjZwg+cuTI=; b=ERfbKRC4HnXsXHEqe9GRxml+O2VpLKuoif/gKrvlolBCaMxhBZrFCp7elm+At0VrvA GUqJR3C1b/DPeKhHHE4oabpnUpPS33sOjD7IvteXwD+8aRVmYEQmgsA10oNbU7qwRx/q mHbRDVip1+cvo2YPCU9emzGSw79raxWrzE4R9yhB3tgPlP4AZC+z0oBGtHhiM0+UAr5L UDDOut2s+ki/KxGubTII1lhnbIdUo1VIMNxhs4FYQRQfxKytGcNtpii805Pvr/6m3rRu 5Ya2WXPZwFG4FpdHymVmQ5Bliff06jo0KIvrZo4JWR0r08PuqhY4Ac+xfepuu5n4ar1p /heQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=I/sIwKo4ZoCICzz9LmlojMKy+Zj7qObGKmjZwg+cuTI=; b=cN/dvhGEP2mnNVFGJpfHT5kUytIFcoX5KHq2PEtxyTM9/tMOhWPU1JSPuenPketxg+ hawJndjnF3R52n7VAcgEnrM5wRyCt0VXoW01hxYaEHajI4BVZd5npCPKoQjjmPJzxWY6 nfp/rxYsVok+XM4l+IDuLxRck2ONunFJXHRRDEbEK3sp2zWTYdf8TYKRV5VDXClEcT0O eGeRpb8dgjW1ghkv4Mc1ci4Ra+OP2lXlqQoSaiNGg7u2x11WgVduK8dkBpOoAv/19UPz zRiBumUN3KeIbfocB1X09qSfbmykPjllyyymKbSUwsu7smwU6HAEuwXNeuUncKSrMNPi URlQ== X-Gm-Message-State: AOAM531aM4aSTuT0P05sgWlJvnI+UNVPOCHU0AJM/a8+URFWV9UfvoC6 6uKa6Aj4gGu9graRV8LdpsJo8aQIayB53Ff8 X-Google-Smtp-Source: ABdhPJwLiPOWaQI/Kp6gyG+QSNkYJXDXVwwAvIRc6AzBP6cFZfufOYP4DLX0uGXA9zoVvpNTp3MFuw== X-Received: by 2002:a05:6512:472:: with SMTP id x18mr60266061lfd.566.1641761871269; Sun, 09 Jan 2022 12:57:51 -0800 (PST) From: Philipp Tomsich To: qemu-devel@nongnu.org Subject: [PATCH] net/dump.c: Suppress spurious compiler warning Date: Sun, 9 Jan 2022 21:57:48 +0100 Message-Id: <20220109205748.4127032-1-philipp.tomsich@vrull.eu> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::129 (failed) 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=2a00:1450:4864:20::129; envelope-from=philipp.tomsich@vrull.eu; helo=mail-lf1-x129.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Cc: Jason Wang , Philipp Tomsich Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1641761989555100001 Compiling with gcc version 11.2.0 (Ubuntu 11.2.0-13ubuntu1) results in a (spurious) warning: In function =E2=80=98dump_receive_iov=E2=80=99, inlined from =E2=80=98filter_dump_receive_iov=E2=80=99 at ../net/dump= .c:157:5: ../net/dump.c:89:9: error: =E2=80=98writev=E2=80=99 specified size 184467= 44073709551600 exceeds maximum object size 9223372036854775807 [-Werror=3Ds= tringop-overflow=3D] 89 | if (writev(s->fd, dumpiov, cnt + 1) !=3D sizeof(hdr) + caplen= ) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/ptomsich/qemu/include/qemu/osdep.h:108, from ../net/dump.c:25: ../net/dump.c: In function =E2=80=98filter_dump_receive_iov=E2=80=99: /usr/include/x86_64-linux-gnu/sys/uio.h:52:16: note: in a call to functio= n =E2=80=98writev=E2=80=99 declared with attribute =E2=80=98read_only (2, 3= )=E2=80=99 52 | extern ssize_t writev (int __fd, const struct iovec *__iovec, int= __count) | ^~~~~~ cc1: all warnings being treated as errors This change helps that version of GCC to understand what is going on and suppresses this warning. Signed-off-by: Philipp Tomsich Reviewed-by: Eric Blake --- net/dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dump.c b/net/dump.c index a07ba62401..c32d3bf4e6 100644 --- a/net/dump.c +++ b/net/dump.c @@ -86,7 +86,7 @@ static ssize_t dump_receive_iov(DumpState *s, const struc= t iovec *iov, int cnt) dumpiov[0].iov_len =3D sizeof(hdr); cnt =3D iov_copy(&dumpiov[1], cnt, iov, cnt, 0, caplen); =20 - if (writev(s->fd, dumpiov, cnt + 1) !=3D sizeof(hdr) + caplen) { + if (writev(s->fd, &dumpiov[0], cnt + 1) !=3D sizeof(hdr) + caplen) { error_report("network dump write error - stopping dump"); close(s->fd); s->fd =3D -1; --=20 2.33.1