X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=generator%2Fgenerator_xdr.ml;h=07f3ff977bd4f0895877a77788eca8516bf3fa9c;hb=ce5a8978b54f409de4347f16f7065b063cb47cf1;hp=ca114c5921ec2d430aede04cf78a97023a37408a;hpb=3aa8182c3cc478bf723205f1a4dd84e160768448;p=libguestfs.git diff --git a/generator/generator_xdr.ml b/generator/generator_xdr.ml index ca114c5..07f3ff9 100644 --- a/generator/generator_xdr.ml +++ b/generator/generator_xdr.ml @@ -1,5 +1,5 @@ (* libguestfs - * Copyright (C) 2009-2010 Red Hat Inc. + * Copyright (C) 2009-2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -65,12 +65,14 @@ let generate_xdr () = List.iter ( fun (shortname, (ret, args, optargs), _, _, _, _, _) -> - if optargs <> [] then - failwithf "optional arguments not supported in XDR yet"; - let name = "guestfs_" ^ shortname in - (match args with + (* Ordinary arguments and optional arguments are concatenated + * together in the XDR args struct. The optargs_bitmask field + * in the header controls which optional arguments are + * meaningful. + *) + (match args @ optargs with | [] -> () | args -> pr "struct %s_args {\n" name; @@ -212,8 +214,14 @@ struct guestfs_chunk { * 'position' and 'total' have undefined units; however they may * have meaning for some calls. * - * NB. guestfs___recv_from_daemon assumes the XDR-encoded + * Notes: + * + * (1) guestfs___recv_from_daemon assumes the XDR-encoded * structure is 24 bytes long. + * + * (2) daemon/proto.c:async_safe_send_pulse assumes the progress + * message is laid out precisely in this way. So if you change + * this then you'd better change that function as well. */ struct guestfs_progress { guestfs_procedure proc; /* @0: GUESTFS_PROC_x */