Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151687712
D30050.id88469.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D30050.id88469.diff
View Options
Index: usr.sbin/bhyve/bhyverun.h
===================================================================
--- usr.sbin/bhyve/bhyverun.h
+++ usr.sbin/bhyve/bhyverun.h
@@ -37,7 +37,6 @@
struct vmctx;
extern int guest_ncpus;
extern uint16_t cores, sockets, threads;
-extern char *guest_uuid_str;
extern const char *vmname;
void *paddr_guest2host(struct vmctx *ctx, uintptr_t addr, size_t len);
Index: usr.sbin/bhyve/bhyverun.c
===================================================================
--- usr.sbin/bhyve/bhyverun.c
+++ usr.sbin/bhyve/bhyverun.c
@@ -69,6 +69,7 @@
#include <sysexits.h>
#include <stdbool.h>
#include <stdint.h>
+#include <uuid.h>
#ifdef BHYVE_SNAPSHOT
#include <ucl.h>
#include <unistd.h>
@@ -188,7 +189,7 @@
int guest_ncpus;
uint16_t cores, maxcpus, sockets, threads;
-char *guest_uuid_str;
+uuid_t guest_uuid;
int raw_stdio = 0;
@@ -1106,6 +1107,8 @@
rtc_localtime = 1;
memflags = 0;
+ uuid_create_nil(guest_uuid, NULL);
+
#ifdef BHYVE_SNAPSHOT
optstr = "aehuwxACDHIPSWYp:G:c:s:m:l:U:r:";
#else
@@ -1196,7 +1199,10 @@
rtc_localtime = 0;
break;
case 'U':
- guest_uuid_str = optarg;
+ uuid_from_string(optarg, &guest_uuid, &error);
+ if (error != uuid_s_ok) {
+ errx(EX_USAGE, "invalid UUID '%s'", optarg);
+ }
break;
case 'w':
strictmsr = 0;
Index: usr.sbin/bhyve/smbiostbl.c
===================================================================
--- usr.sbin/bhyve/smbiostbl.c
+++ usr.sbin/bhyve/smbiostbl.c
@@ -544,6 +544,8 @@
static uint64_t guest_lomem, guest_himem;
static uint16_t type16_handle;
+extern uuid_t guest_uuid;
+
static int
smbios_generic_initializer(struct smbios_structure *template_entry,
const char **template_strings, char *curaddr, char **endaddr,
@@ -593,15 +595,8 @@
curaddr, endaddr, n, size);
type1 = (struct smbios_table_type1 *)curaddr;
- if (guest_uuid_str != NULL) {
- uuid_t uuid;
- uint32_t status;
-
- uuid_from_string(guest_uuid_str, &uuid, &status);
- if (status != uuid_s_ok)
- return (-1);
-
- uuid_enc_le(&type1->uuid, &uuid);
+ if (! uuid_is_nil(&guest_uuid, NULL)) {
+ uuid_enc_le(&type1->uuid, &guest_uuid);
} else {
MD5_CTX mdctx;
u_char digest[16];
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 11, 12:49 AM (8 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31258186
Default Alt Text
D30050.id88469.diff (2 KB)
Attached To
Mode
D30050: Adds uuid validation to bhyve(8) arg parsing
Attached
Detach File
Event Timeline
Log In to Comment