[libvirt] [PATCH 0/4] Clean up machineName-related code
by Martin Kletzander
Just in case we'll want to use the "cleaned-up" machineName for
anything else in the future, I decided to modify the code so that it
is always generated, saved and cleaned-up. While doing that I
identified some code duplication, leak and a TODO/XXX comment that are
all fixed with this series. And it only adds four lines overall!
Martin Kletzander (4):
conf: Pass config.priv to xmlopt->privateData.alloc
qemu: Save qemu driver in qemuDomainObjPrivateData
lxc: Make lxcProcessStop callable even without PID being available
Move machineName generation from virsystemd into domain_conf
src/bhyve/bhyve_domain.c | 2 +-
src/conf/domain_conf.c | 65 +++++++++++++++++++++++++++++++++++++++++++++-
src/conf/domain_conf.h | 7 ++++-
src/libvirt_private.syms | 2 +-
src/libxl/libxl_domain.c | 2 +-
src/lxc/lxc_cgroup.c | 5 +---
src/lxc/lxc_domain.c | 21 ++++++++++++++-
src/lxc/lxc_domain.h | 3 +++
src/lxc/lxc_process.c | 57 +++++++++++-----------------------------
src/qemu/qemu_cgroup.c | 24 ++++-------------
src/qemu/qemu_domain.c | 24 ++++++++++++++++-
src/qemu/qemu_domain.h | 5 ++++
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_process.c | 11 +++++---
src/uml/uml_driver.c | 2 +-
src/util/vircgroup.c | 15 ++++-------
src/util/vircgroup.h | 14 +++++-----
src/util/virsystemd.c | 62 -------------------------------------------
src/util/virsystemd.h | 5 ----
src/vmware/vmware_driver.c | 2 +-
src/vz/vz_utils.c | 2 +-
tests/virsystemdtest.c | 4 +--
22 files changed, 170 insertions(+), 166 deletions(-)
--
2.13.3
7 years, 5 months
[libvirt] [PATCH v3 0/3] More virsecretobj changes to prepare for common object
by John Ferlan
v2: https://www.redhat.com/archives/libvir-list/2017-July/msg00520.html
Changes in v3:
Former patch 1, dropped
Former patch 2, pushed
Former patch 3, adjusted:
-> Use @objDef instead of @objdef
-> Handle the if (backup) leak shown during review
Former patch 4, split
-> Patch 3 handles the virsecretobj call to virSecretObjListRemove
-> Patch 4 handles the secret_driver calls to virSecretObjListRemove
John Ferlan (3):
secret: Properly handle @def after virSecretObjAdd in driver
secret: Fix memory leak in virSecretLoad
secret: Handle object list removal and deletion properly
src/conf/virsecretobj.c | 14 ++++++--------
src/secret/secret_driver.c | 31 ++++++++++++++++++-------------
2 files changed, 24 insertions(+), 21 deletions(-)
--
2.9.4
7 years, 5 months
[libvirt] [PATCH v2 0/4] More virsecretobj changes to prepare for common object
by John Ferlan
v1: https://www.redhat.com/archives/libvir-list/2017-June/msg00168.html
but review was done more recently in 2017-July...
Changes since v1...
... Pushed v1 patches 1-3 since they were ACK'd
... Altered old patch 4, new patch 1 to use if/else processing
... Altered old patch 5, new patch 2 to account for merge conflict
(old patch 5 was ACK'd)
... Dropped old patch 6
... Altered old patch 7, new patch 3 to use VIR_STEAL_PTR and updated
the commit message to also describe the @def usage problem
... Altered old patch 8, new patch 4 to change the commit message to
have more details
John Ferlan (4):
secret: Clean up virSecretObjListAdd processing
secret: Remove need for local configFile and base64File in ObjectAdd
secret: Properly handle @def after virSecretObjAdd in driver
secret: Handle object list removal and deletion properly
src/conf/virsecretobj.c | 53 ++++++++++++++++++++--------------------------
src/secret/secret_driver.c | 28 ++++++++++++++----------
2 files changed, 40 insertions(+), 41 deletions(-)
--
2.9.4
7 years, 5 months
[libvirt] [PATCH] Revert "virthread: Introduce virRWLockInitPreferWriter"
by Michal Privoznik
This reverts commit 328bd24443d2a345a5832ee48ebba0208f8036ea.
As it turns out, this is not portable and very Linux & glibc
specific. Worse, this may lead to not starving writers on Linux
but everywhere else. Revert this and if the starvation occurs
resolve it.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/libvirt_private.syms | 1 -
src/util/virobject.c | 2 +-
src/util/virthread.c | 35 -----------------------------------
src/util/virthread.h | 1 -
4 files changed, 1 insertion(+), 38 deletions(-)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 3cc6f4c6e..d98417678 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -2733,7 +2733,6 @@ virMutexUnlock;
virOnce;
virRWLockDestroy;
virRWLockInit;
-virRWLockInitPreferWriter;
virRWLockRead;
virRWLockUnlock;
virRWLockWrite;
diff --git a/src/util/virobject.c b/src/util/virobject.c
index 4236abfef..b1bb378b4 100644
--- a/src/util/virobject.c
+++ b/src/util/virobject.c
@@ -275,7 +275,7 @@ virObjectRWLockableNew(virClassPtr klass)
if (!(obj = virObjectNew(klass)))
return NULL;
- if (virRWLockInitPreferWriter(&obj->lock) < 0) {
+ if (virRWLockInit(&obj->lock) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unable to initialize RW lock"));
virObjectUnref(obj);
diff --git a/src/util/virthread.c b/src/util/virthread.c
index a8dd72f8b..6c495158f 100644
--- a/src/util/virthread.c
+++ b/src/util/virthread.c
@@ -95,15 +95,6 @@ void virMutexUnlock(virMutexPtr m)
}
-/**
- * virRWLockInit:
- * @m: rwlock to init
- *
- * Initializes RW lock using pthread default attributes (which
- * is PTHREAD_RWLOCK_PREFER_READER_NP).
- *
- * Returns 0 on success, -1 otherwise.
- */
int virRWLockInit(virRWLockPtr m)
{
int ret;
@@ -115,32 +106,6 @@ int virRWLockInit(virRWLockPtr m)
return 0;
}
-
-/**
- * virRWLockInitPreferWriter:
- * @m: rwlock to init
- *
- * Initializes RW lock which prefers writers over readers.
- *
- * Returns 0 on success, -1 otherwise.
- */
-int virRWLockInitPreferWriter(virRWLockPtr m)
-{
- int ret;
- pthread_rwlockattr_t attr;
-
- pthread_rwlockattr_init(&attr);
- pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
- ret = pthread_rwlock_init(&m->lock, &attr);
- pthread_rwlockattr_destroy(&attr);
- if (ret != 0) {
- errno = ret;
- return -1;
- }
- return 0;
-}
-
-
void virRWLockDestroy(virRWLockPtr m)
{
pthread_rwlock_destroy(&m->lock);
diff --git a/src/util/virthread.h b/src/util/virthread.h
index 18b785af2..e466d9bf0 100644
--- a/src/util/virthread.h
+++ b/src/util/virthread.h
@@ -136,7 +136,6 @@ void virMutexUnlock(virMutexPtr m);
int virRWLockInit(virRWLockPtr m) ATTRIBUTE_RETURN_CHECK;
-int virRWLockInitPreferWriter(virRWLockPtr m) ATTRIBUTE_RETURN_CHECK;
void virRWLockDestroy(virRWLockPtr m);
void virRWLockRead(virRWLockPtr m);
--
2.13.0
7 years, 5 months
[libvirt] [PATCH] qemu: fix migration fail of an auto-placement vm after attached memory to it
by Yi Wang
This patch fix this condition:
-vm has the "auto" placement in vcpu
-hot-plug memory with source node "1-3" through attach-device command
-migrate the vm to a host with only 2 numa node
And the migration will fail with error:
"error: unsupported configuration: NUMA node 2 is unavailable"
Signed-off-by: Yi Wang <wang.yi59(a)zte.com.cn>
Signed-off-by: Xi Xu <xu.xi8(a)zte.com.cn>
---
src/qemu/qemu_process.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 7b708be..dcc564c 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5259,6 +5259,16 @@ qemuProcessPrepareDomain(virConnectPtr conn,
goto cleanup;
}
+ VIR_DEBUG("Updating memory source nodes");
+ for (i = 0; i < vm->def->nmems; i++) {
+ virDomainMemoryDefPtr mem = vm->def->mems[i];
+ if (priv->autoNodeset && mem && mem->sourceNodes) {
+ virBitmapFree(mem->sourceNodes);
+ if (!(mem->sourceNodes = virBitmapNewCopy(priv->autoNodeset)))
+ goto cleanup;
+ }
+ }
+
/* Whether we should use virtlogd as stdio handler for character
* devices source backend. */
if (cfg->stdioLogD &&
--
1.8.3.1
7 years, 5 months
[libvirt] [PATCH v3 0/4] Fix a couple issues found w/ vHBA logic
by John Ferlan
v2: https://www.redhat.com/archives/libvir-list/2017-July/msg00661.html
Changes since v2:
* Patch 1 - make the requested logic adjustment
* Patch 2 - no change
* Patch 3 - make this *just* the check that the provided @parent_name
is a valid fc_host (whether it's vHBA or HBA).
* Patch 4 - Alter the checkParent logic to cause a failure if the
passed @name (from the wwnn/wwpn's provided) are for an
HBA instead of a vHBA. Make this an invalid configuration.
Modify the docs to describe that the provided wwnn/wwpn
must be for an existing vHBA, are to be used to create a
vHBA, but cannot be from an existing HBA.
NB: No change to the Destroy code since it's possible one
of these exists and there needs to be a way to shut it down.
The failure could turn into a "conversion" of sorts as well
by changing the type to 'scsi_host', saving the generated
scsi_host name, removing the parent and wwnn & wwpn fields.
Tested using my vHBA system with various valid and invalid configurations.
John Ferlan (4):
storage: Fix existing parent check for vHBA creation
storage: Remove @conn from virNodeDeviceCreateVport
storage: Check if provided parent is vHBA capable
storage: Disallow usage of the HBA for a fc_host backing
docs/formatstorage.html.in | 27 ++++++-----
src/conf/node_device_conf.c | 63 ++-----------------------
src/conf/node_device_conf.h | 3 +-
src/storage/storage_backend_scsi.c | 94 +++++++++++++++++++++++++++++++++++++-
4 files changed, 112 insertions(+), 75 deletions(-)
--
2.9.4
7 years, 5 months
[libvirt] [PATCH v2 0/2] Fix backwards migration of pSeries guests
by Andrea Bolognani
Changes from [v1]:
* don't hide the controller model check inside a function
and propely explain the reason not to format it;
* rename a confusingly named function.
[v1] https://www.redhat.com/archives/libvir-list/2017-July/msg00705.html
Andrea Bolognani (2):
conf: Fix backwards migration of pSeries guests
conf: Rename virDomainControllerIsPCIHostBridge() to IsPSeriesPHB()
src/conf/domain_conf.c | 29 ++++++++++++++++++++++++++---
src/conf/domain_conf.h | 2 +-
src/libvirt_private.syms | 2 +-
src/qemu/qemu_command.c | 2 +-
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_domain_address.c | 2 +-
6 files changed, 31 insertions(+), 8 deletions(-)
--
2.7.5
7 years, 5 months
[libvirt] [PATCH v2 0/3] implement migrate-getmaxdowntime command
by seg@us.ibm.com
Currently, the maximum tolerable downtime for a domain being migrated is
write-only. This patch implements a way to query that value nondestructively.
Changes from [v1]:
* Fixed formatting and style problems
* Add additional JSON error check
* Better patch submission mail, I hope
[v1} https://www.redhat.com/archives/libvir-list/2017-July/msg00908.html
Scott Garfinkle (3):
migrate-getmaxdowntime command qemu side
migrate-getmaxdowntime public symbols and table indices
migrate-getmaxdowntime local/libvirt enablement
src/qemu/qemu_driver.c | 45 ++++++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor.h | 3 +++
src/qemu/qemu_monitor_json.c | 40 +++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor_json.h | 3 +++
src/libvirt_public.syms | 4 ++++
src/remote/remote_protocol.x | 16 +++++++++++++++-
src/remote_protocol-structs | 8 ++++++++
include/libvirt/libvirt-domain.h | 4 ++++
src/driver-hypervisor.h | 6 ++++++
src/libvirt-domain.c | 45 +++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_monitor.c | 12 +++++++++++
src/remote/remote_driver.c | 1 +
tools/virsh-domain.c | 46 ++++++++++++++++++++++++++++++++++++++++
tools/virsh.pod | 18 ++++++++++++++++
14 files changed, 240 insertions(+), 1 deletion(-)
7 years, 5 months
[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, 5 months