[libvirt] [PATCH] qemuProcessHandleMonitorEOF: Disable namespace for domain
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1430634
If a qemu process has died, we get EOF on its monitor. At this
point, since qemu process was the only one running in the
namespace kernel has already cleaned the namespace up. Any
attempt of ours to enter it has to fail.
This really happened in the bug linked above. We've tried to
attach a disk to qemu and while we were in the monitor talking to
qemu it just died. Therefore our code tried to do some roll back
(e.g. deny the device in cgroups again, restore labels, etc.).
However, during the roll back (esp. when restoring labels) we
still thought that domain has a namespace. So we used secdriver's
transactions. This failed as there is no namespace to enter.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain.c | 25 +++++++++++++++++++++++++
src/qemu/qemu_domain.h | 3 +++
src/qemu/qemu_process.c | 4 ++++
3 files changed, 32 insertions(+)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 1a42fcf1b..d5833b026 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -201,6 +201,22 @@ qemuDomainEnableNamespace(virDomainObjPtr vm,
}
+static void
+qemuDomainDisableNamespace(virDomainObjPtr vm,
+ qemuDomainNamespace ns)
+{
+ qemuDomainObjPrivatePtr priv = vm->privateData;
+
+ if (priv->namespaces) {
+ ignore_value(virBitmapClearBit(priv->namespaces, ns));
+ if (virBitmapIsAllClear(priv->namespaces)) {
+ virBitmapFree(priv->namespaces);
+ priv->namespaces = NULL;
+ }
+ }
+}
+
+
void qemuDomainEventQueue(virQEMUDriverPtr driver,
virObjectEventPtr event)
{
@@ -7805,6 +7821,15 @@ qemuDomainCreateNamespace(virQEMUDriverPtr driver,
}
+void
+qemuDomainDestroyNamespace(virQEMUDriverPtr driver ATTRIBUTE_UNUSED,
+ virDomainObjPtr vm)
+{
+ if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT))
+ qemuDomainDisableNamespace(vm, QEMU_DOMAIN_NS_MOUNT);
+}
+
+
bool
qemuDomainNamespaceAvailable(qemuDomainNamespace ns ATTRIBUTE_UNUSED)
{
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 7fa717390..c646828e6 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -816,6 +816,9 @@ int qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg,
int qemuDomainCreateNamespace(virQEMUDriverPtr driver,
virDomainObjPtr vm);
+void qemuDomainDestroyNamespace(virQEMUDriverPtr driver,
+ virDomainObjPtr vm);
+
bool qemuDomainNamespaceAvailable(qemuDomainNamespace ns);
int qemuDomainNamespaceSetupDisk(virQEMUDriverPtr driver,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index fcba7d309..b9c1847bb 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -314,6 +314,10 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
*/
qemuMonitorUnregister(mon);
+ /* We don't want any cleanup from EOF handler (or any other
+ * thread) to enter qemu namespace. */
+ qemuDomainDestroyNamespace(driver, vm);
+
cleanup:
virObjectUnlock(vm);
}
--
2.11.0
7 years, 8 months
[libvirt] [PATCH] qemuxml2argvtest: Don't overwrite driver stateDir
by Michal Privoznik
This is a very historic artefact. Back in the old days of
830ba76c3e when we had macros to add arguments onto qemu command
line (!) we thought it was a good idea to let qemu write out the
PID file. So we passed -pidfile $stateDir/$domName onto the
command line. Thus, in order for tests to work we needed stable
stateDir in the qemu driver. Unfortunately, after 16efa11aa696
where stateDir is mkdtemp()-d, this approach lead to a leak of
temp dir.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tests/qemuxml2argvtest.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index d2d267fce..00b0e25cd 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -581,9 +581,6 @@ mymain(void)
if (VIR_STRDUP_QUIET(driver.config->chardevTLSx509certdir, "/etc/pki/libvirt-chardev") < 0)
return EXIT_FAILURE;
- VIR_FREE(driver.config->stateDir);
- if (VIR_STRDUP_QUIET(driver.config->stateDir, "/nowhere") < 0)
- return EXIT_FAILURE;
VIR_FREE(driver.config->hugetlbfs);
if (VIR_ALLOC_N(driver.config->hugetlbfs, 2) < 0)
return EXIT_FAILURE;
--
2.11.0
7 years, 8 months
[libvirt] [PATCH 0/2] qemu: properly handle delayed vCPU hotunplug
by Peter Krempa
Patch 1 would help in debugging this issue. Patch 2 fixes the bug.
Peter Krempa (2):
qemu: hotplug: Add debug log when dispatching device removal to
existing thread
qemu: hotplug: Reset device removal waiting code after vCPU unplug
src/qemu/qemu_hotplug.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
--
2.12.0
7 years, 8 months
[libvirt] [RFC PATCH 0/2] qemu: Fix ACPI on aarch64
by Andrea Bolognani
Posted as RFC due to the concerns outlined in patch 1.
Andrea Bolognani (2):
qemu: Advertise ACPI support for aarch64 guests
tests: Initialize basic capabilities properly
src/qemu/qemu_capabilities.c | 30 +++++++++++++++++-----
.../caps_2.6.0-gicv2.aarch64.xml | 1 +
.../caps_2.6.0-gicv3.aarch64.xml | 1 +
.../qemuxml2argv-balloon-ccw-deflate.args | 1 -
.../qemuxml2argv-console-sclp.args | 1 -
.../qemuxml2argv-console-virtio-ccw.args | 1 -
.../qemuxml2argv-console-virtio-s390.args | 1 -
.../qemuxml2argv-cpu-s390-features.args | 1 -
.../qemuxml2argv-cpu-s390-zEC12.args | 1 -
.../qemuxml2argv-disk-virtio-ccw-many.args | 1 -
.../qemuxml2argv-disk-virtio-ccw.args | 1 -
.../qemuxml2argv-disk-virtio-s390.args | 1 -
.../qemuxml2argv-disk-virtio-scsi-ccw.args | 1 -
tests/qemuxml2argvdata/qemuxml2argv-fs9p-ccw.args | 1 -
.../qemuxml2argv-hostdev-scsi-vhost-scsi-ccw.args | 1 -
.../qemuxml2argv-hugepages-numa.args | 1 +
.../qemuxml2argv-iothreads-disk-virtio-ccw.args | 1 -
.../qemuxml2argv-iothreads-virtio-scsi-ccw.args | 1 -
.../qemuxml2argv-machine-aeskeywrap-off-cap.args | 1 -
.../qemuxml2argv-machine-aeskeywrap-off-caps.args | 1 -
.../qemuxml2argv-machine-aeskeywrap-on-cap.args | 1 -
.../qemuxml2argv-machine-aeskeywrap-on-caps.args | 1 -
.../qemuxml2argv-machine-deakeywrap-off-cap.args | 1 -
.../qemuxml2argv-machine-deakeywrap-off-caps.args | 1 -
.../qemuxml2argv-machine-deakeywrap-on-cap.args | 1 -
.../qemuxml2argv-machine-deakeywrap-on-caps.args | 1 -
.../qemuxml2argv-machine-keywrap-none-caps.args | 1 -
.../qemuxml2argv-machine-keywrap-none.args | 1 -
.../qemuxml2argv-memory-hotplug-ppc64-nonuma.args | 1 -
.../qemuxml2argv-net-virtio-ccw.args | 1 -
.../qemuxml2argv-net-virtio-s390.args | 1 -
tests/qemuxml2argvdata/qemuxml2argv-ppc-dtb.args | 1 -
.../qemuxml2argv-ppce500-serial.args | 1 -
.../qemuxml2argv-pseries-basic.args | 1 -
.../qemuxml2argv-pseries-cpu-compat.args | 1 -
.../qemuxml2argv-pseries-cpu-exact.args | 1 -
.../qemuxml2argv-pseries-cpu-le.args | 1 -
.../qemuxml2argv-pseries-nvram.args | 1 -
.../qemuxml2argv-pseries-panic-missing.args | 1 -
.../qemuxml2argv-pseries-panic-no-address.args | 1 -
.../qemuxml2argv-pseries-usb-default.args | 1 -
.../qemuxml2argv-pseries-usb-kbd.args | 1 -
.../qemuxml2argv-pseries-usb-multi.args | 1 -
.../qemuxml2argv-pseries-vio-user-assigned.args | 1 -
.../qemuxml2argvdata/qemuxml2argv-pseries-vio.args | 1 -
.../qemuxml2argv-q35-virt-manager-basic.args | 1 +
...muxml2argv-s390-allow-bogus-usb-controller.args | 1 -
.../qemuxml2argv-s390-allow-bogus-usb-none.args | 1 -
.../qemuxml2argv-s390-panic-missing.args | 1 -
.../qemuxml2argv-s390-panic-no-address.args | 1 -
.../qemuxml2argv-virtio-rng-ccw.args | 1 -
.../qemuxml2argv-watchdog-diag288.args | 1 -
tests/qemuxml2argvtest.c | 16 ++++++++++--
53 files changed, 41 insertions(+), 56 deletions(-)
--
2.7.4
7 years, 8 months
[libvirt] [PATCH v2] Revert "conf: move iothread XML validation from qemu_command"
by Pavel Hrdina
This reverts commit c96bd78e4e71c799dc391566fa9f0652dec55dca.
So our code is one big mess and we modify domain definition while
building qemu_command line and our hotplug code share only part
of the parsing and command line building code. Let's revert
that change because to fix it properly would require refactor and
move a lot of things.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1430275
---
src/conf/domain_conf.c | 62 ++------------------------------
src/qemu/qemu_command.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 99 insertions(+), 59 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a58f997621..569becb99d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4737,8 +4737,7 @@ virDomainDiskAddressDiskBusCompatibility(virDomainDiskBus bus,
static int
-virDomainDiskDefValidate(const virDomainDef *def,
- const virDomainDiskDef *disk)
+virDomainDiskDefValidate(const virDomainDiskDef *disk)
{
/* Validate LUN configuration */
if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) {
@@ -4768,24 +4767,6 @@ virDomainDiskDefValidate(const virDomainDef *def,
return -1;
}
- if (disk->iothread > 0) {
- if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO ||
- (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
- disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("IOThreads are only available for virtio pci and "
- "virtio ccw disk"));
- return -1;
- }
-
- if (!virDomainIOThreadIDFind(def, disk->iothread)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Invalid IOThread id '%u' for disk '%s'"),
- disk->iothread, disk->dst);
- return -1;
- }
- }
-
return 0;
}
@@ -4837,47 +4818,12 @@ virDomainNetDefValidate(const virDomainNetDef *net)
static int
-virDomainControllerDefValidate(const virDomainDef *def,
- const virDomainControllerDef *cont)
-{
- if (cont->iothread > 0) {
- if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI ||
- cont->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("IOThreads are only supported for virtio-scsi "
- "controllers, model is '%s'"),
- virDomainControllerModelSCSITypeToString(cont->model));
- return -1;
- }
-
- if (cont->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
- cont->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("IOThreads are only available for virtio pci and "
- "virtio ccw controllers"));
- return -1;
- }
-
- if (!virDomainIOThreadIDFind(def, cont->iothread)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Invalid IOThread id '%u' for controller '%s'"),
- cont->iothread,
- virDomainControllerTypeToString(cont->type));
- return -1;
- }
- }
-
- return 0;
-}
-
-
-static int
virDomainDeviceDefValidateInternal(const virDomainDeviceDef *dev,
const virDomainDef *def)
{
switch ((virDomainDeviceType) dev->type) {
case VIR_DOMAIN_DEVICE_DISK:
- return virDomainDiskDefValidate(def, dev->data.disk);
+ return virDomainDiskDefValidate(dev->data.disk);
case VIR_DOMAIN_DEVICE_REDIRDEV:
return virDomainRedirdevDefValidate(def, dev->data.redirdev);
@@ -4885,9 +4831,6 @@ virDomainDeviceDefValidateInternal(const virDomainDeviceDef *dev,
case VIR_DOMAIN_DEVICE_NET:
return virDomainNetDefValidate(dev->data.net);
- case VIR_DOMAIN_DEVICE_CONTROLLER:
- return virDomainControllerDefValidate(def, dev->data.controller);
-
case VIR_DOMAIN_DEVICE_LEASE:
case VIR_DOMAIN_DEVICE_FS:
case VIR_DOMAIN_DEVICE_INPUT:
@@ -4895,6 +4838,7 @@ virDomainDeviceDefValidateInternal(const virDomainDeviceDef *dev,
case VIR_DOMAIN_DEVICE_VIDEO:
case VIR_DOMAIN_DEVICE_HOSTDEV:
case VIR_DOMAIN_DEVICE_WATCHDOG:
+ case VIR_DOMAIN_DEVICE_CONTROLLER:
case VIR_DOMAIN_DEVICE_GRAPHICS:
case VIR_DOMAIN_DEVICE_HUB:
case VIR_DOMAIN_DEVICE_SMARTCARD:
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 6545a93259..145a0127f2 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1871,6 +1871,49 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
}
+static bool
+qemuCheckIOThreads(const virDomainDef *def,
+ virDomainDiskDefPtr disk)
+{
+ /* Right "type" of disk" */
+ switch ((virDomainDiskBus)disk->bus) {
+ case VIR_DOMAIN_DISK_BUS_VIRTIO:
+ if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
+ disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("IOThreads only available for virtio pci and "
+ "virtio ccw disk"));
+ return false;
+ }
+ break;
+
+ case VIR_DOMAIN_DISK_BUS_IDE:
+ case VIR_DOMAIN_DISK_BUS_FDC:
+ case VIR_DOMAIN_DISK_BUS_SCSI:
+ case VIR_DOMAIN_DISK_BUS_XEN:
+ case VIR_DOMAIN_DISK_BUS_USB:
+ case VIR_DOMAIN_DISK_BUS_UML:
+ case VIR_DOMAIN_DISK_BUS_SATA:
+ case VIR_DOMAIN_DISK_BUS_SD:
+ case VIR_DOMAIN_DISK_BUS_LAST:
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("IOThreads not available for bus %s target %s"),
+ virDomainDiskBusTypeToString(disk->bus), disk->dst);
+ return false;
+ }
+
+ /* Can we find the disk iothread in the iothreadid list? */
+ if (!virDomainIOThreadIDFind(def, disk->iothread)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Disk iothread '%u' not defined in iothreadid"),
+ disk->iothread);
+ return false;
+ }
+
+ return true;
+}
+
+
char *
qemuBuildDriveDevStr(const virDomainDef *def,
virDomainDiskDefPtr disk,
@@ -1889,6 +1932,9 @@ qemuBuildDriveDevStr(const virDomainDef *def,
if (!qemuCheckCCWS390AddressSupport(def, disk->info, qemuCaps, disk->dst))
goto error;
+ if (disk->iothread && !qemuCheckIOThreads(def, disk))
+ goto error;
+
switch (disk->bus) {
case VIR_DOMAIN_DISK_BUS_IDE:
if (disk->info.addr.drive.target != 0) {
@@ -2521,6 +2567,52 @@ qemuBuildUSBControllerDevStr(virDomainControllerDefPtr def,
}
+/* qemuCheckSCSIControllerIOThreads:
+ * @domainDef: Pointer to domain def
+ * @def: Pointer to controller def
+ * @qemuCaps: Capabilities
+ *
+ * If this controller definition has iothreads set, let's make sure the
+ * configuration is right before adding to the command line
+ *
+ * Returns true if either supported or there are no iothreads for controller;
+ * otherwise, returns false if configuration is not quite right.
+ */
+static bool
+qemuCheckSCSIControllerIOThreads(const virDomainDef *domainDef,
+ virDomainControllerDefPtr def)
+{
+ if (!def->iothread)
+ return true;
+
+ if (def->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("IOThreads only supported for virtio-scsi "
+ "controllers model is '%s'"),
+ virDomainControllerModelSCSITypeToString(def->model));
+ return false;
+ }
+
+ if (def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
+ def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("IOThreads only available for virtio pci and "
+ "virtio ccw controllers"));
+ return false;
+ }
+
+ /* Can we find the controller iothread in the iothreadid list? */
+ if (!virDomainIOThreadIDFind(domainDef, def->iothread)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("controller iothread '%u' not defined in iothreadid"),
+ def->iothread);
+ return false;
+ }
+
+ return true;
+}
+
+
char *
qemuBuildControllerDevStr(const virDomainDef *domainDef,
virDomainControllerDefPtr def,
@@ -2571,6 +2663,8 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
if (def->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
virBufferAddLit(&buf, "virtio-scsi-ccw");
if (def->iothread) {
+ if (!qemuCheckSCSIControllerIOThreads(domainDef, def))
+ goto error;
virBufferAsprintf(&buf, ",iothread=iothread%u",
def->iothread);
}
@@ -2583,6 +2677,8 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
} else {
virBufferAddLit(&buf, "virtio-scsi-pci");
if (def->iothread) {
+ if (!qemuCheckSCSIControllerIOThreads(domainDef, def))
+ goto error;
virBufferAsprintf(&buf, ",iothread=iothread%u",
def->iothread);
}
--
2.12.0
7 years, 8 months
[libvirt] Revisiting qemu monitor timeout on VM start
by Jim Fehlig
Hi All,
Encountering a qemu monitor timeout when starting a VM has been discussed here
before, e.g.
https://www.redhat.com/archives/libvir-list/2014-January/msg00060.html
https://www.redhat.com/archives/libvir-list/2014-January/msg00408.html
Recently I've received reports of the same when starting large memory VMs backed
by 1G huge pages. In one of the reports, Matt timed how long it takes to
allocate 402GB worth of hugetlbfs pages (these are 1G pages, but the time is
similar for 2M):
real 105.47
user 0.05
sys 105.42
The time is spent entirely in the kernel zero'ing pages and as you can see it
exceeds the 30 second monitor timeout in libvirt. Do folks have any suggestions
on how to avoid the timeout?
Obviously one solution is to introduce a knob in qemu.conf to control the
timeout, as was proposed in the above threads. Another solution that came to
mind is changing qemu to open the monitor earlier, making it available while the
kernel is off scrubbing pages. I'm not familiar enough with qemu code to know if
such a change is possible, but given the amount of initialization done in main()
prior to calling mon_init_func(), my confidence in this idea is low. Perhaps
someone more familiar with qemu initialization can comment on that. Thanks in
advance for comments on these ideas or alternate proposals!
Regards,
Jim
7 years, 8 months
[libvirt] [PATCH] configure: disable scsi stroage driver on non-Linux
by Roman Bogorodskiy
Even though scsi storage driver builds fine on non-Linux, it
will not work properly because it relies on Linux procfs, so
disable that in configure if we're not building for Linux.
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index e61ab7ba6..cf50422d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -192,6 +192,7 @@ if test $with_linux = no; then
with_lxc=no
fi
with_dtrace=no
+ with_storage_scsi=no
fi
if test $with_freebsd = yes; then
--
2.11.0
7 years, 8 months
[libvirt] [PATCH v2 00/14] Introduce NVDIMM support
by Michal Privoznik
v2 of:
https://www.redhat.com/archives/libvir-list/2017-February/msg01229.html
How to test this feature?
$ > /tmp/nvdimm
$ truncate --size 512M /tmp/nvdimm
$ virsh edit $mydom
<memory model='nvdimm' access='shared'>
<source>
<path>/tmp/nvdimm</path>
</source>
<target>
<size unit='MiB'>512</size>
<node>0</node>
<label>
<size unit='KiB'>128</size>
</label>
</target>
<address type='dimm' slot='0'/>
</memory>
$ virsh start $mydom
$ ssh $mydom "echo \"Hello world\" > /dev/pmem0"
$ hexdump -C /tmp/nvdimm
00000000 48 65 6c 6c 6f 20 77 6f 72 6c 64 0a 00 00 00 00 |Hello world.....|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
20000000
Michal Privoznik (14):
qemuBuildMemoryBackendStr: Reorder args and update comment
Introduce NVDIMM memory model
qemu: Introduce QEMU_CAPS_DEVICE_NVDIMM
qemu: Implement NVDIMM
conf: Introduce @access to <memory/>
qemu: Implement @access for <memory/> banks
qemu: Introduce label-size for NVDIMMs
security_dac: Label host side of NVDIMM
security_selinux: Label host side of NVDIMM
security: Introduce internal APIs for memdev labelling
secdrivers: Implement memdev relabel APIs
qemu_hotplug: Relabel memdev
qemu: Allow nvdimm in devices CGroups
qemu: Namespaces for NVDIMM
docs/formatdomain.html.in | 79 ++++++++---
docs/schemas/domaincommon.rng | 47 +++++--
src/conf/domain_conf.c | 131 +++++++++++++----
src/conf/domain_conf.h | 5 +
src/libvirt_private.syms | 2 +
src/qemu/qemu_alias.c | 10 +-
src/qemu/qemu_capabilities.c | 9 ++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_cgroup.c | 49 +++++++
src/qemu/qemu_cgroup.h | 4 +
src/qemu/qemu_command.c | 155 +++++++++++++++------
src/qemu/qemu_command.h | 16 ++-
src/qemu/qemu_domain.c | 105 +++++++++++++-
src/qemu/qemu_domain.h | 8 ++
src/qemu/qemu_hotplug.c | 42 +++++-
src/qemu/qemu_security.c | 56 ++++++++
src/qemu/qemu_security.h | 8 ++
src/security/security_dac.c | 76 ++++++++++
src/security/security_driver.h | 9 ++
src/security/security_manager.c | 56 ++++++++
src/security/security_manager.h | 7 +
src/security/security_nop.c | 19 +++
src/security/security_selinux.c | 69 +++++++++
src/security/security_stack.c | 38 +++++
.../qemuxml2argv-memory-hotplug-nvdimm-access.args | 26 ++++
.../qemuxml2argv-memory-hotplug-nvdimm-access.xml | 56 ++++++++
.../qemuxml2argv-memory-hotplug-nvdimm-label.args | 26 ++++
.../qemuxml2argv-memory-hotplug-nvdimm-label.xml | 59 ++++++++
.../qemuxml2argv-memory-hotplug-nvdimm.args | 26 ++++
.../qemuxml2argv-memory-hotplug-nvdimm.xml | 56 ++++++++
tests/qemuxml2argvtest.c | 8 +-
...qemuxml2xmlout-memory-hotplug-nvdimm-access.xml | 1 +
.../qemuxml2xmlout-memory-hotplug-nvdimm-label.xml | 1 +
.../qemuxml2xmlout-memory-hotplug-nvdimm.xml | 1 +
tests/qemuxml2xmltest.c | 3 +
35 files changed, 1144 insertions(+), 120 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-access.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-access.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-label.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm-label.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-memory-hotplug-nvdimm.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-memory-hotplug-nvdimm-access.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-memory-hotplug-nvdimm-label.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-memory-hotplug-nvdimm.xml
--
2.11.0
7 years, 8 months
[libvirt] [PATCH] domain_conf: move iothread check for address type back to qemu_command
by Pavel Hrdina
This partially reverts commit c96bd78e4e.
If an API virDomainAttachDevice(Flags) is used the device address
is assigned after the validation and the address type may not be set.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1430275
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/conf/domain_conf.c | 18 ++++--------------
src/qemu/qemu_command.c | 22 ++++++++++++++++++++++
2 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 97d42fe993..747706e673 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -4769,12 +4769,10 @@ virDomainDiskDefValidate(const virDomainDef *def,
}
if (disk->iothread > 0) {
- if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO ||
- (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
- disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("IOThreads are only available for virtio pci and "
- "virtio ccw disk"));
+ if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("IOThreads are not available for bus '%s', disk '%s'"),
+ virDomainDiskBusTypeToString(disk->bus), disk->dst);
return -1;
}
@@ -4850,14 +4848,6 @@ virDomainControllerDefValidate(const virDomainDef *def,
return -1;
}
- if (cont->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
- cont->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("IOThreads are only available for virtio pci and "
- "virtio ccw controllers"));
- return -1;
- }
-
if (!virDomainIOThreadIDFind(def, cont->iothread)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Invalid IOThread id '%u' for controller '%s'"),
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 6545a93259..b49242a7df 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -1871,6 +1871,21 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
}
+static int
+qemuBuildCheckIOThreadAddress(virDomainDeviceInfo info)
+{
+ if (info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI &&
+ info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("IOThreads are only available for virtio pci and "
+ "virtio ccw"));
+ return -1;
+ }
+
+ return 0;
+}
+
+
char *
qemuBuildDriveDevStr(const virDomainDef *def,
virDomainDiskDefPtr disk,
@@ -1889,6 +1904,9 @@ qemuBuildDriveDevStr(const virDomainDef *def,
if (!qemuCheckCCWS390AddressSupport(def, disk->info, qemuCaps, disk->dst))
goto error;
+ if (disk->iothread > 0 && qemuBuildCheckIOThreadAddress(disk->info) < 0)
+ goto error;
+
switch (disk->bus) {
case VIR_DOMAIN_DISK_BUS_IDE:
if (disk->info.addr.drive.target != 0) {
@@ -2571,6 +2589,8 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
if (def->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) {
virBufferAddLit(&buf, "virtio-scsi-ccw");
if (def->iothread) {
+ if (qemuBuildCheckIOThreadAddress(def->info) < 0)
+ goto error;
virBufferAsprintf(&buf, ",iothread=iothread%u",
def->iothread);
}
@@ -2583,6 +2603,8 @@ qemuBuildControllerDevStr(const virDomainDef *domainDef,
} else {
virBufferAddLit(&buf, "virtio-scsi-pci");
if (def->iothread) {
+ if (qemuBuildCheckIOThreadAddress(def->info) < 0)
+ goto error;
virBufferAsprintf(&buf, ",iothread=iothread%u",
def->iothread);
}
--
2.12.0
7 years, 8 months
[libvirt] [PATCH] doc updates
by Philipp Hahn
Hi,
here are 3 patches to improve the documentation:
the 1st one is a re-sent from 2013,
the 2nd one is my version of a patch proposed 2011,
the 3rd is probably most controversal, so drop it if you don't like it. The
QEMU homepage spellts it "QEMU" and "qemu" is used a lot for the binary, but
"Qemu" is used very little.
Philipp Hahn (3):
doc: add storage format entries
doc: Correct the default werror policy
doc: fix writing of QEMU
ChangeLog-old | 4 ++--
docs/formatdomain.html.in | 6 +++---
docs/formatnwfilter.html.in | 6 +++---
docs/news-2009.html.in | 6 +++---
docs/news-2010.html.in | 12 ++++++------
docs/news-2011.html.in | 4 ++--
docs/news-2012.html.in | 2 +-
docs/news-2014.html.in | 2 +-
docs/storage.html.in | 17 ++++++++++-------
libvirt.spec.in | 2 +-
po/af.po | 2 +-
po/am.po | 2 +-
po/anp.po | 2 +-
po/ar.po | 2 +-
po/as.po | 2 +-
po/ast.po | 2 +-
po/bal.po | 2 +-
po/be.po | 2 +-
po/bg.po | 2 +-
po/bn.po | 2 +-
po/bn_IN.po | 2 +-
po/bo.po | 2 +-
po/br.po | 2 +-
po/brx.po | 2 +-
po/bs.po | 2 +-
po/ca.po | 2 +-
po/cs.po | 2 +-
po/cy.po | 2 +-
po/da.po | 2 +-
po/de.po | 2 +-
po/de_CH.po | 2 +-
po/el.po | 2 +-
po/en_GB.po | 4 ++--
po/eo.po | 2 +-
po/es.po | 2 +-
po/et.po | 2 +-
po/eu.po | 2 +-
po/fa.po | 2 +-
po/fi.po | 2 +-
po/fr.po | 2 +-
po/gl.po | 2 +-
po/gu.po | 2 +-
po/he.po | 2 +-
po/hi.po | 2 +-
po/hr.po | 2 +-
po/hu.po | 2 +-
po/ia.po | 2 +-
po/id.po | 2 +-
po/ilo.po | 2 +-
po/is.po | 2 +-
po/it.po | 2 +-
po/ja.po | 2 +-
po/ka.po | 2 +-
po/kk.po | 2 +-
po/km.po | 2 +-
po/kn.po | 2 +-
po/ko.po | 2 +-
po/kw.po | 2 +-
po/kw(a)kkcor.po | 2 +-
po/kw(a)uccor.po | 2 +-
po/kw_GB.po | 2 +-
po/ky.po | 2 +-
po/libvirt.pot | 2 +-
po/lt.po | 2 +-
po/lv.po | 2 +-
po/mai.po | 2 +-
po/mk.po | 2 +-
po/ml.po | 2 +-
po/mn.po | 2 +-
po/mr.po | 2 +-
po/ms.po | 2 +-
po/nb.po | 2 +-
po/nds.po | 2 +-
po/ne.po | 2 +-
po/nl.po | 2 +-
po/nn.po | 2 +-
po/nso.po | 2 +-
po/or.po | 2 +-
po/pa.po | 2 +-
po/pl.po | 2 +-
po/pt.po | 2 +-
po/pt_BR.po | 2 +-
po/ro.po | 2 +-
po/ru.po | 2 +-
po/si.po | 2 +-
po/sk.po | 2 +-
po/sl.po | 2 +-
po/sq.po | 2 +-
po/sr.po | 2 +-
po/sr(a)latin.po | 2 +-
po/sv.po | 2 +-
po/ta.po | 2 +-
po/te.po | 2 +-
po/tg.po | 2 +-
po/th.po | 2 +-
po/tr.po | 2 +-
po/tw.po | 2 +-
po/uk.po | 2 +-
po/ur.po | 2 +-
po/vi.po | 2 +-
po/wba.po | 2 +-
po/yo.po | 2 +-
po/zh_CN.po | 2 +-
po/zh_HK.po | 2 +-
po/zh_TW.po | 2 +-
po/zu.po | 2 +-
src/cpu/cpu_s390.c | 2 +-
src/qemu/MIGRATION.txt | 2 +-
src/qemu/THREADS.txt | 2 +-
src/qemu/qemu.conf | 4 ++--
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_domain.h | 2 +-
src/qemu/qemu_monitor.c | 6 +++---
src/qemu/qemu_parse_command.c | 2 +-
114 files changed, 140 insertions(+), 137 deletions(-)
--
2.1.4
7 years, 8 months