From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37663 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OUHgJ-0003oN-GB for qemu-devel@nongnu.org; Thu, 01 Jul 2010 07:11:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OUHgI-0007So-5s for qemu-devel@nongnu.org; Thu, 01 Jul 2010 07:11:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31160) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OUHgH-0007Sc-UQ for qemu-devel@nongnu.org; Thu, 01 Jul 2010 07:11:46 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o61BBj93012084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 1 Jul 2010 07:11:45 -0400 From: Kevin Wolf Date: Thu, 1 Jul 2010 13:11:34 +0200 Message-Id: <1277982694-28563-5-git-send-email-kwolf@redhat.com> In-Reply-To: <1277982694-28563-1-git-send-email-kwolf@redhat.com> References: <1277982694-28563-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH v2 4/4] blkdebug: Initialize state as 1 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com 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 78cbff4..2a63df9 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -301,6 +301,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) { -- 1.6.6.1