[libvirt] [PATCH v6 0/4] Make virNodeDeviceObj and virNodeDeviceObjList private
by John Ferlan
NB: Like v5, keeping same title for consistency
v5: https://www.redhat.com/archives/libvir-list/2017-July/msg00610.html
Changes since v5:
* Replace patch 1 w/ the aha moment from review. The deletion API's
don't need to use virNodeDeviceObjListGetParentHost. Instead they
can just use virNodeDeviceObjListFindByName as the parent_wwnn/wwpn
and parent_fabric_wwn are not stored in the vHBA. They're merely for
the purpose of creation. The vHBA *does* store the def->parent by
name and we can use that instead
* Add patch 2 in order to remove the CREATE_DEVICE boolean from
virNodeDeviceObjListGetParentHost as it won't be necessary since
the only consumers are now CreateXML callers
* Modify patch 3 calls to virHashSearch to add a NULL parameter since
commit '38e516a52' added this (a real buzzkill for other changes too)
* Modify patch 4 to include removing the locks in Nodedev calls for
test_driver as well.
John Ferlan (4):
nodedev: Alter node device deletion logic
nodedev: Remove @create from virNodeDeviceObjListGetParentHost
nodedev: Convert virNodeDeviceObjListPtr to use hash tables
nodedev: Remove driver locks around object list mgmt code
src/conf/virnodedeviceobj.c | 580 ++++++++++++++++++++++++-----------
src/conf/virnodedeviceobj.h | 3 +-
src/node_device/node_device_driver.c | 90 ++----
src/node_device/node_device_hal.c | 16 +-
src/node_device/node_device_udev.c | 13 +-
src/test/test_driver.c | 53 ++--
6 files changed, 459 insertions(+), 296 deletions(-)
--
2.9.4
7 years, 8 months
[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, 8 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, 8 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, 8 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, 8 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, 8 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, 8 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, 8 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, 8 months