mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user