提交 c39554bf 编写于 作者: D Daniel P. Berrange

Remove virConnectPtr from LXC driver

上级 caa805ea
...@@ -63,8 +63,8 @@ struct __lxc_driver { ...@@ -63,8 +63,8 @@ struct __lxc_driver {
int lxcLoadDriverConfig(lxc_driver_t *driver); int lxcLoadDriverConfig(lxc_driver_t *driver);
virCapsPtr lxcCapsInit(void); virCapsPtr lxcCapsInit(void);
#define lxcError(conn, dom, code, fmt...) \ #define lxcError(code, fmt...) \
virReportErrorHelper(conn, VIR_FROM_LXC, code, __FILE__, \ virReportErrorHelper(NULL, VIR_FROM_LXC, code, __FILE__, \
__FUNCTION__, __LINE__, fmt) __FUNCTION__, __LINE__, fmt)
#endif /* LXC_CONF_H */ #endif /* LXC_CONF_H */
...@@ -684,13 +684,13 @@ static int lxcContainerDropCapabilities(void) ...@@ -684,13 +684,13 @@ static int lxcContainerDropCapabilities(void)
CAP_AUDIT_CONTROL, /* No messing with auditing status */ CAP_AUDIT_CONTROL, /* No messing with auditing status */
CAP_MAC_ADMIN, /* No messing with LSM config */ CAP_MAC_ADMIN, /* No messing with LSM config */
-1 /* sentinal */)) < 0) { -1 /* sentinal */)) < 0) {
lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR, lxcError(VIR_ERR_INTERNAL_ERROR,
_("Failed to remove capabilities: %d"), ret); _("Failed to remove capabilities: %d"), ret);
return -1; return -1;
} }
if ((ret = capng_apply(CAPNG_SELECT_BOTH)) < 0) { if ((ret = capng_apply(CAPNG_SELECT_BOTH)) < 0) {
lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR, lxcError(VIR_ERR_INTERNAL_ERROR,
_("Failed to apply capabilities: %d"), ret); _("Failed to apply capabilities: %d"), ret);
return -1; return -1;
} }
...@@ -729,7 +729,7 @@ static int lxcContainerChild( void *data ) ...@@ -729,7 +729,7 @@ static int lxcContainerChild( void *data )
virDomainFSDefPtr root; virDomainFSDefPtr root;
if (NULL == vmDef) { if (NULL == vmDef) {
lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR, lxcError(VIR_ERR_INTERNAL_ERROR,
"%s", _("lxcChild() passed invalid vm definition")); "%s", _("lxcChild() passed invalid vm definition"));
return -1; return -1;
} }
......
...@@ -179,7 +179,7 @@ static int lxcMonitorServer(const char *sockpath) ...@@ -179,7 +179,7 @@ static int lxcMonitorServer(const char *sockpath)
memset(&addr, 0, sizeof(addr)); memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX; addr.sun_family = AF_UNIX;
if (virStrcpyStatic(addr.sun_path, sockpath) == NULL) { if (virStrcpyStatic(addr.sun_path, sockpath) == NULL) {
lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR, lxcError(VIR_ERR_INTERNAL_ERROR,
_("Socket path %s too long for destination"), sockpath); _("Socket path %s too long for destination"), sockpath);
goto error; goto error;
} }
...@@ -253,7 +253,7 @@ static int lxcControllerClearCapabilities(void) ...@@ -253,7 +253,7 @@ static int lxcControllerClearCapabilities(void)
capng_clear(CAPNG_SELECT_BOTH); capng_clear(CAPNG_SELECT_BOTH);
if ((ret = capng_apply(CAPNG_SELECT_BOTH)) < 0) { if ((ret = capng_apply(CAPNG_SELECT_BOTH)) < 0) {
lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR, lxcError(VIR_ERR_INTERNAL_ERROR,
_("failed to apply capabilities: %d"), ret); _("failed to apply capabilities: %d"), ret);
return -1; return -1;
} }
...@@ -380,7 +380,7 @@ static int lxcControllerMain(int monitor, ...@@ -380,7 +380,7 @@ static int lxcControllerMain(int monitor,
DEBUG("EPOLLHUP from fd %d", epollEvent.data.fd); DEBUG("EPOLLHUP from fd %d", epollEvent.data.fd);
continue; continue;
} else { } else {
lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR, lxcError(VIR_ERR_INTERNAL_ERROR,
_("error event %d"), epollEvent.events); _("error event %d"), epollEvent.events);
goto cleanup; goto cleanup;
} }
...@@ -451,7 +451,7 @@ static int lxcControllerMoveInterfaces(unsigned int nveths, ...@@ -451,7 +451,7 @@ static int lxcControllerMoveInterfaces(unsigned int nveths,
unsigned int i; unsigned int i;
for (i = 0 ; i < nveths ; i++) for (i = 0 ; i < nveths ; i++)
if (moveInterfaceToNetNs(veths[i], container) < 0) { if (moveInterfaceToNetNs(veths[i], container) < 0) {
lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR, lxcError(VIR_ERR_INTERNAL_ERROR,
_("Failed to move interface %s to ns %d"), _("Failed to move interface %s to ns %d"),
veths[i], container); veths[i], container);
return -1; return -1;
...@@ -476,7 +476,7 @@ static int lxcControllerCleanupInterfaces(unsigned int nveths, ...@@ -476,7 +476,7 @@ static int lxcControllerCleanupInterfaces(unsigned int nveths,
unsigned int i; unsigned int i;
for (i = 0 ; i < nveths ; i++) for (i = 0 ; i < nveths ; i++)
if (vethDelete(veths[i]) < 0) if (vethDelete(veths[i]) < 0)
lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR, lxcError(VIR_ERR_INTERNAL_ERROR,
_("Failed to delete veth: %s"), veths[i]); _("Failed to delete veth: %s"), veths[i]);
/* will continue to try to cleanup any other interfaces */ /* will continue to try to cleanup any other interfaces */
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册