From: Greg Kurz <groug@kaod.org>
To: Ashijeet Acharya <ashijeetacharya@gmail.com>
Cc: dgilbert@redhat.com, jsnow@redhat.com, amit.shah@redhat.com,
pbonzini@redhat.com, kwolf@redhat.com, armbru@redhat.com,
quintela@redhat.com, mst@redhat.com, marcandre.lureau@redhat.com,
aneesh.kumar@linux.vnet.ibm.com, peter.maydell@linaro.org,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v4 3/4] migration: disallow migrate_add_blocker during migration
Date: Tue, 10 Jan 2017 09:25:22 +0100 [thread overview]
Message-ID: <20170110092522.36354170@bahia.lan> (raw)
In-Reply-To: <1483981368-9965-4-git-send-email-ashijeetacharya@gmail.com>
On Mon, 9 Jan 2017 22:32:47 +0530
Ashijeet Acharya <ashijeetacharya@gmail.com> 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:
next prev parent reply other threads:[~2017-01-10 8:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-09 17:02 [Qemu-devel] [PATCH v4 0/4] Introduce a new --only-migratable option Ashijeet Acharya
2017-01-09 17:02 ` [Qemu-devel] [PATCH v4 1/4] migration: Add a new option to enable only-migratable Ashijeet Acharya
2017-01-10 11:02 ` Dr. David Alan Gilbert
2017-01-09 17:02 ` [Qemu-devel] [PATCH v4 2/4] migration: Allow "device add" options to only add migratable devices Ashijeet Acharya
2017-01-10 11:23 ` Dr. David Alan Gilbert
2017-01-09 17:02 ` [Qemu-devel] [PATCH v4 3/4] migration: disallow migrate_add_blocker during migration Ashijeet Acharya
2017-01-10 8:25 ` Greg Kurz [this message]
2017-01-10 12:01 ` Dr. David Alan Gilbert
2017-01-10 18:33 ` Ashijeet Acharya
2017-01-09 17:02 ` [Qemu-devel] [PATCH v4 4/4] migration: Fail migration blocker for --only-migratble Ashijeet Acharya
2017-01-09 21:01 ` Eric Blake
2017-01-10 12:11 ` Dr. David Alan Gilbert
2017-01-10 17:15 ` Peter Maydell
2017-01-11 5:43 ` Ashijeet Acharya
2017-01-12 10:45 ` Ashijeet Acharya
2017-01-12 11:16 ` Greg Kurz
2017-01-12 11:50 ` Ashijeet Acharya
2017-01-09 17:27 ` [Qemu-devel] [PATCH v4 0/4] Introduce a new --only-migratable option no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170110092522.36354170@bahia.lan \
--to=groug@kaod.org \
--cc=amit.shah@redhat.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=armbru@redhat.com \
--cc=ashijeetacharya@gmail.com \
--cc=dgilbert@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).