mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 11:10:40 +00:00
xen: wrap in "xen" namespace
Names like "port" are too generic for the global namespace.
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include "evtchn.hh"
|
||||
#include "osv_xen.hh"
|
||||
|
||||
namespace xen {
|
||||
|
||||
void evtchn::make_ready_port(int port) {
|
||||
auto ports = _ports.equal_range(port);
|
||||
for (auto i = ports.first; i != ports.second; ++i) {
|
||||
@@ -176,3 +178,5 @@ evtchn *evtchn::instance(bool userspace, unsigned otherend)
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "core/posix.hh"
|
||||
#include "core/future.hh"
|
||||
|
||||
namespace xen {
|
||||
|
||||
class evtchn;
|
||||
|
||||
class port {
|
||||
@@ -38,4 +40,7 @@ public:
|
||||
virtual port bind() = 0;
|
||||
port bind(int p) { return port(p); };
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include "osv_xen.hh"
|
||||
#include "gntalloc.hh"
|
||||
|
||||
namespace xen {
|
||||
|
||||
gntref invalid_ref;
|
||||
|
||||
// FIXME: Most of the destructors are yet to be coded
|
||||
@@ -210,3 +212,5 @@ gntalloc *gntalloc::instance() {
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "core/posix.hh"
|
||||
|
||||
namespace xen {
|
||||
|
||||
class gntref {
|
||||
public:
|
||||
int xen_id;
|
||||
@@ -42,4 +44,7 @@ public:
|
||||
};
|
||||
|
||||
extern gntref invalid_ref;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -91,7 +91,7 @@ std::unique_ptr<net::device> create_native_net_device(boost::program_options::va
|
||||
#ifdef HAVE_XEN
|
||||
auto xen = is_xen();
|
||||
if (xen != xen_info::nonxen) {
|
||||
return create_xenfront_net_device(opts, xen == xen_info::userspace);
|
||||
return xen::create_xenfront_net_device(opts, xen == xen_info::userspace);
|
||||
}
|
||||
#endif
|
||||
return create_virtio_net_device(opts["tap-device"].as<std::string>(), opts);
|
||||
@@ -103,7 +103,7 @@ add_native_net_options_description(boost::program_options::options_description &
|
||||
#ifdef HAVE_XEN
|
||||
auto xen = is_xen();
|
||||
if (xen != xen_info::nonxen) {
|
||||
opts.add(get_xenfront_net_options_description());
|
||||
opts.add(xen::get_xenfront_net_options_description());
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
|
||||
using namespace net;
|
||||
|
||||
namespace xen {
|
||||
|
||||
using phys = uint64_t;
|
||||
|
||||
class xenfront_net_device : public net::device {
|
||||
@@ -372,3 +374,5 @@ std::unique_ptr<net::device> create_xenfront_net_device(boost::program_options::
|
||||
dev = ptr.get();
|
||||
return std::move(ptr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "core/xen/gntalloc.hh"
|
||||
#include "core/queue.hh"
|
||||
|
||||
namespace xen {
|
||||
|
||||
std::unique_ptr<net::device> create_xenfront_net_device(boost::program_options::variables_map opts, bool userspace);
|
||||
boost::program_options::options_description get_xenfront_net_options_description();
|
||||
|
||||
@@ -108,4 +110,6 @@ public:
|
||||
T& operator[](std::size_t i) { return _sring->_ring[idx(i)]; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* XENFRONT_HH_ */
|
||||
|
||||
Reference in New Issue
Block a user