mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-14 16:45:20 +00:00
qemu: domain: Extract network device def post parse code
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
db4dd58d6c
commit
91779733de
@ -5727,6 +5727,22 @@ qemuDomainDeviceDiskDefPostParse(virDomainDiskDefPtr disk,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static int
|
||||||
|
qemuDomainDeviceNetDefPostParse(virDomainNetDefPtr net,
|
||||||
|
const virDomainDef *def,
|
||||||
|
virQEMUCapsPtr qemuCaps)
|
||||||
|
{
|
||||||
|
if (net->type != VIR_DOMAIN_NET_TYPE_HOSTDEV &&
|
||||||
|
!net->model) {
|
||||||
|
if (VIR_STRDUP(net->model,
|
||||||
|
qemuDomainDefaultNetModel(def, qemuCaps)) < 0)
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
|
qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
|
||||||
const virDomainDef *def,
|
const virDomainDef *def,
|
||||||
@ -5744,12 +5760,8 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (dev->type == VIR_DOMAIN_DEVICE_NET &&
|
if (dev->type == VIR_DOMAIN_DEVICE_NET &&
|
||||||
dev->data.net->type != VIR_DOMAIN_NET_TYPE_HOSTDEV &&
|
qemuDomainDeviceNetDefPostParse(dev->data.net, def, qemuCaps) < 0)
|
||||||
!dev->data.net->model) {
|
|
||||||
if (VIR_STRDUP(dev->data.net->model,
|
|
||||||
qemuDomainDefaultNetModel(def, qemuCaps)) < 0)
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
|
|
||||||
if (dev->type == VIR_DOMAIN_DEVICE_DISK &&
|
if (dev->type == VIR_DOMAIN_DEVICE_DISK &&
|
||||||
qemuDomainDeviceDiskDefPostParse(dev->data.disk, cfg) < 0)
|
qemuDomainDeviceDiskDefPostParse(dev->data.disk, cfg) < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user