CHECK_INCLUDE_FILES("fcgi_stdio.h" HAVE_FASTCGI_STDIO_H)
CHECK_INCLUDE_FILES("openssl/ssl.h" HAVE_SSL_H)
CHECK_INCLUDE_FILES("snappy.h" HAVE_SNAPPY_H)
+CHECK_INCLUDE_FILES("uuid/uuid.h" HAVE_UUID_H)
CHECK_INCLUDE_FILES("atomic_ops.h" HAVE_ATOMIC_OPS)
CHECK_INCLUDE_FILES("keyutils.h" HAVE_KEYUTILS_H)
BuildRequires: libcurl-devel
BuildRequires: libedit-devel
BuildRequires: libxml2-devel
+BuildRequires: libuuid-devel
BuildRequires: libblkid-devel >= 2.17
BuildRequires: libudev-devel
BuildRequires: libtool
# Checks for libraries.
ACX_PTHREAD
+AC_CHECK_LIB([uuid], [uuid_parse], [true], AC_MSG_FAILURE([libuuid not found]))
# rbd {map,unmap,showmapped} dependencies, Linux only
if test x"$linux" = x"yes" -a x"$with_rbd" = x"yes"; then
python-virtualenv,
sdparm | hdparm,
sed,
+ uuid-dev,
+ uuid-runtime,
xfslibs-dev,
xfsprogs,
xmlstarlet,
python,
python-argparse,
sdparm | hdparm,
+ uuid-runtime,
xfsprogs,
python-flask,
${misc:Depends},
#####################
## library definitions and dependencies
-EXTRALIBS = -lm
+EXTRALIBS = -luuid -lm
if FREEBSD
EXTRALIBS += -lexecinfo
endif # FREEBSD
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <uuid/uuid.h>
#include <boost/scoped_ptr.hpp>
#include <iostream>
#include "encoding.h"
#include <ostream>
-#include <boost/uuid/uuid.hpp>
-#include <boost/uuid/uuid_generators.hpp>
-#include <boost/uuid/uuid_io.hpp>
+extern "C" {
+#include <uuid/uuid.h>
+#include <unistd.h>
+}
struct uuid_d {
- boost::uuids::uuid uuid;
+ uuid_t uuid;
uuid_d() {
- boost::uuids::nil_generator gen;
- uuid = gen();
+ memset(&uuid, 0, sizeof(uuid));
}
bool is_zero() const {
- return uuid.is_nil();
+ return uuid_is_null(uuid);
}
void generate_random() {
- boost::uuids::random_generator gen;
- uuid = gen();
+ uuid_generate(uuid);
}
bool parse(const char *s) {
- try {
- boost::uuids::string_generator gen;
- uuid = gen(s);
- return true;
- } catch (std::runtime_error& e) {
- return false;
- }
- }
- void print(char *s) const {
- memcpy(s, boost::uuids::to_string(uuid).c_str(), 37);
+ return uuid_parse(s, uuid) == 0;
}
-
- char *bytes() const {
- return (char*)uuid.data;
+ void print(char *s) {
+ return uuid_unparse(uuid, s);
}
void encode(bufferlist& bl) const {
::encode_raw(uuid, bl);
}
-
void decode(bufferlist::iterator& p) const {
::decode_raw(uuid, p);
}
inline std::ostream& operator<<(std::ostream& out, const uuid_d& u) {
char b[37];
- u.print(b);
+ uuid_unparse(u.uuid, b);
return out << b;
}
inline bool operator==(const uuid_d& l, const uuid_d& r) {
- return l.uuid == r.uuid;
+ return uuid_compare(l.uuid, r.uuid) == 0;
}
inline bool operator!=(const uuid_d& l, const uuid_d& r) {
- return l.uuid != r.uuid;
+ return uuid_compare(l.uuid, r.uuid) != 0;
}
#define CEPH_MCOMMAND_H
#include <vector>
+#include <uuid/uuid.h>
#include "msg/Message.h"
#ifndef CEPH_MGETPOOLSTATS_H
#define CEPH_MGETPOOLSTATS_H
+#include <uuid/uuid.h>
+
#include "messages/PaxosServiceMessage.h"
class MGetPoolStats : public PaxosServiceMessage {
#ifndef CEPH_MGETPOOLSTATSREPLY_H
#define CEPH_MGETPOOLSTATSREPLY_H
+#include <uuid/uuid.h>
+
class MGetPoolStatsReply : public PaxosServiceMessage {
public:
uuid_d fsid;
#include "messages/PaxosServiceMessage.h"
#include <deque>
+#include <uuid/uuid.h>
class MLog : public PaxosServiceMessage {
public:
#ifndef CEPH_MLOGACK_H
#define CEPH_MLOGACK_H
+#include <uuid/uuid.h>
+
class MLogAck : public Message {
public:
uuid_d fsid;
#include "mds/MDSMap.h"
+#include <uuid/uuid.h>
+
/**
#include "mds/MDSMap.h"
#include "include/ceph_features.h"
+#include <uuid/uuid.h>
+
class MMDSMap : public Message {
public:
/*
MStatfsReply() : Message(CEPH_MSG_STATFS_REPLY) {}
MStatfsReply(uuid_d &f, ceph_tid_t t, epoch_t epoch) : Message(CEPH_MSG_STATFS_REPLY) {
- memcpy(&h.fsid, f.bytes(), sizeof(h.fsid));
+ memcpy(&h.fsid, f.uuid, sizeof(h.fsid));
header.tid = t;
h.version = epoch;
}
}
uint64_t get_fsid64() const {
- return *(uint64_t*)fsid.bytes();
+ return *(uint64_t*)&fsid.uuid[0];
}
void encode(bufferlist& bl) const {
flags = 0;
uint64_t tfsid;
::decode(tfsid, bl);
- *(uint64_t*)&fsid.bytes()[0] = tfsid;
- *(uint64_t*)&fsid.bytes()[8] = tfsid;
+ *(uint64_t*)&fsid.uuid[0] = tfsid;
+ *(uint64_t*)&fsid.uuid[8] = tfsid;
::decode(block_size, bl);
::decode(alignment, bl);
::decode(max_size, bl);
return ret;
if (ret == 8) {
// old 64-bit fsid... mirror it.
- *(uint64_t*)&uuid->bytes()[0] = *(uint64_t*)fsid_str;
- *(uint64_t*)&uuid->bytes()[8] = *(uint64_t*)fsid_str;
+ *(uint64_t*)&uuid->uuid[0] = *(uint64_t*)fsid_str;
+ *(uint64_t*)&uuid->uuid[8] = *(uint64_t*)fsid_str;
return 0;
}
return ret;
if (ret == 8) {
// old 64-bit fsid... mirror it.
- *(uint64_t*)&uuid->bytes()[0] = *(uint64_t*)fsid_str;
- *(uint64_t*)&uuid->bytes()[8] = *(uint64_t*)fsid_str;
+ *(uint64_t*)&uuid->uuid[0] = *(uint64_t*)fsid_str;
+ *(uint64_t*)&uuid->uuid[8] = *(uint64_t*)fsid_str;
return 0;
}
rgw_a
global
curl
+ uuid
expat
${CMAKE_DL_LIBS} ${TCMALLOC_LIBS} ${UNITTEST_LIBS})
set_target_properties(test_cors PROPERTIES COMPILE_FLAGS
librados
global
curl
+ uuid
expat
${CMAKE_DL_LIBS}
${TCMALLOC_LIBS}
rgw_a
global
curl
+ uuid
expat
cls_version_client
cls_log_client
rgw_a
global
curl
+ uuid
expat
cls_version_client
cls_log_client
cls_lock_client
global
curl
+ uuid
expat
${CMAKE_DL_LIBS}
${TCMALLOC_LIBS}
ceph_test_rados_api_cmd_SOURCES = test/librados/cmd.cc
ceph_test_rados_api_cmd_LDADD = \
$(LIBCOMMON) $(LIBRADOS) $(CRYPTO_LIBS) \
- $(UNITTEST_LDADD) $(RADOS_TEST_LDADD)
+ $(UNITTEST_LDADD) $(RADOS_TEST_LDADD) -luuid
ceph_test_rados_api_cmd_CXXFLAGS = $(UNITTEST_CXXFLAGS)
bin_DEBUGPROGRAMS += ceph_test_rados_api_cmd
ceph_test_librbd_fsx_SOURCES = test/librbd/fsx.cc
ceph_test_librbd_fsx_LDADD = \
$(LIBKRBD) $(LIBRBD) $(LIBRADOS) \
- $(CRYPTO_LIBS) $(PTHREAD_LIBS)
+ $(CRYPTO_LIBS) $(PTHREAD_LIBS) -luuid
ceph_test_librbd_fsx_CXXFLAGS = $(UNITTEST_CXXFLAGS)
bin_DEBUGPROGRAMS += ceph_test_librbd_fsx
endif
ceph_test_cors_LDADD = \
$(LIBRADOS) $(LIBRGW) $(CEPH_GLOBAL) \
$(UNITTEST_LDADD) \
- -lcurl -lexpat
+ -lcurl -luuid -lexpat
ceph_test_cors_CXXFLAGS = $(UNITTEST_CXXFLAGS)
bin_DEBUGPROGRAMS += ceph_test_cors
ceph_test_rgw_manifest_LDADD = \
$(LIBRADOS) $(LIBRGW) $(LIBRGW_DEPS) $(CEPH_GLOBAL) \
$(UNITTEST_LDADD) $(CRYPTO_LIBS) \
- -lcurl -lexpat
+ -lcurl -luuid -lexpat
ceph_test_rgw_manifest_CXXFLAGS = $(UNITTEST_CXXFLAGS)
bin_DEBUGPROGRAMS += ceph_test_rgw_manifest
ceph_test_cls_rgw_meta_LDADD = \
$(LIBRADOS) $(LIBRGW) $(CEPH_GLOBAL) \
$(UNITTEST_LDADD) $(CRYPTO_LIBS) \
- -lcurl -lexpat \
+ -lcurl -luuid -lexpat \
libcls_version_client.a libcls_log_client.a \
libcls_statelog_client.a libcls_refcount_client.la \
libcls_rgw_client.la libcls_user_client.a libcls_lock_client.la
ceph_test_cls_rgw_log_LDADD = \
$(LIBRADOS) $(LIBRGW) $(CEPH_GLOBAL) \
$(UNITTEST_LDADD) $(CRYPTO_LIBS) \
- -lcurl -lexpat \
+ -lcurl -luuid -lexpat \
libcls_version_client.a libcls_log_client.a \
libcls_statelog_client.a libcls_refcount_client.la \
libcls_rgw_client.la libcls_user_client.a libcls_lock_client.la
ceph_test_cls_rgw_opstate_LDADD = \
$(LIBRADOS) $(LIBRGW) $(CEPH_GLOBAL) \
$(UNITTEST_LDADD) $(CRYPTO_LIBS) \
- -lcurl -lexpat \
+ -lcurl -luuid -lexpat \
libcls_version_client.a libcls_log_client.a \
libcls_statelog_client.a libcls_refcount_client.la \
libcls_rgw_client.la libcls_user_client.a libcls_lock_client.la
entity_addr_t sample_addr;
uuid_d sample_uuid;
for (int i = 0; i < num_osds; ++i) {
- sample_uuid.generate_random();
+ sample_uuid.uuid[i] = i;
sample_addr.nonce = i;
pending_inc.new_state[i] = CEPH_OSD_EXISTS | CEPH_OSD_NEW;
pending_inc.new_up_client[i] = sample_addr;