From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Stefan Hajnoczi <stefanha@gmail.com>,
Anthony Liguori <aliguori@us.ibm.com>,
qemu-devel <qemu-devel@nongnu.org>,
Blue Swirl <blauwirbel@gmail.com>
Subject: Re: [Qemu-devel] [RFC] libqblock OOM issue
Date: Wed, 14 Nov 2012 18:06:55 +0800 [thread overview]
Message-ID: <50A36D3F.4080001@linux.vnet.ibm.com> (raw)
In-Reply-To: <50A35C81.2020602@redhat.com>
> Il 14/11/2012 04:50, Wenchao Xia ha scritto:
>> There are some different way to implement, not sure which would be
>> better:
>> 1 keep client as thin as possible, client stores opaque pointer used
>> in server side, for eg, QBlockContext *ctx, client only get a pointer
>> pointing to the address where server stores really the object. This
>> have risk when server/client crash and reconnect.
>> 2 client and server maintains index for QBlockContext and QBlockState.
>> 3 thick client and server layer, expose all structure details in .x
>> file, each API have a correspond rpc call. .x file may be complex.
>> 4 define a custom protocol on XDR, like libvirt, this may need many
>> code in server/client side.
>>
>> also with method 1-3, Consider wrapping following API:
>> int qb_context_new(QBlockContext **context);
>
> What is the return value of qb_context_new? Can it simply return
> QBlockContext*?
>
Yes it can return QBlockContext*. There are more APIs take 3 or 4
parameters, which may be used to retrieve result. In that case I am
afraid a return structure can't be avoided, this may result .x file
looks strange.
>> The parameter context is a pointer that will be modified, it seems
>> sunrpc does not transfer back modified parameter by server to client, so
>> I need to define a structure as
>> struct qb_context_new_ret {
>> int ret;
>> int opaque_len;
>> char *opaque_val;
>> }
>> and use that as rpc call's return structure. In this way each API
>> wrapped need a new defined internal structure make things complicate.
>> so I am wondering if there is a better way to do it.
>
> Surely not all of the APIs return structs this way, however...
>
> Paolo
>
--
Best Regards
Wenchao Xia
prev parent reply other threads:[~2012-11-14 10:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <50A313A5.8030500@linux.vnet.ibm.com>
2012-11-14 3:50 ` [Qemu-devel] [RFC] libqblock OOM issue Wenchao Xia
2012-11-14 8:45 ` Stefan Hajnoczi
2012-11-14 9:55 ` Wenchao Xia
2012-11-14 10:32 ` Paolo Bonzini
2012-11-15 4:18 ` Wenchao Xia
2012-11-15 10:31 ` Paolo Bonzini
2012-11-15 12:21 ` Wenchao Xia
2012-11-15 12:34 ` Paolo Bonzini
2012-11-14 8:55 ` Paolo Bonzini
2012-11-14 10:06 ` Wenchao Xia [this message]
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=50A36D3F.4080001@linux.vnet.ibm.com \
--to=xiawenc@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.com \
--cc=blauwirbel@gmail.com \
--cc=kwolf@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.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).