Re: [PATCH 3/9] util: Refactor virResctrlAllocFormat of virresctrl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2018年07月25日 06:03, John Ferlan wrote:


On 07/18/2018 03:57 AM, bing.niu@xxxxxxxxx wrote:
From: Bing Niu <bing.niu@xxxxxxxxx>

Refactor virResctrlAllocFormat so that it is easy to support other
resource allocation technologies.

Signed-off-by: Bing Niu <bing.niu@xxxxxxxxx>
---
  src/util/virresctrl.c | 43 ++++++++++++++++++++++++++++---------------
  1 file changed, 28 insertions(+), 15 deletions(-)

diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c
index 98e7296..1515de2 100644
--- a/src/util/virresctrl.c
+++ b/src/util/virresctrl.c
@@ -848,17 +848,13 @@ virResctrlAllocGetID(virResctrlAllocPtr alloc)
  }
-char *
-virResctrlAllocFormat(virResctrlAllocPtr alloc)
+static int
+virResctrlAllocFormatCache(virResctrlAllocPtr alloc, virBufferPtr buf)

One argument per line.  I'll adjust.

  {
-    virBuffer buf = VIR_BUFFER_INITIALIZER;
      unsigned int level = 0;
      unsigned int type = 0;
      unsigned int cache = 0;

[...]

- virBufferCheckError(&buf);
+    if (virBufferCheckError(buf) < 0)
+        return -1;
+    else
+        return 0;

Just return virBufferCheckError(buf); directly

I'll adjust before pushing.
Thanks for that. ;)

Reviewed-by: John Ferlan <jferlan@xxxxxxxxxx>

John


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux