qemu: hotplug: Validate definition of 'FS' device after address allocation

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@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2024-05-30 16:25:33 +02:00
parent c249f909f3
commit 63b32dbe8b

View File

@ -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);