Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142862924
D38887.id118250.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D38887.id118250.diff
View Options
diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c
--- a/usr.sbin/bhyvectl/bhyvectl.c
+++ b/usr.sbin/bhyvectl/bhyvectl.c
@@ -86,8 +86,7 @@
" [--create]\n"
" [--destroy]\n"
#ifdef BHYVE_SNAPSHOT
- " [--checkpoint=<filename>]\n"
- " [--suspend=<filename>]\n"
+ " [--checkpoint=<filename> | --suspend=<filename>]\n"
#endif
" [--get-all]\n"
" [--get-stats]\n"
@@ -299,7 +298,6 @@
static int run;
static int get_cpu_topology;
#ifdef BHYVE_SNAPSHOT
-static int vm_checkpoint_opt;
static int vm_suspend_opt;
#endif
@@ -1747,7 +1745,7 @@
struct tm tm;
struct option *opts;
#ifdef BHYVE_SNAPSHOT
- char *checkpoint_file, *suspend_file;
+ char *checkpoint_file = NULL;
#endif
cpu_intel = cpu_vendor_intel();
@@ -1909,12 +1907,12 @@
break;
#ifdef BHYVE_SNAPSHOT
case SET_CHECKPOINT_FILE:
- vm_checkpoint_opt = 1;
- checkpoint_file = optarg;
- break;
case SET_SUSPEND_FILE:
- vm_suspend_opt = 1;
- suspend_file = optarg;
+ if (checkpoint_file != NULL)
+ usage(cpu_intel);
+
+ checkpoint_file = optarg;
+ vm_suspend_opt = (ch == SET_SUSPEND_FILE);
break;
#endif
default:
@@ -2389,11 +2387,8 @@
vm_destroy(ctx);
#ifdef BHYVE_SNAPSHOT
- if (!error && vm_checkpoint_opt)
- error = snapshot_request(vmname, checkpoint_file, false);
-
- if (!error && vm_suspend_opt)
- error = snapshot_request(vmname, suspend_file, true);
+ if (!error && checkpoint_file)
+ error = snapshot_request(vmname, checkpoint_file, vm_suspend_opt);
#endif
free (opts);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 25, 6:45 AM (5 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27929911
Default Alt Text
D38887.id118250.diff (1 KB)
Attached To
Mode
D38887: bhyvectl: Operations --suspend and --checkpoint are alternative
Attached
Detach File
Event Timeline
Log In to Comment