conf: Drop virDomainChrDeviceType.targetTypeAttr

This attribute was used to decide whether to format the type
attribute of the <target> element, but the logic didn't take into
account all possible cases and as such could lead to unexpected
results. Moreover, it's one more thing to keep track of, and can
easily fall out of sync with other attributes.

Now that we have VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_NONE, we can
use that value to signal that no specific target type has been
configured for the serial device and as such the attribute should
not be formatted at all. All other values are now formatted.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
Andrea Bolognani
2017-11-28 15:46:32 +01:00
parent 6385c8c142
commit 4fb8ff9987
43 changed files with 56 additions and 61 deletions
@@ -72,13 +72,13 @@
<alias name='serial0'/>
</serial>
<serial type='pty'>
<target port='0'/>
<target type='isa-serial' port='0'/>
<alias name='serial1'/>
</serial>
<serial type='tcp'>
<source mode='bind' host='0.0.0.0' service='2445'/>
<protocol type='raw'/>
<target port='1'/>
<target type='isa-serial' port='1'/>
<alias name='serial2'/>
</serial>
<console type='pty'>
@@ -72,13 +72,13 @@
<alias name='serial0'/>
</serial>
<serial type='pty'>
<target port='0'/>
<target type='isa-serial' port='0'/>
<alias name='serial1'/>
</serial>
<serial type='tcp'>
<source mode='bind' host='0.0.0.0' service='2445'/>
<protocol type='raw'/>
<target port='1'/>
<target type='isa-serial' port='1'/>
<alias name='serial2'/>
</serial>
<console type='pty'>