[libvirt] [PATCH 0/8] qemu: Fix non-shared storage migration over NBD (blockdev-add sequels)
by Peter Krempa
I put some blockdev awareness into the non-shared storage migration NBD
code but it was not complete. Seeing it there mislead me thinking that
it's done.
Fix it now.
Peter Krempa (8):
qemu: migration: Simplify handling of 'diskAlias' when adding NBD
exports
qemu: migration: Properly export backend for NBD storage migration
qemu: migration: Access job name from job struct
qemu: migration: Simplify cleanup in qemuMigrationSrcNBDCopyCancelOne
qemu: blockjob: Allow NULL 'mirror' for block copy jobs due to
migration
qemu: migration: Split out setup of the migration target
qemu: migration: Mention disk target rather than the drive name in
debug msg
qemu: migration: Properly setup mirror for blockdev configurations
src/qemu/qemu_blockjob.c | 11 +++-
src/qemu/qemu_migration.c | 115 ++++++++++++++++++++++++--------------
2 files changed, 80 insertions(+), 46 deletions(-)
--
2.23.0
4 years, 10 months
Re: [libvirt] [PATCH for-4.2?] block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap
by Eric Blake
On 12/5/19 1:30 PM, Vladimir Sementsov-Ogievskiy wrote:
> Here is double bug:
>
> First, return error but not set errp. This may lead to:
> qmp block-dirty-bitmap-remove may report success when actually failed
>
> block-dirty-bitmap-remove used in a transaction will crash, as
> qmp_transaction will think that it returned success and will cal
call
> block_dirty_bitmap_remove_commit which will crash, as state->bitmap is
> NULL
>
> Second (like in anecdote), this case is not an error at all. As it is
> documented in the comment above bdrv_co_remove_persistent_dirty_bitmap
> definition, absence of bitmap is not an error, and similar case handled
> at start of qcow2_co_remove_persistent_dirty_bitmap, it returns 0 when
> there is no bitmaps at all..
double .
>
> But when there are some bitmaps, but not the requested one, it return
> error with errp unset.
>
> Fix that.
>
> Fixes: b56a1e31759b750
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov(a)virtuozzo.com>
> ---
>
> Hi all!
>
> Ohm, suddenly we faced this bug. It's a regression in 4.2. I'm very
> sorry for introducing it, and it sad that it's found so late..
>
> Personally, I think that this one worth rc5, as it makes new bitmap
> interfaces unusable. But the decision is yours.
>
> Last minute edit: hmm, actually, transaction action introduced in
> 4.2, so crash is not a regression, only broken block-dirty-bitmap-remove
> command is a regression... Maybe it's OK for stable.
Libvirt REALLY wants to use transaction bitmap management (and require
qemu 4.2) for its incremental backup patches that Peter is almost ready
to merge in. I'm trying to ascertain:
When exactly can this bug hit? Can you give a sequence of QMP commands
that will trigger it for easy reproduction? Are there workarounds (such
as checking that a bitmap exists prior to attempting to remove it)? If
it does NOT get fixed in rc5, how will libvirt be able to probe whether
the fix is in place?
>
> block/qcow2-bitmap.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
> index 8abaf632fc..c6c8ebbe89 100644
> --- a/block/qcow2-bitmap.c
> +++ b/block/qcow2-bitmap.c
> @@ -1469,8 +1469,10 @@ int coroutine_fn qcow2_co_remove_persistent_dirty_bitmap(BlockDriverState *bs,
> Qcow2BitmapList *bm_list;
>
> if (s->nb_bitmaps == 0) {
> - /* Absence of the bitmap is not an error: see explanation above
> - * bdrv_remove_persistent_dirty_bitmap() definition. */
> + /*
> + * Absence of the bitmap is not an error: see explanation above
> + * bdrv_co_remove_persistent_dirty_bitmap() definition.
> + */
> return 0;
> }
>
> @@ -1485,7 +1487,8 @@ int coroutine_fn qcow2_co_remove_persistent_dirty_bitmap(BlockDriverState *bs,
>
> bm = find_bitmap_by_name(bm_list, name);
> if (bm == NULL) {
> - ret = -EINVAL;
> + /* Absence of the bitmap is not an error, see above. */
> + ret = 0;
> goto out;
> }
>
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
4 years, 10 months
[libvirt] Offline manipulation of Dirty Bitmaps by qemu-img
by John Snow
This has come up in the past, and I believe we discussed this at KVM
Forum, too:
There have been requests from oVirt (via Nir Soffer) to add some offline
bitmap manipulation functionality. In the past, our stance has generally
been "Use QEMU without an accelerator, and use QMP to manipulate the
images."
We like this for a few reasons:
1. It keeps bitmap management code tightly centralized
2. It allows for the full suite of bitmap manipulations in either
offline or online mode with one tool
3. We wouldn't have to write new code.
4. Or design new CLIs and duplicate our existing work.
5. Or write even more tests.
However, tools like oVirt may or may not be fully equipped to launch
QEMU in this context, and there is always a desire for qemu-img to be
able to "do more", so existing management suites could extend
functionality more easily.
(Or so I am imagining.)
I am still leaning heavily against adding any more CLI commands or
options to qemu-img right now. Even if we do add some of the fundamental
ones like "add" or "remove", it seems only a matter of time before we
have to add "clear", "merge", etc. Is this just a race to code duplication?
On the other hand, one of the other suggestions is to have qemu-img
check --repair optionally delete corrupted bitmaps. I kind of like this
idea: it's a buyer beware operation that might make management layers
unhappy, but then again ... repair is always something that could make
things worse.
Plus, if you manage to corrupt bitmaps badly enough that they can't even
be parsed, you might need a heavyweight repair operation.
Nir, do you think that'd be sufficient for your needs for now, or would
you still like to see more granular offline management?
--js
4 years, 10 months
[libvirt] [PATCH 0/3] qemu: fix setting of block job speed (blockdev-add sequels)
by Peter Krempa
See patch 3.
Peter Krempa (3):
qemu: domain: Mention searched disk in error of qemuDomainDiskByName
qemu: driver: Use qemuDomainDiskByName instead of virDomainDiskByName
qemu: driver: Use appropriate job name when setting blockjob speed
src/qemu/qemu_domain.c | 4 ++--
src/qemu/qemu_driver.c | 20 ++++++++------------
2 files changed, 10 insertions(+), 14 deletions(-)
--
2.23.0
4 years, 10 months
[libvirt] [PATCH] qemu: remove nested branching to enhance readability
by Pavel Mores
This is a follow-up to patch series posted in
https://www.redhat.com/archives/libvir-list/2019-November/msg01180.html
It implements a suggestion made by Cole in
https://www.redhat.com/archives/libvir-list/2019-November/msg01207.html
and discussed in follow-up messages as there were no objections to the
change.
The aim is to make the code more readable by replacing nested branching
with a flat structure.
Signed-off-by: Pavel Mores <pmores(a)redhat.com>
---
src/qemu/qemu_domain.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d1596a28ca..5e4eede3c2 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -7914,19 +7914,16 @@ static int
qemuDomainDefaultVideoDevice(const virDomainDef *def,
virQEMUCapsPtr qemuCaps)
{
- if (ARCH_IS_PPC64(def->os.arch)) {
+ if (ARCH_IS_PPC64(def->os.arch))
return VIR_DOMAIN_VIDEO_TYPE_VGA;
- } else if (qemuDomainIsARMVirt(def) ||
- qemuDomainIsRISCVVirt(def) ||
- ARCH_IS_S390(def->os.arch)) {
+ if (qemuDomainIsARMVirt(def) || qemuDomainIsRISCVVirt(def) ||
+ ARCH_IS_S390(def->os.arch))
return VIR_DOMAIN_VIDEO_TYPE_VIRTIO;
- } else {
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA))
- return VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
- if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA))
- return VIR_DOMAIN_VIDEO_TYPE_VGA;
- return VIR_DOMAIN_VIDEO_TYPE_DEFAULT;
- }
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_CIRRUS_VGA))
+ return VIR_DOMAIN_VIDEO_TYPE_CIRRUS;
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VGA))
+ return VIR_DOMAIN_VIDEO_TYPE_VGA;
+ return VIR_DOMAIN_VIDEO_TYPE_DEFAULT;
}
--
2.21.0
4 years, 10 months
[libvirt] [PATCH 0/4] Introduce VIR_MIGRATE_PARAM_TLS_DESTINATION migration param
by Jiri Denemark
Normally the TLS certificate from the destination host must match the
host's name for TLS verification to succeed. When the certificate does
not match the destination hostname and the expected cetificate's
hostname is known, this parameter can be used to pass this expected
hostname when starting the migration.
Jiri Denemark (4):
qemu: Add support for setting string migration params
Introduce VIR_MIGRATE_PARAM_TLS_DESTINATION migration param
qemu: Implement VIR_MIGRATE_PARAM_TLS_DESTINATION
virsh: Add --tls-destination option for migrate command
include/libvirt/libvirt-domain.h | 14 +++++++
src/qemu/qemu_migration.h | 1 +
src/qemu/qemu_migration_params.c | 65 +++++++++++++++++++++++++++++++-
tools/virsh-domain.c | 11 ++++++
tools/virsh.pod | 8 +++-
5 files changed, 96 insertions(+), 3 deletions(-)
--
2.24.0
4 years, 10 months
[libvirt] [PATCH 0/3] Remove deprecated pc-0.x machine types and related hacks
by Thomas Huth
These have been on the deprecation list since a year now, so it's
time to finally remove the pc-0.x machine types.
We then can also remove some compatibility hacks in the devices, i.e.
the "use_broken_id" in ac97 and "command_serr_enable" in PCI devices.
Note that there is also the "rombar" property of the PCI devices which
is now not required for the x86 machine types anymore. But it seems to
me like this is still used by various people to bypass the ROM loading
for PCI devices in certain cases, so I did not remove that property here
yet.
Thomas Huth (3):
hw/i386: Remove the deprecated machines 0.12 up to 0.15
hw/audio: Remove the "use_broken_id" hack from the AC97 device
hw/pci: Remove the "command_serr_enable" property
hw/audio/ac97.c | 9 -----
hw/i386/pc_piix.c | 82 -------------------------------------------
hw/pci/pci.c | 6 +---
include/hw/pci/pci.h | 3 --
qemu-deprecated.texi | 2 +-
tests/cpu-plug-test.c | 6 +---
6 files changed, 3 insertions(+), 105 deletions(-)
--
2.18.1
4 years, 10 months
[libvirt] [PATCH] qemu_monitor_text: Drop unused variable and avoid crash
by Michal Privoznik
In v5.8.0-rc1~122 we've removed the only use of @safename in
qemuMonitorTextLoadSnapshot(). What we are left with is an
declared but not initialized variable that is passed to
VIR_FREE().
Caught by libvirt-php test suite.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial rule.
src/qemu/qemu_monitor_text.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 9054682d60..b387235821 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -161,7 +161,6 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name)
char *cmd = NULL;
char *reply = NULL;
int ret = -1;
- char *safename;
cmd = g_strdup_printf("loadvm \"%s\"", name);
@@ -194,7 +193,6 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name)
ret = 0;
cleanup:
- VIR_FREE(safename);
VIR_FREE(cmd);
VIR_FREE(reply);
return ret;
--
2.23.0
4 years, 10 months
[libvirt] [PATCH] news: Update the qemu version that dedicated performance hint is from
by Han Han
KVM dedicated performance hint is added since qemu version 2.10.0 not
2.10.1.
Signed-off-by: Han Han <hhan(a)redhat.com>
---
docs/news.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/news.xml b/docs/news.xml
index 2eb3bfdf6e..3ddebfddfb 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -469,7 +469,7 @@
With <code><hint-dedicated state='on'/></code> and
<code><cpu mode='host-passthrough'/></code>, it
allows a guest to enable optimizations when running on dedicated
- vCPUs. QEMU newer than 2.12.1 and kernel newer than 4.17
+ vCPUs. QEMU newer than 2.12.0 and kernel newer than 4.17
are required.
</description>
</change>
--
2.24.0.rc1
4 years, 10 months
[libvirt] [PATCH] docs: Update minimum QEMU version for kvm-hint-dedicated
by Andrea Bolognani
Same fix that was applied to release notes in a595c66a134d.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
Pushed as trivial.
docs/formatdomain.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 6df4a8b26e..5c0a00350b 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -2226,7 +2226,7 @@
<td>hint-dedicated</td>
<td>Allows a guest to enable optimizations when running on dedicated vCPUs</td>
<td>on, off</td>
- <td><span class="since">5.7.0 (QEMU 2.12.1)</span></td>
+ <td><span class="since">5.7.0 (QEMU 2.12.0)</span></td>
</tr>
</table>
</dd>
--
2.23.0
4 years, 10 months