From: Jiri Denemark Date: Mon, 15 Aug 2011 09:28:53 +0000 (+0200) Subject: Ignore unused streams in virStreamAbort X-Git-Tag: v0.9.5-rc1~157 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b136266d57e5cff90142eaaad204d8b5b468dd9c;p=thirdparty%2Flibvirt.git 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. --- diff --git a/src/libvirt.c b/src/libvirt.c index 5f6836d637..a9a34f52f4 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -13988,8 +13988,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)