
This patch updates the server end to use XDR for processing requests from the QEMU client. The bulk of the patch is basically a simple string replacement to deal with slightly different struct/union nesting & names. The interesting bit of the code is the changes to the qemud/qemud.c file which is where the XDR encoding/ decoding takes places. As with the client equivalent, I feel this code has become much clearer to understand with the use of XDR. Particularly since it also gives us the endianness & alignment safety we never had before. I'd actually consider going one stage further in this refactoring. In the handcrafted protocol all the strings on the wire had a fixed size as we were basically throwing structs straight onto the wire. With XDR however, it is perfectly possible to have regular variable length strings (ie char*) in the structs and thus the payload on the wire is only as large as actually needed, and not artificially limited in size. $ diffstat libvirt-qemu-xdr-server.patch conf.c | 1 dispatch.c | 538 +++++++++++++++++++++---------------------------------------- dispatch.h | 2 internal.h | 21 +- qemud.c | 189 ++++++++++++++------- uuid.c | 1 6 files changed, 341 insertions(+), 411 deletions(-) Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|