Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153764126
D35073.id106138.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
D35073.id106138.diff
View Options
Index: lib/libvmmapi/vmmapi.h
===================================================================
--- lib/libvmmapi/vmmapi.h
+++ lib/libvmmapi/vmmapi.h
@@ -33,6 +33,8 @@
#include <sys/param.h>
#include <sys/cpuset.h>
+#include <sys/cdefs.h>
+#include <machine/vmm.h>
#include <machine/vmm_dev.h>
#include <stdbool.h>
@@ -76,6 +78,8 @@
VM_PCIROM,
};
+__BEGIN_DECLS
+
/*
* Get the length and name of the memory segment identified by 'segid'.
* Note that system memory segments are identified with a nul name.
@@ -117,6 +121,7 @@
int vm_create(const char *name);
int vm_get_device_fd(struct vmctx *ctx);
struct vmctx *vm_open(const char *name);
+void vm_close(struct vmctx *ctx);
void vm_destroy(struct vmctx *ctx);
int vm_parse_memsize(const char *optarg, size_t *memsize);
int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s);
@@ -263,4 +268,6 @@
int vm_snapshot_req(struct vm_snapshot_meta *meta);
int vm_restore_time(struct vmctx *ctx);
+__END_DECLS
+
#endif /* _VMMAPI_H_ */
Index: lib/libvmmapi/vmmapi.c
===================================================================
--- lib/libvmmapi/vmmapi.c
+++ lib/libvmmapi/vmmapi.c
@@ -140,6 +140,15 @@
return (NULL);
}
+void
+vm_close(struct vmctx *vm)
+{
+ assert(vm != NULL);
+
+ close(vm->fd);
+ free(vm);
+}
+
void
vm_destroy(struct vmctx *vm)
{
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 24, 1:12 PM (15 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32077738
Default Alt Text
D35073.id106138.diff (1 KB)
Attached To
Mode
D35073: libvmm: add vm_close() to vmmapi library
Attached
Detach File
Event Timeline
Log In to Comment