[libvirt][PATCH] qemu_nbdkit.c: use %llu to print time_t
by Qi.Chen@windriver.com
From: Chen Qi <Qi.Chen(a)windriver.com>
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.
Signed-off-by: Chen Qi <Qi.Chen(a)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
8 months, 1 week
Release of libvirt-10.7.0
by Jiri Denemark
The 10.7.0 release of both libvirt and libvirt-python is tagged and
signed tarballs are available at
https://download.libvirt.org/
https://download.libvirt.org/python/
Thanks everybody who helped with this release by sending patches,
reviewing, testing, or providing feedback. Your work is greatly
appreciated.
* Security
* CVE-2024-8235: Crash of ``virtinterfaced`` via ``virConnectListInterfaces()``
A refactor of the code fetching the list of interfaces for multiple APIs
introduced corner case on platforms where allocating 0 bytes of memory
results in a NULL pointer.
This corner case would lead to a NULL-pointer dereference and subsequent
crash of ``virtinterfaced`` if ``virConnectListInterfaces()`` is called
requesting 0 networks to be filled.
The bug was introduced in libvirt-10.4.0
* New features
* qemu: Introduce the ability to disable the built-in PS/2 controller
It is now possible to control the state of the ``ps2`` feature in the
domain XML for descendants of the generic PC machine type (``i440fx``,
``q35``, ``xenfv`` and ``isapc``).
* Improvements
* ch: support restore with network devices
Cloud-Hypervisor starting from V40.0 supports restoring file descriptor
backed network devices. So, create new net fds and pass them via
SCM_RIGHTS to CH during restore operation.
* ch: support basic networking modes
Cloud-Hypervisor driver now supports Ethernet, Network (NAT) and Bridge
networking modes.
Enjoy.
Jirka
8 months, 1 week
Changing permissions for /var/lib/libvirt/images/
by Lee Garrett
Hi everyone,
while using virt-v2v I've hit an issue [0], where essentially virt-v2v fails as
non-root user, due to /var/lib/libvirt/images/ belonging to root:root. I
proposed to change the ownership to root:libvirt, and permission bits to
ug=rwx,o=x, as that would allow users of the libvirt group to use virt-v2v
without running as root.
My questions here are: Are there any downsides to this? AFAICS users of the
libvirt group are allowed changed images via the libvirt API anyway, so from the
security standpoint there should be no change. And if there are none, can we
change the upstream default to those permissions?
Thanks in advance,
Lee
P.S.: Keep me CCed, I'm off-list.
[0] downstream Debian bug with more details: https://bugs.debian.org/1054230
8 months, 1 week