All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Goirand <thomas@goirand.fr>
Cc: xen-devel@lists.xensource.com
Subject: Re: Getting domain information in xen 3.0.4-1
Date: Mon, 02 Apr 2007 21:37:51 +0800	[thread overview]
Message-ID: <4611072F.6000906@goirand.fr> (raw)
In-Reply-To: <20070402124217.GC28728@leeni.uk.xensource.com>

Ewan Mellor wrote:
> On Sat, Mar 31, 2007 at 03:29:04AM +0800, Thomas Goirand wrote:
> 
>> import xen.xm.main as xenxm
>> try:
>> 	if xen_version == 3:
>> 		info = xenxm.server.xend.domain(vpsname)
>> 		return info
>> 	else:
>> 		info = xenxm.server.xend_domain(vpsname)
>> 		return info
>>
>> The problem is that if I try this:
>> print xenxm.server.xend.domain( 'xen01' )
>>
>> python returns: object has no attribute 'xend'
>>
>> and if I try this:
>> print xenxm.server.xend_domain( 'xen01' )
>>
>> python returns: object has no attribute 'xend_domain'
>
> Firstly, no, that's not meant to be your programming interface!  You are
> delving into the internals of xm, the command line interface, and pulling an
> internal variable (server) and expecting that to be the thing that you want.
> This certainly isn't supported, and it wouldn't be surprising if it broke at
> any time.

Yes, but as the XenAPI is not released yet... no choice! And spawning a
new process for every command is quite a bad idea. So even if it breaks,
SOMETIMES, then it's still better.

> That said, I don't think that it's the cause of your problem.  It sounds to me
> like something more fundamental is at fault -- that xenxm.server object that
> you are dereferencing is a "magic" object, and so the xend.domain() call is
> actually being proxied through as a call to Xend.  It's possible that your
> server is at fault, rather than your client.

I have found the solution in fact! :)
It took me quite a long time to do it, but now I have found it. The
following code DO work:

#!/usr/bin/env python

import sys
sys.path.append( '/usr/lib/python' )
from xen.xend.XendClient import server
print server.xend.domain('xen01')

>> Last: as far as I could see, the Xen API is still not ready, right?
> 
> It will be released as Xen-API 1.0 in Xen 3.0.5, which will happen in the next
> couple of weeks.

Great. I'd love to have something for the long therms using this API.
Where can I found the feature list? GPLHost would be one of the big
users of this API if it has the things we need!

Thomas Goirand

P.S: For those that are interested in it, I'll try to send the patched
version of dtc-xen to Debian SID asap.

  reply	other threads:[~2007-04-02 13:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-30 19:29 Getting domain information in xen 3.0.4-1 Thomas Goirand
2007-04-02 12:42 ` Ewan Mellor
2007-04-02 13:37   ` Thomas Goirand [this message]
2007-04-03  8:10   ` Wensheng Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4611072F.6000906@goirand.fr \
    --to=thomas@goirand.fr \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.