diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 72bfa35f30..9b3f9ee269 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -277,6 +277,9 @@
<initrd>/root/f8-i386-initrd</initrd>
<cmdline>console=ttyS0 ks=http://example.com/f8-i386/os/</cmdline>
<dtb>/root/ppc.dtb</dtb>
+ <acpi>
+ <table type='slic'>/path/to/slic.dat</table>
+ </acpi>
</os>
...
@@ -302,6 +305,11 @@
The contents of this element specify the fully-qualified path
to the (optional) device tree binary (dtb) image in the host OS.
Since 1.0.4
+ acpi
+ The table
element contains a fully-qualified path
+ to the ACPI table. The type
attribute contains the
+ ACPI table type (currently only slic
is supported)
+ Since 1.3.5 (QEMU only)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 903fd7ebe6..bbe676147e 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -306,6 +306,9 @@
+
+
+
@@ -4505,6 +4508,21 @@
+
+
+
+
+
+
+ slic
+
+
+
+
+
+
+
+
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7108c7e1af..e5c355eb19 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2619,6 +2619,7 @@ void virDomainDefFree(virDomainDefPtr def)
VIR_FREE(def->os.cmdline);
VIR_FREE(def->os.dtb);
VIR_FREE(def->os.root);
+ VIR_FREE(def->os.slic_table);
virDomainLoaderDefFree(def->os.loader);
VIR_FREE(def->os.bootloader);
VIR_FREE(def->os.bootloaderArgs);
@@ -15115,6 +15116,8 @@ virDomainDefParseBootOptions(virDomainDefPtr def,
virHashTablePtr *bootHash)
{
xmlNodePtr *nodes = NULL;
+ xmlNodePtr oldnode;
+ char *tmp = NULL;
int ret = -1;
size_t i;
int n;
@@ -15175,6 +15178,40 @@ virDomainDefParseBootOptions(virDomainDefPtr def,
}
if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) {
+ if ((n = virXPathNodeSet("./os/acpi/table", ctxt, &nodes)) < 0)
+ goto error;
+
+ if (n > 1) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("Only one acpi table is supported"));
+ goto error;
+ }
+
+ if (n == 1) {
+ oldnode = ctxt->node;
+ ctxt->node = nodes[0];
+ tmp = virXPathString("string(./@type)", ctxt);
+
+ if (!tmp) {
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("Missing acpi table type"));
+ goto error;
+ }
+
+ if (STREQ_NULLABLE(tmp, "slic")) {
+ VIR_FREE(tmp);
+ tmp = virXPathString("string(.)", ctxt);
+ def->os.slic_table = virFileSanitizePath(tmp);
+ VIR_FREE(tmp);
+ } else {
+ virReportError(VIR_ERR_XML_ERROR,
+ _("Unknown acpi table type: %s"),
+ tmp);
+ goto error;
+ }
+ ctxt->node = oldnode;
+ }
+
if (virDomainDefParseBootXML(ctxt, def) < 0)
goto error;
if (!(*bootHash = virHashCreate(5, NULL)))
@@ -15185,6 +15222,7 @@ virDomainDefParseBootOptions(virDomainDefPtr def,
error:
VIR_FREE(nodes);
+ VIR_FREE(tmp);
return ret;
}
@@ -22516,6 +22554,14 @@ virDomainDefFormatInternal(virDomainDefPtr def,
def->os.dtb);
virBufferEscapeString(buf, "%s \n",
def->os.root);
+ if (def->os.slic_table) {
+ virBufferAddLit(buf, "\n");
+ virBufferAdjustIndent(buf, 2);
+ virBufferEscapeString(buf, "\n",
+ def->os.slic_table);
+ virBufferAdjustIndent(buf, -2);
+ virBufferAddLit(buf, " \n");
+ }
if (!def->os.bootloader) {
for (n = 0; n < def->os.nBootDevs; n++) {
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 4e0550c4a1..963b478d4c 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1746,6 +1746,7 @@ struct _virDomainOSDef {
char *cmdline;
char *dtb;
char *root;
+ char *slic_table;
virDomainLoaderDefPtr loader;
char *bootloader;
char *bootloaderArgs;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-acpi-table.xml b/tests/qemuxml2argvdata/qemuxml2argv-acpi-table.xml
new file mode 100644
index 0000000000..9b8f590016
--- /dev/null
+++ b/tests/qemuxml2argvdata/qemuxml2argv-acpi-table.xml
@@ -0,0 +1,30 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219136
+ 219136
+ 1
+
+ hvm
+
+
+ /var/lib/libvirt/acpi/slic.dat
+
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-acpi-table.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-acpi-table.xml
new file mode 100644
index 0000000000..2eb25a3392
--- /dev/null
+++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-acpi-table.xml
@@ -0,0 +1,34 @@
+
+ QEMUGuest1
+ c7a5fdbd-edaf-9455-926a-d65c16db1809
+ 219136
+ 219136
+ 1
+
+ hvm
+
+ /var/lib/libvirt/acpi/slic.dat
+
+
+
+
+
+
+
+ destroy
+ restart
+ destroy
+
+ /usr/bin/qemu
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index c85cd60722..e23831b3b4 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -806,6 +806,9 @@ mymain(void)
DO_TEST("virtio-input-passthrough");
virObjectUnref(cfg);
+
+ DO_TEST("acpi-table");
+
qemuTestDriverFree(&driver);
return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE;