Bug 1029726 - Report error on screenshot stream close
Report error on screenshot stream close
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
x86_64 Linux
medium Severity high
: rc
: ---
Assigned To: Michal Privoznik
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-12 21:28 EST by weizhang
Modified: 2013-12-05 09:49 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-05 09:49:20 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
libvirtd.log in level 1 (1.73 MB, text/plain)
2013-11-12 21:28 EST, weizhang
no flags Details

  None (edit)
Description weizhang 2013-11-12 21:28:43 EST
Created attachment 823237 [details]
libvirtd.log in level 1

Description of problem:
When I test it on perl-Sys-Virt with script
#!/usr/bin/perl
use warnings;
use strict;
use Sys::Virt;

my $uri = "qemu:///system";
my $domname = "test";
my $con = Sys::Virt->new(address => $uri, readonly => 0);
my $dom = $con->get_domain_by_name($domname);
my $st = $con->new_stream();
$dom->screenshot($st, 0);
$st->finish();

It will report error
2013-11-07 09:38:45.373+0000: 907: error : virFDStreamCloseInt:315 : internal error: I/O helper exited abnormally
2013-11-07 09:38:45.374+0000: 907: error : virFDStreamUpdateCallback:133 : internal error: stream is not open


Version-Release number of selected component (if applicable):
perl-Sys-Virt-1.1.1-2.el7.x86_64
kernel-3.10.0-26.el7.x86_64
qemu-kvm-rhev-1.5.3-16.el7.x86_64
libvirt-1.1.1-12.el7.x86_64


How reproducible:
100%

Steps to Reproduce:
1. start a guest with name test
2. perl test.pl (content of test.pl show in description)
3.

Actual results:
report error
2013-11-07 09:38:45.373+0000: 907: error : virFDStreamCloseInt:315 : internal error: I/O helper exited abnormally
2013-11-07 09:38:45.374+0000: 907: error : virFDStreamUpdateCallback:133 : internal error: stream is not open

Expected results:
No error

Additional info:
Comment 2 Daniel Berrange 2013-12-02 08:55:06 EST
These log messages are in libvirtd, so not a perl client bug.
Comment 3 Michal Privoznik 2013-12-05 09:49:20 EST
This is not a bug.

First of all: you didn't specify where the stream data should go. Then: you need either to recv all data or abort the stream prior calling finish. So in fact your script needs to look like this:

#!/usr/bin/perl
use warnings;
use strict;
use Sys::Virt;

my $f = shift @ARGV;
my $uri = "qemu:///system";
my $domname = "gentoo";
my $con = Sys::Virt->new(address => $uri, readonly => 0);
my $dom = $con->get_domain_by_name($domname);
my $st = $con->new_stream();

open FILE, ">$f" or die "cannot create $f: $!";

sub foo {
	my $st = shift;
	my $data = shift;
	my $nbytes = shift;
	return syswrite FILE, $data, $nbytes;
};

$dom->screenshot($st, 0);
$st->recv_all(\&foo);
$st->finish();

Note You need to log in before you can comment on or make changes to this bug.