Enable QXL device build
Enable building for ppc64le Re-added Spice support Don't remove slof.bin for ppc64le
This commit is contained in:
commit
e91fca7afd
456
kvm-block-enable-stats-intervals-for-storage-devices.patch
Normal file
456
kvm-block-enable-stats-intervals-for-storage-devices.patch
Normal file
@ -0,0 +1,456 @@
|
||||
From c1b736d645d79363123941613db8a79a59c27298 Mon Sep 17 00:00:00 2001
|
||||
From: Chandan Somani <csomani@redhat.com>
|
||||
Date: Fri, 3 Oct 2025 14:59:26 -0700
|
||||
Subject: [PATCH 1/2] block: enable stats-intervals for storage devices
|
||||
|
||||
RH-Author: Chandan Somani <None>
|
||||
RH-MergeRequest: 467: block: enable stats-intervals for storage devices
|
||||
RH-Jira: RHEL-114231
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Commit: [1/2] 0ca781da8e25bf5d2baf3dcd9f2687b4d21b8613 (csomani1/qemu-kvm)
|
||||
|
||||
This patch allows stats-intervals to be used for storage
|
||||
devices with the -device option. It accepts a list of interval
|
||||
lengths in JSON format.
|
||||
|
||||
It configures and collects the stats in the BlockBackend layer
|
||||
through the storage device that consumes the BlockBackend.
|
||||
|
||||
Signed-off-by: Chandan Somani <csomani@redhat.com>
|
||||
Message-ID: <20251003220039.1336663-1-csomani@redhat.com>
|
||||
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
|
||||
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
|
||||
---
|
||||
block/accounting.c | 17 +++++++++++++++--
|
||||
blockdev.c | 3 ++-
|
||||
hw/block/block.c | 7 +++++--
|
||||
include/block/accounting.h | 5 +++--
|
||||
include/hw/block/block.h | 7 ++++++-
|
||||
tests/qemu-iotests/172.out | 38 ++++++++++++++++++++++++++++++++++++++
|
||||
6 files changed, 69 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/block/accounting.c b/block/accounting.c
|
||||
index 3e46159569..0933c61f3a 100644
|
||||
--- a/block/accounting.c
|
||||
+++ b/block/accounting.c
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "block/block_int.h"
|
||||
#include "qemu/timer.h"
|
||||
#include "system/qtest.h"
|
||||
+#include "qapi/error.h"
|
||||
|
||||
static QEMUClockType clock_type = QEMU_CLOCK_REALTIME;
|
||||
static const int qtest_latency_ns = NANOSECONDS_PER_SECOND / 1000;
|
||||
@@ -56,13 +57,25 @@ static bool bool_from_onoffauto(OnOffAuto val, bool def)
|
||||
}
|
||||
}
|
||||
|
||||
-void block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
|
||||
- enum OnOffAuto account_failed)
|
||||
+bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
|
||||
+ enum OnOffAuto account_failed, uint32_t *stats_intervals,
|
||||
+ uint32_t num_stats_intervals, Error **errp)
|
||||
{
|
||||
stats->account_invalid = bool_from_onoffauto(account_invalid,
|
||||
stats->account_invalid);
|
||||
stats->account_failed = bool_from_onoffauto(account_failed,
|
||||
stats->account_failed);
|
||||
+ if (stats_intervals) {
|
||||
+ for (int i = 0; i < num_stats_intervals; i++) {
|
||||
+ if (stats_intervals[i] <= 0) {
|
||||
+ error_setg(errp, "Invalid interval length: %u", stats_intervals[i]);
|
||||
+ return false;
|
||||
+ }
|
||||
+ block_acct_add_interval(stats, stats_intervals[i]);
|
||||
+ }
|
||||
+ g_free(stats_intervals);
|
||||
+ }
|
||||
+ return true;
|
||||
}
|
||||
|
||||
void block_acct_cleanup(BlockAcctStats *stats)
|
||||
diff --git a/blockdev.c b/blockdev.c
|
||||
index 76c8dd0573..6e86c6262f 100644
|
||||
--- a/blockdev.c
|
||||
+++ b/blockdev.c
|
||||
@@ -617,7 +617,8 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts,
|
||||
|
||||
bs->detect_zeroes = detect_zeroes;
|
||||
|
||||
- block_acct_setup(blk_get_stats(blk), account_invalid, account_failed);
|
||||
+ block_acct_setup(blk_get_stats(blk), account_invalid, account_failed,
|
||||
+ NULL, 0, NULL);
|
||||
|
||||
if (!parse_stats_intervals(blk_get_stats(blk), interval_list, errp)) {
|
||||
blk_unref(blk);
|
||||
diff --git a/hw/block/block.c b/hw/block/block.c
|
||||
index 2e10611d95..f187fa025d 100644
|
||||
--- a/hw/block/block.c
|
||||
+++ b/hw/block/block.c
|
||||
@@ -249,8 +249,11 @@ bool blkconf_apply_backend_options(BlockConf *conf, bool readonly,
|
||||
blk_set_enable_write_cache(blk, wce);
|
||||
blk_set_on_error(blk, rerror, werror);
|
||||
|
||||
- block_acct_setup(blk_get_stats(blk), conf->account_invalid,
|
||||
- conf->account_failed);
|
||||
+ if (!block_acct_setup(blk_get_stats(blk), conf->account_invalid,
|
||||
+ conf->account_failed, conf->stats_intervals,
|
||||
+ conf->num_stats_intervals, errp)) {
|
||||
+ return false;
|
||||
+ }
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/include/block/accounting.h b/include/block/accounting.h
|
||||
index a59e39f49d..b1cf417b57 100644
|
||||
--- a/include/block/accounting.h
|
||||
+++ b/include/block/accounting.h
|
||||
@@ -101,8 +101,9 @@ typedef struct BlockAcctCookie {
|
||||
} BlockAcctCookie;
|
||||
|
||||
void block_acct_init(BlockAcctStats *stats);
|
||||
-void block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
|
||||
- enum OnOffAuto account_failed);
|
||||
+bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
|
||||
+ enum OnOffAuto account_failed, uint32_t *stats_intervals,
|
||||
+ uint32_t num_stats_intervals, Error **errp);
|
||||
void block_acct_cleanup(BlockAcctStats *stats);
|
||||
void block_acct_add_interval(BlockAcctStats *stats, unsigned interval_length);
|
||||
BlockAcctTimedStats *block_acct_interval_next(BlockAcctStats *stats,
|
||||
diff --git a/include/hw/block/block.h b/include/hw/block/block.h
|
||||
index de3946a5f1..b4d914624e 100644
|
||||
--- a/include/hw/block/block.h
|
||||
+++ b/include/hw/block/block.h
|
||||
@@ -34,6 +34,8 @@ typedef struct BlockConf {
|
||||
OnOffAuto account_invalid, account_failed;
|
||||
BlockdevOnError rerror;
|
||||
BlockdevOnError werror;
|
||||
+ uint32_t num_stats_intervals;
|
||||
+ uint32_t *stats_intervals;
|
||||
} BlockConf;
|
||||
|
||||
static inline unsigned int get_physical_block_exp(BlockConf *conf)
|
||||
@@ -66,7 +68,10 @@ static inline unsigned int get_physical_block_exp(BlockConf *conf)
|
||||
DEFINE_PROP_ON_OFF_AUTO("account-invalid", _state, \
|
||||
_conf.account_invalid, ON_OFF_AUTO_AUTO), \
|
||||
DEFINE_PROP_ON_OFF_AUTO("account-failed", _state, \
|
||||
- _conf.account_failed, ON_OFF_AUTO_AUTO)
|
||||
+ _conf.account_failed, ON_OFF_AUTO_AUTO), \
|
||||
+ DEFINE_PROP_ARRAY("stats-intervals", _state, \
|
||||
+ _conf.num_stats_intervals, _conf.stats_intervals, \
|
||||
+ qdev_prop_uint32, uint32_t)
|
||||
|
||||
#define DEFINE_BLOCK_PROPERTIES(_state, _conf) \
|
||||
DEFINE_PROP_DRIVE("drive", _state, _conf.blk), \
|
||||
diff --git a/tests/qemu-iotests/172.out b/tests/qemu-iotests/172.out
|
||||
index 146fc72388..a023cd407d 100644
|
||||
--- a/tests/qemu-iotests/172.out
|
||||
+++ b/tests/qemu-iotests/172.out
|
||||
@@ -30,6 +30,7 @@ Testing:
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "288"
|
||||
|
||||
|
||||
@@ -59,6 +60,7 @@ Testing: -fda TEST_DIR/t.qcow2
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -95,6 +97,7 @@ Testing: -fdb TEST_DIR/t.qcow2
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
dev: floppy, id ""
|
||||
unit = 0 (0x0)
|
||||
@@ -109,6 +112,7 @@ Testing: -fdb TEST_DIR/t.qcow2
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "288"
|
||||
floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -149,6 +153,7 @@ Testing: -fda TEST_DIR/t.qcow2 -fdb TEST_DIR/t.qcow2.2
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
dev: floppy, id ""
|
||||
unit = 0 (0x0)
|
||||
@@ -163,6 +168,7 @@ Testing: -fda TEST_DIR/t.qcow2 -fdb TEST_DIR/t.qcow2.2
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -204,6 +210,7 @@ Testing: -fdb
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "288"
|
||||
dev: floppy, id ""
|
||||
unit = 0 (0x0)
|
||||
@@ -218,6 +225,7 @@ Testing: -fdb
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "288"
|
||||
|
||||
|
||||
@@ -247,6 +255,7 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -283,6 +292,7 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2,index=1
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
dev: floppy, id ""
|
||||
unit = 0 (0x0)
|
||||
@@ -297,6 +307,7 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2,index=1
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "288"
|
||||
floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -337,6 +348,7 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=floppy,file=TEST_DIR/t
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
dev: floppy, id ""
|
||||
unit = 0 (0x0)
|
||||
@@ -351,6 +363,7 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=floppy,file=TEST_DIR/t
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -395,6 +408,7 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/peripheral-anon/device[N]
|
||||
@@ -431,6 +445,7 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,unit=1
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/peripheral-anon/device[N]
|
||||
@@ -467,6 +482,7 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
dev: floppy, id ""
|
||||
unit = 0 (0x0)
|
||||
@@ -481,6 +497,7 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qco
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/peripheral-anon/device[N]
|
||||
@@ -531,6 +548,7 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
dev: floppy, id ""
|
||||
unit = 0 (0x0)
|
||||
@@ -545,6 +563,7 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -586,6 +605,7 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
dev: floppy, id ""
|
||||
unit = 0 (0x0)
|
||||
@@ -600,6 +620,7 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -641,6 +662,7 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
dev: floppy, id ""
|
||||
unit = 1 (0x1)
|
||||
@@ -655,6 +677,7 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -696,6 +719,7 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
dev: floppy, id ""
|
||||
unit = 1 (0x1)
|
||||
@@ -710,6 +734,7 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.qcow2.2 -device fl
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -760,6 +785,7 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
dev: floppy, id ""
|
||||
unit = 0 (0x0)
|
||||
@@ -774,6 +800,7 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -815,6 +842,7 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
dev: floppy, id ""
|
||||
unit = 0 (0x0)
|
||||
@@ -829,6 +857,7 @@ Testing: -drive if=floppy,file=TEST_DIR/t.qcow2 -drive if=none,file=TEST_DIR/t.q
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/unattached/device[N]
|
||||
@@ -876,6 +905,7 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -global floppy.drive=none0 -device
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/peripheral-anon/device[N]
|
||||
@@ -942,6 +972,7 @@ Testing: -device floppy
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "288"
|
||||
|
||||
Testing: -device floppy,drive-type=120
|
||||
@@ -968,6 +999,7 @@ Testing: -device floppy,drive-type=120
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "120"
|
||||
|
||||
Testing: -device floppy,drive-type=144
|
||||
@@ -994,6 +1026,7 @@ Testing: -device floppy,drive-type=144
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
|
||||
Testing: -device floppy,drive-type=288
|
||||
@@ -1020,6 +1053,7 @@ Testing: -device floppy,drive-type=288
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "288"
|
||||
|
||||
|
||||
@@ -1049,6 +1083,7 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,drive-t
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "120"
|
||||
none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/peripheral-anon/device[N]
|
||||
@@ -1085,6 +1120,7 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,drive-t
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "288"
|
||||
none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/peripheral-anon/device[N]
|
||||
@@ -1124,6 +1160,7 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,logical
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/peripheral-anon/device[N]
|
||||
@@ -1160,6 +1197,7 @@ Testing: -drive if=none,file=TEST_DIR/t.qcow2 -device floppy,drive=none0,physica
|
||||
share-rw = false
|
||||
account-invalid = "auto"
|
||||
account-failed = "auto"
|
||||
+ stats-intervals = <null>
|
||||
drive-type = "144"
|
||||
none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2)
|
||||
Attached to: /machine/peripheral-anon/device[N]
|
||||
--
|
||||
2.47.3
|
||||
|
||||
291
kvm-qdev-Free-property-array-on-release.patch
Normal file
291
kvm-qdev-Free-property-array-on-release.patch
Normal file
@ -0,0 +1,291 @@
|
||||
From 97363c23acaa88f3a96e97fe7617496a3c48bc09 Mon Sep 17 00:00:00 2001
|
||||
From: Chandan Somani <csomani@redhat.com>
|
||||
Date: Thu, 8 Jan 2026 15:03:07 -0800
|
||||
Subject: [PATCH 2/2] qdev: Free property array on release
|
||||
|
||||
RH-Author: Chandan Somani <None>
|
||||
RH-MergeRequest: 467: block: enable stats-intervals for storage devices
|
||||
RH-Jira: RHEL-114231
|
||||
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
||||
RH-Commit: [2/2] f8b9e42543653e5a724175b73f25fa02593ff79d (csomani1/qemu-kvm)
|
||||
|
||||
Before this patch, users of the property array would free the
|
||||
array themselves in their cleanup functions. This causes
|
||||
inconsistencies where some users leak the array and some free them.
|
||||
|
||||
This patch makes it so that the property array's release function
|
||||
frees the property array (instead of just its elements). It fixes any
|
||||
leaks and requires less code.
|
||||
|
||||
DEFINE_PROP_ARRAY leakers that are fixed in this patch:
|
||||
ebpf-rss_fds in hw/net/virtio-net.c
|
||||
rnmi_irqvec, rnmi_excpvec in hw/riscv/riscv_hart.c
|
||||
common.display_modes in hw/display/apple-gfx-mmio.m
|
||||
common.display_modes in hw/display/apple-gfx-pci.m
|
||||
|
||||
Signed-off-by: Chandan Somani <csomani@redhat.com>
|
||||
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
|
||||
Link: https://lore.kernel.org/r/20260108230311.584141-2-csomani@redhat.com
|
||||
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
||||
---
|
||||
block/accounting.c | 1 -
|
||||
hw/core/qdev-properties.c | 21 ++++++++++-----------
|
||||
hw/input/stellaris_gamepad.c | 8 --------
|
||||
hw/intc/arm_gicv3_common.c | 8 --------
|
||||
hw/intc/rx_icu.c | 8 --------
|
||||
hw/misc/arm_sysctl.c | 2 --
|
||||
hw/misc/mps2-scc.c | 8 --------
|
||||
hw/net/rocker/rocker.c | 1 -
|
||||
hw/nvram/xlnx-efuse.c | 8 --------
|
||||
hw/nvram/xlnx-versal-efuse-ctrl.c | 1 -
|
||||
hw/virtio/virtio-iommu-pci.c | 8 --------
|
||||
11 files changed, 10 insertions(+), 64 deletions(-)
|
||||
|
||||
diff --git a/block/accounting.c b/block/accounting.c
|
||||
index 0933c61f3a..5cf51f029b 100644
|
||||
--- a/block/accounting.c
|
||||
+++ b/block/accounting.c
|
||||
@@ -73,7 +73,6 @@ bool block_acct_setup(BlockAcctStats *stats, enum OnOffAuto account_invalid,
|
||||
}
|
||||
block_acct_add_interval(stats, stats_intervals[i]);
|
||||
}
|
||||
- g_free(stats_intervals);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
|
||||
index b7e8a89ba5..0449226e00 100644
|
||||
--- a/hw/core/qdev-properties.c
|
||||
+++ b/hw/core/qdev-properties.c
|
||||
@@ -671,10 +671,8 @@ static Property array_elem_prop(Object *obj, const Property *parent_prop,
|
||||
|
||||
/*
|
||||
* Object property release callback for array properties: We call the
|
||||
- * underlying element's property release hook for each element.
|
||||
- *
|
||||
- * Note that it is the responsibility of the individual device's deinit
|
||||
- * to free the array proper.
|
||||
+ * underlying element's property release hook for each element and free the
|
||||
+ * property array.
|
||||
*/
|
||||
static void release_prop_array(Object *obj, const char *name, void *opaque)
|
||||
{
|
||||
@@ -684,15 +682,16 @@ static void release_prop_array(Object *obj, const char *name, void *opaque)
|
||||
char *elem = *arrayptr;
|
||||
int i;
|
||||
|
||||
- if (!prop->arrayinfo->release) {
|
||||
- return;
|
||||
+ if (prop->arrayinfo->release) {
|
||||
+ for (i = 0; i < *alenptr; i++) {
|
||||
+ Property elem_prop = array_elem_prop(obj, prop, name, elem);
|
||||
+ prop->arrayinfo->release(obj, NULL, &elem_prop);
|
||||
+ elem += prop->arrayfieldsize;
|
||||
+ }
|
||||
}
|
||||
|
||||
- for (i = 0; i < *alenptr; i++) {
|
||||
- Property elem_prop = array_elem_prop(obj, prop, name, elem);
|
||||
- prop->arrayinfo->release(obj, NULL, &elem_prop);
|
||||
- elem += prop->arrayfieldsize;
|
||||
- }
|
||||
+ g_clear_pointer(arrayptr, g_free);
|
||||
+ *alenptr = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
diff --git a/hw/input/stellaris_gamepad.c b/hw/input/stellaris_gamepad.c
|
||||
index fec1161c9c..207064dacb 100644
|
||||
--- a/hw/input/stellaris_gamepad.c
|
||||
+++ b/hw/input/stellaris_gamepad.c
|
||||
@@ -63,13 +63,6 @@ static void stellaris_gamepad_realize(DeviceState *dev, Error **errp)
|
||||
qemu_input_handler_register(dev, &stellaris_gamepad_handler);
|
||||
}
|
||||
|
||||
-static void stellaris_gamepad_finalize(Object *obj)
|
||||
-{
|
||||
- StellarisGamepad *s = STELLARIS_GAMEPAD(obj);
|
||||
-
|
||||
- g_free(s->keycodes);
|
||||
-}
|
||||
-
|
||||
static void stellaris_gamepad_reset_enter(Object *obj, ResetType type)
|
||||
{
|
||||
StellarisGamepad *s = STELLARIS_GAMEPAD(obj);
|
||||
@@ -98,7 +91,6 @@ static const TypeInfo stellaris_gamepad_info[] = {
|
||||
.name = TYPE_STELLARIS_GAMEPAD,
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(StellarisGamepad),
|
||||
- .instance_finalize = stellaris_gamepad_finalize,
|
||||
.class_init = stellaris_gamepad_class_init,
|
||||
},
|
||||
};
|
||||
diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c
|
||||
index e438d8c042..4fc84741a8 100644
|
||||
--- a/hw/intc/arm_gicv3_common.c
|
||||
+++ b/hw/intc/arm_gicv3_common.c
|
||||
@@ -488,13 +488,6 @@ static void arm_gicv3_common_realize(DeviceState *dev, Error **errp)
|
||||
s->itslist = g_ptr_array_new();
|
||||
}
|
||||
|
||||
-static void arm_gicv3_finalize(Object *obj)
|
||||
-{
|
||||
- GICv3State *s = ARM_GICV3_COMMON(obj);
|
||||
-
|
||||
- g_free(s->redist_region_count);
|
||||
-}
|
||||
-
|
||||
static void arm_gicv3_common_reset_hold(Object *obj, ResetType type)
|
||||
{
|
||||
GICv3State *s = ARM_GICV3_COMMON(obj);
|
||||
@@ -643,7 +636,6 @@ static const TypeInfo arm_gicv3_common_type = {
|
||||
.instance_size = sizeof(GICv3State),
|
||||
.class_size = sizeof(ARMGICv3CommonClass),
|
||||
.class_init = arm_gicv3_common_class_init,
|
||||
- .instance_finalize = arm_gicv3_finalize,
|
||||
.abstract = true,
|
||||
.interfaces = (const InterfaceInfo[]) {
|
||||
{ TYPE_ARM_LINUX_BOOT_IF },
|
||||
diff --git a/hw/intc/rx_icu.c b/hw/intc/rx_icu.c
|
||||
index f8615527b7..85da0624f6 100644
|
||||
--- a/hw/intc/rx_icu.c
|
||||
+++ b/hw/intc/rx_icu.c
|
||||
@@ -334,13 +334,6 @@ static void rxicu_init(Object *obj)
|
||||
sysbus_init_irq(d, &icu->_swi);
|
||||
}
|
||||
|
||||
-static void rxicu_fini(Object *obj)
|
||||
-{
|
||||
- RXICUState *icu = RX_ICU(obj);
|
||||
- g_free(icu->map);
|
||||
- g_free(icu->init_sense);
|
||||
-}
|
||||
-
|
||||
static const VMStateDescription vmstate_rxicu = {
|
||||
.name = "rx-icu",
|
||||
.version_id = 1,
|
||||
@@ -382,7 +375,6 @@ static const TypeInfo rxicu_info = {
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(RXICUState),
|
||||
.instance_init = rxicu_init,
|
||||
- .instance_finalize = rxicu_fini,
|
||||
.class_init = rxicu_class_init,
|
||||
};
|
||||
|
||||
diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c
|
||||
index 0f4e37cd47..e715ff9475 100644
|
||||
--- a/hw/misc/arm_sysctl.c
|
||||
+++ b/hw/misc/arm_sysctl.c
|
||||
@@ -618,9 +618,7 @@ static void arm_sysctl_finalize(Object *obj)
|
||||
{
|
||||
arm_sysctl_state *s = ARM_SYSCTL(obj);
|
||||
|
||||
- g_free(s->db_voltage);
|
||||
g_free(s->db_clock);
|
||||
- g_free(s->db_clock_reset);
|
||||
}
|
||||
|
||||
static const Property arm_sysctl_properties[] = {
|
||||
diff --git a/hw/misc/mps2-scc.c b/hw/misc/mps2-scc.c
|
||||
index a9a5d4a535..acb0f5773b 100644
|
||||
--- a/hw/misc/mps2-scc.c
|
||||
+++ b/hw/misc/mps2-scc.c
|
||||
@@ -405,13 +405,6 @@ static void mps2_scc_realize(DeviceState *dev, Error **errp)
|
||||
s->oscclk = g_new0(uint32_t, s->num_oscclk);
|
||||
}
|
||||
|
||||
-static void mps2_scc_finalize(Object *obj)
|
||||
-{
|
||||
- MPS2SCC *s = MPS2_SCC(obj);
|
||||
-
|
||||
- g_free(s->oscclk_reset);
|
||||
-}
|
||||
-
|
||||
static bool cfg7_needed(void *opaque)
|
||||
{
|
||||
MPS2SCC *s = opaque;
|
||||
@@ -489,7 +482,6 @@ static const TypeInfo mps2_scc_info = {
|
||||
.parent = TYPE_SYS_BUS_DEVICE,
|
||||
.instance_size = sizeof(MPS2SCC),
|
||||
.instance_init = mps2_scc_init,
|
||||
- .instance_finalize = mps2_scc_finalize,
|
||||
.class_init = mps2_scc_class_init,
|
||||
};
|
||||
|
||||
diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
|
||||
index cc49701dd3..cbc7bd3ed9 100644
|
||||
--- a/hw/net/rocker/rocker.c
|
||||
+++ b/hw/net/rocker/rocker.c
|
||||
@@ -1429,7 +1429,6 @@ static void pci_rocker_uninit(PCIDevice *dev)
|
||||
world_free(r->worlds[i]);
|
||||
}
|
||||
}
|
||||
- g_free(r->fp_ports_peers);
|
||||
}
|
||||
|
||||
static void rocker_reset(DeviceState *dev)
|
||||
diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c
|
||||
index 4c23f8b931..1875fdb953 100644
|
||||
--- a/hw/nvram/xlnx-efuse.c
|
||||
+++ b/hw/nvram/xlnx-efuse.c
|
||||
@@ -224,13 +224,6 @@ static void efuse_realize(DeviceState *dev, Error **errp)
|
||||
}
|
||||
}
|
||||
|
||||
-static void efuse_finalize(Object *obj)
|
||||
-{
|
||||
- XlnxEFuse *s = XLNX_EFUSE(obj);
|
||||
-
|
||||
- g_free(s->ro_bits);
|
||||
-}
|
||||
-
|
||||
static void efuse_prop_set_drive(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
@@ -288,7 +281,6 @@ static const TypeInfo efuse_info = {
|
||||
.name = TYPE_XLNX_EFUSE,
|
||||
.parent = TYPE_DEVICE,
|
||||
.instance_size = sizeof(XlnxEFuse),
|
||||
- .instance_finalize = efuse_finalize,
|
||||
.class_init = efuse_class_init,
|
||||
};
|
||||
|
||||
diff --git a/hw/nvram/xlnx-versal-efuse-ctrl.c b/hw/nvram/xlnx-versal-efuse-ctrl.c
|
||||
index 9096219800..ec86a7d6e5 100644
|
||||
--- a/hw/nvram/xlnx-versal-efuse-ctrl.c
|
||||
+++ b/hw/nvram/xlnx-versal-efuse-ctrl.c
|
||||
@@ -729,7 +729,6 @@ static void efuse_ctrl_finalize(Object *obj)
|
||||
XlnxVersalEFuseCtrl *s = XLNX_VERSAL_EFUSE_CTRL(obj);
|
||||
|
||||
register_finalize_block(s->reg_array);
|
||||
- g_free(s->extra_pg0_lock_spec);
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_efuse_ctrl = {
|
||||
diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c
|
||||
index 8123c6f83a..9396b3c07e 100644
|
||||
--- a/hw/virtio/virtio-iommu-pci.c
|
||||
+++ b/hw/virtio/virtio-iommu-pci.c
|
||||
@@ -94,18 +94,10 @@ static void virtio_iommu_pci_instance_init(Object *obj)
|
||||
TYPE_VIRTIO_IOMMU);
|
||||
}
|
||||
|
||||
-static void virtio_iommu_pci_instance_finalize(Object *obj)
|
||||
-{
|
||||
- VirtIOIOMMUPCI *dev = VIRTIO_IOMMU_PCI(obj);
|
||||
-
|
||||
- g_free(dev->vdev.prop_resv_regions);
|
||||
-}
|
||||
-
|
||||
static const VirtioPCIDeviceTypeInfo virtio_iommu_pci_info = {
|
||||
.generic_name = TYPE_VIRTIO_IOMMU_PCI,
|
||||
.instance_size = sizeof(VirtIOIOMMUPCI),
|
||||
.instance_init = virtio_iommu_pci_instance_init,
|
||||
- .instance_finalize = virtio_iommu_pci_instance_finalize,
|
||||
.class_init = virtio_iommu_pci_class_init,
|
||||
};
|
||||
|
||||
--
|
||||
2.47.3
|
||||
|
||||
@ -158,7 +158,7 @@ Obsoletes: %{name}-block-ssh <= %{epoch}:%{version} \
|
||||
Summary: QEMU is a machine emulator and virtualizer
|
||||
Name: qemu-kvm
|
||||
Version: 10.1.0
|
||||
Release: 16%{?rcrel}%{?dist}%{?cc_suffix}.alma.1
|
||||
Release: 17%{?rcrel}%{?dist}%{?cc_suffix}.alma.1
|
||||
# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped
|
||||
# Epoch 15 used for RHEL 8
|
||||
# Epoch 17 used for RHEL 9 (due to release versioning offset in RHEL 8.5)
|
||||
@ -437,6 +437,10 @@ Patch132: kvm-linux-aio-Resubmit-tails-of-short-reads-writes.patch
|
||||
Patch133: kvm-block-io_uring-avoid-potentially-getting-stuck-after.patch
|
||||
# For RHEL-158224 - qemu-kvm: disk writes of fewer bytes than requested is a retry condition, not necessarily an indication of ENOSPC [rhel-10.2]
|
||||
Patch134: kvm-io-uring-Resubmit-tails-of-short-writes.patch
|
||||
# For RHEL-114231 - Add stats-intervals support to --blockdev
|
||||
Patch135: kvm-block-enable-stats-intervals-for-storage-devices.patch
|
||||
# For RHEL-114231 - Add stats-intervals support to --blockdev
|
||||
Patch136: kvm-qdev-Free-property-array-on-release.patch
|
||||
|
||||
# AlmaLinux Patch
|
||||
Patch2001: 2001-Add-ppc64-support.patch
|
||||
@ -1565,12 +1569,18 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Tue Mar 31 2026 Eduard Abdullin <eabdullin@almalinux.org> - 18:10.1.0-16.alma.1
|
||||
* Wed Apr 22 2026 Eduard Abdullin <eabdullin@almalinux.org> - 18:10.1.0-17.alma.1
|
||||
- Enable QXL device build
|
||||
- Enable building for ppc64le
|
||||
- Re-added Spice support
|
||||
- Don't remove slof.bin for ppc64le
|
||||
|
||||
* Tue Apr 21 2026 Miroslav Rezanina <mrezanin@redhat.com> - 10.1.0-17
|
||||
- kvm-block-enable-stats-intervals-for-storage-devices.patch [RHEL-114231]
|
||||
- kvm-qdev-Free-property-array-on-release.patch [RHEL-114231]
|
||||
- Resolves: RHEL-114231
|
||||
(Add stats-intervals support to --blockdev)
|
||||
|
||||
* Mon Mar 30 2026 Miroslav Rezanina <mrezanin@redhat.com> - 10.1.0-16
|
||||
- kvm-linux-aio-Put-all-parameters-into-qemu_laiocb.patch [RHEL-158224]
|
||||
- kvm-linux-aio-Resubmit-tails-of-short-reads-writes.patch [RHEL-158224]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user