From nobody Mon Feb 9 19:53:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1583223607; cv=none; d=zohomail.com; s=zohoarc; b=dboOG4/PVDiHsZuSc7zWGChb0xF1XLV2rJ3Ak+sKOlgRlnif2yRnrxu6+1aa7j5EYTMdAbCuMjG3HspYha0oyx+/f7O9Ffg5J8lgbL6BQaOtzfQEuvB9+rK2SfoJdSjvNTYWEZwoQc/z0aHC21zPb+cF03l22WWpbFgTgnXkZF0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583223607; 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=q1fHEO319jLj9XwVBPqGoxAm4WMlNTuKWbGW5h8XiYY=; b=Y+E+xICbMlaJ2zq/M8ATnevhI3Wy8oFkDw0A55jk+28tUkskLbVdTLtOZcvWxbU2i87tZdFBTju7XnSaJCrwYNB7O1Xcf4HRtMgunf/SbnVCix57E5rSHcCZSkcrdbKFr3MRck00Zgpc9dOBUR0QEZIbZEf9X9YksnxUDaq/GKc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1583223607557453.5527461463978; Tue, 3 Mar 2020 00:20:07 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-148-YFW4Cw2gNqeJP_WlY8N3ww-1; Tue, 03 Mar 2020 03:20:04 -0500 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 2121C1005516; Tue, 3 Mar 2020 08:19:59 +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 D8A5E60C80; Tue, 3 Mar 2020 08:19: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 7C0FE18089D6; Tue, 3 Mar 2020 08:19:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0238JkQd003624 for ; Tue, 3 Mar 2020 03:19:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id 841D22166B34; Tue, 3 Mar 2020 08:19:46 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B4062166B2E for ; Tue, 3 Mar 2020 08:19:44 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 71DC68007D4 for ; Tue, 3 Mar 2020 08:19:44 +0000 (UTC) Received: from relay.sw.ru (relay.sw.ru [185.231.240.75]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-403-mJOCQp9eOsGguPcRG3Ptdg-1; Tue, 03 Mar 2020 03:19:42 -0500 Received: from dhcp-172-16-24-106.sw.ru ([172.16.24.106] helo=shiny.sw.ru) by relay.sw.ru with esmtp (Exim 4.92.3) (envelope-from ) id 1j92mB-0002uR-Ck for libvir-list@redhat.com; Tue, 03 Mar 2020 11:19:39 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583223606; 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=q1fHEO319jLj9XwVBPqGoxAm4WMlNTuKWbGW5h8XiYY=; b=I5J/AO222LbxModFdL/MIVdcpJXQNQGlvvnGqwlInSLh2NXB0Y3w4+rc40Dp+1q3peXdGY atW4k5Pfg3Ts26crdW+6ewezI8rk6xs7MkUx6qgcNVyAgITWlDclZNT+OLun3vjOwzqSsf 4JEM9domdkhlJJTfuzO3+yEBS7I95/0= X-MC-Unique: YFW4Cw2gNqeJP_WlY8N3ww-1 X-MC-Unique: mJOCQp9eOsGguPcRG3Ptdg-1 From: Nikolay Shirokovskiy To: libvir-list@redhat.com Subject: [PATCH 5/8] qemu: update name on reverting from snapshot Date: Tue, 3 Mar 2020 11:19:19 +0300 Message-Id: <20200303081922.9157-6-nshirokovskiy@virtuozzo.com> In-Reply-To: <20200303081922.9157-1-nshirokovskiy@virtuozzo.com> References: <20200303081922.9157-1-nshirokovskiy@virtuozzo.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 0238JkQd003624 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 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" If domain name is changed since snapshot we need to update it to current in config taken from snapshot. Signed-off-by: Nikolay Shirokovskiy --- src/qemu/qemu_driver.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 288067dd67..875b665cdf 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16326,6 +16326,11 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, driver->xmlopt, priv->qemuCaps, true); if (!config) goto endjob; + + if (STRNEQ(config->name, vm->def->name)) { + VIR_FREE(config->name); + config->name =3D g_strdup(vm->def->name); + } } =20 if (snap->def->inactiveDom) { @@ -16333,6 +16338,11 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr sn= apshot, driver->xmlopt, priv->qemuCaps, = true); if (!inactiveConfig) goto endjob; + + if (STRNEQ(inactiveConfig->name, vm->def->name)) { + VIR_FREE(inactiveConfig->name); + inactiveConfig->name =3D g_strdup(vm->def->name); + } } else { /* Inactive domain definition is missing: * - either this is an old active snapshot and we need to copy the --=20 2.23.0