libIpc separated from vasum #2/2 13/39413/6
authorMateusz Malicki <m.malicki2@samsung.com>
Thu, 14 May 2015 12:32:52 +0000 (14:32 +0200)
committerDariusz Michaluk <d.michaluk@samsung.com>
Tue, 19 May 2015 08:19:59 +0000 (01:19 -0700)
[Feature]      libIpc separated from vasum;
[Cause]        N/A
[Solution]     Some header files from utils are copied to libIpc-devel rpm package
               (they can conflict with libSimpleDbus-devel header files)
[Verification] Build, install, run tests

Change-Id: Ic89a6e1d2a7a4cbb48112eef226b11cd10eb7987

52 files changed:
CMakeLists.txt
cli/CMakeLists.txt
client/CMakeLists.txt
common/netlink/netlink.cpp
common/utils/eventfd.cpp
common/utils/exception.hpp
common/utils/fd-utils.cpp
common/utils/file-wait.cpp
common/utils/fs.cpp
libs/ipc/CMakeLists.txt [new file with mode: 0644]
libs/ipc/client.cpp [moved from common/ipc/client.cpp with 100% similarity]
libs/ipc/client.hpp [moved from common/ipc/client.hpp with 100% similarity]
libs/ipc/epoll/event-poll.cpp [moved from common/ipc/epoll/event-poll.cpp with 99% similarity]
libs/ipc/epoll/event-poll.hpp [moved from common/ipc/epoll/event-poll.hpp with 100% similarity]
libs/ipc/epoll/events.cpp [moved from common/ipc/epoll/events.cpp with 100% similarity]
libs/ipc/epoll/events.hpp [moved from common/ipc/epoll/events.hpp with 100% similarity]
libs/ipc/epoll/glib-dispatcher.cpp [moved from common/ipc/epoll/glib-dispatcher.cpp with 100% similarity]
libs/ipc/epoll/glib-dispatcher.hpp [moved from common/ipc/epoll/glib-dispatcher.hpp with 100% similarity]
libs/ipc/epoll/thread-dispatcher.cpp [moved from common/ipc/epoll/thread-dispatcher.cpp with 100% similarity]
libs/ipc/epoll/thread-dispatcher.hpp [moved from common/ipc/epoll/thread-dispatcher.hpp with 100% similarity]
libs/ipc/exception.hpp [moved from common/ipc/exception.hpp with 95% similarity]
libs/ipc/internals/acceptor.cpp [moved from common/ipc/internals/acceptor.cpp with 100% similarity]
libs/ipc/internals/acceptor.hpp [moved from common/ipc/internals/acceptor.hpp with 100% similarity]
libs/ipc/internals/add-peer-request.hpp [moved from common/ipc/internals/add-peer-request.hpp with 100% similarity]
libs/ipc/internals/event-queue.hpp [moved from common/ipc/internals/event-queue.hpp with 100% similarity]
libs/ipc/internals/finish-request.hpp [moved from common/ipc/internals/finish-request.hpp with 100% similarity]
libs/ipc/internals/method-request.hpp [moved from common/ipc/internals/method-request.hpp with 100% similarity]
libs/ipc/internals/processor.cpp [moved from common/ipc/internals/processor.cpp with 100% similarity]
libs/ipc/internals/processor.hpp [moved from common/ipc/internals/processor.hpp with 100% similarity]
libs/ipc/internals/remove-peer-request.hpp [moved from common/ipc/internals/remove-peer-request.hpp with 100% similarity]
libs/ipc/internals/request-queue.hpp [moved from common/ipc/internals/request-queue.hpp with 100% similarity]
libs/ipc/internals/result-builder.hpp [moved from common/ipc/internals/result-builder.hpp with 100% similarity]
libs/ipc/internals/send-result-request.hpp [moved from common/ipc/internals/send-result-request.hpp with 100% similarity]
libs/ipc/internals/signal-request.hpp [moved from common/ipc/internals/signal-request.hpp with 100% similarity]
libs/ipc/internals/socket.cpp [moved from common/ipc/internals/socket.cpp with 100% similarity]
libs/ipc/internals/socket.hpp [moved from common/ipc/internals/socket.hpp with 100% similarity]
libs/ipc/ipc-gsource.cpp [moved from common/ipc/ipc-gsource.cpp with 100% similarity]
libs/ipc/ipc-gsource.hpp [moved from common/ipc/ipc-gsource.hpp with 100% similarity]
libs/ipc/libIpc.pc.in [new file with mode: 0644]
libs/ipc/method-result.cpp [moved from common/ipc/method-result.cpp with 100% similarity]
libs/ipc/method-result.hpp [moved from common/ipc/method-result.hpp with 100% similarity]
libs/ipc/result.hpp [moved from common/ipc/result.hpp with 100% similarity]
libs/ipc/service.cpp [moved from common/ipc/service.cpp with 100% similarity]
libs/ipc/service.hpp [moved from common/ipc/service.hpp with 100% similarity]
libs/ipc/types.cpp [moved from common/ipc/types.cpp with 100% similarity]
libs/ipc/types.hpp [moved from common/ipc/types.hpp with 100% similarity]
packaging/vasum.spec
server/CMakeLists.txt
server/zones-manager.cpp
tests/unit_tests/CMakeLists.txt
tests/unit_tests/epoll/ut-event-poll.cpp
tests/unit_tests/ipc/ut-ipc.cpp

index a0b6b1b..d42f496 100644 (file)
@@ -142,6 +142,7 @@ SET(LIBS_FOLDER ${PROJECT_SOURCE_DIR}/libs)
 SET(LOGGER_FOLDER ${PROJECT_SOURCE_DIR}/libs/logger)
 SET(DBUS_FOLDER ${PROJECT_SOURCE_DIR}/libs/dbus)
 SET(CONFIG_FOLDER ${PROJECT_SOURCE_DIR}/libs/config)
+SET(IPC_FOLDER ${PROJECT_SOURCE_DIR}/libs/ipc)
 SET(CLIENT_FOLDER ${PROJECT_SOURCE_DIR}/client)
 SET(SERVER_FOLDER ${PROJECT_SOURCE_DIR}/server)
 SET(ZONE_SUPPORT_FOLDER ${PROJECT_SOURCE_DIR}/zone-support)
@@ -185,6 +186,7 @@ SET(VSM_UNIT_TESTS_IPC_SOCKET_PATH /var/run/vasum-ipc-unit-tests.socket)
 ADD_SUBDIRECTORY(${LOGGER_FOLDER})
 ADD_SUBDIRECTORY(${DBUS_FOLDER})
 ADD_SUBDIRECTORY(${CONFIG_FOLDER})
+ADD_SUBDIRECTORY(${IPC_FOLDER})
 ADD_SUBDIRECTORY(${CLIENT_FOLDER})
 ADD_SUBDIRECTORY(${SERVER_FOLDER})
 ADD_SUBDIRECTORY(${ZONE_SUPPORT_FOLDER})
index 957faff..f8ad183 100644 (file)
@@ -31,7 +31,7 @@ PKG_CHECK_MODULES(LIB_DEPS REQUIRED vasum)
 
 INCLUDE_DIRECTORIES(${CLIENT_FOLDER})
 INCLUDE_DIRECTORIES(${COMMON_FOLDER})
-TARGET_LINK_LIBRARIES(${CLI_CODENAME} ${PROJECT_NAME}-client ${LIB_DEPS_LIBRARIES})
+TARGET_LINK_LIBRARIES(${CLI_CODENAME} ${PROJECT_NAME}-client ${LIB_DEPS_LIBRARIES} Ipc)
 
 CONFIGURE_FILE(support/vasum-cli-completion.sh.in
                ${CMAKE_BINARY_DIR}/vasum-cli-completion.sh
index e08c79b..56ed2e7 100644 (file)
@@ -22,10 +22,7 @@ MESSAGE(STATUS "")
 MESSAGE(STATUS "Generating makefile for the Client...")
 FILE(GLOB project_SRCS *.cpp *.hpp *.h)
 
-FILE(GLOB common_SRCS ${COMMON_FOLDER}/ipc/epoll/*.hpp          ${COMMON_FOLDER}/ipc/epoll/*.cpp
-                      ${COMMON_FOLDER}/ipc/*.hpp                ${COMMON_FOLDER}/ipc/*.cpp
-                      ${COMMON_FOLDER}/ipc/internals/*.hpp      ${COMMON_FOLDER}/ipc/internals/*.cpp
-                      ${COMMON_FOLDER}/utils/*.hpp              ${COMMON_FOLDER}/utils/*.cpp
+FILE(GLOB common_SRCS ${COMMON_FOLDER}/utils/*.hpp              ${COMMON_FOLDER}/utils/*.cpp
                       ${COMMON_FOLDER}/*.hpp                    ${COMMON_FOLDER}/*.cpp)
 
 SET(_LIB_VERSION_ "${VERSION}")
@@ -51,9 +48,10 @@ PKG_CHECK_MODULES(LIB_DEPS REQUIRED gio-2.0 libsystemd-daemon libcap-ng)
 INCLUDE_DIRECTORIES(SYSTEM ${LIB_DEPS_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
 INCLUDE_DIRECTORIES(${COMMON_FOLDER})
 INCLUDE_DIRECTORIES(${LIBS_FOLDER})
+INCLUDE_DIRECTORIES(${IPC_FOLDER})
 INCLUDE_DIRECTORIES(${SERVER_FOLDER})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${LIB_DEPS_LIBRARIES} ${Boost_LIBRARIES}
-                      Config SimpleDbus)
+                      Config SimpleDbus Ipc)
 
 ## Generate the pc file ########################################################
 CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_BINARY_DIR}/${PC_FILE} @ONLY)
index 633276a..6dd0ae5 100644 (file)
@@ -28,6 +28,7 @@
 #include "utils/exception.hpp"
 #include "utils/make-clean.hpp"
 #include "utils/environment.hpp"
+#include "base-exception.hpp"
 
 #include <logger/logger.hpp>
 #include <cassert>
index a1b45e9..9af1114 100644 (file)
@@ -34,8 +34,6 @@
 #include <cstring>
 #include <cstdint>
 
-using namespace vasum;
-
 namespace utils {
 
 EventFD::EventFD()
index 49aceb8..ca5564a 100644 (file)
@@ -26,8 +26,7 @@
 #ifndef COMMON_UTILS_EXCEPTION_HPP
 #define COMMON_UTILS_EXCEPTION_HPP
 
-#include "base-exception.hpp"
-
+#include <stdexcept>
 
 namespace utils {
 
@@ -35,9 +34,9 @@ namespace utils {
 /**
  * Base class for exceptions in utils
  */
-struct UtilsException: public vasum::VasumException {
+struct UtilsException: public std::runtime_error {
 
-    UtilsException(const std::string& error) : vasum::VasumException(error) {}
+    UtilsException(const std::string& error) : std::runtime_error(error) {}
 };
 
 /**
index 95080ff..d5179b1 100644 (file)
@@ -39,8 +39,6 @@
 namespace fs = boost::filesystem;
 namespace chr = std::chrono;
 
-using namespace vasum;
-
 namespace utils {
 
 namespace {
index 4949314..b1d9a4f 100644 (file)
@@ -30,8 +30,6 @@
 #include <unistd.h>
 #include <stdexcept>
 
-using namespace vasum;
-
 namespace utils {
 
 
index 5581a29..a093c9e 100644 (file)
@@ -45,8 +45,6 @@
 
 namespace fs = boost::filesystem;
 
-using namespace vasum;
-
 namespace utils {
 
 
diff --git a/libs/ipc/CMakeLists.txt b/libs/ipc/CMakeLists.txt
new file mode 100644 (file)
index 0000000..d760883
--- /dev/null
@@ -0,0 +1,78 @@
+# Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+#
+# @file   CMakeLists.txt
+# @author Mateusz Malicki (m.malicki2@samsung.com)
+#
+
+PROJECT(Ipc)
+
+MESSAGE(STATUS "")
+MESSAGE(STATUS "Generating makefile for the libIpc...")
+
+FILE(GLOB HEADERS           *.hpp)
+FILE(GLOB HEADERS_INTERNALS internals/*.hpp)
+FILE(GLOB HEADERS_EPOLL     epoll/*.hpp)
+FILE(GLOB HEADERS_UTILS     ${COMMON_FOLDER}/utils/fd-utils.hpp
+                            ${COMMON_FOLDER}/utils/eventfd.hpp
+                            ${COMMON_FOLDER}/utils/exception.hpp
+                            ${COMMON_FOLDER}/utils/callback-guard.hpp)
+FILE(GLOB SRCS              *.cpp)
+FILE(GLOB SRCS_INTERNALS    internals/*.cpp)
+FILE(GLOB SRCS_EPOLL        epoll/*.cpp)
+FILE(GLOB SRCS_UTILS        ${COMMON_FOLDER}/utils/fd-utils.cpp
+                            ${COMMON_FOLDER}/utils/eventfd.cpp
+                            ${COMMON_FOLDER}/utils/exception.cpp
+                            ${COMMON_FOLDER}/utils/callback-guard.cpp)
+
+SET(_LIB_VERSION_ "${VERSION}")
+SET(_LIB_SOVERSION_ "0")
+SET(PC_FILE "lib${PROJECT_NAME}.pc")
+
+## Setup target ################################################################
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS} ${SRCS_INTERNALS} ${SRCS_UTILS} ${SRCS_EPOLL})
+SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
+    SOVERSION   ${_LIB_SOVERSION_}
+    VERSION     ${_LIB_VERSION_}
+    )
+
+## Link libraries ##############################################################
+INCLUDE_DIRECTORIES(${LIBS_FOLDER})
+INCLUDE_DIRECTORIES(${COMMON_FOLDER})
+INCLUDE_DIRECTORIES(SYSTEM ${DBUS_DEPS_INCLUDE_DIRS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} Logger Config)
+
+## Generate the pc file ########################################################
+CONFIGURE_FILE(${PC_FILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE} @ONLY)
+
+## Install #####################################################################
+INSTALL(FILES       ${CMAKE_CURRENT_BINARY_DIR}/${PC_FILE}
+        DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+
+INSTALL(TARGETS     ${PROJECT_NAME}
+        DESTINATION ${LIB_INSTALL_DIR}
+        COMPONENT   RuntimeLibraries)
+
+INSTALL(FILES       ${HEADERS}
+        DESTINATION ${INCLUDE_INSTALL_DIR}/vasum-tools/ipc)
+
+INSTALL(FILES       ${HEADERS_INTERNALS}
+        DESTINATION ${INCLUDE_INSTALL_DIR}/vasum-tools/ipc/internals)
+
+INSTALL(FILES       ${HEADERS_EPOLL}
+        DESTINATION ${INCLUDE_INSTALL_DIR}/vasum-tools/ipc/epoll)
+
+INSTALL(FILES       ${HEADERS_UTILS}
+        DESTINATION ${INCLUDE_INSTALL_DIR}/vasum-tools/ipc/utils)
similarity index 100%
rename from common/ipc/client.cpp
rename to libs/ipc/client.cpp
similarity index 100%
rename from common/ipc/client.hpp
rename to libs/ipc/client.hpp
similarity index 99%
rename from common/ipc/epoll/event-poll.cpp
rename to libs/ipc/epoll/event-poll.cpp
index d43c97d..fb8470e 100644 (file)
@@ -33,7 +33,6 @@
 #include <string.h>
 #include <assert.h>
 
-using namespace vasum;
 using namespace utils;
 
 namespace ipc {
similarity index 95%
rename from common/ipc/exception.hpp
rename to libs/ipc/exception.hpp
index 3d89d3b..271cf9a 100644 (file)
 #ifndef COMMON_IPC_EXCEPTION_HPP
 #define COMMON_IPC_EXCEPTION_HPP
 
-#include "base-exception.hpp"
+#include <stdexcept>
 
 namespace ipc {
 
 /**
  * Base class for exceptions in IPC
  */
-struct IPCException: public vasum::VasumException {
+struct IPCException: public std::runtime_error {
     IPCException(const std::string& message)
-        : VasumException(message) {}
+        : std::runtime_error(message) {}
 };
 
 struct IPCParsingException: public IPCException {
diff --git a/libs/ipc/libIpc.pc.in b/libs/ipc/libIpc.pc.in
new file mode 100644 (file)
index 0000000..dbed433
--- /dev/null
@@ -0,0 +1,13 @@
+# Package Information for pkg-config
+
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@LIB_INSTALL_DIR@
+includedir=@INCLUDE_INSTALL_DIR@
+
+Name: libIpc
+Description: IPC library
+Version: @_LIB_VERSION_@
+Libs: -L${libdir} -lIpc
+Cflags: -I${includedir}/vasum-tools -I${includedir}/vasum-tools/ipc
+
similarity index 100%
rename from common/ipc/result.hpp
rename to libs/ipc/result.hpp
similarity index 100%
rename from common/ipc/service.cpp
rename to libs/ipc/service.cpp
similarity index 100%
rename from common/ipc/service.hpp
rename to libs/ipc/service.hpp
similarity index 100%
rename from common/ipc/types.cpp
rename to libs/ipc/types.cpp
similarity index 100%
rename from common/ipc/types.hpp
rename to libs/ipc/types.hpp
index 0636c53..0f99f07 100644 (file)
@@ -356,4 +356,38 @@ The package provides libConfig development tools and libs.
 %{_includedir}/vasum-tools/config
 %{_libdir}/pkgconfig/libConfig.pc
 
+## libIpc Package #######################################################
+%package -n libIpc
+Summary:            IPC library
+Group:              Security/Other
+Requires:           libConfig
+Requires(post):     /sbin/ldconfig
+Requires(postun):   /sbin/ldconfig
+
+%description -n libIpc
+The package provides libIpc library.
 
+%post -n libIpc -p /sbin/ldconfig
+
+%postun -n libIpc -p /sbin/ldconfig
+
+%files -n libIpc
+%defattr(644,root,root,755)
+%{_libdir}/libIpc.so.0
+%attr(755,root,root) %{_libdir}/libIpc.so.%{version}
+
+%package -n libIpc-devel
+Summary:        Development IPC library
+Group:          Development/Libraries
+Requires:       libIpc = %{epoch}:%{version}-%{release}
+Requires:       pkgconfig(libLogger)
+Requires:       pkgconfig(libConfig)
+
+%description -n libIpc-devel
+The package provides libIpc development tools and libs.
+
+%files -n libIpc-devel
+%defattr(644,root,root,755)
+%{_libdir}/libIpc.so
+%{_includedir}/vasum-tools/ipc
+%{_libdir}/pkgconfig/libIpc.pc
index c4e0d8f..6181e15 100644 (file)
@@ -44,7 +44,7 @@ SET_TARGET_PROPERTIES(${SERVER_CODENAME} PROPERTIES
 )
 
 TARGET_LINK_LIBRARIES(${SERVER_CODENAME} ${SERVER_DEPS_LIBRARIES} ${Boost_LIBRARIES}
-                      Logger Config SimpleDbus)
+                      Logger Config SimpleDbus Ipc)
 
 ## Subdirectories ##############################################################
 ADD_SUBDIRECTORY(configs)
index c05b1be..3869a39 100644 (file)
@@ -587,7 +587,7 @@ void ZonesManager::handleNotifyActiveZoneCall(const std::string& caller,
             //XXX:get(iter).sendNotification(caller, application, message);
         }
         result->setVoid();
-    } catch (const VasumException&) {
+    } catch (const std::runtime_error&) {
         LOGE("Notification from " << caller << " hasn't been sent");
         result->setError(api::ERROR_INTERNAL, "Notification hasn't been sent");
     }
@@ -820,7 +820,7 @@ void ZonesManager::handleSetNetdevAttrsCall(const api::SetNetDevAttrsIn& data,
     } catch (const InvalidZoneIdException&) {
         LOGE("No zone with id=" << data.id);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
-    } catch (const VasumException& ex) {
+    } catch (const std::runtime_error& ex) {
         LOGE("Can't set attributes: " << ex.what());
         result->setError(api::ERROR_INTERNAL, ex.what());
     }
@@ -842,7 +842,7 @@ void ZonesManager::handleGetNetdevAttrsCall(const api::GetNetDevAttrsIn& data,
     } catch (const InvalidZoneIdException&) {
         LOGE("No zone with id=" << data.first);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
-    } catch (const VasumException& ex) {
+    } catch (const std::runtime_error& ex) {
         LOGE("Can't set attributes: " << ex.what());
         result->setError(api::ERROR_INTERNAL, ex.what());
     }
@@ -860,7 +860,7 @@ void ZonesManager::handleGetNetdevListCall(const api::ZoneId& zoneId,
     } catch (const InvalidZoneIdException&) {
         LOGE("No zone with id=" << zoneId.value);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
-    } catch (const VasumException& ex) {
+    } catch (const std::runtime_error& ex) {
         LOGE("Can't set attributes: " << ex.what());
         result->setError(api::ERROR_INTERNAL, ex.what());
     }
@@ -878,7 +878,7 @@ void ZonesManager::handleCreateNetdevVethCall(const api::CreateNetDevVethIn& dat
     } catch (const InvalidZoneIdException&) {
         LOGE("No zone with id=" << data.id);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
-    } catch (const VasumException& ex) {
+    } catch (const std::runtime_error& ex) {
         LOGE("Can't create veth: " << ex.what());
         result->setError(api::ERROR_INTERNAL, ex.what());
     }
@@ -895,7 +895,7 @@ void ZonesManager::handleCreateNetdevMacvlanCall(const api::CreateNetDevMacvlanI
     } catch (const InvalidZoneIdException&) {
         LOGE("No zone with id=" << data.id);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
-    } catch (const VasumException& ex) {
+    } catch (const std::runtime_error& ex) {
         LOGE("Can't create macvlan: " << ex.what());
         result->setError(api::ERROR_INTERNAL, ex.what());
     }
@@ -913,7 +913,7 @@ void ZonesManager::handleCreateNetdevPhysCall(const api::CreateNetDevPhysIn& dat
     } catch (const InvalidZoneIdException&) {
         LOGE("No zone with id=" << data.first);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
-    } catch (const VasumException& ex) {
+    } catch (const std::runtime_error& ex) {
         LOGE("Can't create netdev: " << ex.what());
         result->setError(api::ERROR_INTERNAL, ex.what());
     }
@@ -931,7 +931,7 @@ void ZonesManager::handleDestroyNetdevCall(const api::DestroyNetDevIn& data,
     } catch (const InvalidZoneIdException&) {
         LOGE("No zone with id=" << data.first);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
-    } catch (const VasumException& ex) {
+    } catch (const std::runtime_error& ex) {
         LOGE("Can't create netdev: " << ex.what());
         result->setError(api::ERROR_INTERNAL, ex.what());
     }
@@ -948,7 +948,7 @@ void ZonesManager::handleDeleteNetdevIpAddressCall(const api::DeleteNetdevIpAddr
     } catch (const InvalidZoneIdException&) {
         LOGE("No zone with id=" << data.zone);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
-    } catch (const VasumException& ex) {
+    } catch (const std::runtime_error& ex) {
         LOGE("Can't delete address: " << ex.what());
         result->setError(api::ERROR_INTERNAL, ex.what());
     }
@@ -1022,7 +1022,7 @@ void ZonesManager::handleGetDeclarationsCall(const api::ZoneId& zoneId,
     } catch (const InvalidZoneIdException&) {
         LOGE("No zone with id=" << zoneId.value);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
-    } catch (const VasumException& ex) {
+    } catch (const std::runtime_error& ex) {
         LOGE(ex.what());
         result->setError(api::ERROR_INTERNAL, ex.what());
     }
@@ -1039,7 +1039,7 @@ void ZonesManager::handleRemoveDeclarationCall(const api::RemoveDeclarationIn& d
     } catch (const InvalidZoneIdException&) {
         LOGE("No zone with id=" << data.first);
         result->setError(api::ERROR_INVALID_ID, "No such zone id");
-    } catch (const VasumException& ex) {
+    } catch (const std::runtime_error& ex) {
         LOGE(ex.what());
         result->setError(api::ERROR_INTERNAL, ex.what());
     }
@@ -1179,7 +1179,7 @@ void ZonesManager::createZone(const std::string& id,
     try {
         LOGI("Generating config from " << zoneTemplatePath);
         generateNewConfig(id, zoneTemplatePath);
-    } catch (VasumException& e) {
+    } catch (std::runtime_error& e) {
         LOGE("Generate config failed: " << e.what());
         utils::launchAsRoot(std::bind(removeAllWrapper, zonePathStr));
         throw e;
@@ -1188,7 +1188,7 @@ void ZonesManager::createZone(const std::string& id,
     LOGT("Creating new zone");
     try {
         insertZone(id, zoneTemplatePath);
-    } catch (VasumException& e) {
+    } catch (std::runtime_error& e) {
         LOGE("Creating new zone failed: " << e.what());
         utils::launchAsRoot(std::bind(removeAllWrapper, zonePathStr));
         throw e;
@@ -1207,7 +1207,7 @@ void ZonesManager::handleCreateZoneCall(const api::CreateZoneIn& data,
         result->setVoid();
     } catch (const InvalidZoneIdException& e) {
         result->setError(api::ERROR_INVALID_ID, "Existing or invalid zone id");
-    } catch (const VasumException& e) {
+    } catch (const std::runtime_error& e) {
         result->setError(api::ERROR_INTERNAL, "Failed to create zone");
     }
 }
@@ -1222,7 +1222,7 @@ void ZonesManager::handleDestroyZoneCall(const api::ZoneId& zoneId,
         } catch (const InvalidZoneIdException&) {
             LOGE("Failed to destroy zone - no such zone id: " << zoneId.value);
             result->setError(api::ERROR_INVALID_ID, "No such zone id");
-        } catch (const VasumException& e) {
+        } catch (const std::runtime_error& e) {
             LOGE("Error during zone destruction: " << e.what());
             result->setError(api::ERROR_INTERNAL, "Failed to destroy zone");
             return;
index 500e7af..a4e6cfd 100644 (file)
@@ -66,9 +66,9 @@ SET_TARGET_PROPERTIES(${SOCKET_TEST_CODENAME} PROPERTIES
 )
 
 TARGET_LINK_LIBRARIES(${UT_SERVER_CODENAME} ${UT_SERVER_DEPS_LIBRARIES} ${Boost_LIBRARIES}
-                      Logger Config SimpleDbus)
+                      Logger Config SimpleDbus Ipc)
 TARGET_LINK_LIBRARIES(${SOCKET_TEST_CODENAME} ${UT_SERVER_DEPS_LIBRARIES} ${Boost_LIBRARIES}
-                      Logger Config SimpleDbus)
+                      Logger Config SimpleDbus Ipc)
 
 ## Subdirectories ##############################################################
 SET(VSM_TEST_CONFIG_INSTALL_DIR ${VSM_CONFIG_INSTALL_DIR}/tests)
index 819e959..9bf28f0 100644 (file)
@@ -34,7 +34,6 @@
 #include "ipc/epoll/glib-dispatcher.hpp"
 #include "ipc/epoll/thread-dispatcher.hpp"
 
-using namespace vasum;
 using namespace utils;
 using namespace ipc;
 using namespace ipc::epoll;
index b5edbf7..e71a160 100644 (file)
@@ -51,7 +51,6 @@
 #include <utility>
 #include <future>
 
-using namespace vasum;
 using namespace ipc;
 using namespace epoll;
 using namespace utils;