From nobody Mon May 6 09:48:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521804756088219.8860852225713; Fri, 23 Mar 2018 04:32:36 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8FBBD356C1; Fri, 23 Mar 2018 11:32:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4F0CB16920; Fri, 23 Mar 2018 11:32:34 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AAABA1806104; Fri, 23 Mar 2018 11:32:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2NBWVUA022203 for ; Fri, 23 Mar 2018 07:32:31 -0400 Received: by smtp.corp.redhat.com (Postfix) id B45472023233; Fri, 23 Mar 2018 11:32:31 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3AE062023231; Fri, 23 Mar 2018 11:32:31 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 23 Mar 2018 12:32:29 +0100 Message-Id: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH RFC] storage: Remove 'cow' disk format X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 23 Mar 2018 11:32:35 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" There's no tests for this format and nothing seems to specifically care about this format. QEMU does not even recognize it. Remove it completely. Signed-off-by: Peter Krempa --- docs/schemas/storagecommon.rng | 1 - src/util/virstoragefile.c | 31 +------------------------------ src/util/virstoragefile.h | 3 +-- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng index edee1b0845..310ed758ff 100644 --- a/docs/schemas/storagecommon.rng +++ b/docs/schemas/storagecommon.rng @@ -78,7 +78,6 @@ we know how to follow backing chains, and all others --> - cow qcow qcow2 qed diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 67b9ec71ac..dd07f09d2c 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -67,7 +67,7 @@ VIR_ENUM_IMPL(virStorageFileFormat, /* Not direct file formats, but used for various drivers */ "fat", "vhd", "ploop", /* Formats with backing file below here */ - "cow", "qcow", "qcow2", "qed", "vmdk") + "qcow", "qcow2", "qed", "vmdk") VIR_ENUM_IMPL(virStorageFileFeature, VIR_STORAGE_FILE_FEATURE_LAST, @@ -170,8 +170,6 @@ struct FileTypeInfo { }; -static int cowGetBackingStore(char **, int *, - const char *, size_t); static int qcow1GetBackingStore(char **, int *, const char *, size_t); static int qcow2GetBackingStore(char **, int *, @@ -348,11 +346,6 @@ static struct FileTypeInfo const fileTypeInfo[] =3D { PLOOP_SIZE_MULTIPLIER, NULL, NULL, NULL }, /* All formats with a backing store probe below here */ - [VIR_STORAGE_FILE_COW] =3D { - 0, "OOOM", NULL, - LV_BIG_ENDIAN, 4, 4, {2}, - 4+4+1024+4, 8, 1, NULL, cowGetBackingStore, NULL - }, [VIR_STORAGE_FILE_QCOW] =3D { 0, "QFI", NULL, LV_BIG_ENDIAN, 4, 4, {1}, @@ -397,28 +390,6 @@ static const int qcow2CompatibleFeatureArray[] =3D { verify(ARRAY_CARDINALITY(qcow2CompatibleFeatureArray) =3D=3D QCOW2_COMPATIBLE_FEATURE_LAST); -static int -cowGetBackingStore(char **res, - int *format, - const char *buf, - size_t buf_size) -{ -#define COW_FILENAME_MAXLEN 1024 - *res =3D NULL; - *format =3D VIR_STORAGE_FILE_AUTO; - - if (buf_size < 4+4+ COW_FILENAME_MAXLEN) - return BACKING_STORE_INVALID; - if (buf[4+4] =3D=3D '\0') { /* cow_header_v2.backing_file[0] */ - *format =3D VIR_STORAGE_FILE_NONE; - return BACKING_STORE_OK; - } - - if (VIR_STRNDUP(*res, (const char*)buf + 4 + 4, COW_FILENAME_MAXLEN) <= 0) - return BACKING_STORE_ERROR; - return BACKING_STORE_OK; -} - static int qcow2GetBackingStoreFormat(int *format, diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index 596746ccb7..c84e013f46 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -82,8 +82,7 @@ typedef enum { * libvirt support for following a backing chain */ VIR_STORAGE_FILE_BACKING, - VIR_STORAGE_FILE_COW =3D VIR_STORAGE_FILE_BACKING, - VIR_STORAGE_FILE_QCOW, + VIR_STORAGE_FILE_QCOW =3D VIR_STORAGE_FILE_BACKING, VIR_STORAGE_FILE_QCOW2, VIR_STORAGE_FILE_QED, VIR_STORAGE_FILE_VMDK, --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list