On Tue, May 25, 2010 at 09:27:05AM +0200, Andrew Beekhof wrote:
> I was thinking of having some more fields: feature bits
negotiated
> between the host and guest libraries (header sizes may vary, for
> example), once all features are negotiated.
I think we need to include this in the header of every message sent between the guest and
host.
Did you mean to say "we don't need"?
I'd imagine that the capabilities would be part of the body of
messages exchanged during the negotiation stage.
After that they're not going to change, so why resend every time?
+1 Negotiate the features once. But how often would those features change?
Depending on how long the communications go on between the two sides, would
they at some point need to re-negotiate the feature set? Maybe the host
could include a hash id for the feature set and, if things change, they
would sync-up again. Thoughts?
> if (host_features < 0) {
> ...
> } else {
> features = guest_features & host_features;
> }
>
> if (features & F_CLIPBOARD2) {
> ...
> }
>
> something like that.
>
> Anyway, these are just some quick initial thoughts; let me know if
> there's any more discussion surrounding the use-cases and we can decide
> on the design.
>
> Also, Perry mentions an XML payload, but the payload could really be
> anything; example a clipboard copy-paste app will just have free-flowing
> data (unless a key-value protocol is being proposed as part of the
> libvirtioserial library).
Agreed, the type in the header should void* rather than char* and we should include a
"type" field in the header.
This sounds logical to me. And to ensure things are in sync on both
ends, we should have some kind of starter that indicates the beginning
of an envelope.
So the envelope could look like:
0x00 0x0d 0x01 0x14 0x01 0x01 ; start of envelope
0x00 0x00 ; payload type
0x00 0x00 0x00 0x00 ; payload size
0x00 0x00 0x00 0x00 ; payload checksum
... ; payload
0x01 0x01 0x14 0x01 0x0d 0x00 ; end of envelope
Thoughts?
--
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/