[Libvir] [Patch 3/4]: Xen inactive domains: stop xend/xs/xen using inactive domains
Daniel Veillard
veillard at redhat.com
Mon Sep 4 09:22:07 UTC 2006
On Mon, Sep 04, 2006 at 01:37:29AM +0100, Daniel P. Berrange wrote:
>
> The existing xend, xs, xen, proxy driver backends all assume that if they're
> given a virDomainPtr object, the handle member is non-zero (ie its a running
> domain). With the addition of inactive domain support this assumption is no
> longer value. Thus this patch modifies all these drivers, so that if the
> handle is -1, then they return without doing any work. This lets the operation
> be correctly delegated to the new driver for inactive domains.
>
> In addition, the XenD driver assumed that if XenD returns a 404 when looking
> up a domain based on its name, this was a fatal error condition. Since inative
> domains are not known to XenD, this assumption is also now false. The attached
> patch modifies xend_internal so that if a 404 is returned, the error is not
> propagated to the libvirt error handlers. Instead the methods in question
> simply return -1, and control continues to the new backend for managing
> inactive domains.
[...]
> */
> static int
> xend_get(virConnectPtr xend, const char *path,
> - char *content, size_t n_content)
> + char *content, size_t n_content, int quiet404s)
hum following comment missing from xend_get()
* @quiet404s: if set then do not error on 404 for non-exitent domains
> int ret;
> int s = do_connect(xend);
> @@ -444,7 +446,8 @@
> ret = xend_req(s, content, n_content);
> close(s);
>
> - if ((ret < 0) || (ret >= 300)) {
> + if (((ret < 0) || (ret >= 300)) &&
> + ((ret != 404) || !quiet404s)) {
> virXendError(NULL, VIR_ERR_GET_FAILED, content);
> }
>
> @@ -648,7 +651,7 @@
> * Returns a parsed S-Expression in case of success, NULL in case of failure
> */
> static struct sexpr *
> -sexpr_get(virConnectPtr xend, const char *fmt, ...)
> +sexpr_get(virConnectPtr xend, int quiet404s, const char *fmt, ...)
same missing comment.
Looks fine, go ahead!
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
More information about the libvir-list
mailing list