-/* $OpenBSD: vm.c,v 1.80 2023/01/04 02:19:19 dv Exp $ */
+/* $OpenBSD: vm.c,v 1.81 2023/01/08 19:57:17 dv Exp $ */
/*
* Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h> /* PAGE_SIZE */
+#include <sys/param.h> /* PAGE_SIZE, MAXCOMLEN */
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/queue.h>
#include <limits.h>
#include <poll.h>
#include <pthread.h>
+#include <pthread_np.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
size_t i;
int ret;
pthread_t *tid, evtid;
+ char tname[MAXCOMLEN + 1];
struct vm_run_params **vrp;
void *exit_status;
__func__, i);
return (ret);
}
+
+ snprintf(tname, sizeof(tname), "vcpu-%zu", i);
+ pthread_set_name_np(tid[i], tname);
}
log_debug("%s: waiting on events for VM %s", __func__, vcp->vcp_name);
log_warn("%s: could not create event thread", __func__);
return (ret);
}
+ pthread_set_name_np(evtid, "event");
for (;;) {
ret = pthread_cond_wait(&threadcond, &threadmutex);