Re: [PATCH v2 1/6] util: use a single flags arg for virNetDevBandwidthSet(), not multiple bools

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

 



On 11/26/24 7:18 AM, Michal Prívozník wrote:
On 11/26/24 04:24, Laine Stump wrote:
Having two bools in the arg list is on the borderline of being
confusing to anyone trying to read the code, but we're about to add a
3rd. This patch replaces the two bools with a single flags argument
which will instead have one or more bits from virNetDevBandwidthFlags
set.

Signed-off-by: Laine Stump <laine@xxxxxxxxxx>
---
  src/lxc/lxc_driver.c           |  8 ++++++--
  src/lxc/lxc_process.c          |  8 ++++++--
  src/network/bridge_driver.c    | 10 ++++++++--
  src/qemu/qemu_command.c        | 11 ++++++++---
  src/qemu/qemu_driver.c         | 29 ++++++++++++++-------------
  src/qemu/qemu_hotplug.c        | 22 +++++++++++++++------
  src/util/virnetdevbandwidth.c  | 36 ++++++++++++++++++++--------------
  src/util/virnetdevbandwidth.h  | 11 ++++++++---
  tests/virnetdevbandwidthtest.c |  8 +++++++-
  9 files changed, 95 insertions(+), 48 deletions(-)


Squash this in:

diff --git i/src/util/virnetdevbandwidth.h w/src/util/virnetdevbandwidth.h
index 414d6c97eb..80dc654486 100644
--- i/src/util/virnetdevbandwidth.h
+++ w/src/util/virnetdevbandwidth.h
@@ -35,7 +35,7 @@ struct _virNetDevBandwidth {
      virNetDevBandwidthRate *out;
  };
- void virNetDevBandwidthFree(virNetDevBandwidth *def);
+void virNetDevBandwidthFree(virNetDevBandwidth *def);
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevBandwidth, virNetDevBandwidthFree); diff --git i/tests/virnetdevbandwidthtest.c w/tests/virnetdevbandwidthtest.c
index 3a87d876c8..6529ff4026 100644
--- i/tests/virnetdevbandwidthtest.c
+++ w/tests/virnetdevbandwidthtest.c
@@ -82,7 +82,7 @@ testVirNetDevBandwidthSet(const void *data)
          if (virNetDevOpenvswitchInterfaceSetQos(iface, band, info->uuid, true) < 0)
              return -1;
      } else {
-        int flags = (VIR_NETDEV_BANDWIDTH_SET_DIR_SWAPPED);
+        unsigned int flags = VIR_NETDEV_BANDWIDTH_SET_DIR_SWAPPED;

Huh. I thought I had caught all of those, but I guess not. (I'd originally made them all just "int", but the syntax-check stuff pointed out that any arg to a function named "flags" should be unsigned)




[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