]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Use ULL instead of uint64_t for RDMA GID event
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 9 Jan 2019 10:27:15 +0000 (11:27 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 9 Jan 2019 10:31:58 +0000 (11:31 +0100)
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>
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h
src/qemu/qemu_process.c

index 419ea66a6ace4b11556d568e87b7f9d8b965d0da..7ce5bd668e4e8e170fd999550a32b93ad767c64b 100644 (file)
@@ -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,
index 93804233db697cc01941f3c0e077540fc8e7678c..8fcac8850f2cf912f23b1697dcf011536053ce24 100644 (file)
@@ -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);
index 83a054663f220e9aa1c8d4b3834384887e22be44..aad6c125529a86766a0b97c4b3fc1259aa056af4 100644 (file)
@@ -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 ||