From patchwork Tue Oct 1 15:59:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Cody X-Patchwork-Id: 279492 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CF1082C00AA for ; Wed, 2 Oct 2013 01:59:53 +1000 (EST) Received: from localhost ([::1]:59665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR2MZ-0007n3-RA for incoming@patchwork.ozlabs.org; Tue, 01 Oct 2013 11:59:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39463) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR2MF-0007mv-Gg for qemu-devel@nongnu.org; Tue, 01 Oct 2013 11:59:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VR2M7-0005mb-VL for qemu-devel@nongnu.org; Tue, 01 Oct 2013 11:59:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4298) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VR2M7-0005mQ-Mi for qemu-devel@nongnu.org; Tue, 01 Oct 2013 11:59:23 -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 r91FxMa8001574 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 1 Oct 2013 11:59:22 -0400 Received: from localhost (ovpn-112-36.phx2.redhat.com [10.3.112.36]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r91FxKfM030241 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 1 Oct 2013 11:59:22 -0400 From: Jeff Cody To: qemu-devel@nongnu.org Date: Tue, 1 Oct 2013 11:59:20 -0400 Message-Id: <29665682371164fd1e375842f5824b1de5648dde.1380643069.git.jcody@redhat.com> 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: kwolf@redhat.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH] block: vhdx - add migration blocker 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 This blocks migration for VHDX image files, until the functionality can be supported. Signed-off-by: Jeff Cody --- block/vhdx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/block/vhdx.c b/block/vhdx.c index b8aa49c..6cb0412 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -20,6 +20,7 @@ #include "qemu/module.h" #include "qemu/crc32c.h" #include "block/vhdx.h" +#include "migration/migration.h" /* Several metadata and region table data entries are identified by @@ -159,6 +160,7 @@ typedef struct BDRVVHDXState { VHDXParentLocatorHeader parent_header; VHDXParentLocatorEntry *parent_entries; + Error *migration_blocker; } BDRVVHDXState; uint32_t vhdx_checksum_calc(uint32_t crc, uint8_t *buf, size_t size, @@ -806,6 +808,12 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags, /* TODO: differencing files, write */ + /* Disable migration when VHDX images are used */ + error_set(&s->migration_blocker, + QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED, + "vhdx", bs->device_name, "live migration"); + migrate_add_blocker(s->migration_blocker); + return 0; fail: qemu_vfree(s->headers[0]); @@ -952,6 +960,8 @@ static void vhdx_close(BlockDriverState *bs) qemu_vfree(s->headers[1]); qemu_vfree(s->bat); qemu_vfree(s->parent_entries); + migrate_del_blocker(s->migration_blocker); + error_free(s->migration_blocker); } static BlockDriver bdrv_vhdx = {