From nobody Tue Sep 22 01:55:43 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) client-ip=38.145.34.151; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1784734931; cv=none; d=zohomail.com; s=zohoarc; b=D05IIpHHYYoqFF7d34Pn6lUV5q8rXN2USbB3TzM6Reis6Hh2Iaq2ajAZqWrkPRsMJl8c50TpvwTwc44uQADPnpO6VTr2DcI2gKNiPyeZq887do4PY8uFc17weYV3BJNwku57CWr2DZsLJBB3KL8ScAXEdJURno7FShrlhXWPYlA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1784734931; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=KPLIGNK7fx7vGETp2ld0fZBWcMLN8ZScPHusaR+8OFo=; b=QBmmRPfzA9vSONsD5O4L9MhvIQbcq0kAkSBHWN+BXZctIoQ+iml8wRBPQjggGbIsk5Q/eAoajELO1pFHeWvrJdZyrs4geW0R+88s2dpln0Lnzx6YOCjakRGLI6HTJC9GKb7a6O30L4aiS9Dda5p6R7ZXVFiL2PX274M6PRv7jN8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 38.145.34.151 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [38.145.34.151]) by mx.zohomail.com with SMTPS id 1784734931533362.10112886586126; Wed, 22 Jul 2026 08:42:11 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 993) id 425F241B41; Wed, 22 Jul 2026 11:42:10 -0400 (EDT) Received: from [172.19.199.10] (unknown [10.16.107.18]) by lists.libvirt.org (Postfix) with ESMTP id C4F1241BB3; Wed, 22 Jul 2026 11:38:41 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 993) id F0DC841949; Wed, 22 Jul 2026 11:38:26 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 87D6E41920 for ; Wed, 22 Jul 2026 11:38:25 -0400 (EDT) Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-347-QVw7hJe0P7ymUzS4hA6jLg-1; Wed, 22 Jul 2026 11:38:23 -0400 Received: from mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.95]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6A2911805F0B for ; Wed, 22 Jul 2026 15:38:22 +0000 (UTC) Received: from speedmetal.lan (unknown [10.44.24.17]) by mx-prod-int-10.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id BB70A42F for ; Wed, 22 Jul 2026 15:38:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1784734705; h=from:from: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; bh=KPLIGNK7fx7vGETp2ld0fZBWcMLN8ZScPHusaR+8OFo=; b=PKoaRA9XhwryJxckmP2byODzb9hRnG/3Qcy4vRsG5IbGCZI296LlFnbzSm3j/lviagP7H/ 2iGb78k1Dwsjzkx9oE4Pss8YLYZ2k2bW9TZVCOC7i94CleUZ9qOb8+CTtRyfoGGsVFZA1J mNzQ58U1P+0VffE0hHeJuL4zaItQ6eU= X-MC-Unique: QVw7hJe0P7ymUzS4hA6jLg-1 X-Mimecast-MFC-AGG-ID: QVw7hJe0P7ymUzS4hA6jLg_1784734702 To: devel@lists.libvirt.org Subject: [PATCH 01/13] qemu: Always assume support for 'QEMU_CAPS_SET_ACTION' Date: Wed, 22 Jul 2026 17:38:06 +0200 Message-ID: <36289d970fa4af8fac7bffc99cd6a4ff170cea44.1784734635.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.6 on 10.30.177.95 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 2HtTlkMiYNbR7ixBNxk3FyFcoDlD_CFZm38nXEdGS6c_1784734702 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: R7VBWQULH2KYMZDUBMJXSA544GHL4T4B X-Message-ID-Hash: R7VBWQULH2KYMZDUBMJXSA544GHL4T4B X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1784734931877158500 Content-Type: text/plain; charset="utf-8" From: Peter Krempa The 'set-action' QMP command was introduced in qemu-6.0 and can't be disabled in any way. Oldest qemu we support is qemu-7.2 so all versions now have it. Remove all conditional code which depends on the 'set-action' command. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 13 +++---------- src/qemu/qemu_driver.c | 16 ---------------- src/qemu/qemu_hotplug.c | 10 +--------- src/qemu/qemu_process.c | 31 +------------------------------ src/qemu/qemu_validate.c | 14 ++------------ 5 files changed, 7 insertions(+), 77 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 95e2ea9a6b..a76a034158 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6184,16 +6184,9 @@ qemuBuildPMCommandLine(virCommand *cmd, { virQEMUCaps *qemuCaps =3D priv->qemuCaps; - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)) { - /* with new qemu we always want '-no-shutdown' on startup and we s= et - * all the other behaviour later during startup */ - virCommandAddArg(cmd, "-no-shutdown"); - } else { - if (priv->allowReboot =3D=3D VIR_TRISTATE_BOOL_NO) - virCommandAddArg(cmd, "-no-reboot"); - else - virCommandAddArg(cmd, "-no-shutdown"); - } + /* with new qemu we always want '-no-shutdown' on startup and we set + * all the other behaviour later during startup */ + virCommandAddArg(cmd, "-no-shutdown"); /* Use old syntax of -no-acpi only if qemu didn't report that it suppo= rts the * new syntax */ diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index bdc0cff66a..71308770f6 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -19548,9 +19548,6 @@ qemuDomainModifyLifecycleActionLive(virDomainObj *v= m, qemuDomainObjPrivate *priv =3D vm->privateData; int rc; - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)) - return 0; - /* For now we only update 'reboot' action here as we want to keep the * shutdown action as is (we're emulating the outcome anyways)) */ if (type !=3D VIR_DOMAIN_LIFECYCLE_REBOOT || @@ -19600,7 +19597,6 @@ qemuDomainSetLifecycleAction(virDomainPtr dom, { virQEMUDriver *driver =3D dom->conn->privateData; g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); - qemuDomainObjPrivate *priv; virDomainObj *vm =3D NULL; virDomainDef *def =3D NULL; virDomainDef *persistentDef =3D NULL; @@ -19617,8 +19613,6 @@ qemuDomainSetLifecycleAction(virDomainPtr dom, if (!(vm =3D qemuDomainObjFromDomain(dom))) goto cleanup; - priv =3D vm->privateData; - if (virDomainSetLifecycleActionEnsureACL(dom->conn, vm->def) < 0) goto cleanup; @@ -19633,16 +19627,6 @@ qemuDomainSetLifecycleAction(virDomainPtr dom, goto endjob; if (def) { - if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)) { - if (priv->allowReboot =3D=3D VIR_TRISTATE_BOOL_NO || - (type =3D=3D VIR_DOMAIN_LIFECYCLE_REBOOT && - def->onReboot !=3D action)) { - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", - _("cannot update lifecycle action because Q= EMU was started with incompatible -no-reboot setting")); - goto endjob; - } - } - if (qemuDomainModifyLifecycleActionLive(vm, type, action) < 0) goto endjob; diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 5be567b510..8990a716fa 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -3061,7 +3061,7 @@ qemuDomainAttachWatchdog(virDomainObj *vm, if (vm->def->nwatchdogs) { /* Domain already has a watchdog and all must have the same action= . */ rv =3D 0; - } else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)) { + } else { /* QEMU doesn't have a 'dump' action; we tell qemu to 'pause', then libvirt listens for the watchdog event, and we perform the dump ourselves. so convert 'dump' to 'pause' for the qemu cli */ @@ -3103,14 +3103,6 @@ qemuDomainAttachWatchdog(virDomainObj *vm, QEMU_MONITOR_ACTION_REBOOT_KEEP, watchdogaction, QEMU_MONITOR_ACTION_PANIC_KEEP); - } else { - virDomainWatchdogAction actualAction =3D watchdog->action; - - if (actualAction =3D=3D VIR_DOMAIN_WATCHDOG_ACTION_DUMP) - actualAction =3D VIR_DOMAIN_WATCHDOG_ACTION_PAUSE; - - rv =3D qemuMonitorSetWatchdogAction(priv->mon, - virDomainWatchdogActionTypeToStr= ing(actualAction)); } if (rv >=3D 0) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 4c94ff3c91..646ddda7e9 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6898,24 +6898,6 @@ qemuProcessRebootAllowed(const virDomainDef *def) } -static void -qemuProcessPrepareAllowReboot(virDomainObj *vm) -{ - virDomainDef *def =3D vm->def; - qemuDomainObjPrivate *priv =3D vm->privateData; - - /* with 'set-action' QMP command we don't need to keep this around as - * we always update qemu with the proper state */ - if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)) - return; - - if (priv->allowReboot !=3D VIR_TRISTATE_BOOL_ABSENT) - return; - - priv->allowReboot =3D virTristateBoolFromBool(qemuProcessRebootAllowed= (def)); -} - - static int qemuProcessUpdateSEVInfo(virDomainObj *vm) { @@ -7087,8 +7069,6 @@ qemuProcessPrepareDomain(virQEMUDriver *driver, /* Track if this domain remembers original owner */ priv->rememberOwner =3D cfg->rememberOwner; - qemuProcessPrepareAllowReboot(vm); - /* * Normally PCI addresses are assigned in the virDomainCreate * or virDomainDefine methods. We might still need to assign @@ -8216,9 +8196,6 @@ qemuProcessSetupLifecycleActions(virDomainObj *vm, qemuDomainObjPrivate *priv =3D vm->privateData; int rc; - if (!(virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION))) - return 0; - /* for now we handle only onReboot->destroy here as an alternative to * '-no-reboot' on the commandline */ if (vm->def->onReboot !=3D VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY) @@ -9909,10 +9886,6 @@ qemuProcessReconnect(void *opaque) if (qemuExtDevicesInitPaths(cfg, obj->def) < 0) goto error; - /* If we are connecting to a guest started by old libvirt there is no - * allowReboot in status XML and we need to initialize it. */ - qemuProcessPrepareAllowReboot(obj); - if (qemuHostdevUpdateActiveDomainDevices(driver, obj->def) < 0) goto error; @@ -10147,9 +10120,7 @@ qemuProcessReconnect(void *opaque) * domain crashed; otherwise, if the monitor was started, * then we can blame ourselves, else we failed before the * monitor started so we don't really know. */ - if (!priv->mon && tryMonReconn && - (priv->allowReboot =3D=3D VIR_TRISTATE_BOOL_YES || - virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION))) + if (!priv->mon && tryMonReconn) state =3D VIR_DOMAIN_SHUTOFF_CRASHED; else if (priv->mon) state =3D VIR_DOMAIN_SHUTOFF_DAEMON; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 439d4b1916..ae1edf435a 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3658,10 +3658,7 @@ qemuValidateDomainDeviceDefDiskBlkdeviotune(const vi= rDomainDiskDef *disk, static int -qemuValidateDomainDeviceDefDiskTransient(const virDomainDiskDef *disk, - const virDomainDef *def, - virQEMUCaps *qemuCaps) - +qemuValidateDomainDeviceDefDiskTransient(const virDomainDiskDef *disk) { virStorageType actualType =3D virStorageSourceGetActualType(disk->src); @@ -3695,13 +3692,6 @@ qemuValidateDomainDeviceDefDiskTransient(const virDo= mainDiskDef *disk, } if (disk->transientShareBacking =3D=3D VIR_TRISTATE_BOOL_YES) { - if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SET_ACTION) && - !qemuProcessRebootAllowed(def)) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("transient disk backing image sharing with de= stroy action of lifecycle isn't supported by this QEMU binary")); - return -1; - } - /* sharing the backing file requires hotplug of the disk in the qe= mu driver */ switch (disk->bus) { case VIR_DOMAIN_DISK_BUS_USB: @@ -3747,7 +3737,7 @@ qemuValidateDomainDeviceDefDisk(const virDomainDiskDe= f *disk, if (qemuValidateDomainDeviceDefDiskBlkdeviotune(disk, def) < 0) return -1; - if (qemuValidateDomainDeviceDefDiskTransient(disk, def, qemuCaps) < 0) + if (qemuValidateDomainDeviceDefDiskTransient(disk) < 0) return -1; if (disk->src->shared && !disk->src->readonly && --=20 2.55.0