]> git.proxmox.com Git - mirror_qemu.git/commitdiff
include/sysemu/blockdev.h: remove drive_mark_claimed_by_board and inline drive_def
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Wed, 15 Dec 2021 12:11:39 +0000 (07:11 -0500)
committerKevin Wolf <kwolf@redhat.com>
Fri, 14 Jan 2022 11:03:16 +0000 (12:03 +0100)
drive_def is only a particular use case of
qemu_opts_parse_noisily, so it can be inlined.

Also remove drive_mark_claimed_by_board, as it is only defined
but not implemented (nor used) anywhere.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20211215121140.456939-3-eesposit@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/monitor/block-hmp-cmds.c
blockdev.c
include/sysemu/blockdev.h
softmmu/vl.c

index 2ac4aedfff04228be376c05ff97815e4b3bfe2e5..bfb3c043a0527522ab2f0804b3297278e2f30a80 100644 (file)
@@ -101,7 +101,7 @@ void hmp_drive_add(Monitor *mon, const QDict *qdict)
         return;
     }
 
-    opts = drive_def(optstr);
+    opts = qemu_opts_parse_noisily(qemu_find_opts("drive"), optstr, false);
     if (!opts)
         return;
 
index b5ff9b854e5fcb0386e0ebbb12b57d37d813d92d..25b3b202e77675018ab6fc4cd85e644890bb14c5 100644 (file)
@@ -197,17 +197,12 @@ static int drive_index_to_unit_id(BlockInterfaceType type, int index)
     return max_devs ? index % max_devs : index;
 }
 
-QemuOpts *drive_def(const char *optstr)
-{
-    return qemu_opts_parse_noisily(qemu_find_opts("drive"), optstr, false);
-}
-
 QemuOpts *drive_add(BlockInterfaceType type, int index, const char *file,
                     const char *optstr)
 {
     QemuOpts *opts;
 
-    opts = drive_def(optstr);
+    opts = qemu_opts_parse_noisily(qemu_find_opts("drive"), optstr, false);
     if (!opts) {
         return NULL;
     }
index a750f99b79f04c64ae05917739badc9387a9f03a..ea35c42f5c332d0013b86068fa614de970ee327d 100644 (file)
@@ -45,13 +45,11 @@ BlockBackend *blk_by_legacy_dinfo(DriveInfo *dinfo);
 void override_max_devs(BlockInterfaceType type, int max_devs);
 
 DriveInfo *drive_get(BlockInterfaceType type, int bus, int unit);
-void drive_mark_claimed_by_board(void);
 void drive_check_orphaned(void);
 DriveInfo *drive_get_by_index(BlockInterfaceType type, int index);
 int drive_get_max_bus(BlockInterfaceType type);
 int drive_get_max_devs(BlockInterfaceType type);
 
-QemuOpts *drive_def(const char *optstr);
 QemuOpts *drive_add(BlockInterfaceType type, int index, const char *file,
                     const char *optstr);
 DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type,
index a8cad4369154b426d034a68cb4b19ed7b201462e..207a9eb8beb0f33cc8957a7c3e26ca0d1b9bb63a 100644 (file)
@@ -2887,7 +2887,9 @@ void qemu_init(int argc, char **argv, char **envp)
                     break;
                 }
             case QEMU_OPTION_drive:
-                if (drive_def(optarg) == NULL) {
+                opts = qemu_opts_parse_noisily(qemu_find_opts("drive"),
+                                               optarg, false);
+                if (opts == NULL) {
                     exit(1);
                 }
                 break;