Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149185027
D54652.1789643943.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54652.1789643943.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
@@ -249,12 +249,13 @@
}
}
-#ifdef BHYVE_SNAPSHOT
static int
-send_message(const char *vmname, nvlist_t *nvl)
+ipc_send_message(const char *vmname, nvlist_t *request)
{
struct sockaddr_un addr;
int err = 0, socket_fd;
+ const char* errmsg;
+ nvlist_t *reply;
socket_fd = socket(PF_UNIX, SOCK_STREAM, 0);
if (socket_fd < 0) {
@@ -275,18 +276,27 @@
goto done;
}
- if (nvlist_send(socket_fd, nvl) < 0) {
- perror("nvlist_send() failed");
- err = errno;
+ reply = nvlist_xfer(socket_fd, request, 0);
+ request = NULL;
+ if (reply == NULL) {
+ perror("nvlist_xfer() failed");
+ goto done;
+ }
+ if (nvlist_exists_string(reply, "error")) {
+ errmsg = nvlist_get_string(reply, "error");
+ fprintf(stderr, "%s: IPC command failed: %s\n", __func__, errmsg);
+ err = -1;
}
done:
- nvlist_destroy(nvl);
+ if (request != NULL)
+ nvlist_destroy(request);
if (socket_fd >= 0)
close(socket_fd);
return (err);
}
+#ifdef BHYVE_SNAPSHOT
static int
open_directory(const char *file)
{
@@ -318,7 +328,7 @@
nvlist_add_bool(nvl, "suspend", suspend);
nvlist_move_descriptor(nvl, "fddir", fd);
- return (send_message(vmname, nvl));
+ return (ipc_send_message(vmname, nvl));
}
#endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Sep 17, 11:19 AM (13 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29727375
Default Alt Text
D54652.1789643943.diff (1 KB)
Attached To
Mode
D54652: bhyvectl: Generalize bhyve IPC code
Attached
Detach File
Event Timeline
Log In to Comment