MCPcopy Create free account
hub / github.com/F-Stack/f-stack / svm_snapshot_reg

Function svm_snapshot_reg

freebsd/amd64/vmm/amd/svm.c:2277–2303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2275
2276#ifdef BHYVE_SNAPSHOT
2277static int
2278svm_snapshot_reg(void *arg, int vcpu, int ident,
2279 struct vm_snapshot_meta *meta)
2280{
2281 int ret;
2282 uint64_t val;
2283
2284 if (meta->op == VM_SNAPSHOT_SAVE) {
2285 ret = svm_getreg(arg, vcpu, ident, &val);
2286 if (ret != 0)
2287 goto done;
2288
2289 SNAPSHOT_VAR_OR_LEAVE(val, meta, ret, done);
2290 } else if (meta->op == VM_SNAPSHOT_RESTORE) {
2291 SNAPSHOT_VAR_OR_LEAVE(val, meta, ret, done);
2292
2293 ret = svm_setreg(arg, vcpu, ident, val);
2294 if (ret != 0)
2295 goto done;
2296 } else {
2297 ret = EINVAL;
2298 goto done;
2299 }
2300
2301done:
2302 return (ret);
2303}
2304#endif
2305
2306static int

Callers 1

svm_vmcx_snapshotFunction · 0.85

Calls 2

svm_getregFunction · 0.85
svm_setregFunction · 0.85

Tested by

no test coverage detected