WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

Re: [Xen-API] C bindings : xen_session_login_with_password

To: Jim Fehlig <jfehlig@xxxxxxxxxx>
Subject: Re: [Xen-API] C bindings : xen_session_login_with_password
From: Harsh Modawel <harsh.modawel@xxxxxxxxxx>
Date: Mon, 04 Jun 2007 11:05:10 +0530
Cc: xen-api@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 03 Jun 2007 22:34:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <46605AE7.6040005@xxxxxxxxxx>
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>
Organization: Oracle Corporation
References: 465D91F5.90608@xxxxxxxxxx <46605AE7.6040005@xxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
Thanks Jim,
I had a look at test_bindings code and that answered the doubts.

Regards,
-harsh

Jim Fehlig wrote:
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)
      free(read_buf);
   return ccode;
}

Regards,
Jim

  
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
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>