aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-08-03 13:50:41 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2012-08-03 13:50:41 -0500
commitaeb01d5f2c9a89c557adb0fb40bca15238f93124 (patch)
tree04a96e4b5338adb8421afe55f5758529581f44bd
parentc8057f951d64de93bfd01569c0a725baa9f94372 (diff)
parent4cdc0789ec17ce1ce48506cae62035310e932a2e (diff)
Merge remote-tracking branch 'aneesh/for-upstream' into staging
* aneesh/for-upstream: hw/9pfs: Fix assert when disabling migration configure: Fix build with capabilities
-rw-r--r--hw/9pfs/virtio-9p.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index f4a7026381..4b52540116 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: