Plans for the next release
by Jiri Denemark
We are getting close to the first release of libvirt in 2021. To aim for
the release on Jan 15 I suggest entering the freeze on Friday Jan 08 in
the evening or during the weekend and tagging RC2 on Wednesday Jan 13.
I hope this works for everyone.
Jirka
3 years, 9 months
[PATCH RFC v4 00/15] Add riscv kvm accel support
by Yifei Jiang
This series adds both riscv32 and riscv64 kvm support, and implements
migration based on riscv. It is based on temporarily unaccepted kvm:
https://github.com/kvm-riscv/linux (lastest version v15).
This series depends on above pending changes which haven't yet been
accepted, so this QEMU patch series is treated as RFC patches until
that dependency has been dealt with.
Compared to RFC v3, the time scaling is supported in this series. The
new feature also requires the following patches:
[1] Bugfix in kvm v15
https://lkml.org/lkml/2020/11/30/245
[2] kvm patches:
[PATCH RFC 0/3] Implement guest time scaling in RISC-V KVM
Several steps to use this:
1. Build emulation
$ ./configure --target-list=riscv64-softmmu
$ make -j$(nproc)
2. Build kernel
https://github.com/kvm-riscv/linux
3. Build QEMU VM
Cross built in riscv toolchain.
$ PKG_CONFIG_LIBDIR=<toolchain pkgconfig path>
$ export PKG_CONFIG_SYSROOT_DIR=<toolchain sysroot path>
$ ./configure --target-list=riscv64-softmmu --enable-kvm \
--cross-prefix=riscv64-linux-gnu- --disable-libiscsi --disable-glusterfs \
--disable-libusb --disable-usb-redir --audio-drv-list= --disable-opengl \
--disable-libxml2
$ make -j$(nproc)
4. Start emulation
$ ./qemu-system-riscv64 -M virt -m 4096M -cpu rv64,x-h=true -nographic \
-name guest=riscv-hyp,debug-threads=on \
-smp 4 \
-bios ./fw_jump.bin \
-kernel ./Image \
-drive file=./hyp.img,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-append "root=/dev/vda rw console=ttyS0 earlycon=sbi"
5. Start kvm-acceled QEMU VM in emulation
$ ./qemu-system-riscv64 -M virt,accel=kvm -m 1024M -cpu host -nographic \
-name guest=riscv-guset \
-smp 2 \
-bios none \
-kernel ./Image \
-drive file=./guest.img,format=raw,id=hd0 \
-device virtio-blk-device,drive=hd0 \
-append "root=/dev/vda rw console=ttyS0 earlycon=sbi"
Changes since RFC v3
- Rebase on QEMU v5.2.0-rc2 and kvm-riscv linux v15.
- Add time scaling support(New patches 13, 14 and 15).
- Fix the bug that guest vm can't reboot.
Changes since RFC v2
- Fix checkpatch error at target/riscv/sbi_ecall_interface.h.
- Add riscv migration support.
Changes since RFC v1
- Add separate SBI ecall interface header.
- Add riscv32 kvm accel support.
Yifei Jiang (15):
linux-header: Update linux/kvm.h
target/riscv: Add target/riscv/kvm.c to place the public kvm interface
target/riscv: Implement function kvm_arch_init_vcpu
target/riscv: Implement kvm_arch_get_registers
target/riscv: Implement kvm_arch_put_registers
target/riscv: Support start kernel directly by KVM
hw/riscv: PLIC update external interrupt by KVM when kvm enabled
target/riscv: Handle KVM_EXIT_RISCV_SBI exit
target/riscv: Add host cpu type
target/riscv: Add kvm_riscv_get/put_regs_timer
target/riscv: Implement virtual time adjusting with vm state changing
target/riscv: Support virtual time context synchronization
target/riscv: Introduce dynamic time frequency for virt machine
target/riscv: Synchronize vcpu's frequency with KVM
target/riscv: Add time frequency migration support
hw/intc/sifive_plic.c | 31 +-
hw/riscv/virt.c | 26 +-
linux-headers/linux/kvm.h | 8 +
meson.build | 2 +
target/riscv/cpu.c | 13 +
target/riscv/cpu.h | 12 +
target/riscv/kvm.c | 617 +++++++++++++++++++++++++++++
target/riscv/kvm_riscv.h | 25 ++
target/riscv/machine.c | 23 ++
target/riscv/meson.build | 1 +
target/riscv/sbi_ecall_interface.h | 72 ++++
11 files changed, 817 insertions(+), 13 deletions(-)
create mode 100644 target/riscv/kvm.c
create mode 100644 target/riscv/kvm_riscv.h
create mode 100644 target/riscv/sbi_ecall_interface.h
--
2.19.1
3 years, 9 months
[PATCH] qemu: backup: Properly delete temporary bitmap after push-mode incremental backup
by Peter Krempa
Refactor in 0316c28a453ac used incorrect source variable to initialize
the variable which holds the name of the bitmap which needs to be
deleted after the backup job finishes. This resulted into deleting the
source bitmap of the backup rather than the temporary one.
Use 'dd->incrementalBitmap' which holds the temporary bitmap name
instead of 'dd->backupdisk->incremental' which holds the name of the
source bitmap which is used by the backup.
Fixes: 0316c28a453ac15f58c61f30359f66ab9a649884
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1908647
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_backup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index b2340eb1cf..c444f8aaba 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -235,7 +235,7 @@ qemuBackupDiskPrepareOneBitmaps(struct qemuBackupDiskData *dd,
blockNamedNodeData) < 0)
return -1;
- dd->domdiskIncrementalBitmap = dd->backupdisk->incremental;
+ dd->domdiskIncrementalBitmap = dd->incrementalBitmap;
}
return 0;
--
2.29.2
3 years, 9 months
[PATCH 1/3] virStorageBackendCopyToFD: remove unused return variable
by Yi Li
remove unused return variable,
The errno will throw by virReportSystemError
Signed-off-by: Yi Li <yili(a)winhong.com>
---
src/storage/storage_util.c | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index cf1f33f177..6fc8597733 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -128,7 +128,6 @@ virStorageBackendCopyToFD(virStorageVolDefPtr vol,
bool reflink_copy)
{
int amtread = -1;
- int ret = 0;
size_t rbytes = READ_BLOCK_SIZE_DEFAULT;
int wbytes = 0;
int interval;
@@ -138,11 +137,10 @@ virStorageBackendCopyToFD(virStorageVolDefPtr vol,
VIR_AUTOCLOSE inputfd = -1;
if ((inputfd = open(inputvol->target.path, O_RDONLY)) < 0) {
- ret = -errno;
virReportSystemError(errno,
_("could not open input path '%s'"),
inputvol->target.path);
- return ret;
+ return -1;
}
#ifdef __linux__
@@ -160,11 +158,10 @@ virStorageBackendCopyToFD(virStorageVolDefPtr vol,
if (reflink_copy) {
if (reflinkCloneFile(fd, inputfd) < 0) {
- ret = -errno;
virReportSystemError(errno,
_("failed to clone files from '%s'"),
inputvol->target.path);
- return ret;
+ return -1;
} else {
VIR_DEBUG("btrfs clone finished.");
return 0;
@@ -178,11 +175,10 @@ virStorageBackendCopyToFD(virStorageVolDefPtr vol,
rbytes = *total;
if ((amtread = saferead(inputfd, buf, rbytes)) < 0) {
- ret = -errno;
virReportSystemError(errno,
_("failed reading from file '%s'"),
inputvol->target.path);
- return ret;
+ return -1;
}
*total -= amtread;
@@ -195,36 +191,32 @@ virStorageBackendCopyToFD(virStorageVolDefPtr vol,
if (want_sparse && memcmp(buf+offset, zerobuf, interval) == 0) {
if (lseek(fd, interval, SEEK_CUR) < 0) {
- ret = -errno;
virReportSystemError(errno,
_("cannot extend file '%s'"),
vol->target.path);
- return ret;
+ return -1;
}
} else if (safewrite(fd, buf+offset, interval) < 0) {
- ret = -errno;
virReportSystemError(errno,
_("failed writing to file '%s'"),
vol->target.path);
- return ret;
+ return -1;
}
} while ((amtleft -= interval) > 0);
}
if (virFileDataSync(fd) < 0) {
- ret = -errno;
virReportSystemError(errno, _("cannot sync data to file '%s'"),
vol->target.path);
- return ret;
+ return -1;
}
if (VIR_CLOSE(inputfd) < 0) {
- ret = -errno;
virReportSystemError(errno,
_("cannot close file '%s'"),
inputvol->target.path);
- return ret;
+ return -1;
}
return 0;
--
2.25.3
3 years, 9 months
[PATCH v2] docs: support qcow2 format in luks encryption volume
by Meina Li
Signed-off-by: Meina Li <meili(a)redhat.com>
---
docs/formatstorageencryption.html.in | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/docs/formatstorageencryption.html.in b/docs/formatstorageencryption.html.in
index ea80a87cfb..7215c307d7 100644
--- a/docs/formatstorageencryption.html.in
+++ b/docs/formatstorageencryption.html.in
@@ -128,7 +128,9 @@
<p>
Here is an example specifying use of the <code>luks</code> format for
- a specific cipher algorithm for volume creation:
+ a specific cipher algorithm for volume creation.
+ <span class="since">Since 6.10.0,</span> the <code>target</code> format
+ can also support <code>qcow2</code> type with <code>luks</code> encryption.
</p>
<pre>
<volume>
--
2.27.0
3 years, 9 months
[PATCH] virsh-domain: Add quotes around '%s' formatting domain name
by Peter Krempa
Domain name can contain spaces in which case it's not immediately clear
from virsh messages where the boundary of the name is. Enclose all %s
formatters in apostrophes as delimiters.
Done via the following vim regex:
%s/omain %s/omain '%s'/g
This patch changes:
$ virsh undefine --snapshots-metadata 'OWASP Broken Web Apps VM v1.2'
Domain OWASP Broken Web Apps VM v1.2 has been undefined
to:
$ virsh undefine --snapshots-metadata 'OWASP Broken Web Apps VM v1.2'
Domain 'OWASP Broken Web Apps VM v1.2' has been undefined
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
tests/virsh-define-dev-segfault | 2 +-
tests/virsh-read-bufsiz | 2 +-
tests/virsh-undefine | 8 +-
tools/virsh-domain.c | 136 ++++++++++++++++----------------
4 files changed, 74 insertions(+), 74 deletions(-)
diff --git a/tests/virsh-define-dev-segfault b/tests/virsh-define-dev-segfault
index a7533ba9b0..cc5b461932 100755
--- a/tests/virsh-define-dev-segfault
+++ b/tests/virsh-define-dev-segfault
@@ -65,7 +65,7 @@ url=test:///default
$abs_top_builddir/tools/virsh --connect "$url" 'define D.xml; dumpxml D' > out 2>&1 || fail=1
cat > exp <<EOF || fail=1
-Domain D defined from D.xml
+Domain 'D' defined from D.xml
$(cat D.xml)
diff --git a/tests/virsh-read-bufsiz b/tests/virsh-read-bufsiz
index 116eff1c4c..a61816c25b 100755
--- a/tests/virsh-read-bufsiz
+++ b/tests/virsh-read-bufsiz
@@ -42,7 +42,7 @@ for i in before after; do
( test $i = before && cat sp xml || cat xml sp ) > $in || fail=1
$abs_top_builddir/tools/virsh --connect test:///default define $in > out || fail=1
- printf "Domain newtest defined from $in\n\n" > exp || fail=1
+ printf "Domain 'newtest' defined from $in\n\n" > exp || fail=1
compare exp out || fail=1
done
diff --git a/tests/virsh-undefine b/tests/virsh-undefine
index 998d4d3268..dbbb367391 100755
--- a/tests/virsh-undefine
+++ b/tests/virsh-undefine
@@ -37,7 +37,7 @@ sed '/^Persistent/n; /:/d' < out1 > out
cat <<\EOF > exp || fail=1
Persistent: yes
-Domain test has been undefined
+Domain 'test' has been undefined
Persistent: no
@@ -52,7 +52,7 @@ sed '/^Persistent/n; /:/d' < out1 > out
cat <<\EOF > exp || fail=1
Persistent: yes
-Domain 1 has been undefined
+Domain '1' has been undefined
Persistent: no
@@ -64,9 +64,9 @@ $abs_top_builddir/tools/virsh -c test:///default \
'shutdown test; undefine test; dominfo test' > out 2>&1
test $? = 1 || fail=1
cat <<\EOF > expout || fail=1
-Domain test is being shutdown
+Domain 'test' is being shutdown
-Domain test has been undefined
+Domain 'test' has been undefined
error: failed to get domain 'test'
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 1ef9b8d606..2bb136333f 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -1117,17 +1117,17 @@ cmdAutostart(vshControl *ctl, const vshCmd *cmd)
if (virDomainSetAutostart(dom, autostart) < 0) {
if (autostart)
- vshError(ctl, _("Failed to mark domain %s as autostarted"), name);
+ vshError(ctl, _("Failed to mark domain '%s' as autostarted"), name);
else
- vshError(ctl, _("Failed to unmark domain %s as autostarted"), name);
+ vshError(ctl, _("Failed to unmark domain '%s' as autostarted"), name);
virshDomainFree(dom);
return false;
}
if (autostart)
- vshPrintExtra(ctl, _("Domain %s marked as autostarted\n"), name);
+ vshPrintExtra(ctl, _("Domain '%s' marked as autostarted\n"), name);
else
- vshPrintExtra(ctl, _("Domain %s unmarked as autostarted\n"), name);
+ vshPrintExtra(ctl, _("Domain '%s' unmarked as autostarted\n"), name);
virshDomainFree(dom);
return true;
@@ -2987,7 +2987,7 @@ cmdRunConsole(vshControl *ctl, virDomainPtr dom,
return false;
}
- vshPrintExtra(ctl, _("Connected to domain %s\n"), virDomainGetName(dom));
+ vshPrintExtra(ctl, _("Connected to domain '%s'\n"), virDomainGetName(dom));
vshPrintExtra(ctl, _("Escape character is %s"), priv->escapeChar);
if (priv->escapeChar[0] == '^')
vshPrintExtra(ctl, " (Ctrl + %c)", priv->escapeChar[1]);
@@ -3427,9 +3427,9 @@ cmdSuspend(vshControl *ctl, const vshCmd *cmd)
return false;
if (virDomainSuspend(dom) == 0) {
- vshPrintExtra(ctl, _("Domain %s suspended\n"), name);
+ vshPrintExtra(ctl, _("Domain '%s' suspended\n"), name);
} else {
- vshError(ctl, _("Failed to suspend domain %s"), name);
+ vshError(ctl, _("Failed to suspend domain '%s'"), name);
ret = false;
}
@@ -3501,12 +3501,12 @@ cmdDomPMSuspend(vshControl *ctl, const vshCmd *cmd)
}
if (virDomainPMSuspendForDuration(dom, suspendTarget, duration, 0) < 0) {
- vshError(ctl, _("Domain %s could not be suspended"),
+ vshError(ctl, _("Domain '%s' could not be suspended"),
virDomainGetName(dom));
goto cleanup;
}
- vshPrintExtra(ctl, _("Domain %s successfully suspended"),
+ vshPrintExtra(ctl, _("Domain '%s' successfully suspended"),
virDomainGetName(dom));
ret = true;
@@ -3548,12 +3548,12 @@ cmdDomPMWakeup(vshControl *ctl, const vshCmd *cmd)
return false;
if (virDomainPMWakeup(dom, flags) < 0) {
- vshError(ctl, _("Domain %s could not be woken up"),
+ vshError(ctl, _("Domain '%s' could not be woken up"),
virDomainGetName(dom));
goto cleanup;
}
- vshPrintExtra(ctl, _("Domain %s successfully woken up"),
+ vshPrintExtra(ctl, _("Domain '%s' successfully woken up"),
virDomainGetName(dom));
ret = true;
@@ -3930,10 +3930,10 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd)
out:
if (rc == 0) {
- vshPrintExtra(ctl, _("Domain %s has been undefined\n"), name);
+ vshPrintExtra(ctl, _("Domain '%s' has been undefined\n"), name);
ret = true;
} else {
- vshError(ctl, _("Failed to undefine domain %s"), name);
+ vshError(ctl, _("Failed to undefine domain '%s'"), name);
goto cleanup;
}
@@ -4150,12 +4150,12 @@ cmdStart(vshControl *ctl, const vshCmd *cmd)
if ((nfds ? virDomainCreateWithFiles(dom, nfds, fds, flags) :
(flags ? virDomainCreateWithFlags(dom, flags)
: virDomainCreate(dom))) < 0) {
- vshError(ctl, _("Failed to start domain %s"), virDomainGetName(dom));
+ vshError(ctl, _("Failed to start domain '%s'"), virDomainGetName(dom));
goto cleanup;
}
started:
- vshPrintExtra(ctl, _("Domain %s started\n"),
+ vshPrintExtra(ctl, _("Domain '%s' started\n"),
virDomainGetName(dom));
#ifndef WIN32
if (console && !cmdRunConsole(ctl, dom, NULL, 0))
@@ -4255,7 +4255,7 @@ doSave(void *opaque)
if (((flags || xml)
? virDomainSaveFlags(dom, to, xml, flags)
: virDomainSave(dom, to)) < 0) {
- vshError(ctl, _("Failed to save domain %s to %s"), name, to);
+ vshError(ctl, _("Failed to save domain '%s' to %s"), name, to);
goto out;
}
@@ -4512,7 +4512,7 @@ cmdSave(vshControl *ctl, const vshCmd *cmd)
virThreadJoin(&workerThread);
if (!data.ret)
- vshPrintExtra(ctl, _("\nDomain %s saved to %s\n"), name, to);
+ vshPrintExtra(ctl, _("\nDomain '%s' saved to %s\n"), name, to);
cleanup:
virshDomainFree(dom);
@@ -4771,7 +4771,7 @@ doManagedsave(void *opaque)
goto out;
if (virDomainManagedSave(dom, flags) < 0) {
- vshError(ctl, _("Failed to save domain %s state"), name);
+ vshError(ctl, _("Failed to save domain '%s' state"), name);
goto out;
}
@@ -4819,7 +4819,7 @@ cmdManagedSave(vshControl *ctl, const vshCmd *cmd)
virThreadJoin(&workerThread);
if (!data.ret)
- vshPrintExtra(ctl, _("\nDomain %s state saved by libvirt\n"), name);
+ vshPrintExtra(ctl, _("\nDomain '%s' state saved by libvirt\n"), name);
cleanup:
virshDomainFree(dom);
@@ -4863,15 +4863,15 @@ cmdManagedSaveRemove(vshControl *ctl, const vshCmd *cmd)
if (hassave) {
if (virDomainManagedSaveRemove(dom, 0) < 0) {
- vshError(ctl, _("Failed to remove managed save image for domain %s"),
+ vshError(ctl, _("Failed to remove managed save image for domain '%s'"),
name);
goto cleanup;
}
else
- vshPrintExtra(ctl, _("Removed managedsave image for domain %s"), name);
+ vshPrintExtra(ctl, _("Removed managedsave image for domain '%s'"), name);
}
else
- vshPrintExtra(ctl, _("Domain %s has no manage save image; removal skipped"),
+ vshPrintExtra(ctl, _("Domain '%s' has no manage save image; removal skipped"),
name);
ret = true;
@@ -4929,7 +4929,7 @@ cmdManagedSaveEdit(vshControl *ctl, const vshCmd *cmd)
#define EDIT_GET_XML virDomainManagedSaveGetXMLDesc(dom, getxml_flags)
#define EDIT_NOT_CHANGED \
do { \
- vshPrintExtra(ctl, _("Managed save image of domain %s XML configuration " \
+ vshPrintExtra(ctl, _("Managed save image of domain '%s' XML configuration " \
"not changed.\n"), virDomainGetName(dom)); \
ret = true; \
goto edit_cleanup; \
@@ -4938,7 +4938,7 @@ cmdManagedSaveEdit(vshControl *ctl, const vshCmd *cmd)
(virDomainManagedSaveDefineXML(dom, doc_edited, define_flags) == 0)
#include "virsh-edit.c"
- vshPrintExtra(ctl, _("Managed save image of Domain %s XML configuration edited.\n"),
+ vshPrintExtra(ctl, _("Managed save image of Domain '%s' XML configuration edited.\n"),
virDomainGetName(dom));
ret = true;
@@ -5057,7 +5057,7 @@ cmdManagedSaveDefine(vshControl *ctl, const vshCmd *cmd)
goto cleanup;
}
- vshPrintExtra(ctl, _("Managed save state file of domain %s updated.\n"),
+ vshPrintExtra(ctl, _("Managed save state file of domain '%s' updated.\n"),
virDomainGetName(dom));
ret = true;
@@ -5485,12 +5485,12 @@ doDump(void *opaque)
if (dumpformat != VIR_DOMAIN_CORE_DUMP_FORMAT_RAW) {
if (virDomainCoreDumpWithFormat(dom, to, dumpformat, flags) < 0) {
- vshError(ctl, _("Failed to core dump domain %s to %s"), name, to);
+ vshError(ctl, _("Failed to core dump domain '%s' to %s"), name, to);
goto out;
}
} else {
if (virDomainCoreDump(dom, to, flags) < 0) {
- vshError(ctl, _("Failed to core dump domain %s to %s"), name, to);
+ vshError(ctl, _("Failed to core dump domain '%s' to %s"), name, to);
goto out;
}
}
@@ -5543,7 +5543,7 @@ cmdDump(vshControl *ctl, const vshCmd *cmd)
virThreadJoin(&workerThread);
if (!data.ret)
- vshPrintExtra(ctl, _("\nDomain %s dumped to %s\n"), name, to);
+ vshPrintExtra(ctl, _("\nDomain '%s' dumped to %s\n"), name, to);
cleanup:
virshDomainFree(dom);
@@ -5659,7 +5659,7 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd)
cbdata.fd = fd;
if (virStreamRecvAll(st, virshStreamSink, &cbdata) < 0) {
- vshError(ctl, _("could not receive data from domain %s"), name);
+ vshError(ctl, _("could not receive data from domain '%s'"), name);
goto cleanup;
}
@@ -5669,7 +5669,7 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd)
}
if (virStreamFinish(st) < 0) {
- vshError(ctl, _("cannot close stream on domain %s"), name);
+ vshError(ctl, _("cannot close stream on domain '%s'"), name);
goto cleanup;
}
@@ -5882,9 +5882,9 @@ cmdResume(vshControl *ctl, const vshCmd *cmd)
return false;
if (virDomainResume(dom) == 0) {
- vshPrintExtra(ctl, _("Domain %s resumed\n"), name);
+ vshPrintExtra(ctl, _("Domain '%s' resumed\n"), name);
} else {
- vshError(ctl, _("Failed to resume domain %s"), name);
+ vshError(ctl, _("Failed to resume domain '%s'"), name);
ret = false;
}
@@ -5964,9 +5964,9 @@ cmdShutdown(vshControl *ctl, const vshCmd *cmd)
else
rv = virDomainShutdown(dom);
if (rv == 0) {
- vshPrintExtra(ctl, _("Domain %s is being shutdown\n"), name);
+ vshPrintExtra(ctl, _("Domain '%s' is being shutdown\n"), name);
} else {
- vshError(ctl, _("Failed to shutdown domain %s"), name);
+ vshError(ctl, _("Failed to shutdown domain '%s'"), name);
goto cleanup;
}
@@ -6044,9 +6044,9 @@ cmdReboot(vshControl *ctl, const vshCmd *cmd)
goto cleanup;
if (virDomainReboot(dom, flags) == 0) {
- vshPrintExtra(ctl, _("Domain %s is being rebooted\n"), name);
+ vshPrintExtra(ctl, _("Domain '%s' is being rebooted\n"), name);
} else {
- vshError(ctl, _("Failed to reboot domain %s"), name);
+ vshError(ctl, _("Failed to reboot domain '%s'"), name);
goto cleanup;
}
@@ -6086,9 +6086,9 @@ cmdReset(vshControl *ctl, const vshCmd *cmd)
return false;
if (virDomainReset(dom, 0) == 0) {
- vshPrintExtra(ctl, _("Domain %s was reset\n"), name);
+ vshPrintExtra(ctl, _("Domain '%s' was reset\n"), name);
} else {
- vshError(ctl, _("Failed to reset domain %s"), name);
+ vshError(ctl, _("Failed to reset domain '%s'"), name);
ret = false;
}
@@ -8311,7 +8311,7 @@ cmdCreate(vshControl *ctl, const vshCmd *cmd)
goto cleanup;
}
- vshPrintExtra(ctl, _("Domain %s created from %s\n"),
+ vshPrintExtra(ctl, _("Domain '%s' created from %s\n"),
virDomainGetName(dom), from);
#ifndef WIN32
if (console)
@@ -8374,7 +8374,7 @@ cmdDefine(vshControl *ctl, const vshCmd *cmd)
VIR_FREE(buffer);
if (dom != NULL) {
- vshPrintExtra(ctl, _("Domain %s defined from %s\n"),
+ vshPrintExtra(ctl, _("Domain '%s' defined from %s\n"),
virDomainGetName(dom), from);
virshDomainFree(dom);
} else {
@@ -8427,9 +8427,9 @@ cmdDestroy(vshControl *ctl, const vshCmd *cmd)
result = virDomainDestroy(dom);
if (result == 0) {
- vshPrintExtra(ctl, _("Domain %s destroyed\n"), name);
+ vshPrintExtra(ctl, _("Domain '%s' destroyed\n"), name);
} else {
- vshError(ctl, _("Failed to destroy domain %s"), name);
+ vshError(ctl, _("Failed to destroy domain '%s'"), name);
ret = false;
}
@@ -9724,10 +9724,10 @@ virshEventQemuPrint(virConnectPtr conn G_GNUC_UNUSED,
if (virTimeStringNowRaw(timestamp) < 0)
timestamp[0] = '\0';
- vshPrint(data->ctl, "%s: event %s for domain %s: %s\n",
+ vshPrint(data->ctl, "%s: event %s for domain '%s': %s\n",
timestamp, event, virDomainGetName(dom), NULLSTR(details));
} else {
- vshPrint(data->ctl, "event %s at %lld.%06u for domain %s: %s\n",
+ vshPrint(data->ctl, "event %s at %lld.%06u for domain '%s': %s\n",
event, seconds, micros, virDomainGetName(dom), NULLSTR(details));
}
@@ -9886,7 +9886,7 @@ cmdQemuAttach(vshControl *ctl, const vshCmd *cmd)
return false;
}
- vshPrintExtra(ctl, _("Domain %s attached to pid %u\n"),
+ vshPrintExtra(ctl, _("Domain '%s' attached to pid %u\n"),
virDomainGetName(dom), pid_value);
virshDomainFree(dom);
return true;
@@ -12766,7 +12766,7 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd)
#define EDIT_GET_XML virDomainGetXMLDesc(dom, query_flags)
#define EDIT_NOT_CHANGED \
do { \
- vshPrintExtra(ctl, _("Domain %s XML configuration not changed.\n"), \
+ vshPrintExtra(ctl, _("Domain '%s' XML configuration not changed.\n"), \
virDomainGetName(dom)); \
ret = true; \
goto edit_cleanup; \
@@ -12781,7 +12781,7 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd)
#include "virsh-edit.c"
#undef EDIT_RELAX
- vshPrintExtra(ctl, _("Domain %s XML configuration edited.\n"),
+ vshPrintExtra(ctl, _("Domain '%s' XML configuration edited.\n"),
virDomainGetName(dom_edited));
ret = true;
@@ -13088,7 +13088,7 @@ virshEventGenericPrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event '%s' for domain %s\n"),
+ virBufferAsprintf(&buf, _("event '%s' for domain '%s'\n"),
((virshDomEventData *) opaque)->cb->name,
virDomainGetName(dom));
virshEventPrint(opaque, &buf);
@@ -13103,7 +13103,7 @@ virshEventLifecyclePrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'lifecycle' for domain %s: %s %s\n"),
+ virBufferAsprintf(&buf, _("event 'lifecycle' for domain '%s': %s %s\n"),
virDomainGetName(dom),
virshDomainEventToString(event),
virshDomainEventDetailToString(event, detail));
@@ -13118,7 +13118,7 @@ virshEventRTCChangePrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'rtc-change' for domain %s: %lld\n"),
+ virBufferAsprintf(&buf, _("event 'rtc-change' for domain '%s': %lld\n"),
virDomainGetName(dom),
utcoffset);
virshEventPrint(opaque, &buf);
@@ -13132,7 +13132,7 @@ virshEventWatchdogPrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'watchdog' for domain %s: %s\n"),
+ virBufferAsprintf(&buf, _("event 'watchdog' for domain '%s': %s\n"),
virDomainGetName(dom),
virshDomainEventWatchdogToString(action));
virshEventPrint(opaque, &buf);
@@ -13148,7 +13148,7 @@ virshEventIOErrorPrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'io-error' for domain %s: %s (%s) %s\n"),
+ virBufferAsprintf(&buf, _("event 'io-error' for domain '%s': %s (%s) %s\n"),
virDomainGetName(dom),
srcPath,
devAlias,
@@ -13169,7 +13169,7 @@ virshEventGraphicsPrint(virConnectPtr conn G_GNUC_UNUSED,
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
size_t i;
- virBufferAsprintf(&buf, _("event 'graphics' for domain %s: "
+ virBufferAsprintf(&buf, _("event 'graphics' for domain '%s': "
"%s local[%s %s %s] remote[%s %s %s] %s\n"),
virDomainGetName(dom),
virshGraphicsPhaseToString(phase),
@@ -13199,7 +13199,7 @@ virshEventIOErrorReasonPrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'io-error-reason' for domain %s: "
+ virBufferAsprintf(&buf, _("event 'io-error-reason' for domain '%s': "
"%s (%s) %s due to %s\n"),
virDomainGetName(dom),
srcPath,
@@ -13219,7 +13219,7 @@ virshEventBlockJobPrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event '%s' for domain %s: %s for %s %s\n"),
+ virBufferAsprintf(&buf, _("event '%s' for domain '%s': %s for %s %s\n"),
((virshDomEventData *) opaque)->cb->name,
virDomainGetName(dom),
virshDomainBlockJobToString(type),
@@ -13239,7 +13239,7 @@ virshEventDiskChangePrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'disk-change' for domain %s disk %s: "
+ virBufferAsprintf(&buf, _("event 'disk-change' for domain '%s' disk %s: "
"%s -> %s: %s\n"),
virDomainGetName(dom),
alias,
@@ -13258,7 +13258,7 @@ virshEventTrayChangePrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'tray-change' for domain %s disk %s: %s\n"),
+ virBufferAsprintf(&buf, _("event 'tray-change' for domain '%s' disk %s: %s\n"),
virDomainGetName(dom),
alias,
virshDomainEventTrayChangeToString(reason));
@@ -13284,7 +13284,7 @@ virshEventBalloonChangePrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'balloon-change' for domain %s: %lluKiB\n"),
+ virBufferAsprintf(&buf, _("event 'balloon-change' for domain '%s': %lluKiB\n"),
virDomainGetName(dom),
actual);
virshEventPrint(opaque, &buf);
@@ -13298,7 +13298,7 @@ virshEventDeviceRemovedPrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'device-removed' for domain %s: %s\n"),
+ virBufferAsprintf(&buf, _("event 'device-removed' for domain '%s': %s\n"),
virDomainGetName(dom),
alias);
virshEventPrint(opaque, &buf);
@@ -13312,7 +13312,7 @@ virshEventDeviceAddedPrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'device-added' for domain %s: %s\n"),
+ virBufferAsprintf(&buf, _("event 'device-added' for domain '%s': %s\n"),
virDomainGetName(dom),
alias);
virshEventPrint(opaque, &buf);
@@ -13329,7 +13329,7 @@ virshEventTunablePrint(virConnectPtr conn G_GNUC_UNUSED,
size_t i;
char *value;
- virBufferAsprintf(&buf, _("event 'tunable' for domain %s:\n"),
+ virBufferAsprintf(&buf, _("event 'tunable' for domain '%s':\n"),
virDomainGetName(dom));
for (i = 0; i < nparams; i++) {
value = virTypedParameterToString(¶ms[i]);
@@ -13365,7 +13365,7 @@ virshEventAgentLifecyclePrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'agent-lifecycle' for domain %s: state: "
+ virBufferAsprintf(&buf, _("event 'agent-lifecycle' for domain '%s': state: "
"'%s' reason: '%s'\n"),
virDomainGetName(dom),
UNKNOWNSTR(virshEventAgentLifecycleStateTypeToString(state)),
@@ -13381,7 +13381,7 @@ virshEventMigrationIterationPrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'migration-iteration' for domain %s: "
+ virBufferAsprintf(&buf, _("event 'migration-iteration' for domain '%s': "
"iteration: '%d'\n"),
virDomainGetName(dom),
iteration);
@@ -13400,7 +13400,7 @@ virshEventJobCompletedPrint(virConnectPtr conn G_GNUC_UNUSED,
size_t i;
char *value;
- virBufferAsprintf(&buf, _("event 'job-completed' for domain %s:\n"),
+ virBufferAsprintf(&buf, _("event 'job-completed' for domain '%s':\n"),
virDomainGetName(dom));
for (i = 0; i < nparams; i++) {
value = virTypedParameterToString(¶ms[i]);
@@ -13421,7 +13421,7 @@ virshEventDeviceRemovalFailedPrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'device-removal-failed' for domain %s: %s\n"),
+ virBufferAsprintf(&buf, _("event 'device-removal-failed' for domain '%s': %s\n"),
virDomainGetName(dom),
alias);
virshEventPrint(opaque, &buf);
@@ -13443,7 +13443,7 @@ virshEventMetadataChangePrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'metadata-change' for domain %s: %s %s\n"),
+ virBufferAsprintf(&buf, _("event 'metadata-change' for domain '%s': %s %s\n"),
virDomainGetName(dom),
UNKNOWNSTR(virshEventMetadataChangeTypeTypeToString(type)),
NULLSTR(nsuri));
@@ -13462,7 +13462,7 @@ virshEventBlockThresholdPrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'block-threshold' for domain %s: "
+ virBufferAsprintf(&buf, _("event 'block-threshold' for domain '%s': "
"dev: %s(%s) %llu %llu\n"),
virDomainGetName(dom),
dev, NULLSTR(path), threshold, excess);
@@ -13494,7 +13494,7 @@ virshEventMemoryFailurePrint(virConnectPtr conn G_GNUC_UNUSED,
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- virBufferAsprintf(&buf, _("event 'memory-failure' for domain %s:\n"
+ virBufferAsprintf(&buf, _("event 'memory-failure' for domain '%s':\n"
"recipient: %s\naction: %s\n"),
virDomainGetName(dom),
UNKNOWNSTR(virshEventMemoryFailureRecipientTypeTypeToString(recipient)),
--
2.29.2
3 years, 9 months
[PATCH v1] docs: migration: remove xenmigr
by Olaf Hering
xenmigr was for xend
Fixes commit 1dac5fbbbb06a0341e8087dc33af75c8352d77a4
Signed-off-by: Olaf Hering <olaf(a)aepfle.de>
---
docs/migration.html.in | 6 ------
1 file changed, 6 deletions(-)
diff --git a/docs/migration.html.in b/docs/migration.html.in
index ac38c6e13d..627200f96a 100644
--- a/docs/migration.html.in
+++ b/docs/migration.html.in
@@ -491,7 +491,6 @@ virsh migrate web1 xen+tls://desthost/system
eg using secondary network interface
virsh migrate web1 qemu://desthost/system tcp://10.0.0.1/
-virsh migrate web1 xen+tcp://desthost/system xenmigr:10.0.0.1/
</pre>
<p>
@@ -562,13 +561,8 @@ syntax: virsh migrate GUESTNAME HV-URI
eg using same libvirt URI for all connections
-virsh migrate --direct web1 xenmigr://desthost/
</pre>
- <p>
- Supported by Xen driver
- </p>
-
<h3><a id="nativepeer2peer">Native migration, peer2peer between two libvirtd servers</a></h3>
<p>
3 years, 9 months
[PATCH v2] qemu: Don't prealloc mem for real NVDIMMs
by Michal Privoznik
Currently, we configure QEMU to prealloc memory almost by
default. Well, by default for NVDIMMs, hugepages and if user
asked us to (via memoryBacking <allocation mode="immediate"/>).
However, when guest's NVDIMM is backed by real life NVDIMM this
approach is not the best. In this case users should put <pmem/>
into the <memory/> device <source/>, like this:
<memory model='nvdimm' access='shared'>
<source>
<path>/dev/pmem0</path>
<pmem/>
</source>
</memory>
Instructing QEMU to do prealloc in this case means that each
page of the NVDIMM is "touched" (the first byte is read and
written back - see QEMU commit v2.9.0-rc1~26^2) which cripples
device wear.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1894053
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
v2 of:
https://www.redhat.com/archives/libvir-list/2020-November/msg01568.html
diff to v1:
- I've dropped the first hunk of v1 which forbade prealloc even if user
requested it explicitly.
src/qemu/qemu_command.c | 5 ++++-
.../memory-hotplug-nvdimm-pmem.x86_64-latest.args | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index b06a086e18..f572ed64c1 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3085,7 +3085,10 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps,
if (mem->nvdimmPath) {
memPath = g_strdup(mem->nvdimmPath);
- prealloc = true;
+ /* If the NVDIMM is a real device then there's nothing to prealloc.
+ * If anyhing, we would be only wearing off the device. */
+ if (!mem->nvdimmPmem)
+ prealloc = true;
} else if (useHugepage) {
if (qemuGetDomainHupageMemPath(priv->driver, def, pagesize, &memPath) < 0)
return -1;
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
index cac02a6f6d..fb4ae4b518 100644
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
@@ -20,7 +20,7 @@ file=/tmp/lib/domain--1-QEMUGuest1/master-key.aes \
-object memory-backend-ram,id=ram-node0,size=224395264 \
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
-object memory-backend-file,id=memnvdimm0,mem-path=/tmp/nvdimm,share=no,\
-prealloc=yes,size=536870912,pmem=yes \
+size=536870912,pmem=yes \
-device nvdimm,node=0,memdev=memnvdimm0,id=nvdimm0,slot=0 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-display none \
--
2.26.2
3 years, 9 months
[PATCH] qemu: Properly handle setting of <iotune> for empty cdrom
by Peter Krempa
When starting a VM with an empty cdrom which has <iotune> configured the
startup fails as qemu is not happy about setting tuning for an empty
drive:
error: internal error: unable to execute 'block_set_io_throttle', unexpected error: 'Device has no medium'
Resolve this by skipping the setting of throttling for empty drives and
updating the throttling when new medium is inserted into the drive.
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/111
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_hotplug.c | 10 ++++++++++
src/qemu/qemu_process.c | 4 ++++
2 files changed, 14 insertions(+)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 9b93f256e8..57635cd419 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -558,6 +558,16 @@ qemuDomainChangeMediaBlockdev(virQEMUDriverPtr driver,
nodename);
}
+ /* set throttling for the new image */
+ if (rc == 0 &&
+ !virStorageSourceIsEmpty(newsrc) &&
+ qemuDiskConfigBlkdeviotuneEnabled(disk)) {
+ rc = qemuMonitorSetBlockIoThrottle(priv->mon, NULL,
+ diskPriv->qomName,
+ &disk->blkdeviotune,
+ true, true, true);
+ }
+
if (rc == 0)
rc = qemuMonitorBlockdevTrayClose(priv->mon, diskPriv->qomName);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index e7421b415f..414e9327d2 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -6838,6 +6838,10 @@ qemuProcessSetupDiskThrottlingBlockdev(virQEMUDriverPtr driver,
if (qemuDiskBusIsSD(disk->bus))
continue;
+ /* Setting throttling for empty drives fails */
+ if (virStorageSourceIsEmpty(disk->src))
+ continue;
+
if (!qemuDiskConfigBlkdeviotuneEnabled(disk))
continue;
--
2.29.2
3 years, 9 months
[PATCH] networkGetDHCPLeases: Don't assign @ipdef_tmp twice
by Michal Privoznik
When rewriting the function, I've mistakenly declared a variable
and assigned it to itself. Let's initialize the variable properly.
Fixes: 5fb6d98c881c42ab41ca72060217b846949a438f
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed as trivial.
src/network/bridge_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 22d7d330a3..a7c5aade14 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -4155,7 +4155,7 @@ networkGetDHCPLeases(virNetworkPtr net,
/* Obtain prefix */
for (j = 0; j < def->nips; j++) {
- virNetworkIPDefPtr ipdef_tmp = ipdef_tmp = &def->ips[j];
+ virNetworkIPDefPtr ipdef_tmp = &def->ips[j];
if (ipv6 && VIR_SOCKET_ADDR_IS_FAMILY(&ipdef_tmp->address,
AF_INET6)) {
--
2.26.2
3 years, 9 months