From patchwork Tue Jul 31 07:24:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 174167 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 841B22C0089 for ; Tue, 31 Jul 2012 17:25:09 +1000 (EST) Received: from localhost ([::1]:40491 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sw6pH-0000Pc-IQ for incoming@patchwork.ozlabs.org; Tue, 31 Jul 2012 03:25:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sw6p6-0000PK-PD for qemu-devel@nongnu.org; Tue, 31 Jul 2012 03:25:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sw6p2-0007q1-SO for qemu-devel@nongnu.org; Tue, 31 Jul 2012 03:24:56 -0400 Received: from e28smtp03.in.ibm.com ([122.248.162.3]:53040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sw6p2-0007pk-17 for qemu-devel@nongnu.org; Tue, 31 Jul 2012 03:24:52 -0400 Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 31 Jul 2012 12:54:45 +0530 Received: from d28relay05.in.ibm.com (9.184.220.62) by e28smtp03.in.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 31 Jul 2012 12:54:17 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay05.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6V7OHJY18808894 for ; Tue, 31 Jul 2012 12:54:17 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6V7OGEZ032132 for ; Tue, 31 Jul 2012 17:24:17 +1000 Received: from skywalker.in.ibm.com (skywalker.in.ibm.com [9.124.35.165]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q6V7OGnh032118; Tue, 31 Jul 2012 17:24:16 +1000 From: "Aneesh Kumar K.V" To: qemu-devel@nongnu.org Date: Tue, 31 Jul 2012 12:54:13 +0530 Message-Id: <1343719453-26768-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10 x-cbid: 12073107-3864-0000-0000-000003FB68A5 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 122.248.162.3 Cc: aliguori@us.ibm.com, "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH] hw/9pfs: Fix assert when disabling migration X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Aneesh Kumar K.V" For 9p we can get the attach request multiple times for the same export. So don't adding migration blocker for every attach request. Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/virtio-9p.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index f4a7026..4b52540 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -983,11 +983,16 @@ static void v9fs_attach(void *opaque) err += offset; trace_v9fs_attach_return(pdu->tag, pdu->id, qid.type, qid.version, qid.path); - s->root_fid = fid; - /* disable migration */ - error_set(&s->migration_blocker, QERR_VIRTFS_FEATURE_BLOCKS_MIGRATION, - s->ctx.fs_root ? s->ctx.fs_root : "NULL", s->tag); - migrate_add_blocker(s->migration_blocker); + /* + * disable migration if we haven't done already. + * attach could get called multiple times for the same export. + */ + if (!s->migration_blocker) { + s->root_fid = fid; + error_set(&s->migration_blocker, QERR_VIRTFS_FEATURE_BLOCKS_MIGRATION, + s->ctx.fs_root ? s->ctx.fs_root : "NULL", s->tag); + migrate_add_blocker(s->migration_blocker); + } out: put_fid(pdu, fidp); out_nofid: