Bug 602592

Summary: [RFE] expose guestfs_close in perl bindings
Product: [Community] Virtualization Tools Reporter: Matthew Booth <mbooth>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: mbooth, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-14 19:13:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Matthew Booth 2010-06-10 09:22:09 UTC
Currently the only way to close a guestfs handle in perl is to remove all references to it. There are circumstances where it is important to know that the guest handle is closed before proceeding, for example before attempting to unmount a volume which is being used by guestfs. In this case, a simple $g = undef will not suffice if a code change elsewhere has kept a reference to the handle.

Usage of libguestfs in this case would be made significantly more robust by exposing the close() call, allowing the handle to be explicitly closed regardless of remaining references. Attempting to use a reference after close() would result in an error.

Comment 1 Richard W.M. Jones 2010-06-10 11:21:04 UTC
That was an unwelcome tour around the guts of Perl ...

Patch posted upstream:
https://www.redhat.com/archives/libguestfs/2010-June/msg00089.html

Comment 2 Richard W.M. Jones 2010-06-10 17:19:09 UTC
Updated patch:
https://www.redhat.com/archives/libguestfs/2010-June/msg00095.html