]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Do not report useless error in virPortAllocatorRelease
authorJiri Denemark <jdenemar@redhat.com>
Wed, 18 May 2022 07:14:15 +0000 (09:14 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Thu, 19 May 2022 15:40:31 +0000 (17:40 +0200)
If the port allocator bitmap does not have enough bits to keep the state
of the port we're going to release, the port is not reserved and thus is
trivially released without doing anything. No need to report an error in
such case.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/util/virportallocator.c

index 44edd8f99a54d5c4bd15057d7ec112c8bf352402..97ab3627491527c4d685d1c715270522d0d80b7a 100644 (file)
@@ -254,12 +254,7 @@ virPortAllocatorRelease(unsigned short port)
         return 0;
 
     VIR_WITH_OBJECT_LOCK_GUARD(pa) {
-        if (virBitmapClearBit(pa->bitmap, port) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Failed to release port %d"),
-                           port);
-            return -1;
-        }
+        ignore_value(virBitmapClearBit(pa->bitmap, port));
     }
 
     return 0;