mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 03:12:22 +00:00
qemu: domain: Call virDomainCapsDeviceDefValidate
Fill in virDomainCaps at Validate time and use it to call virDomainCapsDeviceDefValidate Reviewed-by: Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
d3c7536ce3
commit
b66ca0220a
@ -41,6 +41,7 @@
|
||||
#include "viruuid.h"
|
||||
#include "virfile.h"
|
||||
#include "domain_addr.h"
|
||||
#include "domain_capabilities.h"
|
||||
#include "domain_event.h"
|
||||
#include "virtime.h"
|
||||
#include "virnetdevopenvswitch.h"
|
||||
@ -6737,14 +6738,24 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
|
||||
int ret = 0;
|
||||
virQEMUDriverPtr driver = opaque;
|
||||
virQEMUCapsPtr qemuCaps = NULL;
|
||||
virDomainCapsPtr domCaps = NULL;
|
||||
|
||||
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
|
||||
def->emulator)))
|
||||
return -1;
|
||||
|
||||
if (!(domCaps = virQEMUDriverGetDomainCapabilities(driver, qemuCaps,
|
||||
def->os.machine,
|
||||
def->os.arch,
|
||||
def->virtType)))
|
||||
goto cleanup;
|
||||
|
||||
if ((ret = qemuDomainDeviceDefValidateAddress(dev, qemuCaps)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainCapsDeviceDefValidate(domCaps, dev, def) < 0)
|
||||
goto cleanup;
|
||||
|
||||
switch ((virDomainDeviceType)dev->type) {
|
||||
case VIR_DOMAIN_DEVICE_NET:
|
||||
ret = qemuDomainDeviceDefValidateNetwork(dev->data.net);
|
||||
@ -6831,6 +6842,7 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
|
||||
|
||||
cleanup:
|
||||
virObjectUnref(qemuCaps);
|
||||
virObjectUnref(domCaps);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user