aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bhyve/pci_ahci.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2023-03-24 18:49:06 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2023-03-24 18:49:06 +0000
commit0f735657aa762e3b226087a9be6edf95868bc62d (patch)
treeb159bcdfb70d549bc9f77ac363eb99c0730a3c9e /usr.sbin/bhyve/pci_ahci.c
parent7d9ef309bd09c061e9cad8ace6f7bb4c60f087e6 (diff)
downloadsrc-0f735657aa762e3b226087a9be6edf95868bc62d.tar.gz
src-0f735657aa762e3b226087a9be6edf95868bc62d.zip
bhyve: Remove vmctx member from struct vm_snapshot_meta.
This is a userland-only pointer that isn't relevant to the kernel and doesn't belong in the ioctl structure shared between userland and the kernel. For the kernel, the old structure for the ioctl is still supported under COMPAT_FREEBSD13. This changes vm_snapshot_req() in libvmmapi to accept an explicit vmctx argument. It also changes vm_snapshot_guest2host_addr to take an explicit vmctx argument. As part of this change, move the declaration for this function and its wrapper macro from vmm_snapshot.h to snapshot.h as it is a userland-only API. Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D38125
Diffstat (limited to 'usr.sbin/bhyve/pci_ahci.c')
-rw-r--r--usr.sbin/bhyve/pci_ahci.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/bhyve/pci_ahci.c b/usr.sbin/bhyve/pci_ahci.c
index 9c023d93cab9..6b6a91325f72 100644
--- a/usr.sbin/bhyve/pci_ahci.c
+++ b/usr.sbin/bhyve/pci_ahci.c
@@ -41,8 +41,6 @@ __FBSDID("$FreeBSD$");
#include <sys/ata.h>
#include <sys/endian.h>
-#include <machine/vmm_snapshot.h>
-
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@@ -61,6 +59,9 @@ __FBSDID("$FreeBSD$");
#include "config.h"
#include "debug.h"
#include "pci_emul.h"
+#ifdef BHYVE_SNAPSHOT
+#include "snapshot.h"
+#endif
#include "ahci.h"
#include "block_if.h"
@@ -2623,10 +2624,10 @@ pci_ahci_snapshot(struct vm_snapshot_meta *meta)
goto done;
}
- SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(port->cmd_lst,
+ SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(pi->pi_vmctx, port->cmd_lst,
AHCI_CL_SIZE * AHCI_MAX_SLOTS, false, meta, ret, done);
- SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(port->rfis, 256, false, meta,
- ret, done);
+ SNAPSHOT_GUEST2HOST_ADDR_OR_LEAVE(pi->pi_vmctx, port->rfis, 256,
+ false, meta, ret, done);
SNAPSHOT_VAR_OR_LEAVE(port->ata_ident, meta, ret, done);
SNAPSHOT_VAR_OR_LEAVE(port->atapi, meta, ret, done);