提交 67f34cd6 编写于 作者: M Matthias Bolte

xen: Remove virConnectPtr from virXenStoreError

上级 68d5d96b
...@@ -88,7 +88,7 @@ struct xenUnifiedDriver xenStoreDriver = { ...@@ -88,7 +88,7 @@ struct xenUnifiedDriver xenStoreDriver = {
#endif /* ! PROXY */ #endif /* ! PROXY */
#define virXenStoreError(conn, code, ...) \ #define virXenStoreError(code, ...) \
virReportErrorHelper(NULL, VIR_FROM_XENSTORE, code, __FILE__, \ virReportErrorHelper(NULL, VIR_FROM_XENSTORE, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__) __FUNCTION__, __LINE__, __VA_ARGS__)
...@@ -297,8 +297,8 @@ xenStoreOpen(virConnectPtr conn, ...@@ -297,8 +297,8 @@ xenStoreOpen(virConnectPtr conn,
* remote) mechanism. * remote) mechanism.
*/ */
if (xenHavePrivilege()) { if (xenHavePrivilege()) {
virXenStoreError(NULL, VIR_ERR_NO_XEN, virXenStoreError(VIR_ERR_NO_XEN,
"%s", _("failed to connect to Xen Store")); "%s", _("failed to connect to Xen Store"));
} }
return (-1); return (-1);
} }
...@@ -322,8 +322,8 @@ xenStoreOpen(virConnectPtr conn, ...@@ -322,8 +322,8 @@ xenStoreOpen(virConnectPtr conn,
if ( xenStoreAddWatch(conn, "@releaseDomain", if ( xenStoreAddWatch(conn, "@releaseDomain",
"releaseDomain", xenStoreDomainReleased, priv) < 0 ) "releaseDomain", xenStoreDomainReleased, priv) < 0 )
{ {
virXenStoreError(NULL, VIR_ERR_INTERNAL_ERROR, virXenStoreError(VIR_ERR_INTERNAL_ERROR,
"%s", _("adding watch @releaseDomain")); "%s", _("adding watch @releaseDomain"));
return -1; return -1;
} }
...@@ -331,8 +331,8 @@ xenStoreOpen(virConnectPtr conn, ...@@ -331,8 +331,8 @@ xenStoreOpen(virConnectPtr conn,
if( xenStoreAddWatch(conn, "@introduceDomain", if( xenStoreAddWatch(conn, "@introduceDomain",
"introduceDomain", xenStoreDomainIntroduced, priv) < 0 ) "introduceDomain", xenStoreDomainIntroduced, priv) < 0 )
{ {
virXenStoreError(NULL, VIR_ERR_INTERNAL_ERROR, virXenStoreError(VIR_ERR_INTERNAL_ERROR,
"%s", _("adding watch @introduceDomain")); "%s", _("adding watch @introduceDomain"));
return -1; return -1;
} }
...@@ -362,7 +362,7 @@ xenStoreClose(virConnectPtr conn) ...@@ -362,7 +362,7 @@ xenStoreClose(virConnectPtr conn)
xenUnifiedPrivatePtr priv; xenUnifiedPrivatePtr priv;
if (conn == NULL) { if (conn == NULL) {
virXenStoreError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return(-1); return(-1);
} }
...@@ -419,8 +419,7 @@ xenStoreGetDomainInfo(virDomainPtr domain, virDomainInfoPtr info) ...@@ -419,8 +419,7 @@ xenStoreGetDomainInfo(virDomainPtr domain, virDomainInfoPtr info)
return (-1); return (-1);
if ((domain == NULL) || (domain->conn == NULL) || (info == NULL)) { if ((domain == NULL) || (domain->conn == NULL) || (info == NULL)) {
virXenStoreError(domain ? domain->conn : NULL, VIR_ERR_INVALID_ARG, virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
__FUNCTION__);
return(-1); return(-1);
} }
...@@ -485,8 +484,7 @@ xenStoreDomainSetMemory(virDomainPtr domain, unsigned long memory) ...@@ -485,8 +484,7 @@ xenStoreDomainSetMemory(virDomainPtr domain, unsigned long memory)
if ((domain == NULL) || (domain->conn == NULL) || if ((domain == NULL) || (domain->conn == NULL) ||
(memory < 1024 * MIN_XEN_GUEST_SIZE)) { (memory < 1024 * MIN_XEN_GUEST_SIZE)) {
virXenStoreError(domain ? domain->conn : NULL, VIR_ERR_INVALID_ARG, virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
__FUNCTION__);
return(-1); return(-1);
} }
if (domain->id == -1) if (domain->id == -1)
...@@ -550,13 +548,13 @@ xenStoreNumOfDomains(virConnectPtr conn) ...@@ -550,13 +548,13 @@ xenStoreNumOfDomains(virConnectPtr conn)
xenUnifiedPrivatePtr priv; xenUnifiedPrivatePtr priv;
if (conn == NULL) { if (conn == NULL) {
virXenStoreError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return -1; return -1;
} }
priv = (xenUnifiedPrivatePtr) conn->privateData; priv = (xenUnifiedPrivatePtr) conn->privateData;
if (priv->xshandle == NULL) { if (priv->xshandle == NULL) {
virXenStoreError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return(-1); return(-1);
} }
...@@ -638,7 +636,7 @@ xenStoreListDomains(virConnectPtr conn, int *ids, int maxids) ...@@ -638,7 +636,7 @@ xenStoreListDomains(virConnectPtr conn, int *ids, int maxids)
int ret; int ret;
if ((conn == NULL) || (ids == NULL)) { if ((conn == NULL) || (ids == NULL)) {
virXenStoreError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return(-1); return(-1);
} }
...@@ -673,7 +671,7 @@ xenStoreLookupByName(virConnectPtr conn, const char *name) ...@@ -673,7 +671,7 @@ xenStoreLookupByName(virConnectPtr conn, const char *name)
xenUnifiedPrivatePtr priv; xenUnifiedPrivatePtr priv;
if ((conn == NULL) || (name == NULL)) { if ((conn == NULL) || (name == NULL)) {
virXenStoreError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
return(NULL); return(NULL);
} }
...@@ -737,8 +735,7 @@ xenStoreDomainShutdown(virDomainPtr domain) ...@@ -737,8 +735,7 @@ xenStoreDomainShutdown(virDomainPtr domain)
xenUnifiedPrivatePtr priv; xenUnifiedPrivatePtr priv;
if ((domain == NULL) || (domain->conn == NULL)) { if ((domain == NULL) || (domain->conn == NULL)) {
virXenStoreError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
__FUNCTION__);
return(-1); return(-1);
} }
if (domain->id == -1 || domain->id == 0) if (domain->id == -1 || domain->id == 0)
...@@ -772,8 +769,7 @@ xenStoreDomainReboot(virDomainPtr domain, unsigned int flags ATTRIBUTE_UNUSED) ...@@ -772,8 +769,7 @@ xenStoreDomainReboot(virDomainPtr domain, unsigned int flags ATTRIBUTE_UNUSED)
xenUnifiedPrivatePtr priv; xenUnifiedPrivatePtr priv;
if ((domain == NULL) || (domain->conn == NULL)) { if ((domain == NULL) || (domain->conn == NULL)) {
virXenStoreError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
__FUNCTION__);
return(-1); return(-1);
} }
if (domain->id == -1 || domain->id == 0) if (domain->id == -1 || domain->id == 0)
...@@ -803,8 +799,7 @@ xenStoreDomainGetOSType(virDomainPtr domain) { ...@@ -803,8 +799,7 @@ xenStoreDomainGetOSType(virDomainPtr domain) {
char *vm, *str = NULL; char *vm, *str = NULL;
if ((domain == NULL) || (domain->conn == NULL)) { if ((domain == NULL) || (domain->conn == NULL)) {
virXenStoreError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, virXenStoreError(VIR_ERR_INVALID_ARG, __FUNCTION__);
__FUNCTION__);
return(NULL); return(NULL);
} }
...@@ -1200,8 +1195,8 @@ int xenStoreAddWatch(virConnectPtr conn, ...@@ -1200,8 +1195,8 @@ int xenStoreAddWatch(virConnectPtr conn,
for (n=0; n < list->count; n++) { for (n=0; n < list->count; n++) {
if( STREQ(list->watches[n]->path, path) && if( STREQ(list->watches[n]->path, path) &&
STREQ(list->watches[n]->token, token)) { STREQ(list->watches[n]->token, token)) {
virXenStoreError(NULL, VIR_ERR_INTERNAL_ERROR, virXenStoreError(VIR_ERR_INTERNAL_ERROR,
"%s", _("watch already tracked")); "%s", _("watch already tracked"));
return -1; return -1;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册