<interleave>
<ref name="qemucdevSrcDef"/>
<optional>
- <element name="target">
- <optional>
- <attribute name="port"/>
- </optional>
- </element>
+ <ref name="qemucdevTgtDef"/>
</optional>
<optional>
<ref name="address"/>
</optional>
</interleave>
</define>
+
+ <define name="qemucdevConsoleTgtType">
+ <attribute name="type">
+ <choice>
+ <value>xen</value>
+ <value>serial</value>
+ <value>uml</value>
+ </choice>
+ </attribute>
+ </define>
+
+ <define name="qemucdevTgtDef">
+ <element name="target">
+ <interleave>
+ <optional>
+ <ref name="qemucdevConsoleTgtType"/>
+ </optional>
+ <optional>
+ <attribute name="port"/>
+ </optional>
+ </interleave>
+ </element>
+ </define>
+
<define name="qemucdevSrcType">
<attribute name="type">
<choice>
unsigned int emulatorRequired : 1;
const char *defaultDiskDriverName;
const char *defaultDiskDriverType;
+ int defaultConsoleTargetType;
void *(*privateDataAllocFunc)(void);
void (*privateDataFreeFunc)(void *);
int (*privateDataXMLFormat)(virBufferPtr, void *);
"guestfwd",
"virtio")
+VIR_ENUM_IMPL(virDomainChrConsoleTarget,
+ VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST,
+ "serial",
+ "xen",
+ "uml")
+
VIR_ENUM_IMPL(virDomainChrDevice, VIR_DOMAIN_CHR_DEVICE_TYPE_LAST,
"monitor",
"parallel",
}
static int
-virDomainChrDefaultTargetType(int devtype) {
+virDomainChrDefaultTargetType(virCapsPtr caps, int devtype) {
int target = -1;
break;
case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
+ target = caps->defaultConsoleTargetType;
+ break;
+
case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL:
case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL:
default:
}
static int
-virDomainChrTargetTypeFromString(int devtype,
+virDomainChrTargetTypeFromString(virCapsPtr caps,
+ int devtype,
const char *targetType)
{
int ret = -1;
int target = 0;
if (!targetType) {
- target = virDomainChrDefaultTargetType(devtype);
+ target = virDomainChrDefaultTargetType(caps, devtype);
goto out;
}
target = virDomainChrChannelTargetTypeFromString(targetType);
break;
+ case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
+ target = virDomainChrConsoleTargetTypeFromString(targetType);
+ /* Fall through */
+
case VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL:
case VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL:
default:
case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
type = virDomainChrChannelTargetTypeToString(targetType);
break;
+ case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
+ type = virDomainChrConsoleTargetTypeToString(targetType);
+ break;
default:
break;
}
}
static int
-virDomainChrDefParseTargetXML(virDomainChrDefPtr def,
+virDomainChrDefParseTargetXML(virCapsPtr caps,
+ virDomainChrDefPtr def,
xmlNodePtr cur,
int flags ATTRIBUTE_UNUSED)
{
const char *portStr = NULL;
if ((def->targetType =
- virDomainChrTargetTypeFromString(def->deviceType, targetType)) < 0) {
+ virDomainChrTargetTypeFromString(caps,
+ def->deviceType, targetType)) < 0) {
goto error;
}
*
*/
static virDomainChrDefPtr
-virDomainChrDefParseXML(xmlNodePtr node,
+virDomainChrDefParseXML(virCapsPtr caps,
+ xmlNodePtr node,
int flags) {
xmlNodePtr cur;
char *type = NULL;
if (protocol == NULL)
protocol = virXMLPropString(cur, "type");
} else if (xmlStrEqual(cur->name, BAD_CAST "target")) {
- if (virDomainChrDefParseTargetXML(def, cur, flags) < 0) {
+ if (virDomainChrDefParseTargetXML(caps, def, cur, flags) < 0) {
goto error;
}
}
goto no_memory;
for (i = 0 ; i < n ; i++) {
- virDomainChrDefPtr chr = virDomainChrDefParseXML(nodes[i],
+ virDomainChrDefPtr chr = virDomainChrDefParseXML(caps,
+ nodes[i],
flags);
if (!chr)
goto error;
goto no_memory;
for (i = 0 ; i < n ; i++) {
- virDomainChrDefPtr chr = virDomainChrDefParseXML(nodes[i],
+ virDomainChrDefPtr chr = virDomainChrDefParseXML(caps,
+ nodes[i],
flags);
if (!chr)
goto error;
VIR_FREE(nodes);
if ((node = virXPathNode("./devices/console[1]", ctxt)) != NULL) {
- virDomainChrDefPtr chr = virDomainChrDefParseXML(node,
+ virDomainChrDefPtr chr = virDomainChrDefParseXML(caps,
+ node,
flags);
if (!chr)
goto error;
goto no_memory;
for (i = 0 ; i < n ; i++) {
- virDomainChrDefPtr chr = virDomainChrDefParseXML(nodes[i],
+ virDomainChrDefPtr chr = virDomainChrDefParseXML(caps,
+ nodes[i],
flags);
if (!chr)
goto error;
/* Nothing to format */
break;
+ case VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE:
+ virBufferVSprintf(buf,
+ " <target type='%s' port='%d'/>\n",
+ virDomainChrTargetTypeToString(def->deviceType,
+ def->targetType),
+ def->target.port);
+ break;
+
default:
- virBufferVSprintf(buf, " <target port='%d'/>\n", def->target.port);
+ virBufferVSprintf(buf, " <target port='%d'/>\n",
+ def->target.port);
break;
}
VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_LAST,
};
+enum virDomainChrConsoleTargetType {
+ VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL = 0,
+ VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN,
+ VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML,
+
+ VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_LAST,
+};
+
enum virDomainChrType {
VIR_DOMAIN_CHR_TYPE_NULL,
VIR_DOMAIN_CHR_TYPE_VC,
VIR_ENUM_DECL(virDomainNet)
VIR_ENUM_DECL(virDomainChrDevice)
VIR_ENUM_DECL(virDomainChrChannelTarget)
+VIR_ENUM_DECL(virDomainChrConsoleTarget)
VIR_ENUM_DECL(virDomainChr)
VIR_ENUM_DECL(virDomainSoundModel)
VIR_ENUM_DECL(virDomainMemballoonModel)
/* QEMU Requires an emulator in the XML */
virCapabilitiesSetEmulatorRequired(caps);
+ caps->defaultConsoleTargetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
+
return caps;
no_memory:
NULL) == NULL)
goto error;
+ caps->defaultConsoleTargetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_UML;
+
return caps;
error:
}
}
+ caps->defaultConsoleTargetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
+
return caps;
no_memory:
if (!(def->console = xenDaemonParseSxprChar("pty", tty)))
goto error;
def->console->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
+ def->console->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
}
VIR_FREE(tty);
if (!(def->console = xenDaemonParseSxprChar("pty", NULL)))
goto cleanup;
def->console->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE;
+ def->console->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN;
}
if (hvm) {
<target port='2'/>
</parallel>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<sound model='pcspk'/>
<sound model='es1370'/>
<target port='0'/>
</serial>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
</serial>
<console type='dev'>
<source path='/dev/ttyS2'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
</serial>
<console type='file'>
<source path='/tmp/serial.log'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
<target port='1'/>
</serial>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
<target port='0'/>
</serial>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
<console type='tcp'>
<source mode='bind' host='127.0.0.1' service='9999'/>
<protocol type='telnet'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
<console type='tcp'>
<source mode='connect' host='127.0.0.1' service='9999'/>
<protocol type='raw'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
<console type='udp'>
<source mode='bind' host='127.0.0.1' service='9999'/>
<source mode='connect' host='127.0.0.1' service='9998'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
</serial>
<console type='unix'>
<source mode='connect' path='/tmp/serial.sock'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
<target port='0'/>
</serial>
<console type='vc'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
<target port='0'/>
</serial>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<memballoon model='virtio'/>
</devices>
<target dev='vif6.0'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
<target dev='vif5.0'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<target dev='vif6.0'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
<target port='0'/>
</serial>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<target port='0'/>
</serial>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
</devices>
</domain>
</serial>
<console type='file'>
<source path='/tmp/serial.log'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5901' autoport='no'/>
<target port='0'/>
</serial>
<console type='null'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5901' autoport='no'/>
</serial>
<console type='pipe'>
<source path='/tmp/serial.pipe'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5901' autoport='no'/>
<target port='0'/>
</serial>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5901' autoport='no'/>
<target port='0'/>
</serial>
<console type='stdio'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5901' autoport='no'/>
<console type='tcp'>
<source mode='bind' host='localhost' service='9999'/>
<protocol type='telnet'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5901' autoport='no'/>
<console type='tcp'>
<source mode='bind' host='localhost' service='9999'/>
<protocol type='raw'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5901' autoport='no'/>
<console type='udp'>
<source mode='bind' host='localhost' service='9999'/>
<source mode='connect' host='localhost' service='9998'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5901' autoport='no'/>
</serial>
<console type='unix'>
<source mode='bind' path='/tmp/serial.sock'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='5901' autoport='no'/>
<target dev='vif6.0'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
<model type='e1000'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
<target dev='vif6.0'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
<target port='0'/>
</serial>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<hostdev mode='subsystem' type='pci' managed='no'>
<source>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='5925' autoport='no' listen='0.0.0.0' keymap='ja'/>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='ja'/>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0' keymap='ja'/>
<target dev='vif1.0'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<target dev='xvda' bus='xen'/>
</disk>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
</devices>
</domain>
</parallel>
<console type='file'>
<source path='[498076b2-02796c1a-ef5b-000ae484a6a3] virtMonServ1/serial1.file'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
</devices>
</domain>
</serial>
<console type='dev'>
<source path='/dev/ttyS0'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
</devices>
</domain>
</serial>
<console type='file'>
<source path='[datastore] directory/serial0.file'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
</devices>
</domain>
</serial>
<console type='pipe'>
<source path='serial0.pipe'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
</devices>
</domain>
</serial>
<console type='file'>
<source path='/tmp/serial.log'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<target port='0'/>
</serial>
<console type='null'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</serial>
<console type='pipe'>
<source path='/tmp/serial.pipe'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<target port='0'/>
</serial>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<target port='0'/>
</serial>
<console type='stdio'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<console type='tcp'>
<source mode='bind' host='127.0.0.1' service='9999'/>
<protocol type='telnet'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<console type='tcp'>
<source mode='connect' host='127.0.0.1' service='7777'/>
<protocol type='raw'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<console type='udp'>
<source mode='bind' host='0.0.0.0' service='99998'/>
<source mode='connect' host='127.0.0.1' service='9999'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
</serial>
<console type='unix'>
<source mode='bind' path='/tmp/serial.sock'/>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<target port='0'/>
</serial>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<model type='e1000'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<model type='e1000'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<script path='vif-bridge'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='5925' autoport='no' listen='127.0.0.1' passwd='123poi'/>
<script path='vif-bridge'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<script path='vif-bridge'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='5925' autoport='no' listen='127.0.0.1' passwd='123poi'/>
<script path='vif-bridge'/>
</interface>
<console type='pty'>
- <target port='0'/>
+ <target type='xen' port='0'/>
</console>
<input type='mouse' bus='xen'/>
<graphics type='vnc' port='-1' autoport='yes' listen='127.0.0.1' passwd='123poi'/>
<target port='0'/>
</serial>
<console type='pty'>
- <target port='0'/>
+ <target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>