]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Format HPT maxpagesize on the command line
authorAndrea Bolognani <abologna@redhat.com>
Wed, 23 May 2018 16:18:02 +0000 (18:18 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 26 Jun 2018 08:15:56 +0000 (10:15 +0200)
This makes the feature fully functional.

https://bugzilla.redhat.com/show_bug.cgi?id=1571078

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
src/qemu/qemu_command.c
tests/qemuxml2argvdata/pseries-features.args

index 1d1d7d6be9111db65410fa96822095a3ac150efb..a357d2199cb0bb29d59b8b42685c93ac40c2db8c 100644 (file)
@@ -7277,6 +7277,18 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
 
             virBufferAsprintf(&buf, ",resize-hpt=%s", str);
         }
+
+        if (def->hpt_maxpagesize > 0) {
+            if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE)) {
+                virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                               _("Configuring the page size for HPT guests "
+                                 "is not supported by this QEMU binary"));
+                goto cleanup;
+            }
+
+            virBufferAsprintf(&buf, ",cap-hpt-max-page-size=%lluk",
+                              def->hpt_maxpagesize);
+        }
     }
 
     if (cpu && cpu->model &&
index f5c1959ccae42b80b42e4167709ddb769e92594a..12c14715c676b2890cc30a3f57e6cfca9c2459f6 100644 (file)
@@ -7,7 +7,8 @@ QEMU_AUDIO_DRV=none \
 /usr/bin/qemu-system-ppc64 \
 -name guest \
 -S \
--machine pseries,accel=tcg,usb=off,dump-guest-core=off,resize-hpt=required \
+-machine pseries,accel=tcg,usb=off,dump-guest-core=off,resize-hpt=required,\
+cap-hpt-max-page-size=1048576k \
 -m 512 \
 -smp 1,sockets=1,cores=1,threads=1 \
 -uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \