This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-API] C bindings : xen_session_login_with_password

To: Harsh Modawel <harsh.modawel@xxxxxxxxxx>
Subject: Re: [Xen-API] C bindings : xen_session_login_with_password
From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: Fri, 01 Jun 2007 11:44:07 -0600
Cc: xen-api@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 01 Jun 2007 10:42:20 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: 465D91F5.90608@xxxxxxxxxx
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird (X11/20060911)
Harsh Modawel wrote:
> Hi,
>    I had few questions regarding the function the client should
> provide to "Query the server and return the response" i.e. The client
> function passed in call to xen_session_login_with_password()
> session->call_func = call_func;
> I see that the xen calls do pass data(input) in the XML-format while
> calling this client function.
> My questions are -
> 1) How should I use that data ? (as its already in XML format).
> I can't pass it as it is to server, nor I can use xmlrpc_client_call
> on it, hence was wondering, the intention ?

That data is ready to be passed to the server.  Just put it as payload
in some transport and send it along.  See
tools/libxen/test/test_bindings.c.  Also FYI, here is example
(simplified) from xen cim providers

static int call_func(const void *data, size_t len, void *user_handle,
                     void *result_handle, xen_result_func result_func)
   xen_utils_session *s = (xen_utils_session *)user_handle;
   char *read_buf = NULL;
   int ccode = 0;
   /* Send data to xend xmlrpc server. */
   if (!xen_utils_xend_post(s->socket, (char *)data, len))
      return -1;

   /* Read response from xend. */
   ccode = xen_utils_xend_read(s->socket, &read_buf);

   /* Check for errors and handle appropriately */
    /* Call result_func to process response */
      result_func(read_buf, strlen(read_buf), result_handle);
   /* Free buffer containing result */
   if (read_buf)
   return ccode;


> 2) Where should I store the result (so that XenCaller can read it). I
> guess, on success I should be returning a NULL value, as the return is
> stored in "error", followed by calls "if (error)".
> 3) In which format does that api expect the result data ? (same XML
> format or should I make use of xmlrpc calls to take out the value from
> the response).
> 4) If one knows the link/doc I should have read, then please let me know.
> Regards,
> -harsh
> _______________________________________________
> xen-api mailing list
> xen-api@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api

xen-api mailing list

<Prev in Thread] Current Thread [Next in Thread>