From patchwork Mon Oct 7 11:28:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 281075 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 D1ABF2C00A7 for ; Mon, 7 Oct 2013 22:31:00 +1100 (EST) Received: from localhost ([::1]:58785 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT91b-0006hz-TP for incoming@patchwork.ozlabs.org; Mon, 07 Oct 2013 07:30:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT8za-000426-In for qemu-devel@nongnu.org; Mon, 07 Oct 2013 07:28:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VT8zU-0003J7-Ij for qemu-devel@nongnu.org; Mon, 07 Oct 2013 07:28:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT8zU-0003J1-Al for qemu-devel@nongnu.org; Mon, 07 Oct 2013 07:28:44 -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.14.4/8.14.4) with ESMTP id r97BShYt026924 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Oct 2013 07:28:43 -0400 Received: from localhost (ovpn-112-38.ams2.redhat.com [10.36.112.38]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r97BSfim017560; Mon, 7 Oct 2013 07:28:42 -0400 From: Stefan Hajnoczi To: Date: Mon, 7 Oct 2013 13:28:05 +0200 Message-Id: <1381145289-6591-5-git-send-email-stefanha@redhat.com> In-Reply-To: <1381145289-6591-1-git-send-email-stefanha@redhat.com> References: <1381145289-6591-1-git-send-email-stefanha@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: Jeff Cody , Stefan Hajnoczi , Anthony Liguori Subject: [Qemu-devel] [PULL 4/8] 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 From: Jeff Cody This blocks migration for VHDX image files, until the functionality can be supported. Signed-off-by: Jeff Cody Signed-off-by: Stefan Hajnoczi --- 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 = {