]> git.proxmox.com Git - mirror_qemu.git/commitdiff
rdma: Fix qemu crash when IPv6 address is used for migration
authorPadmanabh Ratnakar <padmanabh.ratnakar@avagotech.com>
Tue, 2 Jun 2015 23:14:10 +0000 (04:44 +0530)
committerJuan Quintela <quintela@redhat.com>
Fri, 12 Jun 2015 04:42:34 +0000 (06:42 +0200)
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

index 77e34441dcfb08dc03825de60d52a1141e951b61..36719038f77dd3000c819a91c5183c0640a56667 100644 (file)
@@ -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);