Bug 1029726 - Report error on screenshot stream close
Summary: Report error on screenshot stream close
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-13 02:28 UTC by weizhang
Modified: 2013-12-05 14:49 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-05 14:49:20 UTC
Target Upstream Version:


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

Description weizhang 2013-11-13 02:28:43 UTC
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 Berrangé 2013-12-02 13:55:06 UTC
These log messages are in libvirtd, so not a perl client bug.

Comment 3 Michal Privoznik 2013-12-05 14:49:20 UTC
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.