From nobody Fri May 3 21:39:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1637932130; cv=none; d=zohomail.com; s=zohoarc; b=H9oYjYGOSLrRtCTHJwpMxfqlz1F/5/TaNTjnu7ioHa+X/vvm+z/Zzprp3B1qzT9ijhwQqtddor4odyTUye/Py7/YsEv9Mm6XVEhcqxsPIrvFSyn0NCvSaFAc/bU5NN+7Hl2NOaWAlBWXVKEfpt1PG2+7Od2K5U6tj9aU1JIh86o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637932130; 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; bh=ZbeLIkRqczOiCKASS173QBH41nEazwvZsmcp1U/XyYQ=; b=OwO9BzeG0DG+CiHraCXJOejDlfpjqknbzB37L7duqWT6rd/2Oyw0vLo47SQlUBp7nRV1r8ynD0npEAE41n49dO2S9pAoZYjKTKAXt22QXd4fGjVJ/ef35XkTMaLaCrR9ATxxWoJSNFlKRuQttSzT37T3qpMTP1FMCZ7EoBo7N2c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 163793213089661.905965605451456; Fri, 26 Nov 2021 05:08:50 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-468-y6w2M--tPomiUNm4BYeA7A-1; Fri, 26 Nov 2021 08:08:45 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2456B835B4D; Fri, 26 Nov 2021 13:08:41 +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 73079100AE22; Fri, 26 Nov 2021 13:08:40 +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 0B16D4A7C8; Fri, 26 Nov 2021 13:08:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AQD83Mr012633 for ; Fri, 26 Nov 2021 08:08:03 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9A93C72FA4; Fri, 26 Nov 2021 13:08:03 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0B52372FA2 for ; Fri, 26 Nov 2021 13:08:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637932129; 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=ZbeLIkRqczOiCKASS173QBH41nEazwvZsmcp1U/XyYQ=; b=iQHCyxEPWuTkqhEKg0BDI5kmbau+pvso0pbpB/Ln9Ld4jZ5w0OztFHqEft0Cmg6DImPg+V r1TkTZ2c/J838uuTLPUz0Xq3A7/TYvSHSHU/pI4tsr2rxw6V05XlTAIGlnnJjj7fj4Lm3z oK1d5N5ReG45T0oEUyADYxY4S6pKAzU= X-MC-Unique: y6w2M--tPomiUNm4BYeA7A-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemuBlockJobRewriteConfigDiskSource: Add debug statements when skipping disk update Date: Fri, 26 Nov 2021 14:07:53 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637932131760100001 Content-Type: text/plain; charset="utf-8" It makes it easier to see what's going on when trying to figure out why the disk definition was not updated on a finalized blockjob. Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- src/qemu/qemu_blockjob.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index faf9a9fb7d..6911a2a68d 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -667,14 +667,23 @@ qemuBlockJobRewriteConfigDiskSource(virDomainObj *vm, g_autoptr(virStorageSource) copy =3D NULL; virStorageSource *n; - if (!vm->newDef) + if (!vm->newDef) { + VIR_DEBUG("not updating disk '%s' in persistent definition: no per= sistent definition", + disk->dst); return; + } - if (!(persistDisk =3D virDomainDiskByTarget(vm->newDef, disk->dst))) + if (!(persistDisk =3D virDomainDiskByTarget(vm->newDef, disk->dst))) { + VIR_DEBUG("not updating disk '%s' in persistent definition: disk n= ot present", + disk->dst); return; + } - if (!virStorageSourceIsSameLocation(disk->src, persistDisk->src)) + if (!virStorageSourceIsSameLocation(disk->src, persistDisk->src)) { + VIR_DEBUG("not updating disk '%s' in persistent definition: disk s= ource doesn't match", + disk->dst); return; + } if (!(copy =3D virStorageSourceCopy(newsrc, true)) || virStorageSourceInitChainElement(copy, persistDisk->src, true) < 0= ) { --=20 2.31.1 From nobody Fri May 3 21:39:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 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=1637932135; cv=none; d=zohomail.com; s=zohoarc; b=ODI28TC0yPTLNwplGFA7OsaDAuOm5LnsXFMO0TDO/ax5O0keOcOCyF6CDpG0UZ8RFkFJs5gu0JSEb+nfN0t5VSoc1wkUOwx/aHlYeAakzwZjfXb9/iPorRL1Qb3OXrvbF53XXSXgWFdmsZCaSMoKGYEaXor0b28BwnR9bJB0L9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637932135; 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; bh=jAsVLtzKzUfXq51ZeTVYMkm0RXGkD1M3101LpTWHbuA=; b=ML35lHJGqymMpWylAJK6GrSm4Qbtq4wZhXVALSpkT3wGvq7FByQXTSkcZ+IMAFWTeXUkWpiNpiG5Ut7YSZRZAHMzpySuCoFcQeVNGIEX/ZILqaH+JiCp7InVjfZEoj1YAwmeLG6tvrpoqASVbY0YXwOmOXxJ6bHVV3wbzFpSpDg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 163793213494774.0042019963771; Fri, 26 Nov 2021 05:08:54 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-42-PhpHdjTiMHqfDbsUl4wFEQ-1; Fri, 26 Nov 2021 08:08:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5FA6585B66B; Fri, 26 Nov 2021 13:08:47 +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 4586D60622; Fri, 26 Nov 2021 13:08:47 +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 1A7761809C89; Fri, 26 Nov 2021 13:08:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1AQD84Ju012641 for ; Fri, 26 Nov 2021 08:08:04 -0500 Received: by smtp.corp.redhat.com (Postfix) id AEE6772FA7; Fri, 26 Nov 2021 13:08:04 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 09ED372FA2 for ; Fri, 26 Nov 2021 13:08:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637932133; 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=jAsVLtzKzUfXq51ZeTVYMkm0RXGkD1M3101LpTWHbuA=; b=NPNwzT7EnVo4EcnC691H6EPEbSB5tRuA9U8tLaRdLmZVjizB1Yzl7ItEE+RlWnk9Rn7KKy Wwpn7iRug5Fn27EJH3OJyNNNLGWnJKuzDmVqDDW8BEfn2yx650ErvU3QqbP34BOQ4PwoAS MLvtmqS4FSdx0nZqdODLFBqaLoAw0Sw= X-MC-Unique: PhpHdjTiMHqfDbsUl4wFEQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] virStorageSourceIsSameLocation: Special-case storage sources of type 'volume' Date: Fri, 26 Nov 2021 14:07:54 +0100 Message-Id: <7961214f89e95f8e8ca7756a2a827d430c58a58b.1637932021.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637932136350100001 Content-Type: text/plain; charset="utf-8" The function is used also to compare virStorageSource which may not be resolved to the image at that point in which case the 'path' is not yet populated and the actual type is not yet set. This means that the function fails to consider two identical volume-based disks as pointing to the same thing. Add a special case for both images being type=3Dvolume in which case we compare only the pool/volume names. Closes: https://gitlab.com/libvirt/libvirt/-/issues/240 Signed-off-by: Peter Krempa Reviewed-by: Martin Kletzander --- src/conf/storage_source_conf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index 44944e1dbd..c0acee189a 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -920,6 +920,13 @@ virStorageSourceIsSameLocation(virStorageSource *a, virStorageSourceIsEmpty(b)) return true; + /* for disk type=3Dvolume we must check just pool/volume names as they= might + * not yet be resolved if e.g. we are comparing against the persistent= def */ + if (a->type =3D=3D VIR_STORAGE_TYPE_VOLUME && b->type =3D=3D VIR_STORA= GE_TYPE_VOLUME) { + return STREQ(a->srcpool->pool, b->srcpool->pool) && + STREQ(a->srcpool->volume, b->srcpool->volume); + } + if (virStorageSourceGetActualType(a) !=3D virStorageSourceGetActualTyp= e(b)) return false; --=20 2.31.1