From patchwork Thu Dec 13 15:10:36 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 206133 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 488402C007B for ; Fri, 14 Dec 2012 02:45:38 +1100 (EST) Received: from localhost ([::1]:58806 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjAye-00086Y-Hk for incoming@patchwork.ozlabs.org; Thu, 13 Dec 2012 10:45:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjASQ-0001K7-7M for qemu-devel@nongnu.org; Thu, 13 Dec 2012 10:12:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TjARZ-00061N-Cg for qemu-devel@nongnu.org; Thu, 13 Dec 2012 10:12:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TjARZ-000617-20 for qemu-devel@nongnu.org; Thu, 13 Dec 2012 10:11:25 -0500 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.14.4/8.14.4) with ESMTP id qBDFBOLK001954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Dec 2012 10:11:24 -0500 Received: from dhcp-5-188.str.redhat.com (dhcp-200-232.str.redhat.com [10.33.200.232]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qBDFApmi026810; Thu, 13 Dec 2012 10:11:23 -0500 From: Kevin Wolf To: anthony@codemonkey.ws Date: Thu, 13 Dec 2012 16:10:36 +0100 Message-Id: <1355411450-12761-30-git-send-email-kwolf@redhat.com> In-Reply-To: <1355411450-12761-1-git-send-email-kwolf@redhat.com> References: <1355411450-12761-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 29/43] blkdebug: Allow usage without config file 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 As soon as new rules can be set during runtime, as introduced by the next patch, blkdebug makes sense even without a config file. Signed-off-by: Kevin Wolf --- block/blkdebug.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index d61ece8..c9041ec 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -240,6 +240,11 @@ static int read_config(BDRVBlkdebugState *s, const char *filename) int ret; struct add_rule_data d; + /* Allow usage without config file */ + if (!*filename) { + return 0; + } + f = fopen(filename, "r"); if (f == NULL) { return -errno;