[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 3/4] migration: disallow migrate_add_blocker
From: |
Greg Kurz |
Subject: |
Re: [Qemu-devel] [PATCH v4 3/4] migration: disallow migrate_add_blocker during migration |
Date: |
Tue, 10 Jan 2017 09:25:22 +0100 |
On Mon, 9 Jan 2017 22:32:47 +0530
Ashijeet Acharya <address@hidden> wrote:
> [...]
> diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
> index faebd91..c823a44 100644
> --- a/hw/9pfs/9p.c
> +++ b/hw/9pfs/9p.c
> @@ -1013,20 +1013,28 @@ static void coroutine_fn v9fs_attach(void *opaque)
> goto out;
> }
> err += offset;
> - memcpy(&s->root_qid, &qid, sizeof(qid));
> - trace_v9fs_attach_return(pdu->tag, pdu->id,
> - qid.type, qid.version, qid.path);
> +
> /*
> * 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_setg(&s->migration_blocker,
> "Migration is disabled when VirtFS export path '%s' is
> mounted in the guest using mount_tag '%s'",
> s->ctx.fs_root ? s->ctx.fs_root : "NULL", s->tag);
> - migrate_add_blocker(s->migration_blocker);
> + err = migrate_add_blocker(s->migration_blocker, NULL);
> + if (err < 0) {
> + error_free(s->migration_blocker);
> + s->migration_blocker = NULL;
> + clunk_fid(s, fid);
> + goto out;
> + }
> + s->root_fid = fid;
> }
Hmm... my suggestion was to deal with the migration blocker before the call
to pdu_marshal() since there's no point in copying the qid if we're about
to return an error back to the guest.
> +
> + memcpy(&s->root_qid, &qid, sizeof(qid));
> + trace_v9fs_attach_return(pdu->tag, pdu->id,
> + qid.type, qid.version, qid.path);
> out:
> put_fid(pdu, fidp);
> out_nofid: