launch: libvirt: Don't enable <cpu mode="host-model"> on TCG.

It's fairly pointless to do this with TCG, since all we would be doing
is emulating a more complicated processor slowly.  Also it may be the
cause of subtle problems we see during testing.

This updates commit 6f76fdb41e.
This commit is contained in:
Richard W.M. Jones
2013-08-14 15:25:17 +01:00
parent c53b459fdd
commit 46763bcc0b

View File

@@ -823,17 +823,21 @@ construct_libvirt_xml_cpu (guestfs_h *g,
/* It is faster to pass the CPU host model to the appliance,
* allowing maximum speed for things like checksums, encryption.
* Note this may cause problems on some CPUs. See: RHBZ#870071.
* Only do this with KVM. It is broken in subtle ways on TCG, and
* fairly pointless anyway.
*/
XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "cpu"));
XMLERROR (-1,
xmlTextWriterWriteAttribute (xo, BAD_CAST "mode",
BAD_CAST "host-model"));
XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "model"));
XMLERROR (-1,
xmlTextWriterWriteAttribute (xo, BAD_CAST "fallback",
BAD_CAST "allow"));
XMLERROR (-1, xmlTextWriterEndElement (xo));
XMLERROR (-1, xmlTextWriterEndElement (xo));
if (params->is_kvm) {
XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "cpu"));
XMLERROR (-1,
xmlTextWriterWriteAttribute (xo, BAD_CAST "mode",
BAD_CAST "host-model"));
XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "model"));
XMLERROR (-1,
xmlTextWriterWriteAttribute (xo, BAD_CAST "fallback",
BAD_CAST "allow"));
XMLERROR (-1, xmlTextWriterEndElement (xo));
XMLERROR (-1, xmlTextWriterEndElement (xo));
}
XMLERROR (-1, xmlTextWriterStartElement (xo, BAD_CAST "vcpu"));
XMLERROR (-1, xmlTextWriterWriteFormatString (xo, "%d", g->smp));