From nobody Sun Feb 8 21:11:44 2026 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=1636993616; cv=none; d=zohomail.com; s=zohoarc; b=HrxLrsEWLx0dVHHSIT3+tIRaBZKH4zaJP2heShCOPR/fw2Dvlt3778P0zCAmZFL2EViPVnbJ+j6DB0VGVspxBUn6q7sxp63c/LM102BlTlr/RebHV2Iz4HrGkody2ayIbngS2f+mgjwPMAGB4zoHriZLFgyouCwCecKVRGUJH+s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636993616; 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=4dj39jQhtTaR1IdyisbY+EmiyRJkETgNixrVba2nzGQ=; b=DJ/LHagE05Z5aAOmv9Iik5RwdE5UEOpTPjsEQE/C+1Xl4lmF5MqW0z4fQa0Adt1F9m/xDWbQnqYQBEMHGm5OoLhgnIQIpbTCR1TngALC7vjVm5f5kIl/BszD4zhxMXxJKTv39zYuzTiV2njhCaGjMXs5vFdpZTUC6PW0EUFj6T0= 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 1636993616531876.3885050391457; Mon, 15 Nov 2021 08:26:56 -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-120-45_KjKSMOMKpC--r5uHG0A-1; Mon, 15 Nov 2021 11:26:53 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2AF96824FAF; Mon, 15 Nov 2021 16:26:22 +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 62BC956AB6; Mon, 15 Nov 2021 16:26:21 +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 180144A703; Mon, 15 Nov 2021 16:26:21 +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 1AFGN8fQ028215 for ; Mon, 15 Nov 2021 11:23:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 63C01197FC; Mon, 15 Nov 2021 16:23:08 +0000 (UTC) Received: from antique-work.redhat.com (unknown [10.40.194.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id D460160657 for ; Mon, 15 Nov 2021 16:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1636993615; 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=4dj39jQhtTaR1IdyisbY+EmiyRJkETgNixrVba2nzGQ=; b=CO0RlMU7pgsARhVk7F8wO/VThuuQ20Hm9rD0K34hqThGBKwB+LnxTq8THncpxQMyuyGQhT ItIXC9goK5hQTR8DOtmpqhOLkN/OIapqJ3PVDY+l5k4Sw5A0PrANwVW1hDIpPrtksbmawA L58kQCZi0yGX6xpeLGntHFX7+s28NBE= X-MC-Unique: 45_KjKSMOMKpC--r5uHG0A-1 From: Pavel Hrdina To: libvir-list@redhat.com Subject: [libvirt PATCH 02/11] qemu_snapshot: revert: always restart QEMU process for running VM Date: Mon, 15 Nov 2021 17:22:45 +0100 Message-Id: <560359ae82f1e9d7b9cb037f5dcaf1c4a3ea0aa5.1636993188.git.phrdina@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.15 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: 1636993617729100001 Content-Type: text/plain; charset="utf-8" Our compatibility check code isn't complete and there are cases where it fails to detect incompatible configuration and the revert fails. In addition future support for external snapshot will always require restarting the QEMU process. To unify the behavior drop the compatibility check code and always restart the QEMU process. Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- src/qemu/qemu_snapshot.c | 66 ++++++---------------------------------- 1 file changed, 10 insertions(+), 56 deletions(-) diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 3d6ec490ab..661f74146c 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -1989,62 +1989,16 @@ qemuSnapshotRevert(virDomainObj *vm, * to have finer control. */ if (virDomainObjIsActive(vm)) { /* Transitions 5, 6, 8, 9 */ - /* Check for ABI compatibility. We need to do this check again= st - * the migratable XML or it will always fail otherwise */ - bool compatible; - - /* Replace the CPU in config and put the original one in priv - * once we're done. When we have the updated CPU def in the - * cookie, we don't want to replace the CPU in migratable def - * when doing ABI checks to make sure the current CPU exactly - * matches the one used at the time the snapshot was taken. - */ - if (cookie && cookie->cpu && config->cpu) { - origCPU =3D config->cpu; - if (!(config->cpu =3D virCPUDefCopy(cookie->cpu))) - goto endjob; - - compatible =3D qemuDomainDefCheckABIStability(driver, - priv->qemuCaps, - vm->def, - config); - } else { - compatible =3D qemuDomainCheckABIStability(driver, vm, con= fig); - } - - /* If using VM GenID, there is no way currently to change - * the genid for the running guest, so set an error, - * mark as incompatible, and don't allow change of genid - * if the revert force flag would start the guest again. */ - if (compatible && config->genidRequested) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("domain genid update requires restart")); - compatible =3D false; - start_flags &=3D ~VIR_QEMU_PROCESS_START_GEN_VMID; - } - - if (!compatible) { - virErrorPtr err =3D virGetLastError(); - - if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) { - /* Re-spawn error using correct category. */ - if (err->code =3D=3D VIR_ERR_CONFIG_UNSUPPORTED) - virReportError(VIR_ERR_SNAPSHOT_REVERT_RISKY, "%s", - err->str2); - goto endjob; - } - virResetError(err); - qemuProcessStop(driver, vm, - VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, - QEMU_ASYNC_JOB_START, 0); - virDomainAuditStop(vm, "from-snapshot"); - detail =3D VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT; - event =3D virDomainEventLifecycleNewFromObj(vm, - VIR_DOMAIN_EVENT_STOPPED, - detail); - virObjectEventStateQueue(driver->domainEventState, event); - goto load; - } + qemuProcessStop(driver, vm, + VIR_DOMAIN_SHUTOFF_FROM_SNAPSHOT, + QEMU_ASYNC_JOB_START, 0); + virDomainAuditStop(vm, "from-snapshot"); + detail =3D VIR_DOMAIN_EVENT_STOPPED_FROM_SNAPSHOT; + event =3D virDomainEventLifecycleNewFromObj(vm, + VIR_DOMAIN_EVENT_STO= PPED, + detail); + virObjectEventStateQueue(driver->domainEventState, event); + goto load; =20 if (virDomainObjGetState(vm, NULL) =3D=3D VIR_DOMAIN_RUNNING) { /* Transitions 5, 6 */ --=20 2.31.1