From: Daniel Veillard Date: Fri, 16 Mar 2007 14:55:51 +0000 (+0000) Subject: * src/xml.c tests/sexpr2xmltest.c tests/xmconfigtest.c: avoid X-Git-Tag: LIBVIRT_0_2_1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7e1c4fc51c471a3431bf9f9737962c8b0ec9d08;p=thirdparty%2Flibvirt.git * src/xml.c tests/sexpr2xmltest.c tests/xmconfigtest.c: avoid warnings when compiling without Xen Daniel --- diff --git a/ChangeLog b/ChangeLog index 7d3eb7500c..a137bad26f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Mar 16 15:55:01 CET 2007 Daniel Veillard + + * src/xml.c tests/sexpr2xmltest.c tests/xmconfigtest.c: avoid + warnings when compiling without Xen + Fri Mar 16 11:43:08 CET 2007 Daniel Veillard * python/generator.py: patch from Tatsuro Enokura to fix diff --git a/src/xml.c b/src/xml.c index 09034d418a..e3c4f165d4 100644 --- a/src/xml.c +++ b/src/xml.c @@ -1384,6 +1384,10 @@ virDomainXMLDevID(virDomainPtr domain, char *xmldesc, char *class, char *ref) free(xref); goto cleanup; } +#else /* without xen */ + /* hack to avoid the warning that domain is unused */ + if (domain->id < 0) + ret = -1; #endif /* WITH_XEN */ goto error; diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index 236ebd13a8..80403bddf5 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -196,7 +196,7 @@ int main(void) { fprintf(stderr, "libvirt compiled without Xen support\n"); - exit(0); + return(0); } #endif /* WITH_XEN */ /* diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index e5ef2b3cc1..90b432d960 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -220,7 +220,7 @@ int main(void) { fprintf(stderr, "libvirt compiled without Xen support\n"); - exit(0); + return(0); } #endif /* WITH_XEN */