Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178324295
D61070.1796495053.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D61070.1796495053.diff
View Options
diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8
--- a/usr.sbin/bhyve/bhyve.8
+++ b/usr.sbin/bhyve/bhyve.8
@@ -513,7 +513,6 @@
.Cm deflate_on_oom
option lets the guest deflate the balloon under memory pressure; see
.Xr bhyve_config 5 .
-Checkpointing a VM with this device is not supported.
.It Cm virtio-console
Virtio console interface, which exposes multiple ports
to the guest in the form of simple char devices for simple IO
diff --git a/usr.sbin/bhyve/pci_virtio_balloon.c b/usr.sbin/bhyve/pci_virtio_balloon.c
--- a/usr.sbin/bhyve/pci_virtio_balloon.c
+++ b/usr.sbin/bhyve/pci_virtio_balloon.c
@@ -27,6 +27,10 @@
#include <sys/nv.h>
#include <sys/uio.h>
+#ifdef BHYVE_SNAPSHOT
+#include <machine/vmm_snapshot.h>
+#endif
+
#include <dev/pci/pcireg.h>
#include <dev/virtio/balloon/virtio_balloon.h>
#include <dev/virtio/virtio_ids.h>
@@ -113,6 +117,9 @@
static void pci_vtballoon_notify(void *, struct vqueue_info *);
static int pci_vtballoon_cfgread(void *, int, int, uint32_t *);
static int pci_vtballoon_cfgwrite(void *, int, int, uint32_t);
+#ifdef BHYVE_SNAPSHOT
+static int pci_vtballoon_snapshot(void *, struct vm_snapshot_meta *);
+#endif
static struct virtio_consts vtballoon_vi_consts = {
.vc_name = "vtballoon",
@@ -124,6 +131,9 @@
.vc_cfgwrite = pci_vtballoon_cfgwrite,
.vc_hv_caps = VIRTIO_BALLOON_F_MUST_TELL_HOST |
VIRTIO_BALLOON_F_STATS_VQ,
+#ifdef BHYVE_SNAPSHOT
+ .vc_snapshot = pci_vtballoon_snapshot,
+#endif
};
_Static_assert(sizeof(struct virtio_balloon_config) == 8,
@@ -551,10 +561,39 @@
return (0);
}
+#ifdef BHYVE_SNAPSHOT
+static int
+pci_vtballoon_snapshot(void *vsc, struct vm_snapshot_meta *meta)
+{
+ struct pci_vtballoon_softc *sc;
+ int ret;
+
+ sc = vsc;
+ /* vCPUs are stopped and balloon IPC shares the checkpoint thread. */
+ SNAPSHOT_VAR_OR_LEAVE(sc->vbs_cfg, meta, ret, done);
+ SNAPSHOT_BUF_OR_LEAVE(sc->vbs_stats, sizeof(sc->vbs_stats),
+ meta, ret, done);
+ SNAPSHOT_VAR_OR_LEAVE(sc->vbs_stats_valid, meta, ret, done);
+ SNAPSHOT_VAR_OR_LEAVE(sc->vbs_stats_updated, meta, ret, done);
+ SNAPSHOT_VAR_OR_LEAVE(sc->vbs_stats_idx, meta, ret, done);
+ SNAPSHOT_VAR_OR_LEAVE(sc->vbs_stats_held, meta, ret, done);
+ SNAPSHOT_VAR_OR_LEAVE(sc->vbs_stats_pending, meta, ret, done);
+ SNAPSHOT_VAR_OR_LEAVE(sc->vbs_discard_failures, meta, ret, done);
+ SNAPSHOT_VAR_OR_LEAVE(sc->vbs_invalid_pfns, meta, ret, done);
+ SNAPSHOT_VAR_OR_LEAVE(sc->vbs_invalid_requests, meta, ret, done);
+
+done:
+ return (ret);
+}
+#endif
+
static const struct pci_devemu pci_de_vballoon = {
.pe_emu = "virtio-balloon",
.pe_init = pci_vtballoon_init,
.pe_barwrite = vi_pci_write,
.pe_barread = vi_pci_read,
+#ifdef BHYVE_SNAPSHOT
+ .pe_snapshot = vi_pci_snapshot,
+#endif
};
PCI_EMUL_SET(pci_de_vballoon);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 5, 6:24 PM (19 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42238072
Default Alt Text
D61070.1796495053.diff (2 KB)
Attached To
Mode
D61070: bhyve: Save and restore virtio-balloon state
Attached
Detach File
Event Timeline