From patchwork Thu May 19 15:22:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 9127933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7057C60221 for ; Thu, 19 May 2016 16:06:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64144208C2 for ; Thu, 19 May 2016 16:06:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59301281CE; Thu, 19 May 2016 16:06:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D9FF208C2 for ; Thu, 19 May 2016 16:06:25 +0000 (UTC) Received: from localhost ([::1]:51190 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3QSu-0003gB-3U for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 May 2016 12:06:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41766) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Pms-0005cp-9Z for qemu-devel@nongnu.org; Thu, 19 May 2016 11:23:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3Pmm-0000Uo-6y for qemu-devel@nongnu.org; Thu, 19 May 2016 11:22:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3Pme-0000NC-Hi; Thu, 19 May 2016 11:22:44 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1EB08C09725F; Thu, 19 May 2016 15:22:44 +0000 (UTC) Received: from noname.str.redhat.com. (dhcp-192-197.str.redhat.com [10.33.192.197]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4JFMEBI025145; Thu, 19 May 2016 11:22:43 -0400 From: Kevin Wolf To: qemu-block@nongnu.org Date: Thu, 19 May 2016 17:22:07 +0200 Message-Id: <1463671329-22655-30-git-send-email-kwolf@redhat.com> In-Reply-To: <1463671329-22655-1-git-send-email-kwolf@redhat.com> References: <1463671329-22655-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 19 May 2016 15:22:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 29/31] qemu-io: Fix recent UI updates X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Blake Commit 770e0e0e [*] tried to add 'writev -f', but didn't tweak the getopt() call to actually let it work. Likewise, commit c2e001c missed implementing 'aio_write -u -z'. The latter commit also introduced a leak of ctx. [*] does it sound "ech0e" in here? :) Signed-off-by: Eric Blake Message-id: 1463416983-28318-2-git-send-email-eblake@redhat.com Signed-off-by: Max Reitz --- qemu-io-cmds.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 22f2ecf..b5dbc67 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -1107,7 +1107,7 @@ static int writev_f(BlockBackend *blk, int argc, char **argv) int pattern = 0xcd; QEMUIOVector qiov; - while ((c = getopt(argc, argv, "CqP:")) != -1) { + while ((c = getopt(argc, argv, "CfqP:")) != -1) { switch (c) { case 'C': Cflag = true; @@ -1393,7 +1393,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv) int flags = 0; ctx->blk = blk; - while ((c = getopt(argc, argv, "CfqP:z")) != -1) { + while ((c = getopt(argc, argv, "CfqP:uz")) != -1) { switch (c) { case 'C': ctx->Cflag = true; @@ -1436,6 +1436,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv) if ((flags & BDRV_REQ_MAY_UNMAP) && !ctx->zflag) { printf("-u requires -z to be specified\n"); + g_free(ctx); return 0; }