From patchwork Tue May 28 15:37:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 246908 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CA0E82C02A7 for ; Wed, 29 May 2013 01:38:06 +1000 (EST) Received: from localhost ([::1]:42012 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhLyO-0000MN-VR for incoming@patchwork.ozlabs.org; Tue, 28 May 2013 11:38:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhLxk-0008V3-VW for qemu-devel@nongnu.org; Tue, 28 May 2013 11:37:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UhLxe-0001mw-UM for qemu-devel@nongnu.org; Tue, 28 May 2013 11:37:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UhLxe-0001mo-J4 for qemu-devel@nongnu.org; Tue, 28 May 2013 11:37:18 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r4SFbHWA017762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 28 May 2013 11:37:18 -0400 Received: from dhcp-200-207.str.redhat.com (dhcp-192-246.str.redhat.com [10.33.192.246]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r4SFbFm1029753; Tue, 28 May 2013 11:37:16 -0400 Date: Tue, 28 May 2013 17:37:14 +0200 From: Kevin Wolf To: qemu-devel@nongnu.org Message-ID: <20130528153714.GF5642@dhcp-200-207.str.redhat.com> References: <1369754856-30036-1-git-send-email-kwolf@redhat.com> <1369754856-30036-6-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1369754856-30036-6-git-send-email-kwolf@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: pbonzini@redhat.com, stefanha@redhat.com, lcapitulino@redhat.com Subject: Re: [Qemu-devel] [PATCH 05/16] qemu-io: Don't use global bs in command implementations X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Am 28.05.2013 um 17:27 hat Kevin Wolf geschrieben: > Pass in the BlockDriverState to the command handlers instead of using > the global variable. This is an important step to make the commands > usable outside of qemu-io. > > Signed-off-by: Kevin Wolf > @@ -1793,7 +1808,7 @@ static const cmdinfo_t abort_cmd = { > .oneline = "simulate a program crash using abort(3)", > }; > > -static int close_f(int argc, char **argv) > +static int close_f(BlockDriverState *bs, int argc, char **argv) > { > bdrv_delete(bs); > bs = NULL; Here I missed the following hunk that I've applied locally now: Reviewed-by: Eric Blake --- a/qemu-io.c +++ b/qemu-io.c @@ -1811,7 +1811,7 @@ static const cmdinfo_t abort_cmd = { static int close_f(BlockDriverState *bs, int argc, char **argv) { bdrv_delete(bs); - bs = NULL; + qemuio_bs = NULL; return 0; }