
On 07/03/14 23:46, Mike Latimer wrote:
On Friday, March 07, 2014 05:16:48 PM Osier Yang wrote:
$hook->cleanup(); + + # Restarting libvirtd broke the tck connection, so ignore sigpipe and + # undefine $tck to avoid a return code of 141 + $SIG{PIPE} = 'IGNORE'; + undef $tck;
We should get the libvirt "connection" closed before restarting libvirtd, in tck, it should be "$tck->cleanup()". I should have stated in the original email that "$tck->cleanup()" does not help here. With just "$tck->cleanup()" after "$hook->cleanup()", the test still exists with a return code of 141. If I add the code to ignore the SIGPIPE, the test ends with the following messages:
libvirt error code: 38, message: Cannot write data: Broken pipe libvirt error code: 1, message: internal error: client socket is closed
If the test restarts libvirtd (using `service libvirtd restart`), the only way I can get it to end with an exit code of 0 is to undefine $tck.
Hm, $tck->cleanup() doesn't close the connection, it just destroy and undefine the existing domains, networks, and pools. <snip> sub reset { my $self = shift; my $conn = shift || $self->conn; $self->reset_domains($conn); $self->reset_networks($conn); $self->reset_storage_pools($conn); } sub cleanup { my $self = shift; foreach my $conn (@{$self->{conns}}) { $self->reset($conn); } delete $self->{conns}; } </snip> So it looks like we need a new helper to close the connection. Osier