[libvirt] [PATCH] qemu: Introduce qemuDomainDefCheckABIStability
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=994364
Whenever we check for ABI stability, we have new xml (e.g. provided by
user, or obtained from snapshot, whatever) which we compare to old xml
and see if ABI won't break. However, if the new xml was produced via
virDomainGetXMLDesc(..., VIR_DOMAIN_XML_MIGRATABLE) it lacks some
devices, e.g. 'pci-root' controller. Hence, the ABI stability check
fails even though it is stable. Moreover, we can't simply fix
virDomainDefCheckABIStability because removing the correct devices is
task for the driver. For instance, qemu driver wants to remove the usb
controller too, while LXC driver doesn't. That's why we need special
qemu wrapper over virDomainDefCheckABIStability which removes the
correct devices from domain XML, produces MIGRATABLE xml and calls the
check ABI stability function.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_domain.c | 22 ++++++++++++++++++++++
src/qemu/qemu_domain.h | 3 +++
src/qemu/qemu_driver.c | 10 ++--------
src/qemu/qemu_migration.c | 4 ++--
4 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 968e323..f3e2ba1 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -2342,3 +2342,25 @@ qemuDomainUpdateDeviceList(virQEMUDriverPtr driver,
priv->qemuDevices = aliases;
return 0;
}
+
+bool
+qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
+ virDomainDefPtr src,
+ virDomainDefPtr dst)
+{
+ virDomainDefPtr migratableDefSrc = NULL;
+ virDomainDefPtr migratableDefDst = NULL;
+ const int flags = VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_UPDATE_CPU | VIR_DOMAIN_XML_MIGRATABLE;
+ bool ret = false;
+
+ if (!(migratableDefSrc = qemuDomainDefCopy(driver, src, flags)) ||
+ !(migratableDefDst = qemuDomainDefCopy(driver, dst, flags)))
+ goto cleanup;
+
+ ret = virDomainDefCheckABIStability(migratableDefSrc, migratableDefDst);
+
+cleanup:
+ virDomainDefFree(migratableDefSrc);
+ virDomainDefFree(migratableDefDst);
+ return ret;
+}
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 21f116c..5d9fab9 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -368,4 +368,7 @@ extern virDomainDefParserConfig virQEMUDriverDomainDefParserConfig;
int qemuDomainUpdateDeviceList(virQEMUDriverPtr driver,
virDomainObjPtr vm);
+bool qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
+ virDomainDefPtr src,
+ virDomainDefPtr dst);
#endif /* __QEMU_DOMAIN_H__ */
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c71aecc..8481591 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3077,7 +3077,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
VIR_DOMAIN_XML_INACTIVE))) {
goto endjob;
}
- if (!virDomainDefCheckABIStability(vm->def, def)) {
+ if (!qemuDomainDefCheckABIStability(driver, vm->def, def)) {
virDomainDefFree(def);
goto endjob;
}
@@ -12889,7 +12889,6 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
qemuDomainObjPrivatePtr priv;
int rc;
virDomainDefPtr config = NULL;
- virDomainDefPtr migratableDef = NULL;
virQEMUDriverConfigPtr cfg = NULL;
virCapsPtr caps = NULL;
@@ -13006,11 +13005,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
/* Transitions 5, 6, 8, 9 */
/* Check for ABI compatibility. We need to do this check against
* the migratable XML or it will always fail otherwise */
- if (!(migratableDef = qemuDomainDefCopy(driver, vm->def,
- VIR_DOMAIN_XML_MIGRATABLE)))
- goto cleanup;
-
- if (config && !virDomainDefCheckABIStability(migratableDef, config)) {
+ if (config && !qemuDomainDefCheckABIStability(driver, vm->def, config)) {
virErrorPtr err = virGetLastError();
if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) {
@@ -13215,7 +13210,6 @@ cleanup:
}
if (vm)
virObjectUnlock(vm);
- virDomainDefFree(migratableDef);
virObjectUnref(caps);
virObjectUnref(cfg);
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 3a1aab7..59fd263 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2039,7 +2039,7 @@ static char
VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;
- if (!virDomainDefCheckABIStability(vm->def, def))
+ if (!qemuDomainDefCheckABIStability(driver, vm->def, def))
goto cleanup;
rv = qemuDomainDefFormatLive(driver, def, false, true);
@@ -2242,7 +2242,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
if (!newdef)
goto cleanup;
- if (!virDomainDefCheckABIStability(*def, newdef)) {
+ if (!qemuDomainDefCheckABIStability(driver, *def, newdef)) {
virDomainDefFree(newdef);
goto cleanup;
}
--
1.8.1.5
11 years, 1 month
[libvirt] [PATCH] Move virNetDevVPort enum impl into virnetdevvportprofile.c
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The enum for virNetDevVPort is declared in the header file
virnetdevvportprofile.h, but for some reason the impl is
in netdev_vport_profile_conf.c.
This causes a dep from src/util onto src/conf which is not
allowed. Move the enum impl into virnetdevvportprofile.c
to break the circle.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/conf/netdev_vport_profile_conf.c | 7 -------
src/util/virnetdevvportprofile.c | 6 ++++++
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_profile_conf.c
index e8199e2..a16a04a 100644
--- a/src/conf/netdev_vport_profile_conf.c
+++ b/src/conf/netdev_vport_profile_conf.c
@@ -30,13 +30,6 @@
#define VIR_FROM_THIS VIR_FROM_NONE
-VIR_ENUM_IMPL(virNetDevVPort, VIR_NETDEV_VPORT_PROFILE_LAST,
- "none",
- "802.1Qbg",
- "802.1Qbh",
- "openvswitch")
-
-
virNetDevVPortProfilePtr
virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags)
{
diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c
index 07155b9..1cae20a 100644
--- a/src/util/virnetdevvportprofile.c
+++ b/src/util/virnetdevvportprofile.c
@@ -29,6 +29,12 @@
#define VIR_FROM_THIS VIR_FROM_NET
+VIR_ENUM_IMPL(virNetDevVPort, VIR_NETDEV_VPORT_PROFILE_LAST,
+ "none",
+ "802.1Qbg",
+ "802.1Qbh",
+ "openvswitch")
+
VIR_ENUM_IMPL(virNetDevVPortProfileOp, VIR_NETDEV_VPORT_PROFILE_OP_LAST,
"create",
"save",
--
1.8.3.1
11 years, 1 month
[libvirt] [PATCH 0/2] btrfs subvolume management
by Oskari Saarenmaa
Moved btrfs subvolume management to storage_backend_fs.c instead of
implementing it as a separate pool as suggested by Daniel P. Berrange in
https://www.redhat.com/archives/libvir-list/2013-September/msg00316.html
Oskari Saarenmaa (2):
virFileFsType: get filesystem type of a given path
storage: btrfs subvolumes for directory pools
configure.ac | 25 ++-
docs/schemas/storagevol.rng | 1 +
docs/storage.html.in | 30 ++-
libvirt.spec.in | 4 +
src/conf/storage_conf.c | 3 +
src/conf/storage_conf.h | 1 +
src/libvirt_private.syms | 1 +
src/storage/storage_backend.c | 15 +-
src/storage/storage_backend_fs.c | 222 ++++++++++++++++++++--
src/util/virfile.c | 47 +++++
src/util/virfile.h | 1 +
src/util/virstoragefile.c | 4 +-
src/util/virstoragefile.h | 1 +
tests/storagevolxml2xmlin/vol-btrfs-snapshot.xml | 13 ++
tests/storagevolxml2xmlin/vol-btrfs.xml | 9 +
tests/storagevolxml2xmlout/vol-btrfs-snapshot.xml | 26 +++
tests/storagevolxml2xmlout/vol-btrfs.xml | 17 ++
tests/storagevolxml2xmltest.c | 2 +
18 files changed, 392 insertions(+), 30 deletions(-)
11 years, 1 month
[libvirt] [PATCH v2 0/5] qemumonitorjsontest: Introduce some tests
by Michal Privoznik
v2 to some patches that weren't ACKed yet.
Michal Privoznik (5):
qemuMonitorTestFree: Join worker thread
qemumonitorjsontest: Extend the test for yet another monitor commands
qemumonitorjsontest: Test qemuMonitorJSONGetCPUInfo
qemumonitorjsontest: Test qemuMonitorJSONGetVirtType
qemumonitorjsontest: Test qemuMonitorJSONSendKey
tests/qemumonitorjsontest.c | 253 +++++++++++++++++++++++++++++++++++++++++++
tests/qemumonitortestutils.c | 5 +-
2 files changed, 256 insertions(+), 2 deletions(-)
--
1.8.1.5
11 years, 1 month
[libvirt] [PATCHv2 0/4] qemu: Allow users specify -incoming listen address
by Michal Privoznik
v2 for my previous attempt:
https://www.redhat.com/archives/libvir-list/2013-October/msg00400.html
diff to v1:
-Check if listenAddress is a numeric IPv4 or IPv6 prior parsing it
-enclose all IPv6 addresses in angle brackets
1/4 has been ACKed already
Michal Privoznik (4):
Migration: Introduce VIR_MIGRATE_PARAM_LISTEN_ADDRESS
virsocket: Introduce virSocketAddrIsWildcard
qemu: Implement support for VIR_MIGRATE_PARAM_LISTEN_ADDRESS
qemu_conf: Introduce "migration_address"
include/libvirt/libvirt.h.in | 10 ++++
src/libvirt_private.syms | 1 +
src/qemu/libvirtd_qemu.aug | 3 +
src/qemu/qemu.conf | 6 ++
src/qemu/qemu_conf.c | 2 +
src/qemu/qemu_conf.h | 3 +
src/qemu/qemu_driver.c | 33 ++++++++---
src/qemu/qemu_migration.c | 113 +++++++++++++++++++++++++------------
src/qemu/qemu_migration.h | 13 +++--
src/qemu/test_libvirtd_qemu.aug.in | 1 +
src/util/virsocketaddr.c | 71 +++++++++++++++++------
src/util/virsocketaddr.h | 2 +
tests/sockettest.c | 29 ++++++++++
tools/virsh-domain.c | 11 ++++
tools/virsh.pod | 10 +++-
15 files changed, 241 insertions(+), 67 deletions(-)
--
1.8.1.5
11 years, 1 month
[libvirt] [PATCH] AArch64: Porting of armv7l conditons to run qemu for aarch64.
by Pranavkumar Sawargaonkar
AArch64 qemu has similar behavior as armv7l, like use of mmio etc.
This patch adds similar bypass checks what we have for armv7l to aarch64.
E.g. we are enabling mmio transport for Nicdev.
Making addDefaultUSB and addDefaultMemballoon to false etc.
Signed-off-by: Anup Patel <anup.patel(a)linaro.org>
Signed-off-by: Pranavkumar Sawargaonkar <pranavkumar(a)linaro.org>
---
src/qemu/qemu_capabilities.c | 2 +-
src/qemu/qemu_command.c | 8 +++++---
src/qemu/qemu_domain.c | 5 ++++-
3 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 1eae4ba..74a1690 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2872,7 +2872,7 @@ virQEMUCapsSupportsChardev(virDomainDefPtr def,
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE))
return false;
- if (def->os.arch != VIR_ARCH_ARMV7L)
+ if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64))
return true;
/* This may not be true for all ARM machine types, but at least
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 22cc5f2..1c4de84 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -427,7 +427,8 @@ qemuDomainSupportsNicdev(virDomainDefPtr def,
return false;
/* non-virtio ARM nics require legacy -net nic */
- if (def->os.arch == VIR_ARCH_ARMV7L &&
+ if (((def->os.arch == VIR_ARCH_ARMV7L) ||
+ (def->os.arch == VIR_ARCH_AARCH64)) &&
net->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO)
return false;
@@ -1339,7 +1340,8 @@ static int
qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
virQEMUCapsPtr qemuCaps)
{
- if (def->os.arch == VIR_ARCH_ARMV7L &&
+ if (((def->os.arch == VIR_ARCH_ARMV7L) ||
+ (def->os.arch == VIR_ARCH_AARCH64)) &&
STRPREFIX(def->os.machine, "vexpress-") &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) {
qemuDomainPrimeVirtioDeviceAddresses(
@@ -1870,7 +1872,7 @@ cleanup:
static bool
qemuDomainSupportsPCI(virDomainDefPtr def) {
- if (def->os.arch != VIR_ARCH_ARMV7L)
+ if ((def->os.arch != VIR_ARCH_ARMV7L) && (def->os.arch != VIR_ARCH_AARCH64))
return true;
if (STREQ(def->os.machine, "versatilepb"))
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 968e323..f4986d7 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -727,7 +727,10 @@ qemuDomainDefPostParse(virDomainDefPtr def,
addDefaultUSB = false;
addDefaultMemballoon = false;
break;
-
+ case VIR_ARCH_AARCH64:
+ addDefaultUSB = false;
+ addDefaultMemballoon = false;
+ break;
case VIR_ARCH_ALPHA:
case VIR_ARCH_PPC:
case VIR_ARCH_PPC64:
--
1.7.9.5
11 years, 1 month
[libvirt] [PATCH] qemu: Init @pcidevs in qemuPrepareHostdevPCIDevices
by Michal Privoznik
At the beginning of the function qemuPrepareHostdevPCICheckSupport() is
called. After that @pcidevs is initialized. However, if the very first
command fails, we go to 'cleanup' label where virObjectUnref(pcidevs) is
called. Obviously, it is called before @pcidevs was able to get
initialized. Compiler warns about it:
CC qemu/libvirt_driver_qemu_impl_la-qemu_hostdev.lo
qemu/qemu_hostdev.c: In function 'qemuPrepareHostdevPCIDevices':
qemu/qemu_hostdev.c:824:19: error: 'pcidevs' may be used uninitialized in this function [-Werror=maybe-uninitialized]
virObjectUnref(pcidevs);
^
cc1: all warnings being treated as errors
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under buildbreaker and trivial rules.
src/qemu/qemu_hostdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c
index 81e0e88..43c03cc 100644
--- a/src/qemu/qemu_hostdev.c
+++ b/src/qemu/qemu_hostdev.c
@@ -633,7 +633,7 @@ qemuPrepareHostdevPCIDevices(virQEMUDriverPtr driver,
int nhostdevs,
virQEMUCapsPtr qemuCaps)
{
- virPCIDeviceListPtr pcidevs;
+ virPCIDeviceListPtr pcidevs = NULL;
int last_processed_hostdev_vf = -1;
size_t i;
int ret = -1;
--
1.8.1.5
11 years, 1 month
[libvirt] [PATCHv4 0/3] Change preference of default PCI passthrough type to VFIO
by Peter Krempa
Peter Krempa (3):
qemu: hostdev: Fix function spacing and header formatting
qemu: hostdev: Add checks if PCI passthrough is availabe in the host
qemu: Prefer VFIO for PCI device passthrough
docs/formatdomain.html.in | 9 +-
src/conf/domain_conf.h | 2 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_hostdev.c | 207 +++++++++++++++++++++++++++++++++++++++++-----
src/qemu/qemu_hostdev.h | 4 +-
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_process.c | 15 ++--
tests/qemuxml2argvtest.c | 11 +++
8 files changed, 217 insertions(+), 35 deletions(-)
--
1.8.3.2
11 years, 1 month
[libvirt] Can we make sc_copyright_check non-fatal?
by Cole Robinson
The copyright date syntax check is a source of frustration for me:
- It fails on old maint branches.
- It pokes into non git managed directories in $(srcdir). I like to keep
directories like f18-maint.git, f19-maint.git etc. that are checkouts of the
respective maint branches so I can parallelize when doing maint builds, and I
like to keep them in my libvirt.git dir for organization, but running
syntax-check in libvirt.git fails on the copyright check in
$(srcdir)/f18-maint.git/.gnulib/...
Is there any way to make it non-fatal? If it still spams with all the
'failures' I'm sure that's enough to encourage fixing the issues without
blocking valid usage.
Thanks,
Cole
11 years, 1 month
[libvirt] [PATCH 0/4] Add support for compression of managedsave and external snapshot memory images
by Peter Krempa
plus a few refactors.
Peter Krempa (4):
qemu: Fix coding style in qemuDomainSaveFlags()
qemu: refactor qemuCompressProgramAvailable()
qemu: managedsave: Add support for compressing managed save images
qemu: snapshot: Add support for compressing external snapshot memory
src/qemu/qemu.conf | 12 ++++++++
src/qemu/qemu_conf.c | 3 ++
src/qemu/qemu_conf.h | 2 ++
src/qemu/qemu_driver.c | 78 ++++++++++++++++++++++++++++++++++++--------------
4 files changed, 74 insertions(+), 21 deletions(-)
--
1.8.3.2
11 years, 1 month