From nobody Mon Feb 9 09:07:45 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1580910184250152.01796590350807; Wed, 5 Feb 2020 05:43:04 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-315-ZpgdUctPPauuwhmhGKTs8w-1; Wed, 05 Feb 2020 08:42:06 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 29FB68010CB; Wed, 5 Feb 2020 13:42:01 +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 069C05D9E2; Wed, 5 Feb 2020 13:42:01 +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 ADEE18579D; Wed, 5 Feb 2020 13:42:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 015DfCcV008469 for ; Wed, 5 Feb 2020 08:41:12 -0500 Received: by smtp.corp.redhat.com (Postfix) id 15E771001B05; Wed, 5 Feb 2020 13:41:12 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9185210018FF for ; Wed, 5 Feb 2020 13:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580910183; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fWDW1WjBCqwt855ayGVj0nLY3BjHJ7a44war+rOKF00=; b=HBWurF3ZLHpnbZd4oZ1RLz2Bp6TWWqv3A9ha+RX1Y7LuP+tuiy4QRWE/kLByHhx4T4ZdEi VqDEQrD9Kt0ATHCukHfILPSlwjRb3bpGIEBqqf/vYmz91/BBIYJnUyyz++3qKn8w0gmsDU ZV1gGHWPvVCAEg2+nOdkjD+DrBurCWg= From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 9/9] virDomainDiskTranslateSourcePool: Translate 'VOLUME' disks in whole backing chain Date: Wed, 5 Feb 2020 14:41:00 +0100 Message-Id: <6301b5b5867eddf55016ce5c92b5176c59ada868.1580909976.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com 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.14 X-MC-Unique: ZpgdUctPPauuwhmhGKTs8w-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Now that we accept full backing chains on input nothing should prevent users from also using disk type 'VOLUME' for specifying the backing images. Do the translation for the whole backing chain. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/conf/domain_conf.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7bd86d67e5..46062e3969 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -31560,18 +31560,20 @@ int virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def) { g_autoptr(virConnect) conn =3D NULL; + virStorageSourcePtr n; - if (def->src->type !=3D VIR_STORAGE_TYPE_VOLUME) - return 0; - - if (!def->src->srcpool) - return 0; + for (n =3D def->src; virStorageSourceIsBacking(n); n =3D n->backingSto= re) { + if (n->type !=3D VIR_STORAGE_TYPE_VOLUME || !n-> srcpool) + continue; - if (!(conn =3D virGetConnectStorage())) - return -1; + if (!conn) { + if (!(conn =3D virGetConnectStorage())) + return -1; + } - if (virDomainStorageSourceTranslateSourcePool(def->src, conn) < 0) - return -1; + if (virDomainStorageSourceTranslateSourcePool(n, conn) < 0) + return -1; + } if (def->startupPolicy !=3D 0 && virStorageSourceGetActualType(def->src) !=3D VIR_STORAGE_VOL_FILE)= { --=20 2.24.1