提交 fde772cf 编写于 作者: P Peter Krempa

qemu: domain: Don't return default NIC model if @qemuCaps are missing

Return NULL in qemuDomainDefaultNetModel if qemuCaps is missing and the
network card model would be determined by the capabilities.
上级 6df29d08
...@@ -3263,6 +3263,15 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev, ...@@ -3263,6 +3263,15 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
} }
/**
* qemuDomainDefaultNetModel:
* @def: domain definition
* @qemuCaps: qemu capabilities
*
* Returns the default network model for a given domain. Note that if @qemuCaps
* is NULL this function may return NULL if the default model depends on the
* capabilities.
*/
static const char * static const char *
qemuDomainDefaultNetModel(const virDomainDef *def, qemuDomainDefaultNetModel(const virDomainDef *def,
virQEMUCapsPtr qemuCaps) virQEMUCapsPtr qemuCaps)
...@@ -3283,6 +3292,11 @@ qemuDomainDefaultNetModel(const virDomainDef *def, ...@@ -3283,6 +3292,11 @@ qemuDomainDefaultNetModel(const virDomainDef *def,
return "lan9118"; return "lan9118";
} }
/* In all other cases the model depends on the capabilities. If they were
* not provided don't report any default. */
if (!qemuCaps)
return NULL;
/* Try several network devices in turn; each of these devices is /* Try several network devices in turn; each of these devices is
* less likely be supported out-of-the-box by the guest operating * less likely be supported out-of-the-box by the guest operating
* system than the previous one */ * system than the previous one */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册