Page MenuHomeFreeBSD

D34491.diff
No OneTemporary

D34491.diff

diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -196,7 +196,7 @@
static void vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip);
-static struct vm_exit vmexit[VM_MAXCPU];
+static struct vm_exit *vmexit;
struct bhyvestats {
uint64_t vmexit_bogus;
@@ -213,9 +213,9 @@
pthread_t mt_thr;
struct vmctx *mt_ctx;
int mt_vcpu;
-} mt_vmm_info[VM_MAXCPU];
+} *mt_vmm_info;
-static cpuset_t *vcpumap[VM_MAXCPU] = { NULL };
+static cpuset_t **vcpumap;
static void
usage(int code)
@@ -472,6 +472,7 @@
const char *value;
int vcpu;
+ vcpumap = calloc(guest_ncpus, sizeof(*vcpumap));
for (vcpu = 0; vcpu < guest_ncpus; vcpu++) {
snprintf(key, sizeof(key), "vcpu.%d.cpuset", vcpu);
value = get_config_value(key);
@@ -1574,6 +1575,10 @@
vm_restore_time(ctx);
#endif
+ /* Allocate per-VCPU resources. */
+ vmexit = calloc(guest_ncpus, sizeof(*vmexit));
+ mt_vmm_info = calloc(guest_ncpus, sizeof(*mt_vmm_info));
+
/*
* Add CPU 0
*/

File Metadata

Mime Type
text/plain
Expires
Fri, May 1, 12:48 AM (5 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32546868
Default Alt Text
D34491.diff (1 KB)

Event Timeline