mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 22:25:25 +00:00
remote: Replace some virRaiseError with remoteError
This commit is contained in:
parent
9455323530
commit
ddf877cd9e
@ -6585,11 +6585,9 @@ static char *addrToString(struct sockaddr_storage *sa, socklen_t salen)
|
|||||||
host, sizeof(host),
|
host, sizeof(host),
|
||||||
port, sizeof(port),
|
port, sizeof(port),
|
||||||
NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
|
NI_NUMERICHOST | NI_NUMERICSERV)) != 0) {
|
||||||
virRaiseError (NULL, NULL, NULL, VIR_FROM_REMOTE,
|
remoteError(VIR_ERR_UNKNOWN_HOST,
|
||||||
VIR_ERR_UNKNOWN_HOST, VIR_ERR_ERROR,
|
_("Cannot resolve address %d: %s"),
|
||||||
NULL, NULL, NULL, 0, 0,
|
err, gai_strerror(err));
|
||||||
_("Cannot resolve address %d: %s"),
|
|
||||||
err, gai_strerror(err));
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9170,11 +9168,9 @@ processCallDispatch(virConnectPtr conn, struct private_data *priv,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
virRaiseError (in_open ? NULL : conn,
|
remoteError(VIR_ERR_RPC,
|
||||||
NULL, NULL, VIR_FROM_REMOTE,
|
_("got unexpected RPC call %d from server"),
|
||||||
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
|
hdr.proc);
|
||||||
_("got unexpected RPC call %d from server"),
|
|
||||||
hdr.proc);
|
|
||||||
rv = -1;
|
rv = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -9185,8 +9181,9 @@ processCallDispatch(virConnectPtr conn, struct private_data *priv,
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
processCallDispatchReply(virConnectPtr conn, struct private_data *priv,
|
processCallDispatchReply(virConnectPtr conn ATTRIBUTE_UNUSED,
|
||||||
int in_open,
|
struct private_data *priv,
|
||||||
|
int in_open ATTRIBUTE_UNUSED,
|
||||||
remote_message_header *hdr,
|
remote_message_header *hdr,
|
||||||
XDR *xdr) {
|
XDR *xdr) {
|
||||||
struct remote_thread_call *thecall;
|
struct remote_thread_call *thecall;
|
||||||
@ -9199,20 +9196,16 @@ processCallDispatchReply(virConnectPtr conn, struct private_data *priv,
|
|||||||
thecall = thecall->next;
|
thecall = thecall->next;
|
||||||
|
|
||||||
if (!thecall) {
|
if (!thecall) {
|
||||||
virRaiseError (in_open ? NULL : conn,
|
remoteError(VIR_ERR_RPC,
|
||||||
NULL, NULL, VIR_FROM_REMOTE,
|
_("no call waiting for reply with serial %d"),
|
||||||
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
|
hdr->serial);
|
||||||
_("no call waiting for reply with serial %d"),
|
|
||||||
hdr->serial);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hdr->proc != thecall->proc_nr) {
|
if (hdr->proc != thecall->proc_nr) {
|
||||||
virRaiseError (in_open ? NULL : conn,
|
remoteError(VIR_ERR_RPC,
|
||||||
NULL, NULL, VIR_FROM_REMOTE,
|
_("unknown procedure (received %x, expected %x)"),
|
||||||
VIR_ERR_RPC, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
|
hdr->proc, thecall->proc_nr);
|
||||||
_("unknown procedure (received %x, expected %x)"),
|
|
||||||
hdr->proc, thecall->proc_nr);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user