From nobody Mon May 6 09:32:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=reject dis=none) header.from=il.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1676460609; cv=none; d=zohomail.com; s=zohoarc; b=C3TnpG9dko6AWM0CIt+Oq+Mbf0oHyjvWL/+zwzMcgc8ObNnUCb1eNbnlNScUKXNCCOhgtkENg8drSs4L/w1Ye9YQcKe+gOyQLP6vFVJzxLo06CkhE/AV7Q18/1L68nqKjlAM2Exx0CwirEBVyUjlcHG2fRXPzrkuzco78NhHCHg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676460609; h=Content-Type:Content-Transfer-Encoding:Cc: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=Sjvby4Hm9eJGc79R2LQ3e5meCLl4+TfoChMD04MONaQ=; b=VEcusojrTeFDpanN7jt/HVN0mOC+TnRAsKNtd/BZSR2ZsoByyJ+1ngMArEoVNH6WG83K9u93O/8yA2PDxwSwRRx6whoCA6XMjif6bljCgwVW1qgrRAjd9vxE/XP0vBSfhZRuQjgMVHwV1KhRpFH1ISuvwI8ftda5SmgHONTDZCQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=reject dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676460609764550.8452668758546; Wed, 15 Feb 2023 03:30:09 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-65-NGPh9Ay_Nwu_XF5cMaB4aQ-1; Wed, 15 Feb 2023 06:30:07 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 694F1857A89; Wed, 15 Feb 2023 11:30:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 52FE4492B0E; Wed, 15 Feb 2023 11:30:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 043F319465A8; Wed, 15 Feb 2023 11:30:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 32D001946586 for ; Wed, 15 Feb 2023 11:29:14 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 127DD18EC2; Wed, 15 Feb 2023 11:29:14 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09BC618EC1 for ; Wed, 15 Feb 2023 11:29:13 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF4CC28004E1 for ; Wed, 15 Feb 2023 11:29:13 +0000 (UTC) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-45-w6XP0mYTNNugJkXdKp7MJQ-1; Wed, 15 Feb 2023 06:29:10 -0500 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31FBNDWk040722 for ; Wed, 15 Feb 2023 11:29:09 GMT Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nrxfq02ts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:09 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 31FAt9DG007439 for ; Wed, 15 Feb 2023 11:29:09 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([9.208.130.100]) by ppma03dal.us.ibm.com (PPS) with ESMTPS id 3np2n79nc0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:09 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31FBT64c10224232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Feb 2023 11:29:06 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 02528583D0; Wed, 15 Feb 2023 11:29:06 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 56195583CE; Wed, 15 Feb 2023 11:29:05 +0000 (GMT) Received: from oro.sl.cloud9.ibm.com (unknown [9.59.192.176]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Feb 2023 11:29:05 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676460608; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=Sjvby4Hm9eJGc79R2LQ3e5meCLl4+TfoChMD04MONaQ=; b=FlTHiEMGZod+1fF2J4KT+1AT07tW9pBzpgGY/4hFwqupJS1qAZ33rErwY3D9Pz+nnIVmvz Rnoy5TOd2gl69YejLZagJNmllA+6q0wOJ2Qa0AknOjZReHhwDQ6SEj6LySr1lBjh0WHTg8 3QJCif37djXLiuboN9BJjDpIFg1g4ng= X-MC-Unique: NGPh9Ay_Nwu_XF5cMaB4aQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: w6XP0mYTNNugJkXdKp7MJQ-1 From: Or Ozeri To: libvir-list@redhat.com Subject: [PATCH v2 1/6] conf: Add snapshotName attribute for internal disk snapshot Date: Wed, 15 Feb 2023 05:28:17 -0600 Message-Id: <20230215112822.1887694-2-oro@il.ibm.com> In-Reply-To: <20230215112822.1887694-1-oro@il.ibm.com> References: <20230215112822.1887694-1-oro@il.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: YtZa7H_FAvyIeDXoPoeslu35cpDK2NAa X-Proofpoint-ORIG-GUID: YtZa7H_FAvyIeDXoPoeslu35cpDK2NAa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-15_06,2023-02-15_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 mlxlogscore=805 lowpriorityscore=0 adultscore=0 impostorscore=0 suspectscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302150100 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: oro@il.ibm.com, dannyh@il.ibm.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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: 1676460610850100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Add a new attribute to snapshot disks XML element, which allows specifying the name that will be used to refer to internal snapshots. If unspecified, the parent snapshot name will be used. For now, make this attribute unsupported for qemu domains. Signed-off-by: Or Ozeri --- docs/formatsnapshot.rst | 5 +++++ src/conf/schemas/domainsnapshot.rng | 4 ++++ src/conf/snapshot_conf.c | 27 +++++++++++++++++++++++++++ src/conf/snapshot_conf.h | 2 ++ src/qemu/qemu_snapshot.c | 9 +++++++++ 5 files changed, 47 insertions(+) diff --git a/docs/formatsnapshot.rst b/docs/formatsnapshot.rst index 085c712053..d98066dd8c 100644 --- a/docs/formatsnapshot.rst +++ b/docs/formatsnapshot.rst @@ -145,6 +145,11 @@ The top-level ``domainsnapshot`` element may contain t= he following elements: driver and supported values are ``file``, ``block`` and ``network`` :since:`(since 1.2.2)`. =20 + :since:`Since 9.1.0` the ``disk`` element supports an optional attri= bute + ``snapshotName`` if the ``snapshot`` attribute is set to ``int= ernal``. This + attribute specifies the name that will be used to refer to the + internal disk snapshot. + ``source`` =20 If the snapshot mode is external (whether specified or inherited), diff --git a/src/conf/schemas/domainsnapshot.rng b/src/conf/schemas/domains= napshot.rng index 4048266f1d..19f097d2b3 100644 --- a/src/conf/schemas/domainsnapshot.rng +++ b/src/conf/schemas/domainsnapshot.rng @@ -209,6 +209,10 @@ manual + + + + =20 diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 9bf3c78353..58a6afa26d 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -150,6 +150,8 @@ virDomainSnapshotDiskDefParseXML(xmlNodePtr node, VIR_STORAGE_TYPE_FILE) < 0) return -1; =20 + def->snapshot_name =3D virXMLPropString(node, "snapshotName"); + if (src->type =3D=3D VIR_STORAGE_TYPE_VOLUME || src->type =3D=3D VIR_STORAGE_TYPE_DIR) { virReportError(VIR_ERR_XML_ERROR, @@ -192,6 +194,10 @@ virDomainSnapshotDiskDefParseXML(xmlNodePtr node, (src->path || src->format)) def->snapshot =3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL; =20 + if (def->snapshot =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT && + def->snapshot_name) + def->snapshot =3D VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL; + def->name =3D g_steal_pointer(&name); def->src =3D g_steal_pointer(&src); =20 @@ -670,6 +676,15 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDef *snap= def, return -1; } =20 + if (snapdisk->snapshot_name && + snapdisk->snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL)= { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("snapshotName for disk '%s' requires " + "use of internal snapshot mode"), + snapdisk->name); + return -1; + } + if (snapdisk->src->path && snapdisk->snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)= { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -714,6 +729,16 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDef *snap= def, if (virDomainSnapshotDefAssignExternalNames(snapdef) < 0) return -1; =20 + /* set default snapshot name for internal snapshots */ + for (i =3D 0; i < snapdef->ndisks; i++) { + virDomainSnapshotDiskDef * disk =3D &snapdef->disks[i]; + + if (disk->snapshot =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL && + !disk->snapshot_name) { + disk->snapshot_name =3D g_strdup(snapdef->parent.name); + } + } + return 0; } =20 @@ -748,6 +773,8 @@ virDomainSnapshotDiskDefFormat(virBuffer *buf, if (disk->snapshot > 0) virBufferAsprintf(&attrBuf, " snapshot=3D'%s'", virDomainSnapshotLocationTypeToString(disk->snap= shot)); + if (disk->snapshot_name) + virBufferAsprintf(&attrBuf, " snapshotName=3D'%s'", disk->snapshot= _name); =20 if (disk->snapshotDeleteInProgress) virBufferAddLit(&childBuf, "\n"); diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h index 96c77ef42b..c133c105c7 100644 --- a/src/conf/snapshot_conf.h +++ b/src/conf/snapshot_conf.h @@ -57,6 +57,8 @@ struct _virDomainSnapshotDiskDef { /* details of wrapper external file. src is always non-NULL. * XXX optimize this to allow NULL for internal snapshots? */ virStorageSource *src; + + char *snapshot_name; /* snapshot name for internal snapshots */ }; =20 void diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index b8416808b3..1aa2f05300 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -660,6 +660,15 @@ qemuSnapshotPrepare(virDomainObj *vm, virStorageFileFormatTypeToString(dom_disk->= src->format)); return -1; } + + if (disk->snapshot_name) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("snapshot name setting for disk %s unsupp= orted " + "for storage type %s"), + disk->name, + virStorageFileFormatTypeToString(dom_disk->= src->format)); + return -1; + } break; =20 case VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL: --=20 2.25.1 From nobody Mon May 6 09:32:42 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=fail(p=reject dis=none) header.from=il.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1676460565; cv=none; d=zohomail.com; s=zohoarc; b=dIiQhCpA67ZpFmfGjRt/DcM3/A9B1yuPz7g5jQu6gFhk9z9AaDnDQkgfijQj2/kg9yR5/avWntFD9yfiui5vo/Bqu+jSJlXBooxpStJg0eQjB525zLIvphdjGiGg1JMK125SLXb+fgqPxHnH/27PFrNjFk76YQ5qr6W6CVJOIHc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676460565; h=Content-Type:Content-Transfer-Encoding:Cc: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=Y0GMJ5tc5H1mnHnOmdxJ/RZ4apebzkDy1RHsXSok8pg=; b=nQlTw9dqLBIKV1l2i3R0nNfLQF6+24Lb7814CdQkFcf/W8xK6nJzf3s1bpd6yufymweEm69C16iIPDbm9ze3S65mvGiTWWbrR9QP2gM7EJg2chQqEuMO85TPPOP1WSPIiiemnnWx1bRWziAbjF+hiS75QrCRO3m59YfUTPlIGrQ= 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=fail header.from= (p=reject 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 1676460565978235.1400774546015; Wed, 15 Feb 2023 03:29:25 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-498-qUCoy0BgMUW8OpRkr9031A-1; Wed, 15 Feb 2023 06:29:21 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0F994830F87; Wed, 15 Feb 2023 11:29:18 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B1D8492B0E; Wed, 15 Feb 2023 11:29:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5C9C01946588; Wed, 15 Feb 2023 11:29:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9F8F41946586 for ; Wed, 15 Feb 2023 11:29:16 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8EC45492B16; Wed, 15 Feb 2023 11:29:16 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 86AF0492B15 for ; Wed, 15 Feb 2023 11:29:16 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D1A83C10142 for ; Wed, 15 Feb 2023 11:29:16 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-556-0kkPb191NnyxyonM9qUH7Q-1; Wed, 15 Feb 2023 06:29:14 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31FBDbjp026272 for ; Wed, 15 Feb 2023 11:29:14 GMT Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nrxb1gbfq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:13 +0000 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 31F9dESe016713 for ; Wed, 15 Feb 2023 11:29:13 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([9.208.129.113]) by ppma05wdc.us.ibm.com (PPS) with ESMTPS id 3np2n7ckfm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:13 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31FBTAFb11403996 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Feb 2023 11:29:10 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2E020583CE; Wed, 15 Feb 2023 11:29:10 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 81847583CC; Wed, 15 Feb 2023 11:29:09 +0000 (GMT) Received: from oro.sl.cloud9.ibm.com (unknown [9.59.192.176]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Feb 2023 11:29:09 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676460564; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=Y0GMJ5tc5H1mnHnOmdxJ/RZ4apebzkDy1RHsXSok8pg=; b=OpKPEOKYdRVi92mAljw9/R8aikxRnBxP+bGS/HiSCTAc8UQ18+R5mdjKwvTSBwT8KHSMA7 fNexCyWuqahTCOxNowGNsogOFo+0fQlbqDR4pazLwjE24KYMOc+BQpKeAxNZS5AM+HAPnm j7G3w+56vcQx/3oBcPguBiVoMxIpWHA= X-MC-Unique: qUCoy0BgMUW8OpRkr9031A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 0kkPb191NnyxyonM9qUH7Q-1 From: Or Ozeri To: libvir-list@redhat.com Subject: [PATCH v2 2/6] qemu: Block deletion and reverting on non-full internal snapshots Date: Wed, 15 Feb 2023 05:28:18 -0600 Message-Id: <20230215112822.1887694-3-oro@il.ibm.com> In-Reply-To: <20230215112822.1887694-1-oro@il.ibm.com> References: <20230215112822.1887694-1-oro@il.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 18igcTqVpojy7VexyGsIrKS1w-udVWa2 X-Proofpoint-GUID: 18igcTqVpojy7VexyGsIrKS1w-udVWa2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-15_06,2023-02-15_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 phishscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 mlxlogscore=939 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302150100 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: oro@il.ibm.com, dannyh@il.ibm.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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: 1676460566648100001 Content-Type: text/plain; charset="utf-8"; x-default="true" An upcoming commit will add support for creating a disks-only snapshot using internal disk snapshots. Deleting or reverting to these will not be supported, at least not for now. This commit adds a validation for this. Signed-off-by: Or Ozeri --- src/conf/snapshot_conf.c | 29 +++++++++++++++++++++++++++++ src/conf/snapshot_conf.h | 3 +++ src/libvirt_private.syms | 1 + src/qemu/qemu_snapshot.c | 12 ++++++++++++ 4 files changed, 45 insertions(+) diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 58a6afa26d..879fe4c7a1 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -945,6 +945,35 @@ virDomainSnapshotIsExternal(virDomainMomentObj *snap) return virDomainSnapshotDefIsExternal(def); } =20 +bool +virDomainSnapshotDefIsNonFullInternal(virDomainSnapshotDef *def) +{ + bool has_internal =3D false; + bool is_full =3D true; + size_t i; + + for (i =3D 0; i < def->ndisks; i++) { + if (def->disks[i].snapshot =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_INT= ERNAL) { + has_internal =3D true; + } else { + is_full =3D false; + } + } + + if (def->memory =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL) + return !is_full; + + return has_internal; +} + +bool +virDomainSnapshotIsNonFullInternal(virDomainMomentObj *snap) +{ + virDomainSnapshotDef *def =3D virDomainSnapshotObjGetDef(snap); + + return virDomainSnapshotDefIsNonFullInternal(def); +} + int virDomainSnapshotRedefinePrep(virDomainObj *vm, virDomainSnapshotDef *snapdef, diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h index c133c105c7..8f40748602 100644 --- a/src/conf/snapshot_conf.h +++ b/src/conf/snapshot_conf.h @@ -125,6 +125,9 @@ int virDomainSnapshotAlignDisks(virDomainSnapshotDef *s= napshot, bool virDomainSnapshotDefIsExternal(virDomainSnapshotDef *def); bool virDomainSnapshotIsExternal(virDomainMomentObj *snap); =20 +bool virDomainSnapshotDefIsNonFullInternal(virDomainSnapshotDef *def); +bool virDomainSnapshotIsNonFullInternal(virDomainMomentObj *snap); + int virDomainSnapshotRedefinePrep(virDomainObj *vm, virDomainSnapshotDef *snapdef, virDomainMomentObj **snap, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 576ec8f95f..0d38e86936 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1027,6 +1027,7 @@ virDomainSnapshotDiskDefFree; virDomainSnapshotDiskDefParseXML; virDomainSnapshotFormatConvertXMLFlags; virDomainSnapshotIsExternal; +virDomainSnapshotIsNonFullInternal; virDomainSnapshotRedefinePrep; virDomainSnapshotStateTypeFromString; virDomainSnapshotStateTypeToString; diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 1aa2f05300..c1855b3028 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1828,6 +1828,12 @@ qemuSnapshotRevertValidate(virDomainObj *vm, return -1; } =20 + if (virDomainSnapshotIsNonFullInternal(snap)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("revert to a non-full internal snapshot not suppo= rted yet")); + return -1; + } + if (!snap->def->dom) { virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, _("snapshot '%s' lacks domain '%s' rollback info"), @@ -3061,6 +3067,12 @@ qemuSnapshotDeleteValidate(virDomainObj *vm, virDomainMomentObj *snap, unsigned int flags) { + if (virDomainSnapshotIsNonFullInternal(snap)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("deletion of a non-full internal snapshot not sup= ported yet")); + return -1; + } + if (!virDomainSnapshotIsExternal(snap) && virDomainObjIsActive(vm)) { ssize_t i; --=20 2.25.1 From nobody Mon May 6 09:32:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=reject dis=none) header.from=il.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1676460584; cv=none; d=zohomail.com; s=zohoarc; b=DZpTQcTcU5UMTtCVPY+sVZCT48LfXGuZ4Hi/FWEl6Y4TdLf8qZ0uuEd0d/XIje+rWq4HKeWp1bdZWmpwNmEyXMQoRY2bDeE/vrnMjDh8ZCFmmkAslSMtRbVYXLeC/2N2lfBOT5X1flrZuZI8yW6Iwb18t1f79BSEb6AEv91fw4w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676460584; h=Content-Type:Content-Transfer-Encoding:Cc: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=bvBVmVKAHfwMqN/foYcZyf5CZUV9Sx5LL83O7CY6l00=; b=ldlqwlLjr5fmcBzv+Yl6SXkBUkyPzuGn5JxRgASfL1bX01c83OXW00AEQD0wVxL7L+29yr1HT/uu27+mgn6ew90PvUAEDp0ltRr/INFV/Z27Cpe94woZS88+lXCHeg+muAhEH5l8MvfHXb1JW/1Yveil4uGiw6G2+08yOytqxW0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=reject dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676460584283761.686879276779; Wed, 15 Feb 2023 03:29:44 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-371-WSTJLZwbMiOKyVmRztvkOg-1; Wed, 15 Feb 2023 06:29:36 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 92791802D2A; Wed, 15 Feb 2023 11:29:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C96C18EC1; Wed, 15 Feb 2023 11:29:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5E5761946588; Wed, 15 Feb 2023 11:29:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2D7911946586 for ; Wed, 15 Feb 2023 11:29:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 02EEC140EBF4; Wed, 15 Feb 2023 11:29:23 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE5CC1415108 for ; Wed, 15 Feb 2023 11:29:22 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BC6E73C10147 for ; Wed, 15 Feb 2023 11:29:22 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-568-kw5Ge5J9Ov-AowFv1QnfDg-1; Wed, 15 Feb 2023 06:29:19 -0500 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31F9t6Gq012704 for ; Wed, 15 Feb 2023 11:29:18 GMT Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nrw6c2bnn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:18 +0000 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 31FANOH1016675 for ; Wed, 15 Feb 2023 11:29:16 GMT Received: from smtprelay06.wdc07v.mail.ibm.com ([9.208.129.118]) by ppma01wdc.us.ibm.com (PPS) with ESMTPS id 3np2n6vhh8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:16 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay06.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31FBTDuP3605024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Feb 2023 11:29:13 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 98B64583CC; Wed, 15 Feb 2023 11:29:13 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EC241583D2; Wed, 15 Feb 2023 11:29:12 +0000 (GMT) Received: from oro.sl.cloud9.ibm.com (unknown [9.59.192.176]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Feb 2023 11:29:12 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676460583; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=bvBVmVKAHfwMqN/foYcZyf5CZUV9Sx5LL83O7CY6l00=; b=IudEWu9qieuAj9Wz8R+uHj3yJhpluZNSipEnrFqdsQVr3sxCqMt8UWeVbSw6PERUcpVx8Y Fw+z/+kCM+UC4HjJ2+0NjeGgsrRBJtuLfF5oJ77R0xi1vkMLF8hz7vJbBCL57O3JbfpKX/ mt/uUfo49WrGVeDRvTp0FDBE+IIC0i4= X-MC-Unique: WSTJLZwbMiOKyVmRztvkOg-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: kw5Ge5J9Ov-AowFv1QnfDg-1 From: Or Ozeri To: libvir-list@redhat.com Subject: [PATCH v2 3/6] qemu: Add internal support for active disk internal snapshots Date: Wed, 15 Feb 2023 05:28:19 -0600 Message-Id: <20230215112822.1887694-4-oro@il.ibm.com> In-Reply-To: <20230215112822.1887694-1-oro@il.ibm.com> References: <20230215112822.1887694-1-oro@il.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: PRKEA1AkA8Aq7iTZVo-HCxThixRTkiGP X-Proofpoint-GUID: PRKEA1AkA8Aq7iTZVo-HCxThixRTkiGP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-15_06,2023-02-15_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 malwarescore=0 mlxlogscore=999 adultscore=0 suspectscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302150100 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: oro@il.ibm.com, dannyh@il.ibm.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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: 1676460584737100009 Content-Type: text/plain; charset="utf-8"; x-default="true" libvirt supports taking external disk snapshots on a running VM, using qemu's "blockdev-snapshot" command. qemu also supports "blockdev-snapshot-internal-sync" to do the same for internal snapshots. This commit wraps this (old) qemu capability to allow future libvirt users to take internal disk snapshots on a running VM. This will only work for disk types which support internal snapshots, and thus we require the disk type to be part of a white list of known types. For this commit, the list of supported formats is empty. An upcoming commit will allow RBD disks to use this new capability. Signed-off-by: Or Ozeri --- src/qemu/qemu_monitor.c | 9 +++ src/qemu/qemu_monitor.h | 5 ++ src/qemu/qemu_monitor_json.c | 14 ++++ src/qemu/qemu_monitor_json.h | 5 ++ src/qemu/qemu_snapshot.c | 72 ++++++++++++------- .../disk_snapshot.xml | 2 +- .../disk_snapshot.xml | 2 +- .../disk_snapshot_redefine.xml | 2 +- tests/qemumonitorjsontest.c | 1 + 9 files changed, 82 insertions(+), 30 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 38f89167e0..f6dab34243 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -4225,6 +4225,15 @@ qemuMonitorTransactionSnapshotBlockdev(virJSONValue = *actions, } =20 =20 +int +qemuMonitorTransactionInternalSnapshotBlockdev(virJSONValue *actions, + const char *device, + const char *name) +{ + return qemuMonitorJSONTransactionInternalSnapshotBlockdev(actions, dev= ice, name); +} + + int qemuMonitorTransactionBackup(virJSONValue *actions, const char *device, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 2d16214ba2..1bfd1ccbc2 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1411,6 +1411,11 @@ qemuMonitorTransactionSnapshotBlockdev(virJSONValue = *actions, const char *node, const char *overlay); =20 +int +qemuMonitorTransactionInternalSnapshotBlockdev(virJSONValue *actions, + const char *device, + const char *name); + typedef enum { QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_MODE_NONE =3D 0, QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_MODE_INCREMENTAL, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index db99017555..002a6caa52 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -8307,6 +8307,20 @@ qemuMonitorJSONTransactionSnapshotBlockdev(virJSONVa= lue *actions, NULL); } =20 + +int +qemuMonitorJSONTransactionInternalSnapshotBlockdev(virJSONValue *actions, + const char *device, + const char *name) +{ + return qemuMonitorJSONTransactionAdd(actions, + "blockdev-snapshot-internal-sync", + "s:device", device, + "s:name", name, + NULL); +} + + VIR_ENUM_DECL(qemuMonitorTransactionBackupSyncMode); VIR_ENUM_IMPL(qemuMonitorTransactionBackupSyncMode, QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_MODE_LAST, diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 6f376cf9b7..313004f327 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -779,6 +779,11 @@ qemuMonitorJSONTransactionSnapshotBlockdev(virJSONValu= e *actions, const char *node, const char *overlay); =20 +int +qemuMonitorJSONTransactionInternalSnapshotBlockdev(virJSONValue *actions, + const char *device, + const char *name); + int qemuMonitorJSONTransactionBackup(virJSONValue *actions, const char *device, diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index c1855b3028..e82352ba7d 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -736,7 +736,7 @@ qemuSnapshotPrepare(virDomainObj *vm, } =20 /* disk snapshot requires at least one disk */ - if (def->state =3D=3D VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT && !external) { + if (def->state =3D=3D VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT && !external &= & !found_internal) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("disk-only snapshots require at least " "one disk to be selected for snapshot")); @@ -852,6 +852,7 @@ qemuSnapshotDiskCleanup(qemuSnapshotDiskData *data, struct _qemuSnapshotDiskContext { qemuSnapshotDiskData *dd; size_t ndd; + bool has_internal; =20 virJSONValue *actions; =20 @@ -1070,17 +1071,17 @@ qemuSnapshotDiskPrepareOne(qemuSnapshotDiskContext = *snapctxt, =20 =20 /** - * qemuSnapshotDiskPrepareActiveExternal: + * qemuSnapshotDiskPrepareActive: * * Collects and prepares a list of structures that hold information about = disks * that are selected for the snapshot. */ static qemuSnapshotDiskContext * -qemuSnapshotDiskPrepareActiveExternal(virDomainObj *vm, - virDomainMomentObj *snap, - bool reuse, - GHashTable *blockNamedNodeData, - virDomainAsyncJob asyncJob) +qemuSnapshotDiskPrepareActive(virDomainObj *vm, + virDomainMomentObj *snap, + bool reuse, + GHashTable *blockNamedNodeData, + virDomainAsyncJob asyncJob) { g_autoptr(qemuSnapshotDiskContext) snapctxt =3D NULL; size_t i; @@ -1089,16 +1090,33 @@ qemuSnapshotDiskPrepareActiveExternal(virDomainObj = *vm, snapctxt =3D qemuSnapshotDiskContextNew(snapdef->ndisks, vm, asyncJob); =20 for (i =3D 0; i < snapdef->ndisks; i++) { - if (snapdef->disks[i].snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_E= XTERNAL) - continue; + switch (snapdef->disks[i].snapshot) { + case VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL: { + if (qemuSnapshotDiskPrepareOne(snapctxt, + vm->def->disks[i], + snapdef->disks + i, + blockNamedNodeData, + reuse, + true) < 0) + return NULL; + break; + } =20 - if (qemuSnapshotDiskPrepareOne(snapctxt, - vm->def->disks[i], - snapdef->disks + i, - blockNamedNodeData, - reuse, - true) < 0) - return NULL; + case VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL: { + snapctxt->has_internal =3D true; + if (qemuMonitorTransactionInternalSnapshotBlockdev(snapctx= t->actions, + vm->def= ->disks[i]->src->nodeformat, + snapdef= ->disks[i].snapshot_name) < 0) + return NULL; + break; + } + + case VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT: + case VIR_DOMAIN_SNAPSHOT_LOCATION_NO: + case VIR_DOMAIN_SNAPSHOT_LOCATION_MANUAL: + case VIR_DOMAIN_SNAPSHOT_LOCATION_LAST: + continue; + } } =20 return g_steal_pointer(&snapctxt); @@ -1182,7 +1200,7 @@ qemuSnapshotDiskCreate(qemuSnapshotDiskContext *snapc= txt) int rc; =20 /* check whether there's anything to do */ - if (snapctxt->ndd =3D=3D 0) + if (snapctxt->ndd =3D=3D 0 && !snapctxt->has_internal) return 0; =20 if (qemuDomainObjEnterMonitorAsync(snapctxt->vm, snapctxt->asyncJob) <= 0) @@ -1215,11 +1233,11 @@ qemuSnapshotDiskCreate(qemuSnapshotDiskContext *sna= pctxt) =20 /* The domain is expected to be locked and active. */ static int -qemuSnapshotCreateActiveExternalDisks(virDomainObj *vm, - virDomainMomentObj *snap, - GHashTable *blockNamedNodeData, - unsigned int flags, - virDomainAsyncJob asyncJob) +qemuSnapshotCreateActiveDisks(virDomainObj *vm, + virDomainMomentObj *snap, + GHashTable *blockNamedNodeData, + unsigned int flags, + virDomainAsyncJob asyncJob) { bool reuse =3D (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) !=3D 0; g_autoptr(qemuSnapshotDiskContext) snapctxt =3D NULL; @@ -1229,8 +1247,8 @@ qemuSnapshotCreateActiveExternalDisks(virDomainObj *v= m, =20 /* prepare a list of objects to use in the vm definition so that we do= n't * have to roll back later */ - if (!(snapctxt =3D qemuSnapshotDiskPrepareActiveExternal(vm, snap, reu= se, - blockNamedNodeD= ata, asyncJob))) + if (!(snapctxt =3D qemuSnapshotDiskPrepareActive(vm, snap, reuse, + blockNamedNodeData, asy= ncJob))) return -1; =20 if (qemuSnapshotDiskCreate(snapctxt) < 0) @@ -1370,9 +1388,9 @@ qemuSnapshotCreateActiveExternal(virQEMUDriver *drive= r, =20 /* the domain is now paused if a memory snapshot was requested */ =20 - if ((ret =3D qemuSnapshotCreateActiveExternalDisks(vm, snap, - blockNamedNodeData, f= lags, - VIR_ASYNC_JOB_SNAPSHO= T)) < 0) + if ((ret =3D qemuSnapshotCreateActiveDisks(vm, snap, + blockNamedNodeData, flags, + VIR_ASYNC_JOB_SNAPSHOT)) < 0) goto cleanup; =20 /* the snapshot is complete now */ diff --git a/tests/qemudomainsnapshotxml2xmlin/disk_snapshot.xml b/tests/qe= mudomainsnapshotxml2xmlin/disk_snapshot.xml index cf5ea0814e..87b6251a7f 100644 --- a/tests/qemudomainsnapshotxml2xmlin/disk_snapshot.xml +++ b/tests/qemudomainsnapshotxml2xmlin/disk_snapshot.xml @@ -4,7 +4,7 @@ - + diff --git a/tests/qemudomainsnapshotxml2xmlout/disk_snapshot.xml b/tests/q= emudomainsnapshotxml2xmlout/disk_snapshot.xml index 76c543d25c..6cf93183d5 100644 --- a/tests/qemudomainsnapshotxml2xmlout/disk_snapshot.xml +++ b/tests/qemudomainsnapshotxml2xmlout/disk_snapshot.xml @@ -5,7 +5,7 @@ - + diff --git a/tests/qemudomainsnapshotxml2xmlout/disk_snapshot_redefine.xml = b/tests/qemudomainsnapshotxml2xmlout/disk_snapshot_redefine.xml index 24b41ba7c5..f574793edf 100644 --- a/tests/qemudomainsnapshotxml2xmlout/disk_snapshot_redefine.xml +++ b/tests/qemudomainsnapshotxml2xmlout/disk_snapshot_redefine.xml @@ -10,7 +10,7 @@ - + diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 1db1f2b949..1269c74e43 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2587,6 +2587,7 @@ testQemuMonitorJSONTransaction(const void *opaque) qemuMonitorTransactionBitmapDisable(actions, "node4", "bitmap4") <= 0 || qemuMonitorTransactionBitmapMerge(actions, "node5", "bitmap5", &me= rgebitmaps) < 0 || qemuMonitorTransactionSnapshotBlockdev(actions, "node7", "overlay7= ") < 0 || + qemuMonitorTransactionInternalSnapshotBlockdev(actions, "device1",= "snapshot1") < 0 || qemuMonitorTransactionBackup(actions, "dev8", "job8", "target8", "= bitmap8", QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_= MODE_NONE) < 0 || qemuMonitorTransactionBackup(actions, "dev9", "job9", "target9", "= bitmap9", --=20 2.25.1 From nobody Mon May 6 09:32:42 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=fail(p=reject dis=none) header.from=il.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1676460574; cv=none; d=zohomail.com; s=zohoarc; b=S4vX6lHw/fplI3KP7/bl/GWxLVcwmOwF4aJGJ7CW2nJNg01DjurQIaLkaPsjbn5zbbwBHDC4x7IXNYfovvLboHg/Ao8E5JMCv7KKQSSiMJl3v+ncr/T/F0J720t+o3laQVAHUdVYuRoJG3JQO8GPsCID6N3MVoUowwFXWwj13KQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676460574; h=Content-Type:Content-Transfer-Encoding:Cc: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=rmqnGaVZGLvAnA5bvhJVKZ4iuUKp/CT/J62IdE9XUrw=; b=FSHL2D4uDaaVU1foSeCuNMYjJcsrCuEXGVIu5vLute9nyK2laYUcc3M6CEPV6nPLZErVWbzcaXfDzBn8tFA7dT5Vk9N5ShcE5ygBdiATqygBuX+Xtdmr0mieBnSV/x9g0LnqwgnQBPXsznRe0OXsR4wjOK47cfnSn3pYJpCOLVE= 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=fail header.from= (p=reject 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 1676460574920690.8825326298211; Wed, 15 Feb 2023 03:29:34 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-656-2bMp-t8XMoOjsEoed16_EQ-1; Wed, 15 Feb 2023 06:29:31 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C28A685A5A3; Wed, 15 Feb 2023 11:29:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id AED542166B31; Wed, 15 Feb 2023 11:29:28 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9CECB1946588; Wed, 15 Feb 2023 11:29:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AE7BF1946586 for ; Wed, 15 Feb 2023 11:29:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9184DC15BAD; Wed, 15 Feb 2023 11:29:23 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89074C15BA0 for ; Wed, 15 Feb 2023 11:29:23 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 576051871DA1 for ; Wed, 15 Feb 2023 11:29:23 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-136-4Md5teOcNEarIdFbL3rQ4A-1; Wed, 15 Feb 2023 06:29:21 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31FBMbSe023987 for ; Wed, 15 Feb 2023 11:29:21 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nrw6uaf0s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:20 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 31FAr6Wq023603 for ; Wed, 15 Feb 2023 11:29:19 GMT Received: from smtprelay04.dal12v.mail.ibm.com ([9.208.130.102]) by ppma02dal.us.ibm.com (PPS) with ESMTPS id 3np2n7hnqv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:19 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay04.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31FBTHG410945216 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Feb 2023 11:29:17 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F01E3583CC; Wed, 15 Feb 2023 11:29:16 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4F97D583D0; Wed, 15 Feb 2023 11:29:16 +0000 (GMT) Received: from oro.sl.cloud9.ibm.com (unknown [9.59.192.176]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Feb 2023 11:29:16 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676460573; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=rmqnGaVZGLvAnA5bvhJVKZ4iuUKp/CT/J62IdE9XUrw=; b=hKa6FpvVNamICU4awFVM5Wa3a94GYGFgjk74LKaVZS/Q9PbWRYt2jAtpxlzXULBk1X1Ylm 16xILgX032oV62dLMdBtX7vusN1BxSJwnRMEytgKOeNnV7uEAeDHTASffDAHyftOMMK4rV 3cJSutfkiQCGlPBpKAxe6aT8TYnw7c4= X-MC-Unique: 2bMp-t8XMoOjsEoed16_EQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 4Md5teOcNEarIdFbL3rQ4A-1 From: Or Ozeri To: libvir-list@redhat.com Subject: [PATCH v2 4/6] qemu: Allow active disk snapshots for RBD disks Date: Wed, 15 Feb 2023 05:28:20 -0600 Message-Id: <20230215112822.1887694-5-oro@il.ibm.com> In-Reply-To: <20230215112822.1887694-1-oro@il.ibm.com> References: <20230215112822.1887694-1-oro@il.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: TvAhTThuNUQ-4KlgqAeDqdeVW_d871je X-Proofpoint-GUID: TvAhTThuNUQ-4KlgqAeDqdeVW_d871je X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-15_06,2023-02-15_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 impostorscore=0 mlxscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 adultscore=0 spamscore=0 mlxlogscore=709 lowpriorityscore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302150100 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: oro@il.ibm.com, dannyh@il.ibm.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1676460576646100001 Content-Type: text/plain; charset="utf-8"; x-default="true" This commit removes the check disallowing users to take active disk-only snapshots of RBD disks. The actual support for this functionality was added in a previous commit. Signed-off-by: Or Ozeri --- src/qemu/qemu_snapshot.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index e82352ba7d..a10bdf7bf2 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -630,6 +630,8 @@ qemuSnapshotPrepare(virDomainObj *vm, for (i =3D 0; i < def->ndisks; i++) { virDomainSnapshotDiskDef *disk =3D &def->disks[i]; virDomainDiskDef *dom_disk =3D vm->def->disks[i]; + bool is_raw_rbd =3D (dom_disk->src->format =3D=3D VIR_STORAGE_FILE= _RAW && + dom_disk->src->protocol =3D=3D VIR_STORAGE_NET_= PROTOCOL_RBD); =20 if (disk->snapshot !=3D VIR_DOMAIN_SNAPSHOT_LOCATION_NO && qemuDomainDiskBlockJobIsActive(dom_disk)) @@ -639,7 +641,7 @@ qemuSnapshotPrepare(virDomainObj *vm, case VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL: found_internal =3D true; =20 - if (def->state =3D=3D VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT && act= ive) { + if (def->state =3D=3D VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT && act= ive && !is_raw_rbd) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("active qemu domains require external dis= k " "snapshots; disk %s requested internal"), @@ -652,7 +654,8 @@ qemuSnapshotPrepare(virDomainObj *vm, return -1; =20 if (dom_disk->src->format > 0 && - dom_disk->src->format !=3D VIR_STORAGE_FILE_QCOW2) { + dom_disk->src->format !=3D VIR_STORAGE_FILE_QCOW2 && + !is_raw_rbd) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("internal snapshot for disk %s unsupporte= d " "for storage type %s"), --=20 2.25.1 From nobody Mon May 6 09:32:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=reject dis=none) header.from=il.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1676460580; cv=none; d=zohomail.com; s=zohoarc; b=Fyk5Yy1NjY9Rc1CcDkFOjl5s7K9lIsaPAlDFy5Ep5Z2QokYL1TDwM0lE061/weXk34RlUtEW0XTWX8M91e31vbPc927ONA6u/mjAWp0hJaCQnrMh3glR0K+AKGmjKhkr2PvGZAoyATYO6tpqnb7al+0AGty9Lrtt9nvcCp7PLf0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676460580; h=Content-Type:Content-Transfer-Encoding:Cc: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=MN7eBqHp/GlE8l5BZlspi2jfYNDrAN0XZXOR0qjDJQM=; b=iURve0lw7E3inSMF+BAX4vAVHXt+tYv42iWc1dp4rW/rD6VriekOoeHXUiAAe79i8LQ2ytvlfR3bUc2fVxSRW8mhUzNfnMLDjNtOmF5NFxsBY1d5eSUxgsjUY//jayvVEldeN6Ww0u4wKPMEeR2ehljXFqOLus02fGhlS079yx4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=reject dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 167646058093815.478969650560202; Wed, 15 Feb 2023 03:29:40 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-455-Yp3qKvgDP-eTZg8lOZFXqQ-1; Wed, 15 Feb 2023 06:29:36 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 32F3E28004E7; Wed, 15 Feb 2023 11:29:33 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1EED74024B7C; Wed, 15 Feb 2023 11:29:33 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id DAA8D19465B2; Wed, 15 Feb 2023 11:29:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B72871946586 for ; Wed, 15 Feb 2023 11:29:31 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 88F1E492B16; Wed, 15 Feb 2023 11:29:31 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast09.extmail.prod.ext.rdu2.redhat.com [10.11.55.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 81765492B15 for ; Wed, 15 Feb 2023 11:29:31 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4432628004F3 for ; Wed, 15 Feb 2023 11:29:31 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-170-WYzljxNkOC-vk3nDzQa8GA-1; Wed, 15 Feb 2023 06:29:29 -0500 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31FAC5BA030719 for ; Wed, 15 Feb 2023 11:29:28 GMT Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nrwe31w4v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:27 +0000 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 31FAuA0i000999 for ; Wed, 15 Feb 2023 11:29:27 GMT Received: from smtprelay03.wdc07v.mail.ibm.com ([9.208.129.113]) by ppma04dal.us.ibm.com (PPS) with ESMTPS id 3np2n7hnes-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:27 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay03.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31FBTNv39044486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Feb 2023 11:29:23 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2DFCD583CE; Wed, 15 Feb 2023 11:29:23 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 82755583D6; Wed, 15 Feb 2023 11:29:22 +0000 (GMT) Received: from oro.sl.cloud9.ibm.com (unknown [9.59.192.176]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Feb 2023 11:29:22 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676460580; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=MN7eBqHp/GlE8l5BZlspi2jfYNDrAN0XZXOR0qjDJQM=; b=KdTd+lf3KIn4mgV1a4kmdafy4insAfROQ/a0JN7LLFkamF6fNCSo8kRMlnnWj/NJ2xsPaA 2z/GHShdKM4wVCuU7H1PfyZ4cjJH5Ynu+Boh+nYH59OsQ3aiSGE5uvGAruZcPRUhewrzJH Di7B25HD5G6veFZBXx1j2LbUt/pW0D4= X-MC-Unique: Yp3qKvgDP-eTZg8lOZFXqQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: WYzljxNkOC-vk3nDzQa8GA-1 From: Or Ozeri To: libvir-list@redhat.com Subject: [PATCH v2 5/6] qemu: Allow setting per-disk snapshot name for RBD disks Date: Wed, 15 Feb 2023 05:28:21 -0600 Message-Id: <20230215112822.1887694-6-oro@il.ibm.com> In-Reply-To: <20230215112822.1887694-1-oro@il.ibm.com> References: <20230215112822.1887694-1-oro@il.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: JUFh-Ys438Y-XTIM1aWi-a6SAJEtQDAc X-Proofpoint-ORIG-GUID: JUFh-Ys438Y-XTIM1aWi-a6SAJEtQDAc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-15_06,2023-02-15_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=680 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 spamscore=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302150100 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: oro@il.ibm.com, dannyh@il.ibm.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: 1676460582686100005 Content-Type: text/plain; charset="utf-8"; x-default="true" This commit adds the option for setting per-disk snapshot name for RBD disks. All other disk types are still disallowed to use the snapshotName attribute. Signed-off-by: Or Ozeri --- src/qemu/qemu_snapshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index a10bdf7bf2..c72bdb4723 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -664,7 +664,7 @@ qemuSnapshotPrepare(virDomainObj *vm, return -1; } =20 - if (disk->snapshot_name) { + if (disk->snapshot_name && !is_raw_rbd) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("snapshot name setting for disk %s unsupp= orted " "for storage type %s"), --=20 2.25.1 From nobody Mon May 6 09:32:42 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=fail(p=reject dis=none) header.from=il.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1676460612; cv=none; d=zohomail.com; s=zohoarc; b=POuHQ0U3ODg3PmKQc1CO15WuwdlbkU6op6d/OH8ZkLS9q5soKEIYlAJpIO0Og5N0lXZoenVZpBTjPy2uULmyl4qHvTXKp/o1N25Wr4Dk+egY85hOTtR4R4C2TV1972ZuH6WClpYTTW53+VsFgt/6/6RGok2a1nOUR1+Tg+mDoek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676460612; h=Content-Type:Content-Transfer-Encoding:Cc: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=WnYHU/BaKaVFG2OEfuoGZsW75+ngwm7yTlDf6zEHsEw=; b=CKv7mnXi/InIRn1M9Az1P5SZnvLBolJpNpK7fK4UjiFe2sJMyTzJWk8fjBjbjBlMGhWYM1VZ1UU3yRHbLTUnpILGf8GXmNYTfrVWPsKCqpnOZ+9rG54G8uFpBM5Eol3HPMryIFHtvJV8NNN8qBOvfHcs46iPdF+ow8joiOFSyjk= 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=fail header.from= (p=reject 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 1676460612737814.3821676805035; Wed, 15 Feb 2023 03:30:12 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-168-rJzjtn7FPROq0WEB_Fl56g-1; Wed, 15 Feb 2023 06:30:07 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 12EA61008138; Wed, 15 Feb 2023 11:30:04 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id F046E4010E83; Wed, 15 Feb 2023 11:30:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BE9151946595; Wed, 15 Feb 2023 11:30:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5493A1946586 for ; Wed, 15 Feb 2023 11:29:33 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 29511492B16; Wed, 15 Feb 2023 11:29:33 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21291492B15 for ; Wed, 15 Feb 2023 11:29:33 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E4ABC857A88 for ; Wed, 15 Feb 2023 11:29:32 +0000 (UTC) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-86-d323EdxhOdyGUgRMsUMulw-1; Wed, 15 Feb 2023 06:29:31 -0500 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 31FBDd1X005078 for ; Wed, 15 Feb 2023 11:29:30 GMT Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nrxb1gbk7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:30 +0000 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 31FA1EKx021534 for ; Wed, 15 Feb 2023 11:29:30 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([9.208.129.116]) by ppma02wdc.us.ibm.com (PPS) with ESMTPS id 3np2n7cjvb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 15 Feb 2023 11:29:29 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 31FBTRZ38979004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Feb 2023 11:29:27 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EB02B583CE; Wed, 15 Feb 2023 11:29:26 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4AAB9583CC; Wed, 15 Feb 2023 11:29:26 +0000 (GMT) Received: from oro.sl.cloud9.ibm.com (unknown [9.59.192.176]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 15 Feb 2023 11:29:26 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676460611; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=WnYHU/BaKaVFG2OEfuoGZsW75+ngwm7yTlDf6zEHsEw=; b=WlrqXGlg4E1Jt1RGp9LQj/S20zI4xiXYnQFl6lmYXmVQ0Ve/wRWkTyhwDz4bItzSoYzX7b mR3DAk2xcdU0Fq5gHgG+eyvs7mgwuyu76EZzoKUcdY7aYrQwvzmCeLuo6KJkrZa8u+7FPq 5Qaq6WA+6rTbeFKcSHDic30kxKiqGmQ= X-MC-Unique: rJzjtn7FPROq0WEB_Fl56g-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: d323EdxhOdyGUgRMsUMulw-1 From: Or Ozeri To: libvir-list@redhat.com Subject: [PATCH v2 6/6] qemu: Allow mixing active internal and external active disk snapshots Date: Wed, 15 Feb 2023 05:28:22 -0600 Message-Id: <20230215112822.1887694-7-oro@il.ibm.com> In-Reply-To: <20230215112822.1887694-1-oro@il.ibm.com> References: <20230215112822.1887694-1-oro@il.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: uxWa6CZjyaXN6CK5n42TudOMLDb9LCTf X-Proofpoint-GUID: uxWa6CZjyaXN6CK5n42TudOMLDb9LCTf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.170.22 definitions=2023-02-15_06,2023-02-15_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 bulkscore=0 impostorscore=0 adultscore=0 mlxlogscore=895 spamscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302150100 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: oro@il.ibm.com, dannyh@il.ibm.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 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: 1676460614878100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Previous commit added support for active RBD disk snapshots, using the same qmp_transaction used also for external snapshots. The same transaction can be used to mix internal and external snapshots. To allow this, this commit simply removes the check that disallows mixing for active snapshots. Note that previous commits added validation disallowing deletion and reverting of RBD disks. The same validation applies to the mixed type of snapshots introduced by this commit. Signed-off-by: Or Ozeri --- src/qemu/qemu_snapshot.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index c72bdb4723..81b3e94988 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -746,10 +746,9 @@ qemuSnapshotPrepare(virDomainObj *vm, return -1; } =20 - /* For now, we don't allow mixing internal and external disks. - * XXX technically, we could mix internal and external disks for + /* For now, we don't allow mixing internal and external disks for * offline snapshots */ - if ((found_internal && external) || + if ((found_internal && external && !active) || (def->memory =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL && exte= rnal) || (def->memory =3D=3D VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL && foun= d_internal)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", --=20 2.25.1