Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149207184
D39316.1789675636.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
D39316.1789675636.diff
View Options
diff --git a/usr.sbin/bhyve/qemu_fwcfg.c b/usr.sbin/bhyve/qemu_fwcfg.c
--- a/usr.sbin/bhyve/qemu_fwcfg.c
+++ b/usr.sbin/bhyve/qemu_fwcfg.c
@@ -43,6 +43,7 @@
#define QEMU_FWCFG_INDEX_SIGNATURE 0x00
#define QEMU_FWCFG_INDEX_ID 0x01
+#define QEMU_FWCFG_INDEX_NB_CPUS 0x05
#define QEMU_FWCFG_INDEX_MAX_CPUS 0x0F
#define QEMU_FWCFG_INDEX_FILE_DIR 0x19
@@ -227,6 +228,21 @@
(uint8_t *)fwcfg_id));
}
+static int
+qemu_fwcfg_add_item_nb_cpus(void)
+{
+ uint16_t *fwcfg_max_cpus = calloc(1, sizeof(uint16_t));
+ if (fwcfg_max_cpus == NULL) {
+ return (-ENOMEM);
+ }
+
+ *fwcfg_max_cpus = htole16(guest_ncpus);
+
+ return qemu_fwcfg_add_item(QEMU_FWCFG_ARCHITECTURE_GENERIC,
+ QEMU_FWCFG_INDEX_NB_CPUS, sizeof(uint16_t),
+ (uint8_t *)fwcfg_max_cpus);
+}
+
static int
qemu_fwcfg_add_item_max_cpus(void)
{
@@ -425,6 +441,10 @@
warnx("%s: Unable to add id item", __func__);
goto done;
}
+ if ((error = qemu_fwcfg_add_item_nb_cpus()) != 0) {
+ warnx("%s: Unable to add nb_cpus item", __func__);
+ goto done;
+ }
if ((error = qemu_fwcfg_add_item_max_cpus()) != 0) {
warnx("%s: Unable to add max_cpus item", __func__);
goto done;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Sep 17, 8:07 PM (19 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29737962
Default Alt Text
D39316.1789675636.diff (1 KB)
Attached To
Mode
D39316: bhyve/fwcfg: add QEMU_FWCFG_INDEX_NB_CPUS item
Attached
Detach File
Event Timeline
Log In to Comment