virCaps: get rid of defaultConsoleTargetType callback

This patch refactors various places to allow removing of the
defaultConsoleTargetType callback from the virCaps structure.

A new console character device target type is introduced -
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_NONE - to mark that no type was
specified in the XML. This type is at the end converted to the standard
VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL. Other types that are
different from this default have to be processed separately in the
device post parse callback.
This commit is contained in:
Peter Krempa
2013-03-13 21:39:34 +01:00
parent 46becc18ba
commit 482e5f159c
32 changed files with 278 additions and 315 deletions

View File

@@ -55,15 +55,6 @@ static virCapsGuestMachinePtr *testQemuAllocNewerMachines(int *nmachines)
return machines;
}
static int testQemuDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED,
virArch arch)
{
if (arch == VIR_ARCH_S390 ||
arch == VIR_ARCH_S390X)
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO;
else
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL;
}
static int testQemuAddPPC64Guest(virCapsPtr caps)
{
@@ -200,8 +191,6 @@ virCapsPtr testQemuCapsInit(void) {
0, 0)) == NULL)
return NULL;
caps->defaultConsoleTargetType = testQemuDefaultConsoleType;
if ((caps->host.cpu = virCPUDefCopy(&host_cpu)) == NULL ||
(machines = testQemuAllocMachines(&nmachines)) == NULL)
goto cleanup;