WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] tools: add missing libxl_uuid.c

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools: add missing libxl_uuid.c
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Fri, 25 Mar 2011 04:45:15 +0000
Delivery-date: Thu, 24 Mar 2011 21:47:18 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1300900031 0
# Node ID 49728fe8dd6a8fd0bece1b6b35b3579f38dcd2cf
# Parent  d9faf0aa975534e98cedfb16ea5756a1e8283a3e
tools: add missing libxl_uuid.c

This should have been added in 23087:d9faf0aa9755.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r d9faf0aa9755 -r 49728fe8dd6a tools/libxl/libxl_uuid.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxl/libxl_uuid.c  Wed Mar 23 17:07:11 2011 +0000
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2008,2010 Citrix Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include <libxl_uuid.h>
+
+#if defined(__linux__)
+
+int libxl_uuid_is_nil(libxl_uuid *uuid)
+{
+     return uuid_is_null(uuid->uuid);
+}
+
+void libxl_uuid_generate(libxl_uuid *uuid)
+{
+     uuid_generate(uuid->uuid);
+}
+
+int libxl_uuid_from_string(libxl_uuid *uuid, const char *in)
+{
+     return uuid_parse(in, uuid->uuid);
+}
+
+void libxl_uuid_copy(libxl_uuid *dst, libxl_uuid *src)
+{
+     uuid_copy(dst->uuid, src->uuid);
+}
+
+void libxl_uuid_clear(libxl_uuid *uuid)
+{
+     uuid_clear(uuid->uuid);
+}
+
+int libxl_uuid_compare(libxl_uuid *uuid1, libxl_uuid *uuid2)
+{
+     return uuid_compare(uuid1->uuid, uuid2->uuid);
+}
+
+uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid)
+{
+    return uuid->uuid;
+}
+
+#elif defined(__NetBSD__)
+
+int libxl_uuid_is_nil(libxl_uuid *uuid)
+{
+    uint32_t status;
+    return uuid_is_nil((uuid_t *)uuid->uuid, &status);
+}
+
+void libxl_uuid_generate(libxl_uuid *uuid)
+{
+    uint32_t status;
+    uuid_create((uuid_t *)uuid->uuid, &status);
+    assert(status == uuid_s_ok);
+}
+
+#define LIBXL__UUID_PTRS(uuid) &uuid[0], &uuid[1], &uuid[2], &uuid[3], \
+                               &uuid[4], &uuid[5], &uuid[6], &uuid[7], \
+                               &uuid[8], &uuid[9], &uuid[10],&uuid[11], \
+                               &uuid[12],&uuid[13],&uuid[14],&uuid[15]
+int libxl_uuid_from_string(libxl_uuid *uuid, const char *in)
+{
+    if ( sscanf(in, LIBXL_UUID_FMT, LIBXL__UUID_PTRS(uuid->uuid)) != 
sizeof(uuid->uuid) )
+        return -1;
+    return 0;
+}
+#undef LIBXL__UUID_PTRS
+
+void libxl_uuid_copy(libxl_uuid *dst, libxl_uuid *src)
+{
+     memcpy(dst->uuid, src->uuid, sizeof(dst->uuid));
+}
+
+void libxl_uuid_clear(libxl_uuid *uuid)
+{
+     memset(uuid->uuid, 0, sizeof(uuid->uuid));
+}
+
+int libxl_uuid_compare(libxl_uuid *uuid1, libxl_uuid *uuid2)
+{
+     return memcmp(uuid1->uuid, uuid2->uuid, sizeof(uuid1->uuid));
+}
+
+uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid)
+{
+    return uuid->uuid;
+}
+
+#else
+
+#error "Please update libxl_uuid.c for your OS"
+
+#endif

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools: add missing libxl_uuid.c, Xen patchbot-unstable <=