From patchwork Mon Oct 7 21:49:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 175434 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp4849409ill; Mon, 7 Oct 2019 14:53:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCtBa/Z8kLs43FT5PzyLQfrtySe3fkcxxpG3p6gT+0lVdi51nOTSR6zWhRfFxqT2Y7nkaF X-Received: by 2002:a54:4f1b:: with SMTP id e27mr1198509oiy.85.1570485232007; Mon, 07 Oct 2019 14:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570485232; cv=none; d=google.com; s=arc-20160816; b=nnE2Z+4OAkGOWu2WjwgYxq48GsZIbgf3Qsyc42LWsZU7L3PkkchHS1jXkt911ZpYuM mashDbY/YdAGtxwJzFgKlUfP51BUoe4zfPUVWVayMuVaocWo/bAuAAHLK+SK+QSz47SP HnMGDvzsLztMKloJa6kWiPD8F9yyv6Lmcqus4bNnyXTR90AOwEAYRyvUIwz7yelqGE7P ZjO1+B3vIVnEB0lSnVBqj+plWKbW5jEtlL6nC/uwZVuiZkI27EypqI4bQRnmln5ruqmL Z+mKOFOmwdddX3TZyEwDLB5K6znaewsoseG0UdE6e3F8gUaLkwuqD0nVAw95w4ahxIwz 697w== 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=xej1xLcS4uGqhQQois+fdJyo3DobfbQL5u4d3PVMb+w=; b=XnLdkYhQYfkAom8uSujk4lZApN9gKkEY5XOhFsY9mkx4gf361eLpwFOqLCHZsKe0kp zFRuWSNzzdd59ionVywCInT7XppM2ynoE5Jkhpd7BbnM8NgQvLpv3vnJVRq2dm+bTrQI 9hSAYf+tc4WbDjT6Oc6MN31f+m1y7umrObPIK8L2mOAVEGfdXq8j7RE+mXHn2jqHxCUB jj9rsi7BULQ3AaEKjxIpt2bKQo4BstfLw8PGSvl1ntK5o8JuG2NR5n894w21MSmyMs/r emHH0Donph5LeuY/Hk1JNVn1FRigUyEBZYjXybZuxocmuC3fL0ldykYuQmpaJ5fktbyd c62Q== 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 e18si8628269otp.71.2019.10.07.14.53.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Oct 2019 14:53:51 -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-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C1D3D51EE6; Mon, 7 Oct 2019 21:53:49 +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 99F645D71C; Mon, 7 Oct 2019 21:53:49 +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 471614EE97; Mon, 7 Oct 2019 21:53:49 +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 x97LoOS7015037 for ; Mon, 7 Oct 2019 17:50:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 92ED55C224; Mon, 7 Oct 2019 21:50:24 +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 2421B5C223; Mon, 7 Oct 2019 21:49:58 +0000 (UTC) From: Cole Robinson To: libvir-list@redhat.com Date: Mon, 7 Oct 2019 17:49:32 -0400 Message-Id: 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 18/30] storagefile: Add externalDataStore member 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.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 07 Oct 2019 21:53:51 +0000 (UTC) Add the plumbing to track a externalDataStoreRaw as a virStorageSource Signed-off-by: Cole Robinson --- src/util/virstoragefile.c | 9 +++++++++ src/util/virstoragefile.h | 3 +++ 2 files changed, 12 insertions(+) -- 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 7ae6719dd6..ce669b6e0b 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -2339,6 +2339,12 @@ virStorageSourceCopy(const virStorageSource *src, return NULL; } + if (src->externalDataStore) { + if (!(def->externalDataStore = virStorageSourceCopy(src->externalDataStore, + true))) + return NULL; + } + VIR_STEAL_PTR(ret, def); return ret; } @@ -2560,6 +2566,9 @@ virStorageSourceClear(virStorageSourcePtr def) VIR_FREE(def->timestamps); VIR_FREE(def->externalDataStoreRaw); + virObjectUnref(def->externalDataStore); + def->externalDataStore = NULL; + virStorageNetHostDefFree(def->nhosts, def->hosts); virStorageAuthDefFree(def->auth); virObjectUnref(def->privateData); diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h index bbff511657..d84dad052d 100644 --- a/src/util/virstoragefile.h +++ b/src/util/virstoragefile.h @@ -292,6 +292,9 @@ struct _virStorageSource { /* backing chain of the storage source */ virStorageSourcePtr backingStore; + /* external data store storage source */ + virStorageSourcePtr externalDataStore; + /* metadata for storage driver access to remote and local volumes */ virStorageDriverDataPtr drv;