From patchwork Tue Jul 6 12:08:45 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 58011 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 B9D1E1007D3 for ; Tue, 6 Jul 2010 22:40:34 +1000 (EST) Received: from localhost ([127.0.0.1]:46708 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OW7Rv-00078W-JZ for incoming@patchwork.ozlabs.org; Tue, 06 Jul 2010 08:40:31 -0400 Received: from [140.186.70.92] (port=56656 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OW7BQ-0003Vc-N4 for qemu-devel@nongnu.org; Tue, 06 Jul 2010 08:23:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OW6xQ-0003Hx-3b for qemu-devel@nongnu.org; Tue, 06 Jul 2010 08:09:01 -0400 Received: from oxygen.pond.sub.org ([213.239.205.148]:38894) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OW6xP-0003Gx-UJ for qemu-devel@nongnu.org; Tue, 06 Jul 2010 08:09:00 -0400 Received: from blackfin.pond.sub.org (pD9E3954B.dip.t-dialin.net [217.227.149.75]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 00E892DD3C1; Tue, 6 Jul 2010 14:08:56 +0200 (CEST) Received: by blackfin.pond.sub.org (Postfix, from userid 500) id 5336686; Tue, 6 Jul 2010 14:08:56 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 6 Jul 2010 14:08:45 +0200 Message-Id: <1278418136-24556-3-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1278418136-24556-1-git-send-email-armbru@redhat.com> References: <1278418136-24556-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: kwolf@redhat.com, kraxel@redhat.com, hch@lst.de Subject: [Qemu-devel] [PATCH v2 02/13] block migration: Fix test for read-only drive 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 init_blk_migration_it() skips drives with type hint BDRV_TYPE_CDROM. The intention is to skip read-only drives. However, BDRV_TYPE_CDROM is only a hint. It is currently sufficent for read-only. But it's not necessary, and it may not remain sufficient. Use bdrv_is_read_only() instead. Signed-off-by: Markus Armbruster Reviewed-by: Christoph Hellwig --- block-migration.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block-migration.c b/block-migration.c index 7d04d6d..7337349 100644 --- a/block-migration.c +++ b/block-migration.c @@ -236,7 +236,7 @@ static void init_blk_migration_it(void *opaque, BlockDriverState *bs) BlkMigDevState *bmds; int64_t sectors; - if (bs->type == BDRV_TYPE_HD) { + if (!bdrv_is_read_only(bs)) { sectors = bdrv_getlength(bs) >> BDRV_SECTOR_BITS; if (sectors == 0) { return;