From: "Michael S. Tsirkin" <mst@redhat.com>
To: Linhaifeng <haifeng.lin@huawei.com>
Cc: arei.gonglei@huawei.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v1 1/2] vhost-user: support SET_MEM_TABLE waite the result of mmap
Date: Tue, 10 Feb 2015 13:04:22 +0100 [thread overview]
Message-ID: <20150210120422.GA5339@redhat.com> (raw)
In-Reply-To: <54D9F294.2090000@huawei.com>
On Tue, Feb 10, 2015 at 07:59:16PM +0800, Linhaifeng wrote:
>
>
> On 2015/2/10 18:41, Michael S. Tsirkin wrote:
> > On Tue, Feb 10, 2015 at 06:27:04PM +0800, Linhaifeng wrote:
> >>
> >>
> >> On 2015/2/10 16:46, Michael S. Tsirkin wrote:
> >>> On Tue, Feb 10, 2015 at 01:48:12PM +0800, linhaifeng wrote:
> >>>> From: Linhaifeng <haifeng.lin@huawei.com>
> >>>>
> >>>> Slave should reply to master and set u64 to 0 if
> >>>> mmap all regions success otherwise set u64 to 1.
> >>>>
> >>>> Signed-off-by: Linhaifeng <haifeng.lin@huawei.com>
> >>>
> >>> How does this work with existig slaves though?
> >>>
> >>
> >> Slaves should work like this:
> >>
> >> int set_mem_table(...)
> >> {
> >> ....
> >> for (idx = 0, i = 0; idx < memory.nregions; idx++) {
> >> ....
> >> mem = mmap(..);
> >> if (MAP_FAILED == mem) {
> >> msg->msg.u64 = 1;
> >> msg->msg.size = MEMB_SIZE(VhostUserMsg, u64);
> >> return 1;
> >> }
> >> }
> >>
> >> ....
> >>
> >> msg->msg.u64 = 0;
> >> msg->msg.size = MEMB_SIZE(VhostUserMsg, u64);
> >> return 1;
> >> }
> >>
> >> If slaves not reply QEMU will always wait.
> >
> > Are you sure existing slaves reply?
>
> No.May be the existing slaves need add reply in their codes.
So that's not good. We need a way to negotiate the capability,
we can't just deadlock with legacy slaves.
> >
> >>>> ---
> >>>> docs/specs/vhost-user.txt | 1 +
> >>>> 1 file changed, 1 insertion(+)
> >>>>
> >>>> diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt
> >>>> index 650bb18..c96bf6b 100644
> >>>> --- a/docs/specs/vhost-user.txt
> >>>> +++ b/docs/specs/vhost-user.txt
> >>>> @@ -171,6 +171,7 @@ Message types
> >>>> Id: 5
> >>>> Equivalent ioctl: VHOST_SET_MEM_TABLE
> >>>> Master payload: memory regions description
> >>>> + Slave payload: u64 (0:success >0:failed)
> >>>>
> >>>> Sets the memory map regions on the slave so it can translate the vring
> >>>> addresses. In the ancillary data there is an array of file descriptors
> >>>> --
> >>>> 1.7.12.4
> >>>>
> >>>
> >>>
> >>
> >> --
> >> Regards,
> >> Haifeng
> >
> > .
> >
>
> --
> Regards,
> Haifeng
next prev parent reply other threads:[~2015-02-10 12:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 5:48 [Qemu-devel] [PATCH v1 1/2] vhost-user: support SET_MEM_TABLE waite the result of mmap linhaifeng
2015-02-10 5:48 ` [Qemu-devel] [PATCH v1 2/2] vhost-user: add reply for set_mem_table linhaifeng
2015-02-10 6:35 ` Gonglei
2015-02-10 6:54 ` Linhaifeng
2015-02-10 8:46 ` [Qemu-devel] [PATCH v1 1/2] vhost-user: support SET_MEM_TABLE waite the result of mmap Michael S. Tsirkin
2015-02-10 10:27 ` Linhaifeng
2015-02-10 10:41 ` Michael S. Tsirkin
2015-02-10 11:59 ` Linhaifeng
2015-02-10 12:04 ` Michael S. Tsirkin [this message]
2015-02-11 1:38 ` Linhaifeng
2015-02-12 16:38 ` Michael S. Tsirkin
2015-02-11 6:30 ` Linhaifeng
2015-02-12 3:25 ` Linhaifeng
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=20150210120422.GA5339@redhat.com \
--to=mst@redhat.com \
--cc=arei.gonglei@huawei.com \
--cc=haifeng.lin@huawei.com \
--cc=qemu-devel@nongnu.org \
/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).