From: Bruce Ashfield <bruce.ashfield@gmail.com>
To: Qi.Chen@windriver.com
Cc: meta-virtualization@lists.yoctoproject.org
Subject: Re: [meta-virtualization][PATCH] libvirt: fix build on qemuarm
Date: Thu, 5 Sep 2024 19:41:08 +0000 [thread overview]
Message-ID: <ZtoJVIj3GSDD1qEM@gmail.com> (raw)
In-Reply-To: <20240904013050.1629475-1-Qi.Chen@windriver.com>
I'm not sure that I want to support libvirt on qemuarm .. but
since the patch isn't too complicated, I've gone ahead and
merged it
Bruce
In message: [meta-virtualization][PATCH] libvirt: fix build on qemuarm
on 03/09/2024 Chen Qi via lists.yoctoproject.org wrote:
> From: Chen Qi <Qi.Chen@windriver.com>
>
> On qemuarm, time_t is 'long long int', so using '%lu' to print
> it out will give us the following error:
>
> error: format '%lu' expects argument of type 'long unsigned int',
> but argument 10 has type 'time_t' {aka 'long long int'} [-Werror=format=]
>
> So use %llu to print it out.
>
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
> ...emu_nbdkit.c-use-llu-to-print-time_t.patch | 76 +++++++++++++++++++
> recipes-extended/libvirt/libvirt_git.bb | 1 +
> 2 files changed, 77 insertions(+)
> create mode 100644 recipes-extended/libvirt/libvirt/0001-qemu_nbdkit.c-use-llu-to-print-time_t.patch
>
> diff --git a/recipes-extended/libvirt/libvirt/0001-qemu_nbdkit.c-use-llu-to-print-time_t.patch b/recipes-extended/libvirt/libvirt/0001-qemu_nbdkit.c-use-llu-to-print-time_t.patch
> new file mode 100644
> index 00000000..7263666a
> --- /dev/null
> +++ b/recipes-extended/libvirt/libvirt/0001-qemu_nbdkit.c-use-llu-to-print-time_t.patch
> @@ -0,0 +1,76 @@
> +From c4636402c06ab5ae436176daf0ef17005346e27d Mon Sep 17 00:00:00 2001
> +From: Chen Qi <Qi.Chen@windriver.com>
> +Date: Mon, 2 Sep 2024 22:15:51 -0700
> +Subject: [PATCH] qemu_nbdkit.c: use %llu to print time_t
> +
> +Use %lu to print time_t will give use the following error:
> +
> + error: format '%lu' expects argument of type 'long unsigned int',
> + but argument 10 has type 'time_t' {aka 'long long int'} [-Werror=format=]
> +
> +So use %llu to print time_t.
> +
> +Upstream-Status: Submitted [https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/FQSQMML6VWMHNWBYP67OLCUTJY5LJQST/]
> +
> +Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> +---
> + src/qemu/qemu_nbdkit.c | 24 ++++++++++++------------
> + 1 file changed, 12 insertions(+), 12 deletions(-)
> +
> +diff --git a/src/qemu/qemu_nbdkit.c b/src/qemu/qemu_nbdkit.c
> +index f099f35e1e..fe660c78e5 100644
> +--- a/src/qemu/qemu_nbdkit.c
> ++++ b/src/qemu/qemu_nbdkit.c
> +@@ -544,18 +544,18 @@ qemuNbdkitCapsFormatCache(qemuNbdkitCaps *nbdkitCaps)
> +
> + virBufferEscapeString(&buf, "<path>%s</path>\n",
> + nbdkitCaps->path);
> +- virBufferAsprintf(&buf, "<nbdkitctime>%lu</nbdkitctime>\n",
> +- nbdkitCaps->ctime);
> ++ virBufferAsprintf(&buf, "<nbdkitctime>%llu</nbdkitctime>\n",
> ++ (long long)nbdkitCaps->ctime);
> + virBufferEscapeString(&buf, "<plugindir>%s</plugindir>\n",
> + nbdkitCaps->pluginDir);
> +- virBufferAsprintf(&buf, "<plugindirmtime>%lu</plugindirmtime>\n",
> +- nbdkitCaps->pluginDirMtime);
> ++ virBufferAsprintf(&buf, "<plugindirmtime>%llu</plugindirmtime>\n",
> ++ (long long)nbdkitCaps->pluginDirMtime);
> + virBufferEscapeString(&buf, "<filterdir>%s</filterdir>\n",
> + nbdkitCaps->filterDir);
> +- virBufferAsprintf(&buf, "<filterdirmtime>%lu</filterdirmtime>\n",
> +- nbdkitCaps->filterDirMtime);
> +- virBufferAsprintf(&buf, "<selfctime>%lu</selfctime>\n",
> +- nbdkitCaps->libvirtCtime);
> ++ virBufferAsprintf(&buf, "<filterdirmtime>%llu</filterdirmtime>\n",
> ++ (long long)nbdkitCaps->filterDirMtime);
> ++ virBufferAsprintf(&buf, "<selfctime>%llu</selfctime>\n",
> ++ (long long)nbdkitCaps->libvirtCtime);
> + virBufferAsprintf(&buf, "<selfvers>%u</selfvers>\n",
> + nbdkitCaps->libvirtVersion);
> +
> +@@ -593,10 +593,10 @@ virNbdkitCapsSaveFile(void *data,
> + return -1;
> + }
> +
> +- VIR_DEBUG("Saved caps '%s' for '%s' with (%lu, %lu)",
> ++ VIR_DEBUG("Saved caps '%s' for '%s' with (%llu, %llu)",
> + filename, nbdkitCaps->path,
> +- nbdkitCaps->ctime,
> +- nbdkitCaps->libvirtCtime);
> ++ (long long)nbdkitCaps->ctime,
> ++ (long long)nbdkitCaps->libvirtCtime);
> +
> + return 0;
> + }
> +@@ -1054,7 +1054,7 @@ qemuNbdkitProcessBuildCommandCurl(qemuNbdkitProcess *proc,
> + }
> +
> + if (proc->source->timeout > 0) {
> +- g_autofree char *timeout = g_strdup_printf("%llu", proc->source->timeout);
> ++ g_autofree char *timeout = g_strdup_printf("%llu", (long long)proc->source->timeout);
> + virCommandAddArgPair(cmd, "timeout", timeout);
> + }
> +
> +--
> +2.25.1
> +
> diff --git a/recipes-extended/libvirt/libvirt_git.bb b/recipes-extended/libvirt/libvirt_git.bb
> index 706d4a40..d57bdc11 100644
> --- a/recipes-extended/libvirt/libvirt_git.bb
> +++ b/recipes-extended/libvirt/libvirt_git.bb
> @@ -39,6 +39,7 @@ SRC_URI = "gitsm://github.com/libvirt/libvirt.git;name=libvirt;protocol=https;br
> file://0001-messon.build-remove-build-path-information-to-avoid-.patch \
> file://0001-meson.build-clear-abs_top_builddir-to-avoid-QA-warni.patch \
> file://0001-tests-meson-clear-absolute-directory-paths.patch \
> + file://0001-qemu_nbdkit.c-use-llu-to-print-time_t.patch \
> "
>
> S = "${WORKDIR}/git"
> --
> 2.25.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#8866): https://lists.yoctoproject.org/g/meta-virtualization/message/8866
> Mute This Topic: https://lists.yoctoproject.org/mt/108257527/1050810
> Group Owner: meta-virtualization+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
next prev parent reply other threads:[~2024-09-05 19:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-04 1:30 [meta-virtualization][PATCH] libvirt: fix build on qemuarm Qi.Chen
2024-09-05 19:41 ` Bruce Ashfield [this message]
2024-09-05 19:49 ` Khem Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZtoJVIj3GSDD1qEM@gmail.com \
--to=bruce.ashfield@gmail.com \
--cc=Qi.Chen@windriver.com \
--cc=meta-virtualization@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.