From nobody Mon Feb 9 03:16:59 2026 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 ARC-Seal: i=1; a=rsa-sha256; t=1561473290; cv=none; d=zoho.com; s=zohoarc; b=bXZqhRUZ89+Wv6B2mH06qP018RFvB0c3zwceOBnv5IuKqdIwDa+rd5m67Xp+D37vtVXFSlVnHNFtYppRXETgxB5bont7e30A2xWo0VFh6Wv8pImvNgAfOM6ZCyuJkEIXXiI2OOHlhpp5d67CoQGBWtq0Z6Mb0fuJjiO8QXmcgQM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561473290; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=7vaun91NX/V9ubshlMSc88wPRTX37rG51udBjML0leU=; b=Aza2kPoy/vfuARpM6LkR0dHodg477HxId/iPmFooRvuZUFgSI50q3Ael8aQ20oJEstGTye04NZq6UvSgCYoRoyvDmw7jIC7PVR8j2yYjB5OMRrAbGHmS5fIQw8FWelYuGhBmqcm1b1THnz4Dwr0RNGOyjt+wz6Xu0TAy2qOx2JM= ARC-Authentication-Results: i=1; mx.zoho.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 header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1561473290072694.730413420235; Tue, 25 Jun 2019 07:34:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7A4707FDCC; Tue, 25 Jun 2019 14:34:35 +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 4829E1001E8C; Tue, 25 Jun 2019 14:34:35 +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 F07F21806B19; Tue, 25 Jun 2019 14:34:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5PEUkuU005456 for ; Tue, 25 Jun 2019 10:30:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 863E6196E5; Tue, 25 Jun 2019 14:30:46 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1120F19732 for ; Tue, 25 Jun 2019 14:30:45 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 25 Jun 2019 16:30:30 +0200 Message-Id: <21e4c3678fc2a7f1602641ad6954c7f7252e4830.1561472985.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 1/4] util: storage: Fix virStorageSourceGetActualType if volume was not translated 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 25 Jun 2019 14:34:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" virStorageSourceGetActualType would return VIR_STORAGE_TYPE_NONE in case when a virStorageSource of (top level) type VIR_STORAGE_TYPE_VOLUME was not prepared to use by the vm by calling virDomainDiskTranslateSourcePool. Fix this issue by returning VIR_STORAGE_TYPE_VOLUME in case when the volume was not translated yet. Additionally also add documentation for the function describing the quirk. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/util/virstoragefile.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index f7495ab6da..269d0050fd 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -2430,10 +2430,20 @@ virStorageSourcePoolDefFree(virStorageSourcePoolDef= Ptr def) } +/** + * virStorageSourceGetActualType: + * @def: storage source definition + * + * Returns type of @def. In case when the type is VIR_STORAGE_TYPE_VOLUME + * and virDomainDiskTranslateSourcePool was called on @def the actual type + * of the storage volume is returned rather than VIR_STORAGE_TYPE_VOLUME. + */ int virStorageSourceGetActualType(const virStorageSource *def) { - if (def->type =3D=3D VIR_STORAGE_TYPE_VOLUME && def->srcpool) + if (def->type =3D=3D VIR_STORAGE_TYPE_VOLUME && + def->srcpool && + def->srcpool->actualtype !=3D VIR_STORAGE_TYPE_NONE) return def->srcpool->actualtype; return def->type; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list