Browse Source

hw/scsi/disk: Prefer target_s390x() over qemu_arch_available()

qemu_arch_available() is used to check if a broadly available
feature should be exposed to a particular set of target
architectures. Here we only want to check something that is
specific to s390x: the target_s390x() helper is more adapted.
Besides, it will allow to reduce qemu_arch_available() scope.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20260213175032.32121-4-philmd@linaro.org>
master
Philippe Mathieu-Daudé 6 months ago
parent
commit
1afc7da7db
  1. 4
      hw/scsi/scsi-disk.c

4
hw/scsi/scsi-disk.c

@ -27,13 +27,13 @@
#include "qemu/module.h"
#include "qemu/hw-version.h"
#include "qemu/memalign.h"
#include "qemu/target-info.h"
#include "hw/scsi/scsi.h"
#include "migration/misc.h"
#include "migration/qemu-file-types.h"
#include "migration/vmstate.h"
#include "hw/scsi/emulation.h"
#include "scsi/constants.h"
#include "system/arch_init.h"
#include "system/block-backend.h"
#include "system/blockdev.h"
#include "hw/block/block.h"
@ -3180,7 +3180,7 @@ static void scsi_property_add_specifics(DeviceClass *dc)
ObjectClass *oc = OBJECT_CLASS(dc);
/* The loadparm property is only supported on s390x */
if (qemu_arch_available(QEMU_ARCH_S390X)) {
if (target_s390x()) {
object_class_property_add_str(oc, "loadparm",
scsi_property_get_loadparm,
scsi_property_set_loadparm);

Loading…
Cancel
Save