summaryrefslogtreecommitdiff
path: root/migration/rdma.c
diff options
context:
space:
mode:
authorPadmanabh Ratnakar <padmanabh.ratnakar@avagotech.com>2015-06-03 04:44:10 +0530
committerJuan Quintela <quintela@redhat.com>2015-06-12 06:42:34 +0200
commit5b61d5752156dcbbe2bf1366c877a676ed9f8f51 (patch)
tree0b445ba0469177e706ad4eb9b5d41616e14b8a17 /migration/rdma.c
parent5ee6926582cca64238967b2d00d870265cdb10b8 (diff)
downloadqemu-5b61d5752156dcbbe2bf1366c877a676ed9f8f51.tar.gz
rdma: Fix qemu crash when IPv6 address is used for migration
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>
Diffstat (limited to 'migration/rdma.c')
-rw-r--r--migration/rdma.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/migration/rdma.c b/migration/rdma.c
index 77e34441dc..36719038f7 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);