diff options
author | pd <pd@cvs.openbsd.org> | 2018-09-13 04:23:37 +0000 |
---|---|---|
committer | pd <pd@cvs.openbsd.org> | 2018-09-13 04:23:37 +0000 |
commit | a996dae9e8cfed66ea02e02db8765fce20e0a5e2 (patch) | |
tree | 22ac972db9b33b052d5bdc8d698c7d818e937fe7 | |
parent | 9edd7b65ebb9933f8856ddd9c34ebe4c286c3330 (diff) |
vmd: set irq and vm_id in virtio dev structs on restore
This unbreaks vmctl receive.
ok ccardenas@
-rw-r--r-- | usr.sbin/vmd/virtio.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/vmd/virtio.c b/usr.sbin/vmd/virtio.c index c774cc7813a..cdff71aed69 100644 --- a/usr.sbin/vmd/virtio.c +++ b/usr.sbin/vmd/virtio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: virtio.c,v 1.67 2018/09/11 13:45:29 ccardenas Exp $ */ +/* $OpenBSD: virtio.c,v 1.68 2018/09/13 04:23:36 pd Exp $ */ /* * Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org> @@ -2024,6 +2024,7 @@ vmmci_restore(int fd, uint32_t vm_id) return (-1); } vmmci.vm_id = vm_id; + vmmci.irq = pci_get_dev_irq(vmmci.pci_id); memset(&vmmci.timeout, 0, sizeof(struct event)); evtimer_set(&vmmci.timeout, vmmci_timeout, NULL); return (0); @@ -2043,6 +2044,7 @@ viornd_restore(int fd, struct vm_create_params *vcp) return (-1); } viornd.vm_id = vcp->vcp_id; + viornd.irq = pci_get_dev_irq(viornd.pci_id); return (0); } @@ -2094,6 +2096,7 @@ vionet_restore(int fd, struct vmd_vm *vm, int *child_taps) vionet[i].rx_pending = 0; vionet[i].vm_id = vcp->vcp_id; vionet[i].vm_vmid = vm->vm_vmid; + vionet[i].irq = pci_get_dev_irq(vionet[i].pci_id); memset(&vionet[i].event, 0, sizeof(struct event)); event_set(&vionet[i].event, vionet[i].fd, @@ -2140,6 +2143,8 @@ vioblk_restore(int fd, struct vmop_create_params *vmc, int *child_disks) __func__); return (-1); } + vioblk[i].vm_id = vcp->vcp_id; + vioblk[i].irq = pci_get_dev_irq(vioblk[i].pci_id); } return (0); } @@ -2175,6 +2180,8 @@ vioscsi_restore(int fd, struct vm_create_params *vcp, int child_cdrom) log_warnx("%s: unable to determine iso format", __func__); return (-1); } + vioscsi->vm_id = vcp->vcp_id; + vioscsi->irq = pci_get_dev_irq(vioscsi->pci_id); return (0); } |