>Submitter-Id: net >Originator: Scott Blomenkamp <[email protected]> >Synopsis: xen(4) handles control/shutdown but doesn't advertise it with control/feature-poweroff >Severity: non-critical >Priority: low >Category: kernel >Class: sw-bug >Release: 8.0 >Environment: System : OpenBSD 8.0 https://www.google.com/url?q=http://GENERIC.MP&source=gmail&ust=1795678566802000&sa=E, with the local PVH workarounds from my report "amd64: OpenBSD 8.0 cannot boot as a Xen PVH guest (seven separate faults)", sent to bugs@ the same day Architecture: OpenBSD.amd64 Machine : Xen 4.19.6 PVH guest on a Qubes OS host (libxl through libvirt); also Xen 4.20 xl on Debian >Description: Xen guests tell the toolstack that they handle a PV shutdown request by writing control/feature-poweroff = 1 (and feature-reboot, feature-suspend) to xenstore; Linux does this when it sets up its shutdown watch (drivers/xen/manage.c). OpenBSD's xen(4) acts on control/shutdown when it is written, but never writes the feature keys.
For an HVM or PVH guest, libxl sends a PV shutdown only when the key is there, and otherwise refuses: libxl__domain_pvcontrol: Domain 114:PV control 'poweroff' not supported by this domain An HVM guest then falls back to an ACPI power button, so it still shuts down. A PVH guest has no ACPI power button, so on Qubes OS (Xen 4.19.6) qvm-shutdown fails. On Xen 4.20 with xl on Debian the same guest did shut down without the key, so whether it shows depends on the toolstack. >How-To-Repeat: 1. Boot an 8.0 guest as PVH (see my report "amd64: OpenBSD 8.0 cannot boot as a Xen PVH guest (seven separate faults)", sent to bugs@ the same day) under a libxl that checks the key (Qubes OS, Xen 4.19.6). 2. In dom0: qvm-shutdown --wait <guest> (or xl shutdown -w) The request is refused with the line above. In the source, xen_attach() sets up the control/shutdown watch (xen_control()), but nothing writes the feature keys. Writing it by hand, `hostctl control/feature-poweroff 1` (from rc.local), makes the same shutdown work, before and after a reboot. >Fix: None attached. xen(4) could write control/feature-poweroff (and the other keys it handles) once its control/shutdown watch is in place, as Linux does. Disclosure: I found and analysed this with the help of an AI assistant (Anthropic's Claude), in a lab on a Qubes OS host and on Xen 4.20. The refusal and the workaround above were seen in real runs. No AI-written code is attached.
