conf: refactor checking for unsupported memory devices

Introduce a helper to check supported device and domain config and move
the memory hotplug checks to it.

The advantage of this approach is that by default all new features are
considered unsupported by all hypervisors unless specifically changed
rather than the previous approach where every hypervisor would need to
declare that a given feature is unsupported.
This commit is contained in:
Peter Krempa
2016-03-09 10:09:16 +01:00
parent 23eb382128
commit 185d13b1b0
16 changed files with 65 additions and 84 deletions
+1 -5
View File
@@ -251,15 +251,11 @@ static char *vboxGenerateMediumName(PRUint32 storageBus,
}
static int
vboxDomainDefPostParse(virDomainDefPtr def,
vboxDomainDefPostParse(virDomainDefPtr def ATTRIBUTE_UNUSED,
virCapsPtr caps ATTRIBUTE_UNUSED,
unsigned int parseFlags ATTRIBUTE_UNUSED,
void *opaque ATTRIBUTE_UNUSED)
{
/* memory hotplug tunables are not supported by this driver */
if (virDomainDefCheckUnsupportedMemoryHotplug(def) < 0)
return -1;
return 0;
}