[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
3 months, 3 weeks
[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
3 months, 3 weeks
[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
3 months, 3 weeks
[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
3 months, 3 weeks
[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
3 months, 3 weeks
[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
3 months, 3 weeks
[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
3 months, 3 weeks
[PATCH] domain_validate: Check for domain address conflicts fully
by Michal Privoznik
Current implementation of virDomainMemoryDefCheckConflict() does
only a one way comparison, i.e. if there's a memory device within
def->mems[] which address falls in [mem->address, mem->address +
mem->size] range (mem is basically an iterator within
def->mems[]). And for static XML this works just fine. Problem is
with hot/cold plugging of a memory device. Then mem points to
freshly parsed memory device and these half checks are
insufficient. Not only we must check whether an existing memory
device doesn't clash with freshly parsed memory device, but also
whether freshly parsed memory device does not fall into range of
already existing memory device.
Resolves: https://issues.redhat.com/browse/RHEL-4452
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_validate.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
index d485ec4fb1..14148a18d3 100644
--- a/src/conf/domain_validate.c
+++ b/src/conf/domain_validate.c
@@ -2264,6 +2264,7 @@ virDomainMemoryDefCheckConflict(const virDomainMemoryDef *mem,
for (i = 0; i < def->nmems; i++) {
const virDomainMemoryDef *other = def->mems[i];
unsigned long long otherStart = 0;
+ unsigned long long otherEnd = 0;
if (other == mem)
continue;
@@ -2315,7 +2316,10 @@ virDomainMemoryDefCheckConflict(const virDomainMemoryDef *mem,
if (thisStart == 0 || otherStart == 0)
continue;
- if (thisStart <= otherStart && thisEnd > otherStart) {
+ otherEnd = otherStart + other->size;
+
+ if ((thisStart <= otherStart && thisEnd > otherStart) ||
+ (otherStart <= thisStart && otherEnd > thisStart)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("memory device address [0x%1$llx:0x%2$llx] overlaps with other memory device (0x%3$llx)"),
thisStart, thisEnd, otherStart);
--
2.43.0
3 months, 3 weeks