mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
virSystemdCreateMachine: Use proper format string for uint64_t when constructing gvariant
g_variant_new_parsed uses '%t' for a uint64_t rather than printf-like %llu. Additionally ensure that the passed value is a uint64_t since the argument used is a 'unsigned int'. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1937287 Fixes: bf5f2ed09c2 Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
d380dd0efd
commit
07c6e493b2
@ -519,11 +519,12 @@ int virSystemdCreateMachine(const char *name,
|
||||
}
|
||||
|
||||
if (maxthreads > 0) {
|
||||
uint64_t max = maxthreads;
|
||||
|
||||
if (!(scopename = virSystemdMakeScopeName(name, drivername, false)))
|
||||
return -1;
|
||||
|
||||
gprops = g_variant_new_parsed("[('TasksMax', <%llu>)]",
|
||||
(uint64_t)maxthreads);
|
||||
gprops = g_variant_new_parsed("[('TasksMax', <%t>)]", max);
|
||||
|
||||
message = g_variant_new("(sb@a(sv))",
|
||||
scopename,
|
||||
|
Loading…
x
Reference in New Issue
Block a user