mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
remote: Propagate error from virDomainGetSecurityLabelList via RPC
The daemon side of this API has been broken ever since the API was introduced in 2012. Instead of sending the error from virDomainGetSecurityLabelList via RPC so that the client can see it, the dispatcher would just send a successful reply with return value set to -1 (and an empty array of labels). The client side would propagate this return value so the client can see the API failed, but the original error would be lost. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
0211e430a8
commit
4849eb2220
@ -2637,13 +2637,11 @@ remoteDispatchDomainGetSecurityLabelList(virNetServer *server G_GNUC_UNUSED,
|
||||
if (!(dom = get_nonnull_domain(conn, args->dom)))
|
||||
goto cleanup;
|
||||
|
||||
if ((len = virDomainGetSecurityLabelList(dom, &seclabels)) < 0) {
|
||||
ret->ret = len;
|
||||
ret->labels.labels_len = 0;
|
||||
ret->labels.labels_val = NULL;
|
||||
goto done;
|
||||
}
|
||||
if ((len = virDomainGetSecurityLabelList(dom, &seclabels)) < 0)
|
||||
goto cleanup;
|
||||
|
||||
ret->ret = len;
|
||||
ret->labels.labels_len = len;
|
||||
ret->labels.labels_val = g_new0(remote_domain_get_security_label_ret, len);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
@ -2653,9 +2651,7 @@ remoteDispatchDomainGetSecurityLabelList(virNetServer *server G_GNUC_UNUSED,
|
||||
cur->label.label_len = label_len;
|
||||
cur->enforcing = seclabels[i].enforcing;
|
||||
}
|
||||
ret->labels.labels_len = ret->ret = len;
|
||||
|
||||
done:
|
||||
rv = 0;
|
||||
|
||||
cleanup:
|
||||
|
Loading…
x
Reference in New Issue
Block a user