virsh: cmdScreenshot: fix cbdata passing to virshStreamSink

The changes for sparse stream support started passing
virshStreamCallbackDataPtr to virshStreamSink
instead of passing a simple file descriptor, but
forgot to adjust all the callers.

Fix it in cmdScreenshot as well.

https://bugzilla.redhat.com/show_bug.cgi?id=1875195

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 9e745a9717
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Ján Tomko 2020-09-09 10:55:40 +02:00
parent 0b261edd15
commit 3144e881b1

View File

@ -5628,6 +5628,7 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd)
bool generated = false;
char *mime = NULL;
virshControlPtr priv = ctl->privData;
virshStreamCallbackData cbdata;
if (vshCommandOptStringReq(ctl, cmd, "file", (const char **) &file) < 0)
return false;
@ -5663,7 +5664,10 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd)
created = true;
}
if (virStreamRecvAll(st, virshStreamSink, &fd) < 0) {
cbdata.ctl = ctl;
cbdata.fd = fd;
if (virStreamRecvAll(st, virshStreamSink, &cbdata) < 0) {
vshError(ctl, _("could not receive data from domain %s"), name);
goto cleanup;
}