[libvirt] [PATCH RESEND] qemu: Remove inactive vm when failed to start it
by Yi Wang
Libvirt forgets to remove inactive vm when failed to start a defined vm.
That may result in residual domain in driver->domains on such condition:
during the process of starting a vm, undefine it, and qemu exit because
of some exception. As we undefined the vm successfully, the vm->persistent
was set to 0, we will always fail to undefine it until restart libvirtd.
Signed-off-by: Yi Wang <wang.yi59(a)zte.com.cn>
---
src/qemu/qemu_driver.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index cdb727b..af8afab 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7185,6 +7185,8 @@ qemuDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
endjob:
qemuProcessEndJob(driver, vm);
+ if (ret < 0)
+ qemuDomainRemoveInactive(driver, vm);
cleanup:
virDomainObjEndAPI(&vm);
--
1.8.3.1
7 years, 5 months
[libvirt] [PATCH] testutils: Remove unneeded variable
by Martin Kletzander
virDomainXMLOptionNew() gladly accepts NULL and it is used in some
drivers. There is no need for additional variable with no members set
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Pushed as trivial.
tests/testutils.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/tests/testutils.c b/tests/testutils.c
index f45596997d6d..ed01136a07c1 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -1130,13 +1130,11 @@ virCapsPtr virTestGenericCapsInit(void)
static virDomainDefParserConfig virTestGenericDomainDefParserConfig = {
.features = VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS,
};
-static virDomainXMLPrivateDataCallbacks virTestGenericPrivateDataCallbacks;
virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void)
{
return virDomainXMLOptionNew(&virTestGenericDomainDefParserConfig,
- &virTestGenericPrivateDataCallbacks,
- NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL);
}
--
2.13.3
7 years, 5 months
[libvirt] [PATCH] qemu_capabilities: Fix the formatting with a space
by Shivaprasad G Bhat
It was observed while adding new property that there should be a space
before closing a curly brace in intel-iommu object property definition.
Fixing it as a separate patch.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
---
src/qemu/qemu_capabilities.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 5fb6fd4..3f2c089 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1908,7 +1908,7 @@ static struct virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
-1 },
{ "intel-iommu", virQEMUCapsObjectPropsIntelIOMMU,
ARRAY_CARDINALITY(virQEMUCapsObjectPropsIntelIOMMU),
- QEMU_CAPS_DEVICE_INTEL_IOMMU},
+ QEMU_CAPS_DEVICE_INTEL_IOMMU },
{ "spapr-pci-host-bridge", virQEMUCapsObjectPropsSpaprPCIHostBridge,
ARRAY_CARDINALITY(virQEMUCapsObjectPropsSpaprPCIHostBridge),
QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE },
7 years, 5 months
[libvirt] [PATCH] storage: Fix editing mistake in storagePoolSetAutostart
by John Ferlan
Commit id '905f1024b' had a rogue editing mistake that inadvertently
dropped a goto cleanup in storagePoolSetAutostart, but Coverity noted it.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
NB: Pushed as trivial the other day, but forgot to send the email to
the list on it.
src/storage/storage_driver.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index df563f1..e616ae0 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -1280,6 +1280,7 @@ storagePoolSetAutostart(virStoragePoolPtr pool,
if (!obj->configFile) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("pool has no config file"));
+ goto cleanup;
}
autostart = (autostart != 0);
--
2.9.4
7 years, 5 months
[libvirt] [PATCH] rpc : fix a access for null pointer
by Peng Hao
virNetSocketRemoveIOCallback get sock's ObjectLock and will call
virNetSocketEventFree. virNetSocketEventFree may be free sock
object and virNetSocketRemoveIOCallback will access a null pointer
in release sock's ObjectLock.
Signed-off-by: Liu Yun <liu.yunh(a)zte.com.cn>
Signed-off-by: Peng Hao <peng.hao2(a)zte.com.cn>
---
src/rpc/virnetsocket.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
index d228c8a..8b550e8 100644
--- a/src/rpc/virnetsocket.c
+++ b/src/rpc/virnetsocket.c
@@ -2140,14 +2140,12 @@ static void virNetSocketEventFree(void *opaque)
virFreeCallback ff;
void *eopaque;
- virObjectLock(sock);
ff = sock->ff;
eopaque = sock->opaque;
sock->func = NULL;
sock->ff = NULL;
sock->opaque = NULL;
- virObjectUnlock(sock);
-
+
if (ff)
ff(eopaque);
@@ -2207,6 +2205,7 @@ void virNetSocketUpdateIOCallback(virNetSocketPtr sock,
void virNetSocketRemoveIOCallback(virNetSocketPtr sock)
{
+ virObjectRef(sock);
virObjectLock(sock);
if (sock->watch < 0) {
@@ -2220,6 +2219,7 @@ void virNetSocketRemoveIOCallback(virNetSocketPtr sock)
sock->watch = -1;
virObjectUnlock(sock);
+ virObjectRef(sock);
}
void virNetSocketClose(virNetSocketPtr sock)
--
1.8.3.1
7 years, 5 months
[libvirt] [PATCH] conf: Fix backwards migration of pSeries guests
by Andrea Bolognani
Recent commits made it so that pci-root controllers for
pSeries guests are automatically assigned the
spapr-pci-host-bridge model name; however, that prevents
guests to migrate to older versions of libvirt which don't
know about that model name at all, which at the moment is
all of them :)
To avoid the issue, just strip the model name from PHBs
when formatting the migratable XML; guests that use more
than one PHB are not going to be migratable anyway.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/conf/domain_conf.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9320794..21bd7c7 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -21919,7 +21919,20 @@ virDomainControllerDefFormat(virBufferPtr buf,
}
if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) {
- if (def->opts.pciopts.modelName != VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE) {
+ bool formatModelName = true;
+
+ if (def->opts.pciopts.modelName == VIR_DOMAIN_CONTROLLER_PCI_MODEL_NAME_NONE)
+ formatModelName = false;
+
+ /* Don't format the model name for PHBs when migrating so that
+ * guests that only use the default one can be migrated to older
+ * libvirt version which don't know about PHBs at all */
+ if (virDomainControllerIsPCIHostBridge(def) &&
+ flags & VIR_DOMAIN_DEF_FORMAT_MIGRATABLE) {
+ formatModelName = false;
+ }
+
+ if (formatModelName) {
modelName = virDomainControllerPCIModelNameTypeToString(def->opts.pciopts.modelName);
if (!modelName) {
virReportError(VIR_ERR_INTERNAL_ERROR,
--
2.7.5
7 years, 5 months
[libvirt] An API to copy files.
by Julio Faracco
Hi guys,
Unfortunately, my company does not allow access to IRC.
I need to ask question by email.
Why doesn't libvirt have any method to copy files?
A kind of virFileCopy(src, dst) for example.
Libvirt has a lots of helper functions but it does not have a
specific method to copy a file.
There is a similar method inside openvz_conf.c.
But I don't see any method inside virfile.c
--
Julio Cesar Faracco
7 years, 5 months
[libvirt] [PATCH v2 0/6] Convert port to unsigned integer
by Peter Krempa
Since Michal did not want to finis this I did. I also found a few bugs in
my previous patches which are addressed here.
Peter Krempa (6):
qemu: command: Rename and move qemuNetworkDriveGetPort
util: uri: Convert port number to unsigned integer
qemu: command: Remove condition to use default sheepdog port
util: storage: fill in default ports when parsing backing chain
conf: domain: Split up virDomainStorageHostParse and rename it
virStorageNetHostDef: Turn @port into integer
src/conf/domain_conf.c | 133 +++++++++++++++++++---------------
src/libvirt_private.syms | 1 +
src/libxl/libxl_conf.c | 2 +-
src/qemu/qemu_block.c | 7 +-
src/qemu/qemu_command.c | 30 ++------
src/qemu/qemu_parse_command.c | 13 ++--
src/storage/storage_backend_gluster.c | 17 +----
src/storage/storage_driver.c | 7 +-
src/util/virstoragefile.c | 68 +++++++----------
src/util/virstoragefile.h | 4 +-
src/util/virstring.c | 37 ++++++++++
src/util/virstring.h | 4 +
src/util/viruri.h | 2 +-
src/xenconfig/xen_xl.c | 2 +-
tests/virstoragetest.c | 14 ++--
15 files changed, 182 insertions(+), 159 deletions(-)
--
2.13.2
7 years, 5 months
[libvirt] [PATCH v3 0/2] qemu: Add AAVMF32 to the list of known UEFIs
by dann frazier
Changes since v2:
* Include updates to qemu.conf
* Update tests for parity w/ AAVMF
* Drop reference to 'experimental' in commit message
Changes since v1:
* Add a virt-aa-helper-test case.
dann frazier (2):
qemu: Add AAVMF32 to the list of known UEFIs
virt-aa-helper-test: Add test for aarch32 UEFI image path
src/qemu/qemu.conf | 3 ++-
src/qemu/qemu_conf.c | 12 ++++++++----
src/qemu/test_libvirtd_qemu.aug.in | 1 +
tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0-gicv2-virt.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0-gicv3-virt.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml | 1 +
tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.7.0.s390x.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0-tcg.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0.s390x.xml | 1 +
tests/domaincapsschemadata/qemu_2.8.0.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0-q35.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0-tcg.x86_64.xml | 1 +
tests/domaincapsschemadata/qemu_2.9.0.x86_64.xml | 1 +
tests/domaincapstest.c | 1 +
tests/virt-aa-helper-test | 1 +
18 files changed, 26 insertions(+), 5 deletions(-)
--
2.13.2
7 years, 5 months