]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Ignore unused streams in virStreamAbort
authorJiri Denemark <jdenemar@redhat.com>
Mon, 15 Aug 2011 09:28:53 +0000 (11:28 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 26 Aug 2011 09:25:01 +0000 (11:25 +0200)
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

index 5f6836d63701dbb3cfe36756d4f18b71769c4bb9..a9a34f52f4b43faa78ac1b8d09fcd5ee5e630717 100644 (file)
@@ -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)