[libvirt] [PATCH 1/2] virmacmap: Fix variable handling

Michal Privoznik mprivozn at redhat.com
Mon Jan 2 09:49:21 UTC 2017


In virMacMapRemoveLocked() we have two variables: @macsList and
@newMacsList. Obviously, @newMacsList is supposed to hold pointer
to modified list but in fact it holds pointer to the old list.
It's confusing.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/util/virmacmap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/virmacmap.c b/src/util/virmacmap.c
index 36c364e10..11b3e0334 100644
--- a/src/util/virmacmap.c
+++ b/src/util/virmacmap.c
@@ -121,8 +121,8 @@ virMacMapRemoveLocked(virMacMapPtr mgr,
         return 0;
 
     newMacsList = macsList;
-    virStringListRemove(&macsList, mac);
-    if (!macsList) {
+    virStringListRemove(&newMacsList, mac);
+    if (!newMacsList) {
         virHashSteal(mgr->macs, domain);
     } else {
         if (macsList != newMacsList &&
-- 
2.11.0




More information about the libvir-list mailing list