From: Anthony Liguori <aliguori@us.ibm.com>
To: Ewan Mellor <ewan@xensource.com>
Cc: Ian Pratt <m+Ian.Pratt@cl.cam.ac.uk>, xen-devel@lists.xensource.com
Subject: Re: [RFC] Xend XML-RPC Refactoring
Date: Tue, 14 Mar 2006 00:58:48 -0600 [thread overview]
Message-ID: <441669A8.2030409@us.ibm.com> (raw)
In-Reply-To: <20060311205510.GH13877@leeni.uk.xensource.com>
Hi Ewan,
I've made the changes you've requested except where I've described
below. After all the regressions complete, I'll push it out to the list
(sometime tomorrow as long as nothing fails miserably).
Ewan Mellor wrote:
> This is all a bit skanky, and could be easily cleaned up by introducing a
> naming convention for XendDomain, XendNode, etc. How about if we prefixed
> every function that we wish to expose to the messaging layer with
> "public_"? So for example XendDomainInfo.send_sysrq would be named
> public_send_sysrq instead. Then, we could use that to guide the
> function registration, rather than having exclude lists and inline lists
> of callable methods.
>
I went ahead and started using the public_ naming convention for
XendDomainInfo. It was fine for a couple of the methods but it got ugly
real quick for things like deviceDestroy as it's called in a bunch of
other places within Xend.
So, I've got two possible solutions for this. We could just keep the
white list or we could introduce new public_ methods within
XendDomainInfo that were just simple wrappers for the underlying
methods. It's seems a bit unnatural but less unnatural than peppering
calls to public_ functions through Xend. Thoughts?
> I can see why you've done this, but it just led me to wonder why
> XendDomain.domain_destroy exists at all. All it's doing is looking up a
> domain ID, checking that it's not the privileged domain (in the wrong
> order!) calling XendDomainInfo.destroy, and calling xc.domain_destroy in
> the case of an exception. We should move the check and the exception
> handling into XendDomainInfo.destroy, and then we can dispatch to that
> method straight away, without needing XendDomain.domain_destroy at all.
> The messaging layer already has the capability to lookup domain IDs --
> we should use it.
>
I've gone through and made sure that all XendDomain functions can accept
either domids or names so that effectively takes care of this hack. I
didn't refactor away the domain_destroy function though as it seems
independent of the XML-RPC stuff.
> I expect we can do better than just printing "Internal Xend Error". How
> much structure and useful information is there in an xmlrpclib.Fault at
> the moment?
>
This one is a bit tricky. We use faultCode to encode particular
exception types but I'm not sure what that buys us. I don't think
encoding OSError as a faultCode (which is what I think the most common
exception we toss other than XendError) really buys us much right now.
I think what we need to do is audit the methods in Xend, figure out what
the common errors are, *catch them within Xend*, and then rethrow them
as standardized Faults. Thoughts?
Regards,
Anthony Liguori
>> sys.exit(1)
>> except:
>> print "Unexpected error:", sys.exc_info()[0]
>>
>
> Looks like that's it! Thanks for all your hard work, Anthony, this is
> going to make a big difference to Xend's usefulness and maintainability,
> and you've done a good job of it. Let's get it into 3.0.2.
>
> Cheers,
>
> Ewan.
>
next prev parent reply other threads:[~2006-03-14 6:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-07 23:37 [RFC] Xend XML-RPC Refactoring Ian Pratt
2006-03-08 0:07 ` Anthony Liguori
2006-03-11 20:55 ` Ewan Mellor
2006-03-11 21:36 ` Daniel Veillard
2006-03-11 22:20 ` Ewan Mellor
2006-03-12 1:46 ` Anthony Liguori
2006-03-12 9:27 ` Daniel Veillard
2006-03-12 9:57 ` Daniel Veillard
2006-03-12 17:41 ` Anthony Liguori
2006-03-12 18:29 ` Daniel Veillard
2006-03-12 20:28 ` Anthony Liguori
2006-03-12 21:49 ` Daniel Veillard
2006-03-12 1:44 ` Anthony Liguori
2006-03-13 10:30 ` Ewan Mellor
2006-03-14 6:58 ` Anthony Liguori [this message]
2006-03-14 8:35 ` Ewan Mellor
-- strict thread matches above, loose matches on Subject: below --
2006-01-31 21:25 Anthony Liguori
2006-01-31 21:36 ` Ronald G Minnich
2006-01-31 21:47 ` Matt Sottile
2006-01-31 21:58 ` Anthony Liguori
2006-02-01 9:53 ` Ewan Mellor
2006-02-01 9:37 ` Daniel Veillard
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=441669A8.2030409@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=ewan@xensource.com \
--cc=m+Ian.Pratt@cl.cam.ac.uk \
--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.