Changing any of the attributes of an <interface>'s <backend> would
require removing and re-adding the interface for the new setting to
take effect, so fail any update-device that changes anything in
<backend>
Resolves: https://bugzilla.redhat.com/
2169245
Signed-off-by: Laine Stump <laine@redhat.com>
}
+bool
+virDomainNetBackendIsEqual(virDomainNetBackend *src,
+ virDomainNetBackend *dst)
+{
+ if (src->type != dst->type ||
+ STRNEQ_NULLABLE(src->tap, dst->tap) ||
+ STRNEQ_NULLABLE(src->vhost, dst->vhost) ||
+ STRNEQ_NULLABLE(src->logFile, dst->logFile)) {
+ return false;
+ }
+ return true;
+}
+
+
static bool
virDomainNetDefCheckABIStability(virDomainNetDef *src,
virDomainNetDef *dst)
bool virDomainHasNet(virDomainDef *def, virDomainNetDef *net);
int virDomainNetInsert(virDomainDef *def, virDomainNetDef *net);
int virDomainNetUpdate(virDomainDef *def, size_t netidx, virDomainNetDef *newnet);
+bool virDomainNetBackendIsEqual(virDomainNetBackend *src,
+ virDomainNetBackend *dst);
int virDomainNetDHCPInterfaces(virDomainDef *def, virDomainInterfacePtr **ifaces);
int virDomainNetARPInterfaces(virDomainDef *def, virDomainInterfacePtr **ifaces);
virDomainNetDef *virDomainNetRemove(virDomainDef *def, size_t i);
virDomainNetAllocateActualDevice;
virDomainNetAppendIPAddress;
virDomainNetARPInterfaces;
+virDomainNetBackendIsEqual;
virDomainNetBandwidthUpdate;
virDomainNetDefActualFromNetworkPort;
virDomainNetDefActualToNetworkPort;
goto cleanup;
}
+ /* nothing in <backend> can be modified in an existing interface -
+ * the entire device will need to be removed and re-added.
+ */
+ if (!virDomainNetBackendIsEqual(&olddev->backend, &newdev->backend)) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+ _("cannot modify network device backend settings"));
+ goto cleanup;
+ }
+
/* allocate new actual device to compare to old - we will need to
* free it if we fail for any reason
*/