From patchwork Wed Jun 30 15:48:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 57428 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 45D30B6F06 for ; Thu, 1 Jul 2010 01:56:03 +1000 (EST) Received: from localhost ([127.0.0.1]:34546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTzdl-0003k3-IT for incoming@patchwork.ozlabs.org; Wed, 30 Jun 2010 11:55:57 -0400 Received: from [140.186.70.92] (port=47202 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTzWv-0007vA-RL for qemu-devel@nongnu.org; Wed, 30 Jun 2010 11:48:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTzWp-0001Iv-Tf for qemu-devel@nongnu.org; Wed, 30 Jun 2010 11:48:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17228) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTzWp-0001Ip-Lk for qemu-devel@nongnu.org; Wed, 30 Jun 2010 11:48:47 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5UFmkI4009335 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 30 Jun 2010 11:48:47 -0400 Received: from localhost.localdomain (dhcp-5-217.str.redhat.com [10.32.5.217]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5UFmevT019511; Wed, 30 Jun 2010 11:48:45 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Wed, 30 Jun 2010 17:48:34 +0200 Message-Id: <1277912914-21771-4-git-send-email-kwolf@redhat.com> In-Reply-To: <1277912914-21771-1-git-send-email-kwolf@redhat.com> References: <1277912914-21771-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: kwolf@redhat.com Subject: [Qemu-devel] [PATCH 3/3] blkdebug: Initialize state as 1 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org state = 0 in rules means that the rule is valid for any state. Therefore it's impossible to have a rule that works only in the initial state. This changes the initial state from 0 to 1 to make this possible. Signed-off-by: Kevin Wolf --- block/blkdebug.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index b084782..99340db 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -306,6 +306,9 @@ static int blkdebug_open(BlockDriverState *bs, const char *filename, int flags) } filename = c + 1; + /* Set initial state */ + s->vars.state = 1; + /* Open the backing file */ ret = bdrv_file_open(&bs->file, filename, flags); if (ret < 0) {