From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:56051) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVqsO-0007DX-FW for qemu-devel@nongnu.org; Wed, 30 Nov 2011 15:35:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVqsN-00039b-9Q for qemu-devel@nongnu.org; Wed, 30 Nov 2011 15:35:32 -0500 Received: from smtp25.services.sfr.fr ([93.17.128.119]:36384) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVqsN-00039V-2D for qemu-devel@nongnu.org; Wed, 30 Nov 2011 15:35:31 -0500 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 30 Nov 2011 21:35:37 +0100 Message-Id: <1322685338-3825-2-git-send-email-hpoussin@reactos.org> In-Reply-To: <1322685338-3825-1-git-send-email-hpoussin@reactos.org> References: <1322685338-3825-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 1/2] net: truncate output file when using dump backend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= This prevents data of a previous run to be seen in the new dump file. Reviewed-by: Stefan Hajnoczi Signed-off-by: Herv=C3=A9 Poussineau --- net/dump.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/dump.c b/net/dump.c index 0d0cbb2..8132411 100644 --- a/net/dump.c +++ b/net/dump.c @@ -106,7 +106,7 @@ static int net_dump_init(VLANState *vlan, const char = *device, DumpState *s; int fd; =20 - fd =3D open(filename, O_CREAT | O_WRONLY | O_BINARY, 0644); + fd =3D open(filename, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0644)= ; if (fd < 0) { error_report("-net dump: can't open %s", filename); return -1; --=20 1.7.6.3