]> Git Repo - qemu.git/commitdiff
qemu-storage-daemon: Use qmp_block_export_add()
authorKevin Wolf <[email protected]>
Thu, 24 Sep 2020 15:26:51 +0000 (17:26 +0200)
committerKevin Wolf <[email protected]>
Fri, 2 Oct 2020 13:46:40 +0000 (15:46 +0200)
No reason to duplicate the functionality locally, we can now just reuse
the QMP command block-export-add for --export.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Message-Id: <20200924152717[email protected]>
Acked-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
storage-daemon/qemu-storage-daemon.c

index ed2609725409b86e3f58cf9ece0657c7c82b22a9..b6f678d3abfdebb2535fdb27be5d7115007dacf7 100644 (file)
@@ -150,17 +150,6 @@ static void init_qmp_commands(void)
                          qmp_marshal_qmp_capabilities, QCO_ALLOW_PRECONFIG);
 }
 
-static void init_export(BlockExportOptions *export, Error **errp)
-{
-    switch (export->type) {
-    case BLOCK_EXPORT_TYPE_NBD:
-        qmp_nbd_server_add(&export->u.nbd, errp);
-        break;
-    default:
-        g_assert_not_reached();
-    }
-}
-
 static void process_options(int argc, char *argv[])
 {
     int c;
@@ -241,7 +230,7 @@ static void process_options(int argc, char *argv[])
                 visit_type_BlockExportOptions(v, NULL, &export, &error_fatal);
                 visit_free(v);
 
-                init_export(export, &error_fatal);
+                qmp_block_export_add(export, &error_fatal);
                 qapi_free_BlockExportOptions(export);
                 break;
             }
This page took 0.027852 seconds and 4 git commands to generate.