qemu: pass priv data to qemuBuildMonitorCommandLine

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Pavel Hrdina 2017-10-11 13:06:09 +02:00
parent e54d4d5e98
commit b569ef0a76

View File

@ -5634,20 +5634,17 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManager,
virCommandPtr cmd, virCommandPtr cmd,
virQEMUDriverConfigPtr cfg, virQEMUDriverConfigPtr cfg,
virDomainDefPtr def, virDomainDefPtr def,
virQEMUCapsPtr qemuCaps, qemuDomainObjPrivatePtr priv)
virDomainChrSourceDefPtr monitor_chr,
bool monitor_json,
bool chardevStdioLogd)
{ {
char *chrdev; char *chrdev;
if (!monitor_chr) if (!priv->monConfig)
return 0; return 0;
if (!(chrdev = qemuBuildChrChardevStr(logManager, cmd, cfg, def, if (!(chrdev = qemuBuildChrChardevStr(logManager, cmd, cfg, def,
monitor_chr, "monitor", priv->monConfig, "monitor",
qemuCaps, true, priv->qemuCaps, true,
chardevStdioLogd))) priv->chardevStdioLogd)))
return -1; return -1;
virCommandAddArg(cmd, "-chardev"); virCommandAddArg(cmd, "-chardev");
virCommandAddArg(cmd, chrdev); virCommandAddArg(cmd, chrdev);
@ -5656,7 +5653,7 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManager,
virCommandAddArg(cmd, "-mon"); virCommandAddArg(cmd, "-mon");
virCommandAddArgFormat(cmd, virCommandAddArgFormat(cmd,
"chardev=charmonitor,id=monitor,mode=%s", "chardev=charmonitor,id=monitor,mode=%s",
monitor_json ? "control" : "readline"); priv->monJSON ? "control" : "readline");
return 0; return 0;
} }
@ -9988,7 +9985,6 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
unsigned int bootHostdevNet = 0; unsigned int bootHostdevNet = 0;
qemuDomainObjPrivatePtr priv = vm->privateData; qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainDefPtr def = vm->def; virDomainDefPtr def = vm->def;
virDomainChrSourceDefPtr monitor_chr = priv->monConfig;
bool monitor_json = priv->monJSON; bool monitor_json = priv->monJSON;
virQEMUCapsPtr qemuCaps = priv->qemuCaps; virQEMUCapsPtr qemuCaps = priv->qemuCaps;
virBitmapPtr nodeset = priv->autoNodeset; virBitmapPtr nodeset = priv->autoNodeset;
@ -9997,7 +9993,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
VIR_DEBUG("driver=%p def=%p mon=%p json=%d " VIR_DEBUG("driver=%p def=%p mon=%p json=%d "
"qemuCaps=%p migrateURI=%s snapshot=%p vmop=%d", "qemuCaps=%p migrateURI=%s snapshot=%p vmop=%d",
driver, def, monitor_chr, monitor_json, driver, def, priv->monConfig, monitor_json,
qemuCaps, migrateURI, snapshot, vmop); qemuCaps, migrateURI, snapshot, vmop);
if (qemuBuildCommandLineValidate(driver, def) < 0) if (qemuBuildCommandLineValidate(driver, def) < 0)
@ -10091,10 +10087,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
if (qemuBuildSgaCommandLine(cmd, def, qemuCaps) < 0) if (qemuBuildSgaCommandLine(cmd, def, qemuCaps) < 0)
goto error; goto error;
if (qemuBuildMonitorCommandLine(logManager, cmd, cfg, def, if (qemuBuildMonitorCommandLine(logManager, cmd, cfg, def, priv) < 0)
qemuCaps, monitor_chr,
monitor_json,
chardevStdioLogd) < 0)
goto error; goto error;
if (qemuBuildClockCommandLine(cmd, def, qemuCaps) < 0) if (qemuBuildClockCommandLine(cmd, def, qemuCaps) < 0)