[libvirt] [PATCH v2] Ignore virtio-mmio disks in qemuAssignDevicePCISlots()
by Pavel Fedin
Fixes the following error when attempting to add a disk with bus='virtio'
to a machine which actually supports virtio-mmio (caught with ARM virt):
virtio disk cannot have an address of type 'virtio-mmio'
The problem has been likely introduced by
e8d55172544c1fafe31a9e09346bdebca4f0d6f9. Before that
qemuAssignDevicePCISlots() was never called for ARM "virt" machine.
Signed-off-by: Pavel Fedin <p.fedin(a)samsung.com>
---
v1 => v2
- Added check for QEMU_CAPS_DEVICE_VIRTIO_MMIO, this leaves the
error message for machines which actually do not support
virtio-mmio. In this case the user may still attempt to add
such a disk manually.
---
src/qemu/qemu_command.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ec5e3d4..db21ee9 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2598,6 +2598,12 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
continue;
+ /* Also ignore virtio-mmio disks if our machine allows them */
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO) &&
+ def->disks[i]->info.type ==
+ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO)
+ continue;
+
if (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("virtio disk cannot have an address of type '%s'"),
--
1.9.5.msysgit.0
9 years, 2 months
[libvirt] [sandbox PATCH v4 00/21] *** virt-sandbox-image v4 ***
by Eren Yagdiran
Hi,
Running sandbox now has its own disk layer.
virt-sandbox now using GHashMap to store key value pairs for environment variables
and some minor changes.
Daniel P Berrange (1):
Add virt-sandbox-image
Eren Yagdiran (20):
Fix virt-sandbox-image
Image: Add Hooking Mechanism
Image: virt-sandbox-image default dir constants
Image: Discard caching bytecode
Image: Add check_writable and runtime resolver
Image: Add download function
Image: Refactor create function
Image: Add delete function
Image: Add get_command function to Source
Image: Add run args
Image: Add check_connect function
Image: Add get_disk function to Source
Image: Add run function
Image: Add network support
Image: Add Volume Support
Image: man file for virt-sandbox-image
Add config for environment variables
Add environment parameter to virt-sandbox
init-common: Exporting custom environment variables
Image: Add custom environment support
.gitignore | 1 +
bin/Makefile.am | 21 +-
bin/virt-sandbox-image.in | 3 +
bin/virt-sandbox-image.pod | 172 +++++++++++
bin/virt-sandbox.c | 14 +
configure.ac | 2 +
libvirt-sandbox/libvirt-sandbox-config.c | 171 ++++++++++-
libvirt-sandbox/libvirt-sandbox-config.h | 13 +
libvirt-sandbox/libvirt-sandbox-init-common.c | 18 ++
libvirt-sandbox/libvirt-sandbox.sym | 6 +
libvirt-sandbox/tests/test-config.c | 10 +
po/POTFILES.in | 1 +
virt-sandbox-image/Makefile.am | 14 +
virt-sandbox-image/sources/DockerSource.py | 419 ++++++++++++++++++++++++++
virt-sandbox-image/sources/Source.py | 55 ++++
virt-sandbox-image/sources/__init__.py | 26 ++
virt-sandbox-image/virt-sandbox-image.py | 306 +++++++++++++++++++
17 files changed, 1247 insertions(+), 5 deletions(-)
create mode 100644 bin/virt-sandbox-image.in
create mode 100644 bin/virt-sandbox-image.pod
create mode 100644 virt-sandbox-image/Makefile.am
create mode 100644 virt-sandbox-image/sources/DockerSource.py
create mode 100644 virt-sandbox-image/sources/Source.py
create mode 100644 virt-sandbox-image/sources/__init__.py
create mode 100755 virt-sandbox-image/virt-sandbox-image.py
--
2.1.0
9 years, 2 months
[libvirt] [PATCH] qemu: migration: Relax enforcement of memory hotplug support
by Peter Krempa
If the current live definition does not have memory hotplug enabled, but
the persistent one does libvirt would reject migration if the
destination does not support memory hotplug even if the user didn't want
to persist the VM at the destination and thus the XML containing the
memory hotplug definition would not be used. To fix this corner case the
code will check for memory hotplug in the newDef only if
VIR_MIGRATE_PERSIST_DEST was used.
---
src/qemu/qemu_migration.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index d50d367..1846239 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2989,7 +2989,8 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver,
}
if (vm->def->mem.max_memory ||
- (vm->newDef &&
+ ((flags & VIR_MIGRATE_PERSIST_DEST) &&
+ vm->newDef &&
vm->newDef->mem.max_memory))
cookieFlags |= QEMU_MIGRATION_COOKIE_MEMORY_HOTPLUG;
--
2.4.5
9 years, 2 months
[libvirt] [PATCH] docs: Drop unused rule for internals/%.html.tmp target
by Guido Günther
We're using the %.html.tmp for all html files now so drop the unused one
and rather make sure the needed directory exists.
This fixes build failures as described in
https://www.redhat.com/archives/libvir-list/2015-August/msg00603.html
---
configure.ac | 1 +
docs/Makefile.am | 9 ---------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/configure.ac b/configure.ac
index 9066ed6..749dbb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2774,6 +2774,7 @@ AC_DEFINE_UNQUOTED([isbase64],[libvirt_gl_isbase64],[Hack to avoid symbol clash]
AC_DEFINE_UNQUOTED([base64_encode],[libvirt_gl_base64_encode],[Hack to avoid symbol clash])
AC_DEFINE_UNQUOTED([base64_encode_alloc],[libvirt_gl_base64_encode_alloc],[Hack to avoid symbol clash])
+AC_CONFIG_COMMANDS([mkdir], [$MKDIR_P docs/internals])
AC_CONFIG_FILES([run],
[chmod +x,-w run])
AC_CONFIG_FILES([\
diff --git a/docs/Makefile.am b/docs/Makefile.am
index daf37b6..563baca 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -218,15 +218,6 @@ $(srcdir)/hvsupport.html.in: $(srcdir)/hvsupport.pl $(api_DATA) \
%.png: %.fig
convert -rotate 90 $< $@
-internals/%.html.tmp: internals/%.html.in subsite.xsl page.xsl sitemap.html.in
- @if [ -x $(XSLTPROC) ] ; then \
- echo "Generating $@"; \
- $(MKDIR_P) internals; \
- name=`echo $@ | sed -e 's/.tmp//'`; \
- $(XSLTPROC) --stringparam pagename $$name --nonet \
- $(top_srcdir)/docs/subsite.xsl $< > $@ \
- || { rm $@ && exit 1; }; fi
-
%.html.tmp: %.html.in site.xsl page.xsl sitemap.html.in $(acl_generated)
@if [ -x $(XSLTPROC) ] ; then \
echo "Generating $@"; \
--
2.1.4
9 years, 2 months
[libvirt] [PATCH] Ignore virtio-mmio disks in qemuAssignDevicePCISlots()
by Pavel Fedin
Fixes the following error when attempting to add a disk with bus='virtio':
virtio only support device address type 'PCI'
Signed-off-by: Pavel Fedin <p.fedin(a)samsung.com>
---
src/qemu/qemu_command.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 38104da..408b249 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2189,12 +2189,14 @@ qemuAssignDevicePCISlots(virDomainDefPtr def,
if (def->disks[i]->bus != VIR_DOMAIN_DISK_BUS_VIRTIO)
continue;
- /* don't touch s390 devices */
+ /* don't touch s390 and virtio-mmio devices */
if (def->disks[i]->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI ||
def->disks[i]->info.type ==
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390 ||
def->disks[i]->info.type ==
- VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)
+ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW ||
+ def->disks[i]->info.type ==
+ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO)
continue;
if (def->disks[i]->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
--
1.9.5.msysgit.0
9 years, 2 months
[libvirt] [PATCHv2] qemu: Validate address type when attaching a disk device.
by Ruifeng Bian
https://bugzilla.redhat.com/show_bug.cgi?id=1257844
Attach-device can hotplug a virtio disk device with any address type now,
it need to validate the address type before the attachment.
Coldplug a scsi disk device without checking the address type in current
version, this patch also fix the scsi disk problem.
---
src/qemu/qemu_driver.c | 8 ++++++++
src/qemu/qemu_hotplug.c | 18 ++++++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 91eb661..af926fc 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8050,6 +8050,14 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
if (disk->bus != VIR_DOMAIN_DISK_BUS_VIRTIO)
if (virDomainDefAddImplicitControllers(vmdef) < 0)
return -1;
+ /* scsi disk should have an address type of driver */
+ if (disk->bus == VIR_DOMAIN_DISK_BUS_SCSI &&
+ (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("scsi disk cannot have an address of type '%s'"),
+ virDomainDeviceAddressTypeToString(disk->info.type));
+ return -1;
+ }
if (qemuDomainAssignAddresses(vmdef, qemuCaps, NULL) < 0)
return -1;
break;
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 63fafa6..4226650 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -335,6 +335,24 @@ qemuDomainAttachVirtioDiskDevice(virConnectPtr conn,
if (!qemuCheckCCWS390AddressSupport(vm->def, disk->info, priv->qemuCaps,
disk->dst))
goto cleanup;
+
+ /* virtio device should either have a ccw or pci address */
+ if (qemuDomainMachineIsS390CCW(vm->def) &&
+ virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_VIRTIO_CCW)) {
+ if (!virDomainDeviceAddressIsValid(&disk->info,
+ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) {
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("device cannot be attached without a valid CCW address"));
+ goto cleanup;
+ }
+ } else {
+ if (!virDomainDeviceAddressIsValid(&disk->info,
+ VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("device cannot be attached without a valid PCI address"));
+ goto cleaup;
+ }
+ }
}
for (i = 0; i < vm->def->ndisks; i++) {
--
2.4.3
9 years, 2 months
[libvirt] [PATCH] Allow execute access to /var/lib/libvirt/qemu/ for others
by Martin Kletzander
Commit f1f68ca33433 tried fixing running multiple domains under various
users, but if the user can't browse the directory, it's hard for the
qemu running under that user to create the monitor socket.
The permissions need to be fixed in two places due to support for both
installations with and without driver modules.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146886
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
This is not a problem for non-rpm installs because normal make install
will not change the permissions, it will just create the directory, so
it has 0755, but that difference is not something I'm trying to fix in
this patch.
libvirt.spec.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index bb8bfc3c25c1..48461e865dc8 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -2002,7 +2002,7 @@ exit 0
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
%ghost %dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/qemu/
-%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
+%dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/
%{_datadir}/augeas/lenses/libvirtd_qemu.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
@@ -2110,7 +2110,7 @@ exit 0
%config(noreplace) %{_sysconfdir}/libvirt/qemu-lockd.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.qemu
%ghost %dir %attr(0700, root, root) %{_localstatedir}/run/libvirt/qemu/
-%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
+%dir %attr(0751, %{qemu_user}, %{qemu_group}) %{_localstatedir}/lib/libvirt/qemu/
%dir %attr(0750, %{qemu_user}, %{qemu_group}) %{_localstatedir}/cache/libvirt/qemu/
%{_datadir}/augeas/lenses/libvirtd_qemu.aug
%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
--
2.5.1
9 years, 2 months
[libvirt] [PATCH] qemu: Report error if per-VM directory cannot be created
by Martin Kletzander
Commit f1f68ca33433 did not report an error if virFileMakePath()
returned -1. Well, who would've guessed function with name starting
with 'vir' sets an errno instead of reporting an error the libvirt way.
Anyway, let's fix it, so the output changes from:
$ virsh start arm
error: Failed to start domain arm
error: An error occurred, but the cause is unknown
to:
$ virsh start arm
error: Failed to start domain arm
error: Cannot create directory '/var/lib/libvirt/qemu/domain-arm': Not
a directory
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1146886
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_process.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index f7eb2b609437..d9a0942c4dfd 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4734,8 +4734,10 @@ int qemuProcessStart(virConnectPtr conn,
if (virAsprintf(&tmppath, "%s/domain-%s", cfg->libDir, vm->def->name) < 0)
goto cleanup;
- if (virFileMakePath(tmppath) < 0)
+ if (virFileMakePath(tmppath) < 0) {
+ virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath);
goto cleanup;
+ }
if (virSecurityManagerDomainSetDirLabel(driver->securityManager,
vm->def, tmppath) < 0)
@@ -4747,8 +4749,10 @@ int qemuProcessStart(virConnectPtr conn,
cfg->channelTargetDir, vm->def->name) < 0)
goto cleanup;
- if (virFileMakePath(tmppath) < 0)
+ if (virFileMakePath(tmppath) < 0) {
+ virReportSystemError(errno, _("Cannot create directory '%s'"), tmppath);
goto cleanup;
+ }
if (virSecurityManagerDomainSetDirLabel(driver->securityManager,
vm->def, tmppath) < 0)
--
2.5.1
9 years, 2 months
[libvirt] [PATCH] Distribute only generated virkeymaps.h
by Martin Kletzander
We are distributing virkeymaps.h and all the tools needed to rebuild
that file. On top of that, we are generating that file into the
$(srcdir) and that sometimes fails for me when trying to do make dist in
VPATH on rawhide fedora. And we don't clean the file when
maintainer-clean make target is requested.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/Makefile.am | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index 429137561c6f..c2784af299dc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -173,15 +173,13 @@ UTIL_SOURCES = \
$(NULL)
-EXTRA_DIST += $(srcdir)/util/virkeymaps.h $(srcdir)/util/keymaps.csv \
- $(srcdir)/util/virkeycode-mapgen.py
-
BUILT_SOURCES += util/virkeymaps.h
+MAINTAINERCLEANFILES += util/virkeymaps.h
util/virkeymaps.h: $(srcdir)/util/keymaps.csv \
$(srcdir)/util/virkeycode-mapgen.py
$(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py \
- <$(srcdir)/util/keymaps.csv >$(srcdir)/util/virkeymaps.h
+ <$(srcdir)/util/keymaps.csv >util/virkeymaps.h
# Internal generic driver infrastructure
NODE_INFO_SOURCES = nodeinfo.h nodeinfo.c nodeinfopriv.h
--
2.5.1
9 years, 2 months