[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 13/25] include/sysemu/blockdev.h: move drive_add and inlin

From: Hanna Reitz
Subject: Re: [PATCH v4 13/25] include/sysemu/blockdev.h: move drive_add and inline drive_def
Date: Fri, 12 Nov 2021 16:41:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0

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 <eesposit@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@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`).


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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]