[libvirt PATCH] virsh: cmdScreenshot: fix cbdata passing to virshStreamSink

Martin Kletzander mkletzan at redhat.com
Wed Sep 9 12:34:34 UTC 2020


On Wed, Sep 09, 2020 at 11:05:37AM +0200, Ján Tomko wrote:
>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.
>
>Signed-off-by: Ján Tomko <jtomko at redhat.com>
>Fixes: 9e745a97171e10f050962c166082439d6724e245
>https://bugzilla.redhat.com/show_bug.cgi?id=1875195
>---

Reviewed-by: Martin Kletzander <mkletzan at redhat.com>

> tools/virsh-domain.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
>diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
>index 31597ee469..d1d3f8e566 100644
>--- a/tools/virsh-domain.c
>+++ b/tools/virsh-domain.c
>@@ -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;
>     }
>-- 
>2.26.2
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20200909/4f38a071/attachment-0001.sig>


More information about the libvir-list mailing list