Add the monitor type to the domain state XML

There are no functional changes in this patch apart from adding the
monitor type to the state XML.

The patch mostly consists of switching to use virDomainChrDef every
where to describe the monitor.

* src/domain_conf.h: replace monitorpath with monitor_chr

* src/domain_conf.c: handle parsing the monitor type and initializing
  monitor chr

* src/qemu_conf.[ch]: make qemudBuildCommandLine take a
  virDomainChrDefPtr and use that to build the -monitor parameter

* src/qemu_driver.c: split pty specific and common code from
  qemudOpenMonitor, have qemudStartVMDaemon() initialize monitor_chr

* tests/qemuxml2argvtest.c: update for qemudBuildCommandLine() change
This commit is contained in:
Mark McLoughlin
2009-07-09 18:06:38 +01:00
parent 1f4ec305f0
commit 05d377bdd2
6 changed files with 127 additions and 36 deletions

View File

@@ -34,6 +34,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
const char **tmp = NULL;
int ret = -1, len, flags;
virDomainDefPtr vmdef = NULL;
virDomainChrDef monitor_chr;
if (virtTestLoadFile(cmd, &expectargv, MAX_FILE) < 0)
goto fail;
@@ -47,12 +48,15 @@ static int testCompareXMLToArgvFiles(const char *xml,
else
vmdef->id = -1;
monitor_chr.type = VIR_DOMAIN_CHR_TYPE_PTY;
flags = QEMUD_CMD_FLAG_VNC_COLON |
QEMUD_CMD_FLAG_NO_REBOOT |
extraFlags;
if (qemudBuildCommandLine(NULL, &driver,
vmdef, flags, &argv, &qenv,
vmdef, &monitor_chr, flags,
&argv, &qenv,
NULL, NULL, migrateFrom) < 0)
goto fail;