]> git.proxmox.com Git - mirror_qemu.git/blobdiff - block/create.c
meson: convert hw/smbios
[mirror_qemu.git] / block / create.c
index 1bd00ed5f8c93dfd315d637f8c6b74f001e533c2..89812669df45f7f3f2f75d7cb0590f81a97f989e 100644 (file)
@@ -64,9 +64,13 @@ void qmp_blockdev_create(const char *job_id, BlockdevCreateOptions *options,
     const char *fmt = BlockdevDriver_str(options->driver);
     BlockDriver *drv = bdrv_find_format(fmt);
 
+    if (!drv) {
+        error_setg(errp, "Block driver '%s' not found or not supported", fmt);
+        return;
+    }
+
     /* If the driver is in the schema, we know that it exists. But it may not
      * be whitelisted. */
-    assert(drv);
     if (bdrv_uses_whitelist() && !bdrv_is_whitelisted(drv, false)) {
         error_setg(errp, "Driver is not whitelisted");
         return;