Browse Source

hw/9pfs: Fix crash when mounting with synthfs

Some Fsdriver backend don't have fs_root. So check for that in
migrate message.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Aneesh Kumar K.V 13 năm trước cách đây
mục cha
commit
71f86cd6f3
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      hw/9pfs/virtio-9p.c

+ 1 - 1
hw/9pfs/virtio-9p.c

@@ -986,7 +986,7 @@ static void v9fs_attach(void *opaque)
     s->root_fid = fid;
     s->root_fid = fid;
     /* disable migration */
     /* disable migration */
     error_set(&s->migration_blocker, QERR_VIRTFS_FEATURE_BLOCKS_MIGRATION,
     error_set(&s->migration_blocker, QERR_VIRTFS_FEATURE_BLOCKS_MIGRATION,
-              s->ctx.fs_root, s->tag);
+              s->ctx.fs_root ? s->ctx.fs_root : "NULL", s->tag);
     migrate_add_blocker(s->migration_blocker);
     migrate_add_blocker(s->migration_blocker);
 out:
 out:
     put_fid(pdu, fidp);
     put_fid(pdu, fidp);