Some of the checks make sense only after the address is allocated and
thus we need to re-do the validation after the address is assigned.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 4739beead8..416e89d00d 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -40,6 +40,7 @@
#include "domain_audit.h"
#include "domain_cgroup.h"
#include "domain_interface.h"
+#include "domain_validate.h"
#include "netdev_bandwidth_conf.h"
#include "domain_nwfilter.h"
#include "virlog.h"
@@ -3216,6 +3217,9 @@ qemuDomainAttachFSDevice(virQEMUDriver *driver,
qemuAssignDeviceFSAlias(vm->def, fs);
+ if (virDomainDeviceDefValidate(&dev, vm->def, 0, driver->xmlopt,
priv->qemuCaps) < 0)
+ goto cleanup;
+
chardev = virDomainChrSourceDefNew(priv->driver->xmlopt);
chardev->type = VIR_DOMAIN_CHR_TYPE_UNIX;
chardev->data.nix.path = qemuDomainGetVHostUserFSSocketPath(priv, fs);
--
2.45.1