[libvirt PATCH] build: Make daemons depend on generated *_protocol.[ch]
by Jiri Denemark
This should fix build failures when a daemon code is compiled before the
included *_protocol.h headers are ready, such as:
FAILED: src/virtqemud.p/remote_remote_daemon_config.c.o
../src/remote/remote_daemon_config.c: In function ‘daemonConfigNew’:
../src/remote/remote_daemon_config.c:111:30: error:
‘REMOTE_AUTH_POLKIT’ undeclared (first use in this function)
111 | data->auth_unix_rw = REMOTE_AUTH_POLKIT;
| ^~~~~~~~~~~~~~~~~~
../src/remote/remote_daemon_config.c:111:30: note: each undeclared
identifier is reported only once for each function it appears in
../src/remote/remote_daemon_config.c:115:30: error:
‘REMOTE_AUTH_NONE’ undeclared (first use in this function)
115 | data->auth_unix_rw = REMOTE_AUTH_NONE;
| ^~~~~~~~~~~~~~~~
../src/remote/remote_daemon_config.c: In function
‘daemonConfigLoadOptions’:
../src/remote/remote_daemon_config.c:252:31: error:
‘REMOTE_AUTH_POLKIT’ undeclared (first use in this function)
252 | if (data->auth_unix_rw == REMOTE_AUTH_POLKIT) {
| ^~~~~~~~~~~~~~~~~~
or
FAILED: src/virtqemud.p/remote_remote_daemon_dispatch.c.o
In file included from ../src/remote/remote_daemon.h:28,
from ../src/remote/remote_daemon_dispatch.c:26:
src/remote/lxc_protocol.h:13:5: error:
unknown type name ‘remote_nonnull_domain’
13 | remote_nonnull_domain dom;
| ^~~~~~~~~~~~~~~~~~~~~
In file included from ../src/remote/remote_daemon.h:29,
from ../src/remote/remote_daemon_dispatch.c:26:
src/remote/qemu_protocol.h:13:5: error:
unknown type name ‘remote_nonnull_domain’
13 | remote_nonnull_domain dom;
| ^~~~~~~~~~~~~~~~~~~~~
src/remote/qemu_protocol.h:14:5: error:
unknown type name ‘remote_nonnull_string’
14 | remote_nonnull_string cmd;
| ^~~~~~~~~~~~~~~~~~~~~
...
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
Notes:
I couldn't check this patch actually fixes the error because the build
failure is non-deterministic and I cannot reproduce the failure now.
po/meson.build | 1 +
src/meson.build | 6 +++++-
src/remote/meson.build | 15 +++++++++++----
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/po/meson.build b/po/meson.build
index a20877ad34..592b254447 100644
--- a/po/meson.build
+++ b/po/meson.build
@@ -20,6 +20,7 @@ potfiles_dep = [
access_gen_sources,
admin_client_generated,
admin_driver_generated,
+ remote_protocol_generated,
remote_driver_generated,
remote_daemon_generated,
]
diff --git a/src/meson.build b/src/meson.build
index 6538c43628..f52d2d5994 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -616,7 +616,11 @@ foreach daemon : virt_daemons
bin = executable(
daemon['name'],
[
- daemon.get('sources', [ remote_daemon_sources, remote_daemon_generated ]),
+ daemon.get('sources', [
+ remote_protocol_generated,
+ remote_daemon_sources,
+ remote_daemon_generated
+ ]),
dtrace_gen_objects,
],
c_args: [
diff --git a/src/remote/meson.build b/src/remote/meson.build
index 681c709823..831acaaa01 100644
--- a/src/remote/meson.build
+++ b/src/remote/meson.build
@@ -7,8 +7,6 @@ remote_driver_generated = []
foreach name : [ 'remote', 'qemu', 'lxc' ]
client_bodies_h = '@0(a)_client_bodies.h'.format(name)
- protocol_c = '@0(a)_protocol.c'.format(name)
- protocol_h = '@0(a)_protocol.h'.format(name)
protocol_x = '@0(a)_protocol.x'.format(name)
remote_driver_generated += custom_target(
@@ -20,8 +18,16 @@ foreach name : [ 'remote', 'qemu', 'lxc' ]
],
capture: true,
)
+endforeach
- remote_driver_generated += custom_target(
+remote_protocol_generated = []
+
+foreach name : [ 'remote', 'qemu', 'lxc' ]
+ protocol_c = '@0(a)_protocol.c'.format(name)
+ protocol_h = '@0(a)_protocol.h'.format(name)
+ protocol_x = '@0(a)_protocol.x'.format(name)
+
+ remote_protocol_generated += custom_target(
protocol_h,
input: protocol_x,
output: protocol_h,
@@ -32,7 +38,7 @@ foreach name : [ 'remote', 'qemu', 'lxc' ]
],
)
- remote_driver_generated += custom_target(
+ remote_protocol_generated += custom_target(
protocol_c,
input: protocol_x,
output: protocol_c,
@@ -143,6 +149,7 @@ if conf.has('WITH_REMOTE')
remote_driver_lib = static_library(
'virt_remote_driver',
[
+ remote_protocol_generated,
remote_driver_sources,
remote_driver_generated,
],
--
2.43.0
11 months
[PATCH 0/3] qemu: migration: Fix allocation and release of NBD port
by Peter Krempa
See 2/3 for the bugfix
Peter Krempa (3):
util: virtportallocator: Add VIR_DEBUG statements for port allocations
and release
qemu: migration: Properly handle reservation of manually specified NBD
port
qemuMigrationDstStartNBDServer: Refactor cleanup
src/qemu/qemu_migration.c | 40 +++++++++++++------------------------
src/util/virportallocator.c | 9 +++++++++
2 files changed, 23 insertions(+), 26 deletions(-)
--
2.43.0
11 months
[PATCH] qemu_process: Skip over non-virtio NIC models when refreshing rx-filter
by Michal Privoznik
After guest is started, or we are reconnecting to already running
one (after daemon restart), qemuProcessRefreshRxFilters() is
called to refresh rx-filters (basically MAC addresses of guest
NICs) as they might have changed while we were not running (for
the case when reconnecting to an already running guest), or we
need to enable them by running a command (for freshly started
guest - see processNicRxFilterChangedEvent()).
Now, our XML parser allowed trustGuestRxFilters attribute for all
types and models of <interface/> while in reality, only virtio
model can see MAC address changes.
Fixes: 060d4c83ef436cf56abfad51a4d64c39448e199d
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_process.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 3563ad215c..a736846588 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7958,6 +7958,12 @@ qemuProcessRefreshRxFilters(virDomainObj *vm,
if (!virDomainNetGetActualTrustGuestRxFilters(def))
continue;
+ /* rx-filters are supported only for virtio macvtaps */
+ if (def->model != VIR_DOMAIN_NET_MODEL_VIRTIO ||
+ virDomainNetGetActualType(def) != VIR_DOMAIN_NET_TYPE_DIRECT) {
+ continue;
+ }
+
if (qemuDomainSyncRxFilter(vm, def, asyncJob) < 0)
return -1;
}
--
2.43.0
11 months
[PATCH 0/3] Allow reserving more memory for PCI controllers
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (3):
conf: Introduce @memReserve to <controller/>
qemu_validate: Restrict setting @memReserve only to some controllers
qemu_command: Generate mem-reserve for controllers
docs/formatdomain.rst | 6 +++++
src/conf/domain_conf.c | 9 +++++++
src/conf/domain_conf.h | 3 +++
src/conf/schemas/domaincommon.rng | 5 ++++
src/qemu/qemu_command.c | 3 +++
src/qemu/qemu_validate.c | 25 +++++++++++++++++++
.../q35-usb2.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/q35-usb2.xml | 2 +-
.../q35-usb2.x86_64-latest.xml | 2 +-
9 files changed, 54 insertions(+), 3 deletions(-)
--
2.41.0
11 months
[PATCH] Explicitly convert type to double to avoid losing precision
by Egor Makrushin
Division between integers will also be integer.
Thus, to preserve fractional part explicitly
convert first operand to double.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 28d54aab05 ("examples: Introduce domtop")
Signed-off-by: Egor Makrushin <emakrushin(a)astralinux.ru>
---
examples/c/domain/domtop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/c/domain/domtop.c b/examples/c/domain/domtop.c
index dd35ec8661..65663a1c39 100644
--- a/examples/c/domain/domtop.c
+++ b/examples/c/domain/domtop.c
@@ -224,7 +224,7 @@ print_cpu_usage(size_t cpu,
* performed has a bad effect on the precision, so instead of dividing
* @now_params and @then_params by 1000 and then multiplying again by
* 100, we divide only once by 10 and get the same result. */
- usage = (now_params[pos].value.ul - then_params[pos].value.ul) /
+ usage = (double)(now_params[pos].value.ul - then_params[pos].value.ul) /
(now - then) / 10;
if (delim)
--
2.30.2
11 months
[PATCH] conf: make virNetDevVPortProfileFormat() void
by Alexandra Diupina
In commit 4af3cbafdd0e31c5c5b20d57c4aaeb19efcb98bc
(Laine Stump <laine(a)redhat.com>, Tue Jul 31 14:36:51 2012 -0400)
the return -1 was removed and since then
virNetDevVPortProfileFormat() always returns 0,
so it is possible to make this function void
and remove return value checks.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Alexandra Diupina <adiupina(a)astralinux.ru>
---
src/conf/domain_conf.c | 8 ++++----
src/conf/netdev_vport_profile_conf.c | 10 +++++-----
src/conf/netdev_vport_profile_conf.h | 2 +-
src/conf/network_conf.c | 7 +++----
src/conf/virnetworkportdef.c | 4 ++--
5 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6211d2a51b..dac2584cf2 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -23767,8 +23767,8 @@ virDomainActualNetDefContentsFormat(virBuffer *buf,
if (virNetDevVlanFormat(virDomainNetGetActualVlan(def), buf) < 0)
return -1;
- if (virNetDevVPortProfileFormat(virDomainNetGetActualVirtPortProfile(def), buf) < 0)
- return -1;
+ virNetDevVPortProfileFormat(virDomainNetGetActualVirtPortProfile(def), buf);
+
if (virNetDevBandwidthFormat(virDomainNetGetActualBandwidth(def), 0, buf) < 0)
return -1;
virNetworkPortOptionsFormat(virDomainNetGetActualPortOptionsIsolated(def), buf);
@@ -24241,8 +24241,8 @@ virDomainNetDefFormat(virBuffer *buf,
if (virNetDevVlanFormat(&def->vlan, buf) < 0)
return -1;
- if (virNetDevVPortProfileFormat(def->virtPortProfile, buf) < 0)
- return -1;
+ virNetDevVPortProfileFormat(def->virtPortProfile, buf);
+
if (virNetDevBandwidthFormat(def->bandwidth, 0, buf) < 0)
return -1;
virNetworkPortOptionsFormat(def->isolatedPort, buf);
diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_profile_conf.c
index 59237e10de..032a3147d7 100644
--- a/src/conf/netdev_vport_profile_conf.c
+++ b/src/conf/netdev_vport_profile_conf.c
@@ -177,7 +177,7 @@ virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags)
}
-int
+void
virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
virBuffer *buf)
{
@@ -185,7 +185,7 @@ virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
bool noParameters;
if (!virtPort)
- return 0;
+ return;
noParameters = !(virtPort->managerID_specified ||
virtPort->typeID_specified ||
@@ -197,13 +197,13 @@ virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
type = virtPort->virtPortType;
if (type == VIR_NETDEV_VPORT_PROFILE_NONE) {
if (noParameters)
- return 0;
+ return;
virBufferAddLit(buf, "<virtualport>\n");
} else {
if (noParameters) {
virBufferAsprintf(buf, "<virtualport type='%s'/>\n",
virNetDevVPortTypeToString(type));
- return 0;
+ return;
} else {
virBufferAsprintf(buf, "<virtualport type='%s'>\n",
virNetDevVPortTypeToString(type));
@@ -255,5 +255,5 @@ virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
virBufferAddLit(buf, "/>\n");
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</virtualport>\n");
- return 0;
+ return;
}
diff --git a/src/conf/netdev_vport_profile_conf.h b/src/conf/netdev_vport_profile_conf.h
index 58b104610a..f710d34874 100644
--- a/src/conf/netdev_vport_profile_conf.h
+++ b/src/conf/netdev_vport_profile_conf.h
@@ -39,6 +39,6 @@ typedef enum {
virNetDevVPortProfile *
virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags);
-int
+void
virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort,
virBuffer *buf);
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 6f8a0d2d0b..ed2e72eddf 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -2213,8 +2213,8 @@ virPortGroupDefFormat(virBuffer *buf,
virBufferAdjustIndent(buf, 2);
if (virNetDevVlanFormat(&def->vlan, buf) < 0)
return -1;
- if (virNetDevVPortProfileFormat(def->virtPortProfile, buf) < 0)
- return -1;
+ virNetDevVPortProfileFormat(def->virtPortProfile, buf);
+
virNetDevBandwidthFormat(def->bandwidth, 0, buf);
virBufferAdjustIndent(buf, -2);
virBufferAddLit(buf, "</portgroup>\n");
@@ -2466,8 +2466,7 @@ virNetworkDefFormatBuf(virBuffer *buf,
return -1;
}
- if (virNetDevVPortProfileFormat(def->virtPortProfile, buf) < 0)
- return -1;
+ virNetDevVPortProfileFormat(def->virtPortProfile, buf);
for (i = 0; i < def->nPortGroups; i++)
if (virPortGroupDefFormat(buf, &def->portGroups[i]) < 0)
diff --git a/src/conf/virnetworkportdef.c b/src/conf/virnetworkportdef.c
index 64db63ae66..ad6150d5a7 100644
--- a/src/conf/virnetworkportdef.c
+++ b/src/conf/virnetworkportdef.c
@@ -307,8 +307,8 @@ virNetworkPortDefFormatBuf(virBuffer *buf,
virMacAddrFormat(&def->mac, macaddr);
virBufferAsprintf(buf, "<mac address='%s'/>\n", macaddr);
- if (virNetDevVPortProfileFormat(def->virtPortProfile, buf) < 0)
- return -1;
+ virNetDevVPortProfileFormat(def->virtPortProfile, buf);
+
if (def->bandwidth)
virNetDevBandwidthFormat(def->bandwidth, def->class_id, buf);
if (virNetDevVlanFormat(&def->vlan, buf) < 0)
--
2.30.2
11 months
[PATCH v2 0/2] A couple nbdkit-related fixes
by Jonathon Jongsma
Changes in v2
- patch 1 now includes the same patch for both start and stop storage source
functions
Jonathon Jongsma (2):
qemu: Fix bug in nbdkit-backed backing chains
tests: Remove readahead and timeout from ssh tests
src/qemu/qemu_nbdkit.c | 4 ++--
tests/qemuxml2argvdata/disk-network-ssh-key.xml | 4 ----
tests/qemuxml2argvdata/disk-network-ssh-password.xml | 2 --
tests/qemuxml2argvdata/disk-network-ssh.xml | 2 --
4 files changed, 2 insertions(+), 10 deletions(-)
--
2.43.0
11 months
[PATCH v4 0/2] A couple nbdkit-related fixes
by Jonathon Jongsma
Jonathon Jongsma (2):
qemu: Fix bug in nbdkit-backed backing chains
tests: Remove readahead and timeout from ssh tests
src/qemu/qemu_nbdkit.c | 2 +-
tests/qemuxml2argvdata/disk-network-ssh-key.xml | 4 ----
tests/qemuxml2argvdata/disk-network-ssh-password.xml | 2 --
tests/qemuxml2argvdata/disk-network-ssh.xml | 2 --
4 files changed, 1 insertion(+), 9 deletions(-)
--
2.43.0
11 months