+Wed Jan 21 18:18:12 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
+
+ Missing test case fix up from Xen threadsafety changes
+ * tests/sexpr2xmltest.c, tests/Makefile.am: Pass a real
+ connection object into the xenDaemonParseSxprString()
+ method, since it needs to use the priv object.
+
Thu Jan 22 09:23:53 PST 2009 John Levon <john.levon@sun.com>
Least privilege support for Solaris
#include "internal.h"
#include "xml.h"
+#include "datatypes.h"
+#include "xen_unified.h"
#include "xend_internal.h"
#include "testutils.h"
+#include "testutilsxen.h"
static char *progname;
static char *abs_srcdir;
+static virCapsPtr caps;
#define MAX_FILE 4096
char *sexprPtr = &(sexprData[0]);
int ret = -1;
virDomainDefPtr def = NULL;
+ virConnectPtr conn;
+ struct _xenUnifiedPrivate priv;
+
+
+ conn = virGetConnect();
+ if (!conn) goto fail;
if (virtTestLoadFile(xml, &xmlPtr, MAX_FILE) < 0)
goto fail;
if (virtTestLoadFile(sexpr, &sexprPtr, MAX_FILE) < 0)
goto fail;
- if (!(def = xenDaemonParseSxprString(NULL, sexprData, xendConfigVersion)))
+ memset(&priv, 0, sizeof priv);
+ /* Many puppies died to bring you this code. */
+ priv.xendConfigVersion = xendConfigVersion;
+ priv.caps = caps;
+ conn->privateData = &priv;
+ if (virMutexInit(&priv.lock) < 0)
+ goto fail;
+
+ if (!(def = xenDaemonParseSxprString(conn, sexprData, xendConfigVersion)))
goto fail;
if (!(gotxml = virDomainDefFormat(NULL, def, 0)))
fail:
free(gotxml);
virDomainDefFree(def);
+ virUnrefConnect(conn);
return ret;
}
return(EXIT_FAILURE);
}
+ if (!(caps = testXenCapsInit()))
+ return(EXIT_FAILURE);
+
#define DO_TEST(in, out, version) \
do { \
struct testInfo info = { in, out, version }; \