On 25.10.21 12:17, Emanuele Giuseppe Esposito wrote:
drive_add is only used in softmmu/vl.c, so it can be a static
function there,and 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.

This also helps simplifying next patch.

Signed-off-by: Emanuele Giuseppe Esposito <eespo...@redhat.com>
Reviewed-by: Paolo Bonzini <pbonz...@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com>
---
  block/monitor/block-hmp-cmds.c |  2 +-
  blockdev.c                     | 27 +--------------------------
  include/sysemu/blockdev.h      |  6 ++----
  softmmu/vl.c                   | 25 ++++++++++++++++++++++++-
  4 files changed, 28 insertions(+), 32 deletions(-)

[...]

diff --git a/blockdev.c b/blockdev.c
index c1f6171c6c..1bf49ef610 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -73,7 +73,7 @@ void bdrv_set_monitor_owned(BlockDriverState *bs)
      QTAILQ_INSERT_TAIL(&monitor_bdrv_states, bs, monitor_list);
  }
-static const char *const if_name[IF_COUNT] = {
+const char *const if_name[IF_COUNT] = {

When making this global, I’d give its name a prefix, like `block_if_name` (or even `block_if_type_to_name`).

Hanna

      [IF_NONE] = "none",
      [IF_IDE] = "ide",
      [IF_SCSI] = "scsi",


Reply via email to