From patchwork Tue Aug 27 08:08:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Wolf X-Patchwork-Id: 270056 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 5872F2C00A6 for ; Tue, 27 Aug 2013 18:08:59 +1000 (EST) Received: from localhost ([::1]:54716 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEEKM-0004FT-B5 for incoming@patchwork.ozlabs.org; Tue, 27 Aug 2013 04:08:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEEJp-00044J-Mn for qemu-devel@nongnu.org; Tue, 27 Aug 2013 04:08:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEEJj-000883-Mx for qemu-devel@nongnu.org; Tue, 27 Aug 2013 04:08:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEEJj-00086Y-FZ for qemu-devel@nongnu.org; Tue, 27 Aug 2013 04:07:59 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7R87wGw014940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 27 Aug 2013 04:07:58 -0400 Received: from dhcp-200-207.str.redhat.com (dhcp-192-197.str.redhat.com [10.33.192.197]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r7R87utV003591; Tue, 27 Aug 2013 04:07:57 -0400 From: Kevin Wolf To: qemu-devel@nongnu.org Date: Tue, 27 Aug 2013 10:08:05 +0200 Message-Id: <1377590885-27630-1-git-send-email-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, jtomko@redhat.com, stefanha@redhat.com Subject: [Qemu-devel] [PATCH v2] qcow2: Change default for new images to compat=1.1 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 By the time that qemu 1.7 will be released, enough time will have passed since qemu 1.1, which is the first version to understand version 3 images, that changing the default shouldn't hurt many people any more and the benefits of using the new format outweigh the pain. qemu-iotests already runs with compat=1.1 by default. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/qcow2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 3376901..6ab3341 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1402,7 +1402,7 @@ static int qcow2_create(const char *filename, QEMUOptionParameter *options) int flags = 0; size_t cluster_size = DEFAULT_CLUSTER_SIZE; int prealloc = 0; - int version = 2; + int version = 3; /* Read out options */ while (options && options->name) { @@ -1429,7 +1429,9 @@ static int qcow2_create(const char *filename, QEMUOptionParameter *options) return -EINVAL; } } else if (!strcmp(options->name, BLOCK_OPT_COMPAT_LEVEL)) { - if (!options->value.s || !strcmp(options->value.s, "0.10")) { + if (!options->value.s) { + /* keep the default */ + } else if (!strcmp(options->value.s, "0.10")) { version = 2; } else if (!strcmp(options->value.s, "1.1")) { version = 3;