From patchwork Mon Oct 7 21:49:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 175424 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4845941ill; Mon, 7 Oct 2019 14:49:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1AXNoodrgywmUJ17bQ1OAQEW7guANNlIdgQjeFempx1M9fN/93rQhGN316vHzKNM3iW/f X-Received: by 2002:a92:d20e:: with SMTP id y14mr32528970ily.230.1570484989792; Mon, 07 Oct 2019 14:49:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570484989; cv=none; d=google.com; s=arc-20160816; b=Qf4UqhIpfMa0jFwEUyJq6zCaq0HsWvgZpSIkZLNKgVJzO0mVvEF07Uf/60VRsWBBYx rAGgs83vQS7GazjhCbge4VfmWtpqp2mOwOcMv8oXgKKQSNUZT+VmgMW1kqYSbQCQCetk HijFEwSGkwAEQw5wSw6aJB0+3jw9rmXZRm/ZJnann1UCf60VWDNzO14sd5+9H3LuqndD X75Bk08EBVnJnkMvnQd5nZE56qWTd51bVUAfU5JuSuhvBhA2KscEAX1ElwQIqwI7QjQS /UP50JVrcoywISE4eD5BdKsjULElkODv37NbZ1uiywTrzNyyRP21j67U9Sva6Z5r9bTS 7n4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=2s2KKWOOpoje/szkXhm5hdVYxfRXFp7WhPj4pWxV6Fc=; b=fAI2DV8MJZPf3PuTzUGE/OM+/T+ZKPcwP4vshKjhDGPDAy4LiewTbuTWAZhcYZuQZq ylNN260SsklYLKcz/xNn/nPUMlwlyOpqcBNdRtNbdG6jg1X2BADZESrwHb37LdkTlzNF I13a8yoLL3BEmrJ3bWwJyJe4HvjD4vNtFfd2Gp44+Gvn/Dp9j3UzSJBPv4etIZCtlDdk tOg86YeSrGs2Mtd/3xtBn1h6LXNS+9SUpQlHjYyr6gAIiNc3Za/VO42LMc0WVe0LDBKx SOcYbZrA/S8WV7WaHp0YfQqzPIKE2z6hKmmjn/vdn1Mmk84HlimHhFdnL19paEfhFnvu d38g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id x21si18208160ill.127.2019.10.07.14.49.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Oct 2019 14:49:49 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9FAE5302C07C; Mon, 7 Oct 2019 21:49:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 78A3119C68; Mon, 7 Oct 2019 21:49:48 +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 3CDC94EE71; Mon, 7 Oct 2019 21:49:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x97LnRNG014578 for ; Mon, 7 Oct 2019 17:49:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id C98D35C223; Mon, 7 Oct 2019 21:49:27 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from worklaptop.redhat.com (ovpn-123-156.rdu2.redhat.com [10.10.123.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 100EC5C1D4; Mon, 7 Oct 2019 21:49:25 +0000 (UTC) From: Cole Robinson To: libvir-list@redhat.com Date: Mon, 7 Oct 2019 17:49:21 -0400 Message-Id: <753e01b3ed570fb49fe0d294cb34ad7bf49d9a2a.1570482718.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/30] storagefile: Use qcowXGetBackingStore directly 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Mon, 07 Oct 2019 21:49:49 +0000 (UTC) The qcow1 and qcow2 variants are identical, so remove the wrappers Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) -- 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Daniel Henrique Barboza diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 14551af4d2..a9a6c3e132 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -180,9 +180,7 @@ 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 *, +static int qcowXGetBackingStore(char **, int *, const char *, size_t); static int qcow2GetFeatures(virBitmapPtr *features, int format, char *buf, ssize_t len); @@ -366,14 +364,14 @@ static struct FileTypeInfo const fileTypeInfo[] = { LV_BIG_ENDIAN, 4, 4, {1}, QCOWX_HDR_IMAGE_SIZE, 8, 1, qcow1EncryptionInfo, - qcow1GetBackingStore, NULL + qcowXGetBackingStore, NULL }, [VIR_STORAGE_FILE_QCOW2] = { 0, "QFI", NULL, LV_BIG_ENDIAN, 4, 4, {2, 3}, QCOWX_HDR_IMAGE_SIZE, 8, 1, qcow2EncryptionInfo, - qcow2GetBackingStore, + qcowXGetBackingStore, qcow2GetFeatures }, [VIR_STORAGE_FILE_QED] = { @@ -565,25 +563,6 @@ qcowXGetBackingStore(char **res, } -static int -qcow1GetBackingStore(char **res, - int *format, - const char *buf, - size_t buf_size) -{ - return qcowXGetBackingStore(res, format, buf, buf_size); -} - -static int -qcow2GetBackingStore(char **res, - int *format, - const char *buf, - size_t buf_size) -{ - return qcowXGetBackingStore(res, format, buf, buf_size); -} - - static int vmdk4GetBackingStore(char **res, int *format,