mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 04:55:18 +00:00
qemu_hotplug: Allow QoS update in qemuDomainChangeNet
The qemuDomainChangeNet() is called when 'virsh update-device' is invoked on a NIC. Currently, we fail to update the QoS even though we have routines for that. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> (cherry picked from commit 9fa10d3901a14997f724fe50ad8a33d7f0d23abe)
This commit is contained in:
parent
eaf803e7f0
commit
e6f4742b97
@ -1470,6 +1470,7 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
|||||||
bool needFilterChange = false;
|
bool needFilterChange = false;
|
||||||
bool needLinkStateChange = false;
|
bool needLinkStateChange = false;
|
||||||
bool needReplaceDevDef = false;
|
bool needReplaceDevDef = false;
|
||||||
|
bool needBandwidthSet = false;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
if (!devslot || !(olddev = *devslot)) {
|
if (!devslot || !(olddev = *devslot)) {
|
||||||
@ -1738,8 +1739,6 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
|||||||
virDomainNetGetActualDirectMode(olddev) != virDomainNetGetActualDirectMode(olddev) ||
|
virDomainNetGetActualDirectMode(olddev) != virDomainNetGetActualDirectMode(olddev) ||
|
||||||
!virNetDevVPortProfileEqual(virDomainNetGetActualVirtPortProfile(olddev),
|
!virNetDevVPortProfileEqual(virDomainNetGetActualVirtPortProfile(olddev),
|
||||||
virDomainNetGetActualVirtPortProfile(newdev)) ||
|
virDomainNetGetActualVirtPortProfile(newdev)) ||
|
||||||
!virNetDevBandwidthEqual(virDomainNetGetActualBandwidth(olddev),
|
|
||||||
virDomainNetGetActualBandwidth(newdev)) ||
|
|
||||||
!virNetDevVlanEqual(virDomainNetGetActualVlan(olddev),
|
!virNetDevVlanEqual(virDomainNetGetActualVlan(olddev),
|
||||||
virDomainNetGetActualVlan(newdev))) {
|
virDomainNetGetActualVlan(newdev))) {
|
||||||
needReconnect = true;
|
needReconnect = true;
|
||||||
@ -1748,6 +1747,10 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
|||||||
if (olddev->linkstate != newdev->linkstate)
|
if (olddev->linkstate != newdev->linkstate)
|
||||||
needLinkStateChange = true;
|
needLinkStateChange = true;
|
||||||
|
|
||||||
|
if (!virNetDevBandwidthEqual(virDomainNetGetActualBandwidth(olddev),
|
||||||
|
virDomainNetGetActualBandwidth(newdev)))
|
||||||
|
needBandwidthSet = true;
|
||||||
|
|
||||||
/* FINALLY - actually perform the required actions */
|
/* FINALLY - actually perform the required actions */
|
||||||
|
|
||||||
if (needReconnect) {
|
if (needReconnect) {
|
||||||
@ -1757,6 +1760,18 @@ qemuDomainChangeNet(virQEMUDriverPtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (needBandwidthSet) {
|
||||||
|
if (virNetDevBandwidthSet(newdev->ifname,
|
||||||
|
virDomainNetGetActualBandwidth(newdev),
|
||||||
|
false) < 0) {
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("cannot set bandwidth limits on %s"),
|
||||||
|
newdev->ifname);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
needReplaceDevDef = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (needBridgeChange) {
|
if (needBridgeChange) {
|
||||||
if (qemuDomainChangeNetBridge(dom->conn, vm, olddev, newdev) < 0)
|
if (qemuDomainChangeNetBridge(dom->conn, vm, olddev, newdev) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user