From nobody Sun May 5 01:14:01 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1616423468; cv=none; d=zohomail.com; s=zohoarc; b=XKfwBQpnlW75nn44zgkW8TDMPtkEv5VP9XwClkrFQIOS5i6ShjR8YBdM9B0bj5vq16C/EGAhP2bjV4rKF0jCVOfaiduTpFav9P6gPhhydjCPErpiRDPgSGz446rcJQ4VNpyTg4wvQou5JAOK7vbSE1IFjEz8TI7Ylu8+oqWgaZs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616423468; 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=QKzkhTZNijgVMFdGqR8f7cP16JDgNQ+icD/JjqrcA1g=; b=VQK1lGMFsIoFQ3LRbflEwp1VCjj3/oiLOuxS7gmheC1rPZ3U4dpGw6in5tix/dv9GNr3MRbbHLltZMu7alBWWHqSqoOV2qjQkpWYkfHlk/JUX+XJowrNqIiaDzGkvHIFrCI4qEXfUS+qK5YAuMUszlzLnF+Y7c4/NKJsS0ovso0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1616423468808631.3741980772276; Mon, 22 Mar 2021 07:31:08 -0700 (PDT) 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-15-M3OTVveMOOOA9s_aDTYhsQ-1; Mon, 22 Mar 2021 10:31:04 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 32C61107B7C8; Mon, 22 Mar 2021 14:30:58 +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 0807F60C0F; Mon, 22 Mar 2021 14:30:58 +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 572CC1809C83; Mon, 22 Mar 2021 14:30:55 +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 12MEUrkf031863 for ; Mon, 22 Mar 2021 10:30:53 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3DFAF59459; Mon, 22 Mar 2021 14:30:53 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 936DE13493 for ; Mon, 22 Mar 2021 14:30:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616423467; 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=QKzkhTZNijgVMFdGqR8f7cP16JDgNQ+icD/JjqrcA1g=; b=OTwL/NA74R9814fBgZKzUEpes0JeJD/INf3rluGiayOVFx5XqeeKqHQ5mV4O7a898uQ4NW E/9CBBIaE1PApQt3dagRXBMnFgLV0iLvqtYJIL7QIRCXgmBFHMDeoIbtBipMjZnpYhsh6Q dfmR6QhwiQ5b53zdwnJvx9zXnQBv0jA= X-MC-Unique: M3OTVveMOOOA9s_aDTYhsQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemuCheckpointDiscardBitmaps: Refuse to delete checkpoint with NULL bitmap name Date: Mon, 22 Mar 2021 15:30:45 +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.79 on 10.5.11.12 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) Content-Type: text/plain; charset="utf-8" When a checkpoint is redefined without providing the domain XML, we might end up with a definition where the per-disk bitmap name is not set. Trying to delete such checkpoint would lead to a crash. Refuse such deletion. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1941600 Signed-off-by: Peter Krempa --- src/qemu/qemu_checkpoint.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index 689a556959..d2a621a52b 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -206,6 +206,13 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, if (chkdisk->type !=3D VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP) continue; + if (!chkdisk->bitmap) { + virReportError(VIR_ERR_INVALID_ARG, + _("missing bitmap name for disk '%s' of checkpo= int '%s'"), + chkdisk->name, chkdef->parent.name); + return -1; + } + if (qemuCheckpointDiscardDiskBitmaps(domdisk->src, blockNamedNodeD= ata, chkdisk->bitmap, actions, domdisk->dst, --=20 2.29.2 From nobody Sun May 5 01:14:01 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=1616423492; cv=none; d=zohomail.com; s=zohoarc; b=D4pajuD/sZrGEPhJ4HaZj5+y8Zy41rlpFsWOkTB+bmhaupHrTHw3o2KzhVezf45kxqPdKKqQLN2qbGBIDNNdAFY/m9n695F+Erxxjo3bihZaHt4RUs29blM0aS53MfOhqVA5xkNqA/8sZ7AysDLwpuTwCwSk59LCxccK5yr9tgk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616423492; 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=cUml6Z1VS5ToFal153H+4XeC1VkgvclvmkGfu03izyI=; b=apizEWvkGaX0IDDuwXE1g0YZbz0YZaewm2LCbOXce7Zjm3ACM2J4CeWGa1WNW1LU6nfieOteHgnlGZ3E7KrryJJGeHyTeiWbUf9GZ4L7AhoGCl1oGtCU8zWsDdpVrne2xYfIeVyGrPjzkQZeWYPSnsPDxxjh1Q8hT0V0RBsvm7s= 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) header.from= 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 1616423492419918.1885843192957; Mon, 22 Mar 2021 07:31:32 -0700 (PDT) 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-266-KkYPH-tdNy2aUdzV1D_kKg-1; Mon, 22 Mar 2021 10:31:28 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 097C6107B7C5; Mon, 22 Mar 2021 14:31:23 +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 B7DD419C87; Mon, 22 Mar 2021 14:31:22 +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 4DB814BB7C; Mon, 22 Mar 2021 14:31:22 +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 12MEUsgP031878 for ; Mon, 22 Mar 2021 10:30:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6E61F13493; Mon, 22 Mar 2021 14:30:54 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id B193C59459 for ; Mon, 22 Mar 2021 14:30:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616423491; 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=cUml6Z1VS5ToFal153H+4XeC1VkgvclvmkGfu03izyI=; b=f7Sp6uFTsQyRsTzkFSYQprYsGvtr75HXmRdlQ7mMfaEbsEFTrEd0AP/LdCgxd20d0YzN6t aUOimcjq2a83Uiku6gRPYlBjfiw39krp94H5Tf2abxBFMe01pSyhnKz3jlKDS9vrlVPlCs 0NpVrq2aH0pr9T22rDwi7wHygP38pDE= X-MC-Unique: KkYPH-tdNy2aUdzV1D_kKg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] virDomainCheckpointRedefinePrep: Assign default bitmap names when domain XML is missing Date: Mon, 22 Mar 2021 15:30:46 +0100 Message-Id: <6bf95854b2ee84a45fd5e652d745e008f28e8e09.1616423413.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.11 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) Content-Type: text/plain; charset="utf-8" Previously we'd assign the default checkpoint bitmap names in virDomainCheckpointAlignDisks. In cases when the checkpoint is redefined without a domain XML virDomainCheckpointAlignDisks is not called. Add an explicit call to virDomainCheckpointDefAssignBitmapNames to restore functionality. Signed-off-by: Peter Krempa --- src/conf/checkpoint_conf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index f8704852e0..cd48570b51 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -508,6 +508,9 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm, if (virDomainCheckpointAlignDisks(def) < 0) return -1; + } else { + if (virDomainCheckpointDefAssignBitmapNames(def) < 0) + return -1; } if (def->parent.parent_name && --=20 2.29.2