Diff related to vmctl reload below... Eric Augé <[email protected]> writes:
> Hello, > > small questions regarding 2 things I noticed today: > > II == vmd guest: linux x86 host: openbsd/amd64 == > > I had a running/installed x86 alpine linux virt VM running on vmm(4). > I "sysupgrade -s" 'd 2 days ago from my previous -current and the x86 > guest just does not run anymore, I've tried reinstalling an > alpine-virt 3.22 x86, vmd goes to 100% CPU after a minute or 2 when > booting the virt install ISO. > > https://dl-cdn.alpinelinux.org/alpine/v3.22/releases/x86/alpine-virt-3.22.1-x86.iso > > I had not run it for a while, so I am not sure when the behavior changed. > I am not sure if it's a me problem, or if anybody else experiences > similar symptoms on linux x86 guests on an amd64 OpenBSD host HV. > > I tried with OpenBSD i386 and it seems to run fine > > II == vmctl reload == > > I noticed another thing, "vmctl reload" just stalls... and never ends > it seems to stall on recvmsg() from /var/run/vmd.sock > --- > 6808 vmctl RET kbind 0 > 6808 vmctl CALL kbind(0x734d85a9f0e0,24,0xd4092a5288fecfd1) > 6808 vmctl RET kbind 0 > 6808 vmctl CALL recvmsg(3,0x734d85a9f1d0,0) > ... > --- > Anyone experienced something similar ? > Any idea what I have missed? Try the below diff. You will need to rebuild both vmd and vmctl (as vmctl relies on shared header files from vmd). diff refs/heads/master refs/heads/vmd-vmctl-reload commit - adfd21e9d9de44ec58cb6572dda9c677e59b7964 commit + 3d1793eea15f1aaedbdd89f0b64fc72af7e576a4 blob - 581739abf59d3d1bf0d9e026817c955fc17e6fe8 blob + 45d39356bb9d0bc9ce2a6f026f7b1fcbdb712711 --- usr.sbin/vmd/proc.h +++ usr.sbin/vmd/proc.h @@ -26,6 +26,7 @@ #define _PROC_H enum { + IMSG_NONE = 0, IMSG_CTL_OK, IMSG_CTL_FAIL, IMSG_CTL_VERBOSE, blob - f10b945b37f20e59ad961268a2d57a40c85fbe37 blob + 8bc41dd280fadccc19d19297508672aa86057d50 --- usr.sbin/vmd/virtio.c +++ usr.sbin/vmd/virtio.c @@ -807,7 +807,7 @@ vmmci_ack(struct virtio_dev *dev, unsigned int cmd) * timeout to give the VM a chance to reboot before the * timer is expired. */ - if (v->cmd == 0) { + if (v->cmd == IMSG_NONE) { log_debug("%s: vm %u requested shutdown", __func__, dev->vm_id); vm_pipe_send(&v->dev_pipe, VMMCI_SET_TIMEOUT_SHORT); blob - 6132f15735b54204e3743df3bd16827a62bc74b6 blob + 627d0f3f3adbfda62025c08aa6b4ddd580dfcae0 --- usr.sbin/vmd/vmd.c +++ usr.sbin/vmd/vmd.c @@ -91,7 +91,7 @@ int vmd_dispatch_control(int fd, struct privsep_proc *p, struct imsg *imsg) { struct privsep *ps = p->p_ps; - int res = 0, cmd = 0, verbose; + int res = 0, cmd = IMSG_NONE, verbose; unsigned int v = 0, flags; struct vmop_create_params vmc; struct vmop_id vid; @@ -251,14 +251,13 @@ vmd_dispatch_control(int fd, struct privsep_proc *p, s control_reset(&ps->ps_csock); TAILQ_FOREACH(rcs, &ps->ps_rcsocks, cs_entry) control_reset(rcs); - cmd = 0; break; default: return (-1); } switch (cmd) { - case 0: + case IMSG_NONE: break; case IMSG_VMDOP_START_VM_RESPONSE: case IMSG_VMDOP_TERMINATE_VM_RESPONSE: blob - 8a33e351745a63401ebff65e6d301766d1f883da blob + 08b51df37960de8964cfb2903af8a835da0b39cc --- usr.sbin/vmd/vmm.c +++ usr.sbin/vmd/vmm.c @@ -95,7 +95,7 @@ int vmm_dispatch_parent(int fd, struct privsep_proc *p, struct imsg *imsg) { struct privsep *ps = p->p_ps; - int res = 0, cmd = 0, verbose; + int res = 0, cmd = IMSG_NONE, verbose; struct vmd_vm *vm = NULL; struct vm_terminate_params vtp; struct vmop_id vid;

