[libvirt] [PATCH] qemu: Use ULL instead of uint64_t for RDMA GID event

Michal Privoznik posted 1 patch 5 years, 3 months ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/f886271410cf8b64ce92d0f727efe1b9a922c8c7.1547036374.git.mprivozn@redhat.com
src/qemu/qemu_monitor.c |  6 +++---
src/qemu/qemu_monitor.h | 12 +++++++-----
src/qemu/qemu_process.c |  6 +++---
3 files changed, 13 insertions(+), 11 deletions(-)
[libvirt] [PATCH] qemu: Use ULL instead of uint64_t for RDMA GID event
Posted by Michal Privoznik 5 years, 3 months ago
In the previous commit we are using uint64_t for storing subnet
prefix and interface id that qemu reports in
RDMA_GID_STATUS_CHANGED event. We also report them in some debug
messages. This poses a problem because uint64_t can be UL or ULL
depending on the host architecture and hence we wouldn't know
which format to use. Switch to ULL which is big enough and
doesn't suffer from the issue.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---

Pushed under build breaker and trivial rules.

 src/qemu/qemu_monitor.c |  6 +++---
 src/qemu/qemu_monitor.h | 12 +++++++-----
 src/qemu/qemu_process.c |  6 +++---
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 419ea66a6a..7ce5bd668e 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -1688,11 +1688,11 @@ int
 qemuMonitorEmitRdmaGidStatusChanged(qemuMonitorPtr mon,
                                     const char *netdev,
                                     bool gid_status,
-                                    uint64_t subnet_prefix,
-                                    uint64_t interface_id)
+                                    unsigned long long subnet_prefix,
+                                    unsigned long long interface_id)
 {
     int ret = -1;
-    VIR_DEBUG("netdev=%s, gid_status=%d, subnet_prefix=0x%lx, interface_id=0x%lx",
+    VIR_DEBUG("netdev=%s, gid_status=%d, subnet_prefix=0x%llx, interface_id=0x%llx",
               netdev, gid_status, subnet_prefix, interface_id);
 
     QEMU_MONITOR_CALLBACK(mon, ret, domainRdmaGidStatusChanged, mon->vm,
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
index 93804233db..8fcac8850f 100644
--- a/src/qemu/qemu_monitor.h
+++ b/src/qemu/qemu_monitor.h
@@ -294,8 +294,8 @@ typedef int (*qemuMonitorDomainRdmaGidStatusChangedCallback)(qemuMonitorPtr mon,
                                                              virDomainObjPtr vm,
                                                              const char *netdev,
                                                              bool gid_status,
-                                                             uint64_t subnet_prefix,
-                                                             uint64_t interface_id,
+                                                             unsigned long long subnet_prefix,
+                                                             unsigned long long interface_id,
                                                              void *opaque);
 
 typedef struct _qemuMonitorCallbacks qemuMonitorCallbacks;
@@ -466,9 +466,11 @@ int qemuMonitorEmitPRManagerStatusChanged(qemuMonitorPtr mon,
                                           const char *prManager,
                                           bool connected);
 
-int qemuMonitorEmitRdmaGidStatusChanged(qemuMonitorPtr mon, const char *netdev,
-                                        bool gid_status, uint64_t subnet_prefix,
-                                        uint64_t interface_id);
+int qemuMonitorEmitRdmaGidStatusChanged(qemuMonitorPtr mon,
+                                        const char *netdev,
+                                        bool gid_status,
+                                        unsigned long long subnet_prefix,
+                                        unsigned long long interface_id);
 
 int qemuMonitorStartCPUs(qemuMonitorPtr mon);
 int qemuMonitorStopCPUs(qemuMonitorPtr mon);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 83a054663f..aad6c12552 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1720,8 +1720,8 @@ qemuProcessHandleRdmaGidStatusChanged(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
                                       virDomainObjPtr vm,
                                       const char *netdev,
                                       bool gid_status,
-                                      uint64_t subnet_prefix,
-                                      uint64_t interface_id,
+                                      unsigned long long subnet_prefix,
+                                      unsigned long long interface_id,
                                       void *opaque)
 {
     virQEMUDriverPtr driver = opaque;
@@ -1731,7 +1731,7 @@ qemuProcessHandleRdmaGidStatusChanged(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
 
     virObjectLock(vm);
 
-    VIR_DEBUG("netdev=%s,gid_status=%d,subnet_prefix=0x%lx,interface_id=0x%lx",
+    VIR_DEBUG("netdev=%s,gid_status=%d,subnet_prefix=0x%llx,interface_id=0x%llx",
               netdev, gid_status, subnet_prefix, interface_id);
 
     if (VIR_ALLOC(info) < 0 ||
-- 
2.19.2

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