use 5.010; use warnings; use Sys::Virt; use Sys::Virt::Stream; my $data; my $url = "someurl"; my $con = Sys::Virt->new('uri' => "qemu+tls://$url/system"); my $dom = $con->get_domain_by_name("name"); #Until here everything is just like in every other function i wrote. my $st = $con->new_stream(); $dom->open_console($st, undef); #I guess that i'm also fine until here - because there are no errors.. #And now i'm trying to do something with this stream object i made... #If i would type virsh console i would get a promt to log in, so i try to fetch this promt. #Here are two examples of what i was trying: #Result of this block: Blinking cursor - no "test" my $rv = $st->recv($data, "1"); say "test"; say $rv; say $data; #Result of this block: Blinking cursor - no "test" $st->recv_all(sub{ my ($st, $data, $nbytes) = @_; }); say "test"; say $st; say $data; say $nbytes; $st->finish(); #### my $st=$con->new_stream(Sys::Virt::Stream::NONBLOCK); $dom->open_console($st, undef, 0);