@@ -1553,18 +1553,6 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
if (!libxl__acpi_defbool_val(b_info)) {
flexarray_append(dm_args, "-no-acpi");
}
- if (b_info->max_vcpus > 1) {
- flexarray_append(dm_args, "-smp");
- if (b_info->avail_vcpus.size) {
- int nr_set_cpus = 0;
- nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
-
- flexarray_append(dm_args, GCSPRINTF("%d,maxcpus=%d",
- nr_set_cpus,
- b_info->max_vcpus));
- } else
- flexarray_append(dm_args, GCSPRINTF("%d", b_info->max_vcpus));
- }
for (i = 0; i < num_nics; i++) {
if (nics[i].nictype == LIBXL_NIC_TYPE_VIF_IOEMU) {
char *smac = GCSPRINTF(LIBXL_MAC_FMT,
@@ -1800,6 +1788,22 @@ static int libxl__build_device_model_args_new(libxl__gc *gc,
for (i = 0; b_info->extra && b_info->extra[i] != NULL; i++)
flexarray_append(dm_args, b_info->extra[i]);
+ if (b_info->type == LIBXL_DOMAIN_TYPE_HVM ||
+ b_info->type == LIBXL_DOMAIN_TYPE_PVH) {
+ if (b_info->max_vcpus > 1) {
+ flexarray_append(dm_args, "-smp");
+ if (b_info->avail_vcpus.size) {
+ int nr_set_cpus = 0;
+ nr_set_cpus = libxl_bitmap_count_set(&b_info->avail_vcpus);
+
+ flexarray_append(dm_args, GCSPRINTF("%d,maxcpus=%d",
+ nr_set_cpus,
+ b_info->max_vcpus));
+ } else
+ flexarray_append(dm_args, GCSPRINTF("%d", b_info->max_vcpus));
+ }
+ }
+
flexarray_append(dm_args, "-machine");
switch (b_info->type) {
case LIBXL_DOMAIN_TYPE_PVH: