RFC: vmware registration
Pete Zaitcev
zaitcev at redhat.com
Thu May 26 19:22:58 UTC 2011
On Thu, 26 May 2011 11:53:23 +0200
Jim Meyering <jim at meyering.net> wrote:
> With this patch, everything compiles warning-free:
Yeah, but that's not the objective here... This is a problem:
> @@ -651,14 +651,6 @@ static void poke_Login(struct config *cfg, struct session *ses,
> ns_env = xmlNewNs(etroot,
> BAD_CAST "http://schemas.xmlsoap.org/soap/envelope/",
> BAD_CAST "SOAP-ENV");
> - ns_enc = xmlNewNs(etroot,
> - BAD_CAST "http://schemas.xmlsoap.org/soap/encoding/",
> - BAD_CAST "SOAP-ENC");
> - ns_xsi = xmlNewNs(etroot,
> - BAD_CAST "http://www.w3.org/2001/XMLSchema-instance",
> - BAD_CAST "xsi");
> - ns_xsd = xmlNewNs(etroot,
> - BAD_CAST "http://www.w3.org/2001/XMLSchema", BAD_CAST "xsd");
> ns_v = xmlNewNs(etroot, BAD_CAST "urn:vim25", BAD_CAST "v");
> xmlSetNs(etroot, ns_env);
I found that VMware for some reason is picky about namespaces, even
unused ones. It would definitely reject an XML that does not have them.
Why, I have no idea.
The right approach is probably xmlNewNs to (void).
> @@ -2400,8 +2336,9 @@ static void run_upload(struct config *cfg, struct session *ses,
> if (uploader == 0) {
> v_upload(cfg, ses, 0, url, tfd);
> status = 3;
> - write(pipe_up_report[1], &status, 1);
> - exit(0);
> + int err = (write(pipe_up_report[1], &status, 1) == 1
> + ? EXIT_SUCCESS : EXIT_FAILURE);
> + exit(err);
> }
Heh. I think EPIPE here is going to mean that nobody is there
to fetch the exit status.
> @@ -2503,13 +2440,13 @@ static void convert(const char *fname, off_t vol_size, int vfd)
> struct GrainMarker *gm;
> struct MetaDataMarker gtmarker, gdmarker, eosmarker, footmarker;
> unsigned int *currentGrainTable, *grainDirectory;
> - int cgx, gdx;
> + unsigned long cgx, gdx;
What, seriously? Wow.
> - int i;
> + unsigned int i;
LOL at least they didn't make you make it long this time.
I'll take the const stuff, that one is good.
-- Pete
More information about the iwhd-devel
mailing list