提交 8153c72b 编写于 作者: J Jiri Denemark 提交者: Daniel Veillard

Only probe for CPU models if required

* src/qemu/qemu_conf.c: CPU models should be probed only if the
  a guest's XML contains CPU model, not each time a qemu command line
  is generated.
上级 5dbb208a
......@@ -1778,17 +1778,18 @@ qemudBuildCommandLineCPU(virConnectPtr conn,
{
const virCPUDefPtr host = driver->caps->host.cpu;
virCPUDefPtr guest = NULL;
unsigned int ncpus;
unsigned int ncpus = 0;
const char **cpus = NULL;
union cpuData *data = NULL;
int ret = -1;
virBuffer buf = VIR_BUFFER_INITIALIZER;
int i;
if (qemudProbeCPUModels(emulator, ut->machine, &ncpus, &cpus) < 0)
if (def->cpu && def->cpu->model
&& qemudProbeCPUModels(emulator, ut->machine, &ncpus, &cpus) < 0)
goto cleanup;
if (ncpus > 0 && host && def->cpu && def->cpu->model) {
if (ncpus > 0 && host) {
virCPUCompareResult cmp;
cmp = cpuGuestData(conn, host, def->cpu, &data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册