[libvirt] [PATCH] Ignore unused streams in virStreamAbort

When virStreamAbort is called on a stream that has not been used yet, quite confusing error is returned: "this function is not supported by the connection driver". Let's just ignore such streams as there's nothing to abort anyway. --- src/libvirt.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 256828c..72c47f8 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -13975,8 +13975,12 @@ int virStreamAbort(virStreamPtr stream) return -1; } - if (stream->driver && - stream->driver->streamAbort) { + if (!stream->driver) { + VIR_DEBUG("aborting unused stream"); + return 0; + } + + if (stream->driver->streamAbort) { int ret; ret = (stream->driver->streamAbort)(stream); if (ret < 0) -- 1.7.6

On 08/16/2011 04:44 AM, Jiri Denemark wrote:
When virStreamAbort is called on a stream that has not been used yet, quite confusing error is returned: "this function is not supported by the connection driver". Let's just ignore such streams as there's nothing to abort anyway. --- src/libvirt.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Tue, Aug 16, 2011 at 08:33:27 -0600, Eric Blake wrote:
On 08/16/2011 04:44 AM, Jiri Denemark wrote:
When virStreamAbort is called on a stream that has not been used yet, quite confusing error is returned: "this function is not supported by the connection driver". Let's just ignore such streams as there's nothing to abort anyway. --- src/libvirt.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
ACK.
Pushed, thanks. Jirka
participants (2)
-
Eric Blake
-
Jiri Denemark