bhyve: Fix handling of -r

Just make "restore_file" a global variable so that it can be set by the
MD option handler.

Reviewed by:	corvink
Reported by:	bdrewery
Fixes:		981f9f7495 ("bhyve: Push option parsing down into bhyverun_machdep.c")
Differential Revision:	https://reviews.freebsd.org/D44974
This commit is contained in:
Mark Johnston 2024-04-29 10:13:50 -04:00
parent 9e8618276f
commit 390e44988a
2 changed files with 8 additions and 3 deletions

View file

@ -100,6 +100,10 @@ uint16_t cpu_cores, cpu_sockets, cpu_threads;
int raw_stdio = 0;
#ifdef BHYVE_SNAPSHOT
char *restore_file;
#endif
static const int BSP = 0;
static cpuset_t cpumask;
@ -656,10 +660,7 @@ main(int argc, char *argv[])
size_t memsize;
const char *value, *vmname;
#ifdef BHYVE_SNAPSHOT
char *restore_file;
struct restore_state rstate;
restore_file = NULL;
#endif
bhyve_init_config();

View file

@ -37,6 +37,10 @@
extern int guest_ncpus;
extern uint16_t cpu_cores, cpu_sockets, cpu_threads;
#ifdef BHYVE_SNAPSHOT
extern char *restore_file;
#endif
struct vcpu;
struct vmctx;
struct vm_run;