]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: bitamp: Remove virBitmapNewEmpty
authorPeter Krempa <pkrempa@redhat.com>
Thu, 1 Oct 2020 15:02:16 +0000 (17:02 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 5 Oct 2020 13:38:47 +0000 (15:38 +0200)
It can be replaced by virBitmapNew(0).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/numa_conf.c
src/libvirt_private.syms
src/util/virbitmap.c
src/util/virbitmap.h
src/util/virhostcpu.c
src/util/virnuma.c
src/util/virtpm.c
tests/virbitmaptest.c

index cc6c77f105623b9862cc2fd8b82cf505a4d4983c..b5ddf2c134c34b59755ef524a03ae5fc10916d83 100644 (file)
@@ -1374,7 +1374,7 @@ virDomainNumaDefValidate(const virDomainNuma *def)
 
     for (i = 0; i < def->nmem_nodes; i++) {
         const virDomainNumaNode *node = &def->mem_nodes[i];
-        g_autoptr(virBitmap) levelsSeen = virBitmapNewEmpty();
+        g_autoptr(virBitmap) levelsSeen = virBitmapNew(0);
 
         for (j = 0; j < node->ncaches; j++) {
             const virDomainNumaCache *cache = &node->caches[j];
index 185f120f6b1a15354bce45b54d5ab3c66505d449..01ae3cad933bced620f43be404acb242369cf30e 100644 (file)
@@ -1683,7 +1683,6 @@ virBitmapLastSetBit;
 virBitmapNew;
 virBitmapNewCopy;
 virBitmapNewData;
-virBitmapNewEmpty;
 virBitmapNewString;
 virBitmapNextClearBit;
 virBitmapNextSetBit;
index 3545160957f10a06504bd77fd84f6abe1200c9ed..79e9ca96835218fb84d84a641bf7f777ee4c9fc3 100644 (file)
@@ -84,20 +84,6 @@ virBitmapNew(size_t size)
 }
 
 
-/**
- * virBitmapNewEmpty:
- *
- * Allocate an empty bitmap. It can be used with self-expanding APIs.
- *
- * Returns a pointer to the allocated bitmap.
- */
-virBitmapPtr
-virBitmapNewEmpty(void)
-{
-    return g_new0(virBitmap, 1);
-}
-
-
 /**
  * virBitmapFree:
  * @bitmap: previously allocated bitmap
@@ -576,7 +562,7 @@ virBitmapParse(const char *str,
 virBitmapPtr
 virBitmapParseUnlimited(const char *str)
 {
-    virBitmapPtr bitmap = virBitmapNewEmpty();
+    virBitmapPtr bitmap = virBitmapNew(0);
     bool neg = false;
     const char *cur = str;
     char *tmp;
index 88af3bbadcf688837ae3655098832eb2accca3d4..cd5caa6f619a824e8e2a2bc5eb07be8b94bb7641 100644 (file)
@@ -33,7 +33,6 @@ typedef virBitmap *virBitmapPtr;
  * Allocate a bitmap capable of containing @size bits.
  */
 virBitmapPtr virBitmapNew(size_t size);
-virBitmapPtr virBitmapNewEmpty(void) G_GNUC_WARN_UNUSED_RESULT;
 
 /*
  * Free previously allocated bitmap
index f7e92cd924348378f99edf3da6d7f69d9d14ffee..c00a393def4085c76de3f0ad4a27c61d7bfd1690 100644 (file)
@@ -336,7 +336,7 @@ virHostCPUParseNode(const char *node,
         goto cleanup;
 
     /* enumerate sockets in the node */
-    sockets_map = virBitmapNewEmpty();
+    sockets_map = virBitmapNew(0);
 
     while ((direrr = virDirRead(cpudir, &cpudirent, node)) > 0) {
         if (sscanf(cpudirent->d_name, "cpu%u", &cpu) != 1)
@@ -372,7 +372,7 @@ virHostCPUParseNode(const char *node,
         goto cleanup;
 
     for (i = 0; i < sock_max; i++)
-        cores_maps[i] = virBitmapNewEmpty();
+        cores_maps[i] = virBitmapNew(0);
 
     /* Iterate over all CPUs in the node, in ascending order */
     for (cpu = 0; cpu < npresent_cpus; cpu++) {
index 39f0f309173c2750e528913f895aa836e5a8f1b4..5a1218cdf208b6861d7717fffe99c33f00920e6f 100644 (file)
@@ -311,7 +311,7 @@ virNumaNodesetToCPUset(virBitmapPtr nodeset,
     if (!nodeset)
         return 0;
 
-    allNodesCPUs = virBitmapNewEmpty();
+    allNodesCPUs = virBitmapNew(0);
     nodesetSize = virBitmapSize(nodeset);
 
     for (i = 0; i < nodesetSize; i++) {
index 1a3b5a05aa47b1ea7ce05319372fecf9c6ba3383..0e11674a3cfc1a9d8fcef0631260735bc58b4570 100644 (file)
@@ -183,7 +183,7 @@ virTPMExecGetCaps(virCommandPtr cmd,
     if (virCommandRun(cmd, &exitstatus) < 0)
         return NULL;
 
-    bitmap = virBitmapNewEmpty();
+    bitmap = virBitmapNew(0);
 
     /* older version does not support --print-capabilties -- that's fine */
     if (exitstatus != 0) {
index 3559e61be75a139b89de45b528d23c9a629d11bc..efdce51c3bff103aab0eebd2001e4e2226dccc79 100644 (file)
@@ -189,7 +189,7 @@ test4a(const void *data G_GNUC_UNUSED)
 
     /* 0. empty set */
 
-    bitmap = virBitmapNewEmpty();
+    bitmap = virBitmapNew(0);
 
     if (virBitmapNextSetBit(bitmap, -1) != -1)
         return -1;
@@ -561,7 +561,7 @@ test11(const void *opaque)
 static int
 test12a(const void *opaque G_GNUC_UNUSED)
 {
-    g_autoptr(virBitmap) map = virBitmapNewEmpty();
+    g_autoptr(virBitmap) map = virBitmapNew(0);
 
     if (checkBitmap(map, "", 0) < 0)
         return -1;
@@ -687,11 +687,11 @@ test15(const void *opaque)
 }
 
 
-/* virBitmapNewEmpty + virBitmapToString */
+/* virBitmapNew(0) + virBitmapToString */
 static int
 test16(const void *opaque G_GNUC_UNUSED)
 {
-    g_autoptr(virBitmap) map = virBitmapNewEmpty();
+    g_autoptr(virBitmap) map = virBitmapNew(0);
     g_autofree char *res_empty = NULL;
     g_autofree char *res_set = NULL;