[libvirt] [PATCH v2 0/4] test_driver: implement FS-related APIs
by Ilias Stamatis
Ilias Stamatis (4):
test_driver: introduce domain-private data
test_driver: implement virDomainFSFreeze
test_driver: implement virDomainFSThaw
test_driver: implement virDomainFSTrim
src/test/test_driver.c | 200 ++++++++++++++++++++++++++++++++++++++++-
1 file changed, 199 insertions(+), 1 deletion(-)
--
2.22.0
5 years, 4 months
[libvirt] [PATCH] daemon: improve Xen support in systemd service
by Jim Fehlig
The xencommons service provides all the essential services such as
xenstored, xenconsoled, etc. needed by the libvirt Xen driver, so
libvirtd should be started after xencommons.
The xendomains service uses Xen's xl tool to operate on any domains it
finds running, even those managed by libvirt. Add a conflicts on the
xendomains service to ensure it is not enabled when libvirtd is enabled.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
src/remote/libvirtd.service.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in
index 3ddf0e229b..5dbe7cbe72 100644
--- a/src/remote/libvirtd.service.in
+++ b/src/remote/libvirtd.service.in
@@ -15,6 +15,8 @@ After=local-fs.target
After=remote-fs.target
After=systemd-logind.service
After=systemd-machined.service
+After=xencommons.service
+Conflicts=xendomains.service
Documentation=man:libvirtd(8)
Documentation=https://libvirt.org
--
2.22.0
5 years, 4 months
[libvirt] [PATCH] tools: console: Use proper constructor
by Roman Bolshakov
"virsh console" on macOS cannot attach to a domain and it doesn't matter if
it's local or remote domain:
$ ~ virsh console vm
Connected to domain vm
Escape character is ^]
error: internal error: unable to wait on console condition
The error comes from pthread_cond_wait that fails with EINVAL. The mutex
in the parent is not initialized with pthread_mutex_init and it results
in silent failure of pthead_mutex_lock and the attach failure.
Fixes: 98361cc3b95 ("tools: console: make console virLockableObject")
Signed-off-by: Roman Bolshakov <r.bolshakov(a)yadro.com>
---
tools/virsh-console.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh-console.c b/tools/virsh-console.c
index 826a4afcb2..e16f841e57 100644
--- a/tools/virsh-console.c
+++ b/tools/virsh-console.c
@@ -367,7 +367,7 @@ virConsoleNew(void)
if (virConsoleInitialize() < 0)
return NULL;
- if (!(con = virObjectNew(virConsoleClass)))
+ if (!(con = virObjectLockableNew(virConsoleClass)))
return NULL;
if (virCondInit(&con->cond) < 0) {
--
2.20.1 (Apple Git-117)
5 years, 4 months
[libvirt] [PATCH] news.xml: Restore blank news example
by Michal Privoznik
In v5.6.0-rc1~347 I've mistakenly messed up news.xml as the
change I wanted to promote was added into a comment (I blame git
rebase for that). Anyway, restore the original state of the
comment so it can be copied again.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial rule.
docs/news.xml | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/docs/news.xml b/docs/news.xml
index 3c5cd7d597..a4d727b9c5 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -25,19 +25,6 @@
<section title="New features">
</section>
<section title="Improvements">
- <change>
- <summary>
- Remember original owners and SELinux labels of files
- </summary>
- <description>
- When a domain is starting up libvirt changes DAC and
- SELinux labels so that domain can access it. However,
- it never remembered the original labels and therefore
- the file was returned back to <code>root:root</code>.
- With this release, the original labels are remembered
- and restored properly.
- </description>
- </change>
</section>
<section title="Bug fixes">
</section>
--
2.21.0
5 years, 4 months
[libvirt] Release of libvirt-5.6.0
by Daniel Veillard
It's out ! Tagged in git and with signed tarball and source rpm at the usual
place:
https://libvirt.org/sources/
I also released the 5.6.0 python bindings for the release that can be found
at:
https://libvirt.org/sources/python/
This release includes a number of new features, notably the checkpoint APIs
removes the sxpr xen support and carries a set of improvement and bug fixes
as usual:
New features:
- qemu: Introduce a new video model of type 'bochs'
Introduce a new video model type that supports the bochs-display device
that was added in qemu version 3.0.
- api: new virDomainCheckpoint APIs
Introduce several new APIs for creating and managing checkpoints in the
test and qemu drivers (the latter requires qcow2 images). Checkpoints
serve as a way to tell which portions of a disk have changed since a
point in time.
- qemu: Add support for overriding max threads per process limit
systemd-based systems impose a limit on the number of threads a process
can spawn, which in some cases can be exceeded by QEMU processes
running VMs. Add a max_threads_per_process option to qemu.conf to
override the system default.
- Remember original owners and SELinux labels of files
When a domain is starting up libvirt changes DAC and SELinux labels so
that domain can access it. However, it never remembered the original
labels and therefore the file was returned back to root:root. With this
release, the original labels are remembered and restored properly.
- network: Allow passing arbitrary options to dnsmasq
This works similarly to the existing support for passing arbitary
options to QEMU, and just like that feature it comes with no support
guarantees.
Removed features:
- xen: Remove sxpr config support
Remove the sxpr style config parser and formatter a year after the xend
driver was removed.
Improvements:
- qemu: Allow XML validation for snapshot creation
Add flag VIR_DOMAIN_SNAPSHOT_CREATE_VALIDATE to validate snapshot input
XML. For virsh, users can use it as virsh snapshot-create --validate.
- Support encrypted soft TPM
A soft TPM backend could be encrypted with passphrase. Now libvirt
supports using a secret object to hold the passphrase, and referring to
it via the encryption element of the TPM device.
- test driver: Expand API coverage
Additional APIs have been implemented in the test driver.
- Implement per-driver locking
Drivers now acquire a lock when they're loaded, ensuring that there can
never be two instances of the same driver active at a time.
- nss: Report newer addresses first
In some cases, a guest might be assigned a new IP address by DHCP
before the previous lease has expired, in which case the NSS plugin
will correctly report both addresses; many applications, however,
ignore all addresses but the first, and may thus end up trying to
connect using a stale address. To prevent that from happening, the NSS
plugin will now always report the newest address first.
- util: Optimize mass closing of FDs when spawning child processes
When the limit on the number of FDs is very high, closing all unwanted
FDs after calling fork() can take a lot of time and delay the start of
the child process. libvirt will now use an optimized algorithm that
minimizes such delays.
Bug fixes:
- logging: Ensure virtlogd rollover takes priority over logrotate
virtlogd implements its own rollover mechanism, but until now logrotate
could end up acting on the logs before virtlogd had a chance to do so
itself.
Thanks everybody who helped with this release, be it with bug reports,
patches, reviews, documenation, localization, etc ...
Enjoy the release,
Daniel
--
Daniel Veillard | Red Hat Developers Tools http://developer.redhat.com/
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
5 years, 4 months
[libvirt] [PATCH] maint: Post-release version bump to 5.7.0
by Michal Privoznik
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial rule.
configure.ac | 2 +-
docs/news.xml | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index d18d427695..109827b89c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,7 +16,7 @@ dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library. If not, see
dnl <http://www.gnu.org/licenses/>.
-AC_INIT([libvirt], [5.6.0], [libvir-list(a)redhat.com], [], [https://libvirt.org])
+AC_INIT([libvirt], [5.7.0], [libvir-list(a)redhat.com], [], [https://libvirt.org])
AC_CONFIG_SRCDIR([src/libvirt.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
diff --git a/docs/news.xml b/docs/news.xml
index 9d95b827ed..3c5cd7d597 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -52,6 +52,14 @@
-->
<libvirt>
+ <release version="v5.7.0" date="unreleased">
+ <section title="New features">
+ </section>
+ <section title="Improvements">
+ </section>
+ <section title="Bug fixes">
+ </section>
+ </release>
<release version="v5.6.0" date="2019-08-05">
<section title="New features">
<change>
--
2.21.0
5 years, 4 months
[libvirt] [PATCH] qemu: support bootindex on vfio-ccw mdev device
by Boris Fiuczynski
Add support to specify a boot order on vfio-ccw passthrough devices.
Signed-off-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
Acked-by: Jason J. Herne <jjherne(a)linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay(a)linux.ibm.com>
---
src/qemu/qemu_command.c | 27 +++++++++++++----
.../hostdev-subsys-mdev-vfio-ccw-boot.args | 29 +++++++++++++++++++
.../hostdev-subsys-mdev-vfio-ccw-boot.xml | 23 +++++++++++++++
tests/qemuxml2argvtest.c | 4 +++
4 files changed, 78 insertions(+), 5 deletions(-)
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.args
create mode 100644 tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.xml
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index fee51158a9..36138e2ccf 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -5613,6 +5613,9 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *def,
if (qemuBuildDeviceAddressStr(&buf, def, dev->info, qemuCaps) < 0)
goto cleanup;
+ if (dev->info->bootIndex)
+ virBufferAsprintf(&buf, ",bootindex=%u", dev->info->bootIndex);
+
if (virBufferCheckError(&buf) < 0)
goto cleanup;
@@ -5624,6 +5627,22 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *def,
return ret;
}
+static bool
+qemuHostdevSupportsBoot(virDomainHostdevDefPtr hostdev)
+{
+ if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) {
+ virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys;
+ if (subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI ||
+ subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB ||
+ subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI ||
+ (subsys->type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV &&
+ subsys->u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_CCW)) {
+ return true;
+ }
+ }
+ return false;
+}
+
static int
qemuBuildHostdevCommandLine(virCommandPtr cmd,
const virDomainDef *def,
@@ -5638,13 +5657,11 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
char *devstr;
if (hostdev->info->bootIndex) {
- if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS ||
- (subsys->type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI &&
- subsys->type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB &&
- subsys->type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI)) {
+ if (!qemuHostdevSupportsBoot(hostdev)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("booting from assigned devices is only "
- "supported for PCI, USB and SCSI devices"));
+ "supported for PCI, USB, SCSI and MDEV "
+ "of model vfio-ccw devices"));
return -1;
}
}
diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.args b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.args
new file mode 100644
index 0000000000..6fb22b3014
--- /dev/null
+++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.args
@@ -0,0 +1,29 @@
+LC_ALL=C \
+PATH=/bin \
+HOME=/tmp/lib/domain--1-QEMUGuest1 \
+USER=test \
+LOGNAME=test \
+XDG_DATA_HOME=/tmp/lib/domain--1-QEMUGuest1/.local/share \
+XDG_CACHE_HOME=/tmp/lib/domain--1-QEMUGuest1/.cache \
+XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
+QEMU_AUDIO_DRV=none \
+/usr/bin/qemu-system-s390x \
+-name QEMUGuest1 \
+-S \
+-machine s390-ccw-virtio,accel=tcg,usb=off,dump-guest-core=off \
+-m 512 \
+-realtime mlock=off \
+-smp 2,sockets=2,cores=1,threads=1 \
+-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
+-display none \
+-no-user-config \
+-nodefaults \
+-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
+server,nowait \
+-mon chardev=charmonitor,id=monitor,mode=control \
+-rtc base=utc \
+-no-shutdown \
+-device vfio-ccw,id=hostdev0,\
+sysfsdev=/sys/bus/mdev/devices/90c6c135-ad44-41d0-b1b7-bae47de48627,\
+devno=fe.0.0000,bootindex=1 \
+-device virtio-balloon-ccw,id=balloon0,devno=fe.0.0001
diff --git a/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.xml b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.xml
new file mode 100644
index 0000000000..6cca13c33f
--- /dev/null
+++ b/tests/qemuxml2argvdata/hostdev-subsys-mdev-vfio-ccw-boot.xml
@@ -0,0 +1,23 @@
+<domain type='qemu'>
+ <name>QEMUGuest1</name>
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
+ <memory unit='KiB'>524288</memory>
+ <currentMemory unit='KiB'>524288</currentMemory>
+ <vcpu placement='static'>2</vcpu>
+ <os>
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
+ <hostdev mode='subsystem' type='mdev' model='vfio-ccw'>
+ <source>
+ <address uuid='90c6c135-ad44-41d0-b1b7-bae47de48627'/>
+ </source>
+ <boot order='1'/>
+ </hostdev>
+ </devices>
+</domain>
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index c166fd18d6..c30a0c74ca 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -1621,6 +1621,10 @@ mymain(void)
QEMU_CAPS_CCW,
QEMU_CAPS_CCW_CSSID_UNRESTRICTED,
QEMU_CAPS_DEVICE_VFIO_CCW);
+ DO_TEST("hostdev-subsys-mdev-vfio-ccw-boot",
+ QEMU_CAPS_CCW,
+ QEMU_CAPS_CCW_CSSID_UNRESTRICTED,
+ QEMU_CAPS_DEVICE_VFIO_CCW);
DO_TEST_FAILURE("hostdev-subsys-mdev-vfio-ccw",
QEMU_CAPS_CCW,
QEMU_CAPS_CCW_CSSID_UNRESTRICTED);
--
2.17.0
5 years, 4 months
[libvirt] [PATCH 0/4] Adding resolution properties for QXL device
by jcfaracco@gmail.com
From: Julio Faracco <jcfaracco(a)gmail.com>
This serie adds 'xres' and 'yres' properties into XML definition for QXL
video device to specify a default resolution. This serie covers a simple
test case too.
Julio Faracco (4):
docs: Adding 'xres' and 'yres' into qxl XML definition
conf: Adding XML support for 'xres' and 'yres'
qemu: Generate 'xres' and 'yres' for qxl device.
tests: Add separate tests for 'xres' and 'yres'
docs/schemas/domaincommon.rng | 10 +++++
src/conf/domain_conf.c | 26 ++++++++++++
src/conf/domain_conf.h | 2 +
src/qemu/qemu_command.c | 4 ++
.../video-qxl-resolution.args | 32 +++++++++++++++
.../qemuxml2argvdata/video-qxl-resolution.xml | 40 +++++++++++++++++++
tests/qemuxml2argvtest.c | 4 ++
.../video-qxl-resolution.xml | 40 +++++++++++++++++++
tests/qemuxml2xmltest.c | 1 +
9 files changed, 159 insertions(+)
create mode 100644 tests/qemuxml2argvdata/video-qxl-resolution.args
create mode 100644 tests/qemuxml2argvdata/video-qxl-resolution.xml
create mode 100644 tests/qemuxml2xmloutdata/video-qxl-resolution.xml
--
2.20.1
5 years, 4 months
[libvirt] [PATCH] libxl: Implement domain metadata getter/setter
by Michal Privoznik
Fortunately, the code that handles metadata getting or setting is
driver agnostic, so all that is needed from individual hypervisor
drivers is to call the right functions.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1732306
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/libxl/libxl_driver.c | 67 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 492028c487..ca01f620c7 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -6515,6 +6515,70 @@ libxlConnectBaselineCPU(virConnectPtr conn,
return cpustr;
}
+static int
+libxlDomainSetMetadata(virDomainPtr dom,
+ int type,
+ const char *metadata,
+ const char *key,
+ const char *uri,
+ unsigned int flags)
+{
+ libxlDriverPrivatePtr driver = dom->conn->privateData;
+ VIR_AUTOUNREF(libxlDriverConfigPtr) cfg = libxlDriverConfigGet(driver);
+ virDomainObjPtr vm = NULL;
+ int ret = -1;
+
+ virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
+ VIR_DOMAIN_AFFECT_CONFIG, -1);
+
+ if (!(vm = libxlDomObjFromDomain(dom)))
+ return -1;
+
+ if (virDomainSetMetadataEnsureACL(dom->conn, vm->def, flags) < 0)
+ goto cleanup;
+
+ if (libxlDomainObjBeginJob(driver, vm, LIBXL_JOB_MODIFY) < 0)
+ goto cleanup;
+
+ ret = virDomainObjSetMetadata(vm, type, metadata, key, uri, cfg->caps,
+ driver->xmlopt, cfg->stateDir,
+ cfg->configDir, flags);
+
+ if (ret == 0) {
+ virObjectEventPtr ev = NULL;
+ ev = virDomainEventMetadataChangeNewFromObj(vm, type, uri);
+ virObjectEventStateQueue(driver->domainEventState, ev);
+ }
+
+ libxlDomainObjEndJob(driver, vm);
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
+
+static char *
+libxlDomainGetMetadata(virDomainPtr dom,
+ int type,
+ const char *uri,
+ unsigned int flags)
+{
+ virDomainObjPtr vm;
+ char *ret = NULL;
+
+ if (!(vm = libxlDomObjFromDomain(dom)))
+ return NULL;
+
+ if (virDomainGetMetadataEnsureACL(dom->conn, vm->def) < 0)
+ goto cleanup;
+
+ ret = virDomainObjGetMetadata(vm, type, uri, flags);
+
+ cleanup:
+ virDomainObjEndAPI(&vm);
+ return ret;
+}
+
static virHypervisorDriver libxlHypervisorDriver = {
.name = LIBXL_DRIVER_NAME,
.connectURIProbe = libxlConnectURIProbe,
@@ -6628,6 +6692,9 @@ static virHypervisorDriver libxlHypervisorDriver = {
.connectGetDomainCapabilities = libxlConnectGetDomainCapabilities, /* 2.0.0 */
.connectCompareCPU = libxlConnectCompareCPU, /* 2.3.0 */
.connectBaselineCPU = libxlConnectBaselineCPU, /* 2.3.0 */
+ .domainSetMetadata = libxlDomainSetMetadata, /* 5.7.0 */
+ .domainGetMetadata = libxlDomainGetMetadata, /* 5.7.0 */
+
};
static virConnectDriver libxlConnectDriver = {
--
2.21.0
5 years, 4 months