diff mbox

[PULL,06/21] rdma: Fix qemu crash when IPv6 address is used for migration

Message ID 1433333157-9939-7-git-send-email-quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela June 3, 2015, 12:05 p.m. UTC
From: Padmanabh Ratnakar <padmanabh.ratnakar@avagotech.com>

Qemu crashes when IPv6 address is specified for migration and access
to any RDMA uverbs device available on the system is blocked using cgroups.
Fix the crash by checking the return value of ibv_open_device routine.

Signed-off-by: Meghana Cheripady <meghana.cheripady@avagotech.com>
Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@avagotech.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 migration/rdma.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/migration/rdma.c b/migration/rdma.c
index 77e3444..3671903 100644
--- a/migration/rdma.c
+++ b/migration/rdma.c
@@ -790,6 +790,13 @@  static int qemu_rdma_broken_ipv6_kernel(Error **errp, struct ibv_context *verbs)

         for (x = 0; x < num_devices; x++) {
             verbs = ibv_open_device(dev_list[x]);
+            if (!verbs) {
+                if (errno == EPERM) {
+                    continue;
+                } else {
+                    return -EINVAL;
+                }
+            }

             if (ibv_query_port(verbs, 1, &port_attr)) {
                 ibv_close_device(verbs);