Users can provide URI without a schema.

https://bugzilla.redhat.com/show_bug.cgi?id=1638889

Signed-off-by: Martin Kletzander <mklet...@redhat.com>
---
 src/qemu/qemu_migration.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index fcb33d0364a1..90b0ec95e35a 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -408,6 +408,11 @@ qemuMigrationDstStartNBDServer(virQEMUDriverPtr driver,
         if (!uri)
             return -1;
 
+        if (!uri->scheme) {
+            virReportError(VIR_ERR_INVALID_ARG, _("No URI scheme specified: 
%s"), nbdURI);
+            return -1;
+        }
+
         if (STREQ(uri->scheme, "tcp")) {
             server.transport = VIR_STORAGE_NET_HOST_TRANS_TCP;
             if (!uri->server || STREQ(uri->server, "")) {
-- 
2.29.2

Reply via email to