Trivial patches for 2026-06-12
Subsystems (2)
The following changes since commit 193963218accbcf65f28ab1efa773ac6d1cc634c:
Merge tag 'pull-ufs-20260612' of https://gitlab.com/jeuk20.kim/qemu into staging (2026-06-12 09:01:07 -0400)
are available in the Git repository at:
https://gitlab.com/mjt0k/qemu.git tags/pull-trivial-patches
for you to fetch changes up to 2a57339f89f47b4b1686f419fa2bbd6c0ea6e016:
qemu-options: fix typo in spelling of 'scheduler' (2026-06-12 19:43:21 +0300)
----------------------------------------------------------------
trivial patches for 2026-06-12
a few small things here and there.
the hostfwd one hasn't been reviewed for a few months, but it's simple enough.
----------------------------------------------------------------
Ajinkya Udgirkar (1):
hw/xtensa: replace calloc with g_new0 in mx_pic
Ani Sinha (1):
igvm: spit out region size on error
BALATON Zoltan (1):
hw/display/vga: Fix debug message
Evgeny Kolmakov (2):
net/colo-compare: Use QEMU_LOCK_GUARD to simplify mutex handling block/io: Use QEMU_LOCK_GUARD to simplify mutex handling
Fiona Ebner (1):
qemu-options: fix typo in spelling of 'scheduler'
Michael Tokarev (1):
net/slirp: allow hostfwd socket paths with dashes
Thomas Huth (1):
system/rtc: Fix a possible year-2038 integer overflow problem
backends/igvm.c | 4 ++-- block/io.c | 4 +--- hw/display/vga.c | 2 +- hw/xtensa/mx_pic.c | 2 +- net/colo-compare.c | 8 ++------ net/slirp.c | 5 +++-- qemu-options.hx | 4 ++-- system/rtc.c | 4 ++-- 8 files changed, 14 insertions(+), 19 deletions(-)
[PULL 2/8] hw/display/vga: Fix debug message
From: BALATON Zoltan <[email protected]>
--- hw/display/vga.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/display/vga.c +1 -1
@@ -1662,7 +1662,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update)#if 0 printf ("w=%d h=%d v=%d line_offset=%d cr[0x09]=0x%02x cr[0x17]=0x%02x linecmp=%d sr[0x01]=0x%02x\n" , - width, height, v, line_offset, s->cr[9 ], s->cr[VGA_CRTC_MODE ], + width, height, v, s->params.line_offset, s->cr[9 ], s->cr[VGA_CRTC_MODE ], s->params.line_compare,sr (s,VGA_SEQ_CLOCK_MODE ));#endif addr1 = (s->params.start_addr *4 );
Signature · 1 line
2.47.3
[PULL 3/8] system/rtc: Fix a possible year-2038 integer overflow problem
In reply to Michael TokarevFrom: Thomas Huth <[email protected]>
rtc_realtime_clock_offset is initialized with:
rtc_realtime_clock_offset = qemu_clock_get_ms(QEMU_CLOCK_REALTIME) / 1000;
And QEMU_CLOCK_REALTIME might be based on gettimeofday() in certain cases (see get_clock_realtime() in include/qemu/timer.h). So this counter will exceed 32 bits in the year 2038, thus we should not store this value in a normal integer variable. Change it to a time_t to fix the problem.
And while we're at it, also adjust the nearby rtc_host_datetime_offset variable to be on the safe side in the related code.
--- system/rtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
system/rtc.c +2 -2
@@ -41,8 +41,8 @@ static enum {RTC_BASE_DATETIME , } rtc_base_type = RTC_BASE_UTC;static time_t rtc_ref_start_datetime; -static int rtc_realtime_clock_offset;/* used only with QEMU_CLOCK_REALTIME */ -static int rtc_host_datetime_offset =-1 ;/* valid & used only with +static time_t rtc_realtime_clock_offset;/* used only with QEMU_CLOCK_REALTIME */ +static time_t rtc_host_datetime_offset =-1 ;/* valid & used only with RTC_BASE_DATETIME */ QEMUClockType rtc_clock;/***********************************************************/
Signature · 1 line
2.47.3
[PULL 1/8] net/slirp: allow hostfwd socket paths with dashes
In reply to Michael TokarevThe format of hostfwd parameter is:
hostfwd=hostpart-guestaddr:guestport
so a minus sign can not be part of the hostpart.
If hostpart specifies a unix socket path, this becomes problematic.
To solve this, look for the LAST minus/dash char in the string, not first.
Unfortunately, [-guestaddr] is optional (defaults to 10.0.0.15), so we still can't parse the thing in an uniform way.
Extend get_str_sep() to accept negative separator to indicate searching from the end of buffer, to find the last occurence. Update slirp_hostfwd to search for the last separator when parsing unix domain socket path.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/347
--- net/slirp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
net/slirp.c +3 -2
@@ -54,7 +54,8 @@ static int get_str_sep(char *buf, int buf_size, const char **pp, int sep)const char *p, *p1;int len; p = *pp; - p1 =strchr (p, sep); +/* negative sep means to search -sep from the end of buf */ + p1 = sep >=0 ?strchr (p, sep) :strrchr (p, -sep);if (!p1)return -1 ; len = p1 - p;
@@ -848,7 +849,7 @@ static int slirp_hostfwd(SlirpState *s, const char *redir_str, Error **errp)#if !defined(WIN32 ) &&SLIRP_CHECK_VERSION (4 ,7 ,0 )if (is_unix) { -if (get_str_sep (buf,sizeof (buf), &p,'-' ) <0 ) { +if (get_str_sep (buf,sizeof (buf), &p,0 -'-' ) <0 ) { fail_reason ="Missing - separator" ; goto fail_syntax; }
Signature · 1 line
2.47.3
[PULL 7/8] igvm: spit out region size on error
In reply to Michael TokarevFrom: Ani Sinha <[email protected]>
This change makes the error message provide more details on the values that caused the error. Cosmetic, no functional change. Only useful for debugging purpose.
--- backends/igvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
backends/igvm.c +2 -2
@@ -198,8 +198,8 @@ static void *qigvm_prepare_memory(QIgvm *ctx, uint64_t addr, uint64_t size,error_setg ( errp,"Processing of IGVM file failed: Could not prepare memory " -"at address 0x%" PRIx64": region size exceeded" , - addr); +"at address 0x%" PRIx64": region size 0x%" PRIx64" exceeded" , + addr, size);return NULL ; }return qemu_map_ram_ptr (mrs.mr->ram_block, mrs.offset_within_region);
Signature · 1 line
2.47.3
[PULL 8/8] qemu-options: fix typo in spelling of 'scheduler'
In reply to Michael TokarevFrom: Fiona Ebner <[email protected]>
--- qemu-options.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
qemu-options.hx +2 -2
@@ -5517,7 +5517,7 @@ DEF("sandbox", HAS_ARG, QEMU_OPTION_sandbox, \ " main QEMU process but will allow forks and execves to run unprivileged\n" \ " use 'spawn' to avoid QEMU to spawn new threads or processes by\n" \ " blocking *fork and execve\n" \ - " use 'resourcecontrol' to disable process affinity and schedular priority\n", + " use 'resourcecontrol' to disable process affinity and scheduler priority\n", QEMU_ARCH_ALL) SRST ``-sandbox arg[,obsolete=string][,elevateprivileges=string][,spawn=string][,resourcecontrol=string]``
@@ -5534,7 +5534,7 @@ SRST Disable \*fork and execve ``resourcecontrol=string`` - Disable process affinity and schedular priority + Disable process affinity and scheduler priority ERST DEF("readconfig", HAS_ARG, QEMU_OPTION_readconfig,
Signature · 1 line
2.47.3
[PULL 5/8] block/io: Use QEMU_LOCK_GUARD to simplify mutex handling
In reply to Michael TokarevFrom: Evgeny Kolmakov <[email protected]>
Replace qemu_mutex_(un)lock() calls with QEMU_LOCK_GUARD().
--- block/io.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
block/io.c +1 -3
@@ -719,14 +719,12 @@ BdrvTrackedRequest *coroutine_fn bdrv_co_get_self_request(BlockDriverState *bs)Coroutine *self =qemu_coroutine_self ();IO_CODE (); -qemu_mutex_lock (&bs->reqs_lock); +QEMU_LOCK_GUARD (&bs->reqs_lock); QLIST_FOREACH(req, &bs->tracked_requests, list) {if (req->co == self) { -qemu_mutex_unlock (&bs->reqs_lock);return req; } } -qemu_mutex_unlock (&bs->reqs_lock);return NULL ; }
Signature · 1 line
2.47.3
[PULL 4/8] net/colo-compare: Use QEMU_LOCK_GUARD to simplify mutex handling
In reply to Michael TokarevFrom: Evgeny Kolmakov <[email protected]>
Replace qemu_mutex_(un)lock() calls with the QEMU_LOCK_GUARD().
--- net/colo-compare.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
net/colo-compare.c +2 -6
@@ -902,14 +902,13 @@ static void check_old_packet_regular(void *opaque)void colo_notify_compares_event (void *opaque,int event,Error **errp) {CompareState *s; -qemu_mutex_lock (&colo_compare_mutex); +QEMU_LOCK_GUARD (&colo_compare_mutex);if (!colo_compare_active) { -qemu_mutex_unlock (&colo_compare_mutex);return ; } -qemu_mutex_lock (&event_mtx); +QEMU_LOCK_GUARD (&event_mtx); QTAILQ_FOREACH(s, &net_compares, next) { s->event = event;qemu_bh_schedule (s->event_bh);
@@ -919,9 +918,6 @@ void colo_notify_compares_event(void *opaque, int event, Error **errp)while (event_unhandled_count >0 ) {qemu_cond_wait (&event_complete_cond, &event_mtx); } - -qemu_mutex_unlock (&event_mtx); -qemu_mutex_unlock (&colo_compare_mutex); }static void colo_compare_timer_init (CompareState *s)
Signature · 1 line
2.47.3
[PULL 6/8] hw/xtensa: replace calloc with g_new0 in mx_pic
In reply to Michael TokarevFrom: Ajinkya Udgirkar <[email protected]>
Replace libc calloc() with GLib g_new0() for consistency with the rest of the QEMU codebase. g_new0() aborts on allocation failure rather than returning NULL, which matches QEMU's allocation policy.
--- hw/xtensa/mx_pic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/xtensa/mx_pic.c +1 -1
@@ -343,7 +343,7 @@ static void xtensa_mx_pic_set_irq(void *opaque, int irq, int active)XtensaMxPic *xtensa_mx_pic_init (unsigned n_irq) { -XtensaMxPic *mx =calloc (1 ,sizeof (XtensaMxPic)); +XtensaMxPic *mx =g_new0 (XtensaMxPic,1 ); mx->n_irq = n_irq +1 ; mx->irq_inputs = qemu_allocate_irqs(xtensa_mx_pic_set_irq, mx,
Signature · 1 line
2.47.3
Stefan Hajnoczi
AppliedApplied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/11.1 for any user-visible changes.