From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yzm45-000310-Aa for qemu-devel@nongnu.org; Tue, 02 Jun 2015 09:17:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yzm3z-0007A6-MY for qemu-devel@nongnu.org; Tue, 02 Jun 2015 09:17:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yzm3z-00079h-Hl for qemu-devel@nongnu.org; Tue, 02 Jun 2015 09:17:03 -0400 From: Juan Quintela In-Reply-To: <20150602131054.GB2139@work-vm> (David Alan Gilbert's message of "Tue, 2 Jun 2015 14:10:57 +0100") References: <1433286850-12753-1-git-send-email-padmanabh.ratnakar@avagotech.com> <87pp5e9sji.fsf@neno.neno> <20150602131054.GB2139@work-vm> Date: Tue, 02 Jun 2015 15:17:00 +0200 Message-ID: <87lhg29rn7.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] rdma: Fix qemu crash when IPv6 address is used for migration Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: amit.shah@redhat.com, Meghana Cheripady , mrhines@us.ibm.com, qemu-devel@nongnu.org, Padmanabh Ratnakar "Dr. David Alan Gilbert" wrote: > * Juan Quintela (quintela@redhat.com) wrote: >> Padmanabh Ratnakar wrote: >> > 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 >> > Signed-off-by: Padmanabh Ratnakar >> > --- >> > migration/rdma.c | 7 +++++++ >> > 1 files changed, 7 insertions(+), 0 deletions(-) >> > >> > 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; >> >> Why do we want to continue here? > > I think the idea is to loop through the set of devices and find if any of them > are 'roce'; if one of the devices iwe don't have permission to use > then it's probably > ok to skip and move onto the next one? > >> > + } else { >> > + return -EINVAL; >> > + } >> > + } >> > >> > if (ibv_query_port(verbs, 1, &port_attr)) { >> >> >> Reading the documentation, my understandig is that if verbs is NULL, we >> don't have a context to do anything useful here, no? > > But that's OK because of the if (!verbs) above? > >> > ibv_close_device(verbs); >> >> >> Thanks, Juan. I got a brown paper bag over my head. Just got patch contexct wrong. > > Dave > >> > -- > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK