[libvirt] [PATCH v4 0/2] qemu/gluster: add option for tuning debug logging level
by Prasanna Kumar Kalever
v4:
Address comments by peter on v3
Mostly betterments in naming variables and grouping patterns in Caps by 5
Thanks to Peter
v3:
Add patch 2/2 which address capability checks
Changed 'glusterfs_debug_level' to 'gluster_debug_level' agreeing to Peter
Made changes in libvirtd_qemu.aug
Thanks to Peter & Daniel
v2:
Modify test cases and syntax check changes as suggested by Peter in v1.
Rename qemu_gfapi_debuglevel to glusterfs_debug_level as per Daniel comments.
Fix to make debug_level changes effects on URI along with JSON.
TODO:
* changes in libvirtd_qemu.aug
Which I don't understand for now
* comment on debug_level variable in storage source
Not sure what is the right place
* Capablities check
v1:
Initial post
*** BLURB HERE ***
Prasanna Kumar Kalever (2):
qemu/gluster: add option for tuning debug logging level
qemu_capabilities: Introduce gluster specific debug capability
src/qemu/libvirtd_qemu.aug | 3 +++
src/qemu/qemu.conf | 20 ++++++++++++++++++++
src/qemu/qemu_capabilities.c | 5 +++++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 21 ++++++++++++++++++---
src/qemu/qemu_conf.c | 3 +++
src/qemu/qemu_conf.h | 1 +
src/util/virstoragefile.h | 2 ++
.../qemuargv2xml-disk-drive-network-gluster.args | 7 ++++---
.../qemuxml2argv-disk-drive-network-gluster.args | 12 ++++++------
tests/qemuxml2argvtest.c | 3 ++-
11 files changed, 65 insertions(+), 13 deletions(-)
--
2.7.4
8 years, 3 months
[libvirt] [libvirt-php][PATCH] libvirt_domain_get_screenshot_api: More memleak fixes and checks
by Michal Privoznik
Firstly, we are not checking whether virStreamNew succeeds or
not. Secondly, we are not freeing the stream in all exit paths.
Then we are copying the same pattern which frees allocated memory
over and over again. Oh, and also we should abort stream if we
are exiting abnormally.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under "I'm a lonely libvirt-php maintainer" rule.
src/libvirt-php.c | 64 +++++++++++++++++++++++++++++--------------------------
1 file changed, 34 insertions(+), 30 deletions(-)
diff --git a/src/libvirt-php.c b/src/libvirt-php.c
index 3aed882..df2f32a 100644
--- a/src/libvirt-php.c
+++ b/src/libvirt-php.c
@@ -4758,49 +4758,38 @@ PHP_FUNCTION(libvirt_domain_get_screenshot_api)
RETURN_FALSE;
#endif
- GET_DOMAIN_FROM_ARGS("r|l",&zdomain, &screen);
+ GET_DOMAIN_FROM_ARGS("r|l", &zdomain, &screen);
+
+ if (!(st = virStreamNew(domain->conn->conn, 0))) {
+ set_error("Cannot create new stream" TSRMLS_CC);
+ goto error;
+ }
- st = virStreamNew(domain->conn->conn, 0);
mime = virDomainScreenshot(domain->domain, st, screen, 0);
if (!mime) {
set_error_if_unset("Cannot get domain screenshot" TSRMLS_CC);
- RETURN_FALSE;
+ goto error;
}
-#ifndef EXTWIN
- if (mkstemp(file) == 0) {
- free(mime);
- RETURN_FALSE;
- }
-#endif
-
- if ((fd = open(file, O_WRONLY|O_CREAT|O_EXCL, 0666)) < 0) {
- if (errno != EEXIST ||
- (fd = open(file, O_WRONLY|O_TRUNC, 0666)) < 0) {
- virStreamFree(st);
- set_error_if_unset("Cannot get create file to save domain screenshot" TSRMLS_CC);
- free(mime);
- RETURN_FALSE;
- }
+ if (!(fd = mkstemp(file))) {
+ virStreamAbort(st);
+ set_error_if_unset("Cannot get create file to save domain screenshot" TSRMLS_CC);
+ goto error;
}
if (virStreamRecvAll(st, streamSink, &fd) < 0) {
- virStreamFree(st);
set_error_if_unset("Cannot receive screenshot data" TSRMLS_CC);
- free(mime);
- RETURN_FALSE;
+ virStreamAbort(st);
+ goto error;
}
- close(fd);
-
if (virStreamFinish(st) < 0) {
- virStreamFree(st);
set_error_if_unset("Cannot close stream for domain" TSRMLS_CC);
- free(mime);
- RETURN_FALSE;
+ goto error;
}
virStreamFree(st);
+ st = NULL;
array_init(return_value);
if (bin) {
@@ -4811,19 +4800,34 @@ PHP_FUNCTION(libvirt_domain_get_screenshot_api)
snprintf(fileNew, sizeof(fileNew), "%s.png", file);
snprintf(tmp, sizeof(tmp), "%s %s %s > /dev/null 2> /dev/null", bin, file, fileNew);
exitStatus = system(tmp);
- unlink(file);
if (WEXITSTATUS(exitStatus) != 0)
- RETURN_FALSE;
+ goto error;
+ unlink(file);
+ close(fd);
+ fd = -1;
VIRT_ADD_ASSOC_STRING(return_value, "file", fileNew);
VIRT_ADD_ASSOC_STRING(return_value, "mime", "image/png");
- }
- else {
+ } else {
+ unlink(file);
+ close(fd);
+ fd = -1;
VIRT_ADD_ASSOC_STRING(return_value, "file", file);
VIRT_ADD_ASSOC_STRING(return_value, "mime", mime);
}
free(mime);
+ return;
+
+ error:
+ free(mime);
+ if (fd != -1) {
+ unlink(file);
+ close(fd);
+ }
+ if (st)
+ virStreamFree(st);
+ RETURN_FALSE;
}
/*
--
2.8.4
8 years, 3 months
[libvirt] [PATCH 0/4] qemu: fix vcpupin/emulatorpin with --config on VMs with automatic NUMA pinning
by Peter Krempa
The automatic nodeset would creep into the persistent definition for live VMs
with automatic pinning which is incorrect.
https://bugzilla.redhat.com/show_bug.cgi?id=1365779
Peter Krempa (4):
conf: Introduce virDomainObjGetOneDefState
qemu: domain: Add macro to simplify access to vm private data
qemu: driver: Don't return automatic NUMA vCPU pinning data for
persistentDef
qemu: driver: Don't return automatic NUMA emulator pinning data for
persistentDef
src/conf/domain_conf.c | 40 ++++++++++++++++++++++++++++++++++++----
src/conf/domain_conf.h | 3 +++
src/libvirt_private.syms | 1 +
src/qemu/qemu_domain.h | 3 +++
src/qemu/qemu_driver.c | 23 +++++++++++++----------
5 files changed, 56 insertions(+), 14 deletions(-)
--
2.10.0
8 years, 3 months
[libvirt] [PATCH v4 0/5] Remove caching of address sets
by Tomasz Flendrich
Link to the previous version:
https://www.redhat.com/archives/libvir-list/2016-August/msg00721.html
Changes in v4:
* instead of failing, qemuDomainValidateDevicePCISlotsChipsets now simply
displays a warning when a new address is being assigned during pci address
set recalculation
Tomasz Flendrich (5):
Move validating chipset PCI slots to qemuDomainPCIAddressSetCreate
Warn when assigning new pci addresses during recalculation
Reduce number of parameters to qemuDomainPCIAddressSetCreate
qemu_hotplug: generate pci address set on demand
qemu: remove pciaddrs caching
src/qemu/qemu_domain.c | 1 -
src/qemu/qemu_domain.h | 1 -
src/qemu/qemu_domain_address.c | 215 +++++++++++++++++++++++------------------
src/qemu/qemu_domain_address.h | 6 ++
src/qemu/qemu_hotplug.c | 50 ++++++++--
5 files changed, 168 insertions(+), 105 deletions(-)
--
1.9.1
8 years, 3 months
[libvirt] [PATCH 0/2] Rework qemuhotplugtest
by Tomasz Flendrich
This series requires another one:
https://www.redhat.com/archives/libvir-list/2016-July/msg01205.html
Tomasz Flendrich (2):
qemuhotplugtest: handle xml files more precisely
qemuhotplugtest: change indentation
tests/qemuhotplugtest.c | 254 +++++++++++----------
.../qemuhotplug-ccw-virtio-1-reverse.xml | 7 -
...ach.xml => qemuhotplug-qemu-agent-nosource.xml} | 1 -
.../qemuhotplug-qemu-agent.xml | 1 +
.../qemuhotplug-base+qemu-agent-detach.xml | 58 -----
.../qemuhotplug-base+qemu-agent.xml | 58 -----
...plug-base-ccw-live+ccw-virtio+ccw-virtio-2.xml} | 0
... => qemuhotplug-base-ccw-live+ccw-virtio-2.xml} | 0
...ive-with-2-ccw-virtio+ccw-virtio-1-explicit.xml | 73 ------
...live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml | 73 ------
...-live-with-ccw-virtio+ccw-virtio-2-explicit.xml | 73 ------
.../qemuhotplug-base-ccw-live-with-ccw-virtio.xml | 63 -----
....xml => qemuhotplug-base-config+qemu-agent.xml} | 0
.../qemuhotplug-base-live+qemu-agent-detach.xml | 58 -----
...-base-with-scsi-controller-live+disk-scsi-2.xml | 51 -----
15 files changed, 140 insertions(+), 630 deletions(-)
delete mode 100644 tests/qemuhotplugtestdevices/qemuhotplug-ccw-virtio-1-reverse.xml
rename tests/qemuhotplugtestdevices/{qemuhotplug-qemu-agent-detach.xml => qemuhotplug-qemu-agent-nosource.xml} (66%)
delete mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base+qemu-agent-detach.xml
delete mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base+qemu-agent.xml
rename tests/qemuhotplugtestdomains/{qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2.xml => qemuhotplug-base-ccw-live+ccw-virtio+ccw-virtio-2.xml} (100%)
rename tests/qemuhotplugtestdomains/{qemuhotplug-base-ccw-live-with-2-ccw-virtio.xml => qemuhotplug-base-ccw-live+ccw-virtio-2.xml} (100%)
delete mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-explicit.xml
delete mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-2-ccw-virtio+ccw-virtio-1-reverse.xml
delete mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio+ccw-virtio-2-explicit.xml
delete mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-ccw-live-with-ccw-virtio.xml
rename tests/qemuhotplugtestdomains/{qemuhotplug-base-config+qemu-agent+config.xml => qemuhotplug-base-config+qemu-agent.xml} (100%)
delete mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-live+qemu-agent-detach.xml
delete mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-with-scsi-controller-live+disk-scsi-2.xml
--
2.7.4 (Apple Git-66)
8 years, 3 months
[libvirt] [PATCH v3 0/6] Test persistent device attachment
by Tomasz Flendrich
Changes in v3:
* fewer patches, because part of v2 was ACK'd
* two old commits, 08/10 and 09/10, are now one commit
* qemuDomainUpdateDeviceFlags is now also split, creating a new function
qemuDomainUpdateDeviceLiveAndConfig(). This function is now used in
qemuhotplugtest.c.
* qemuDomainAttachDeviceLiveAndConfig, qemuDomainDetachDeviceLiveAndConfig
and qemuDomainUpdateDeviceLiveAndConfig are now in a new file:
qemu_driverpriv.h
* variable "target" is renamed to "impact" and its type is changed
* testQemuHotplugCheckResult() now takes "impact" as a parameter to determine
whether to test the ->def or ->newDef
* def->id is no longer set when handling a persistent domain
* split DO_TEST_ATTACH (and other macros) to DO_TEST_ATTACH_LIVE and
DO_TEST_ATTACH_CONFIG instead of taking a parameter
* fixed indentation
* "<source mode='bind'/>" is removed from one xml
* a three year old testcase for updating a disk device was modified
a little bit to make it finally execute and test something
Link to v2: https://www.redhat.com/archives/libvir-list/2016-July/msg00595.html
Tomasz Flendrich (6):
Split qemuDomainUpdateDeviceFlags in two
Make qemu attach/detach functions public
Make qemuhotplugtest work with persistent domains
qemuhotplug: Use a more generic function to update devices
qemuhotplugtest: add testcase to update a disk device
qemuhotplugtest: add a persistent attachment testcase
src/qemu/qemu_driver.c | 117 +++---
src/qemu/qemu_driverpriv.h | 47 +++
tests/qemuhotplugtest.c | 433 ++++++++++++---------
.../qemuhotplug-disk-cdrom-nochange.xml | 2 +-
.../qemuhotplug-qemu-agent.xml | 1 -
.../qemuhotplug-base-config+qemu-agent+config.xml | 44 +++
.../qemuhotplug-base-config.xml | 40 ++
.../qemuhotplug-disk-cdrom.xml | 2 +-
8 files changed, 454 insertions(+), 232 deletions(-)
create mode 100644 src/qemu/qemu_driverpriv.h
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-config+qemu-agent+config.xml
create mode 100644 tests/qemuhotplugtestdomains/qemuhotplug-base-config.xml
--
1.9.1
8 years, 3 months
[libvirt] [PATCH] migration: Document we don't copy storage during offline migration
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1322717
During offline migration, no storage is copied. Nor disks, nor
NVRAM file, nor anything. We use qemu for that and because domain
is not running there's nobody to copy that for us.
We should document this to avoid confusing users.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
docs/migration.html.in | 5 +++--
src/libvirt-domain.c | 12 ++++++++++++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/docs/migration.html.in b/docs/migration.html.in
index 8efdd7f..2768955 100644
--- a/docs/migration.html.in
+++ b/docs/migration.html.in
@@ -148,8 +148,9 @@
<code>virsh dumpxml</code> on source host followed by
<code>virsh define</code> on destination host, as offline migration
will run the pre-migration hook to update the domain XML on
- destination host. Currently, copying non-shared storage is not
- supported during offline migration.
+ destination host. Currently, copying non-shared storage or other file
+ based storages (e.g. UEFI variable storage) is not supported during
+ offline migration.
</p>
<h2><a name="uris">Migration URIs</a></h2>
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index fa82e49..9ba9f49 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -3574,6 +3574,10 @@ virDomainMigrateUnmanaged(virDomainPtr domain,
* not support this feature and will return an error if bandwidth
* is not 0.
*
+ * Users should note that implementation of VIR_MIGRATE_OFFLINE
+ * flag in some drivers does not copy storage or any other file
+ * based storage (e.g. UEFI variable storage).
+ *
* Enabling the VIR_MIGRATE_POSTCOPY flag tells libvirt to enable post-copy
* migration. Use virDomainMigrateStartPostCopy to switch migration into
* the post-copy mode. See virDomainMigrateStartPostCopy for more details
@@ -3791,6 +3795,10 @@ virDomainMigrate(virDomainPtr domain,
* not support this feature and will return an error if bandwidth
* is not 0.
*
+ * Users should note that implementation of VIR_MIGRATE_OFFLINE
+ * flag in some drivers does not copy storage or any other file
+ * based storage (e.g. UEFI variable storage).
+ *
* Enabling the VIR_MIGRATE_POSTCOPY flag tells libvirt to enable post-copy
* migration. Use virDomainMigrateStartPostCopy to switch migration into
* the post-copy mode. See virDomainMigrateStartPostCopy for more details
@@ -3980,6 +3988,10 @@ virDomainMigrate2(virDomainPtr domain,
* can use either VIR_MIGRATE_NON_SHARED_DISK or
* VIR_MIGRATE_NON_SHARED_INC as they are mutually exclusive.
*
+ * Users should note that implementation of VIR_MIGRATE_OFFLINE
+ * flag in some drivers does not copy storage or any other file
+ * based storage (e.g. UEFI variable storage).
+ *
* Enabling the VIR_MIGRATE_POSTCOPY flag tells libvirt to enable post-copy
* migration. Use virDomainMigrateStartPostCopy to switch migration into
* the post-copy mode. See virDomainMigrateStartPostCopy for more details
--
2.8.4
8 years, 3 months
[libvirt] [PATCH] qemu: Ignore graphics cookie if port == 0
by Jiri Denemark
Old libvirt represents
<graphics type='spice'>
<listen type='none'/>
</graphics>
as
<graphics type='spice' autoport='no'/>
In this mode, QEMU doesn't listen for SPICE connection anywhere and
clients have to use virDomainOpenGraphics* APIs to attach to the domain.
That is, the client has to run on the same host where the domains runs
and it's impossible to tell the client to reconnect to the destination
QEMU during migration (unless there is some kind of proxy on the host).
While current libvirt correctly ignores such graphics devices when
creating graphics migration cookie, old libvirt just sends
<graphics type='spice' port='0' listen='0.0.0.0' tlsPort='-1'/>
in the cookie. After seeing this cookie, we happily would call
client_migrate_info QMP command and wait for SPICE_MIGRATE_COMPLETED
event, which is quite pointless since the doesn't know where to connecti
anyway. We should just ignore such cookies.
https://bugzilla.redhat.com/show_bug.cgi?id=1376083
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_migration.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index e734816..8a220d9 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2903,6 +2903,15 @@ qemuDomainMigrateGraphicsRelocate(virQEMUDriverPtr driver,
goto cleanup;
}
+ /* Older libvirt sends port == 0 for listen type='none' graphics. It's
+ * safe to ignore such requests since relocation to unknown port does
+ * not make sense in general.
+ */
+ if (port <= 0 && tlsPort <= 0) {
+ ret = 0;
+ goto cleanup;
+ }
+
if (qemuDomainObjEnterMonitorAsync(driver, vm,
QEMU_ASYNC_JOB_MIGRATION_OUT) == 0) {
ret = qemuMonitorGraphicsRelocate(priv->mon, type, listenAddress,
--
2.10.0
8 years, 3 months
[libvirt] [PATCH] qemuDomainOpenGraphics: Start job early
by Jiri Denemark
Checking if a domain's definition or if it is active before we got a job
is pointless since the domain might have changed in the meantime.
Luckily libvirtd didn't crash when the API tried to talk to an inactive
domain:
debug : qemuDomainObjBeginJobInternal:2914 : Started job: modify
(async=none vm=0x7f8f340140c0 name=ble)
debug : qemuDomainObjEnterMonitorInternal:3137 : Entering monitor
(mon=(nil) vm=0x7f8f340140c0 name=ble)
warning : virObjectLock:319 : Object (nil) ((unknown)) is not a
virObjectLockable instance
debug : qemuMonitorOpenGraphics:3505 : protocol=spice fd=27
fdname=graphicsfd skipauth=1
error : qemuMonitorOpenGraphics:3508 : invalid argument: monitor must
not be NULL
debug : qemuDomainObjExitMonitorInternal:3160 : Exited monitor
(mon=(nil) vm=0x7f8f340140c0 name=ble)
debug : qemuDomainObjEndJob:3068 : Stopping job: modify (async=none
vm=0x7f8f340140c0 name=ble)
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/qemu/qemu_driver.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e29180d..4c45fc3 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17118,10 +17118,13 @@ qemuDomainOpenGraphics(virDomainPtr dom,
if (virDomainOpenGraphicsEnsureACL(dom->conn, vm->def) < 0)
goto cleanup;
+ if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
+ goto cleanup;
+
if (!virDomainObjIsActive(vm)) {
virReportError(VIR_ERR_OPERATION_INVALID,
"%s", _("domain is not running"));
- goto cleanup;
+ goto endjob;
}
priv = vm->privateData;
@@ -17129,7 +17132,7 @@ qemuDomainOpenGraphics(virDomainPtr dom,
if (idx >= vm->def->ngraphics) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No graphics backend with index %d"), idx);
- goto cleanup;
+ goto endjob;
}
switch (vm->def->graphics[idx]->type) {
case VIR_DOMAIN_GRAPHICS_TYPE_VNC:
@@ -17142,20 +17145,20 @@ qemuDomainOpenGraphics(virDomainPtr dom,
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Can only open VNC or SPICE graphics backends, not %s"),
virDomainGraphicsTypeToString(vm->def->graphics[idx]->type));
- goto cleanup;
+ goto endjob;
}
if (virSecurityManagerSetImageFDLabel(driver->securityManager, vm->def,
fd) < 0)
- goto cleanup;
+ goto endjob;
- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
- goto cleanup;
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorOpenGraphics(priv->mon, protocol, fd, "graphicsfd",
(flags & VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH) != 0);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
+
+ endjob:
qemuDomainObjEndJob(driver, vm);
cleanup:
--
2.10.0
8 years, 3 months
[libvirt] [PATCH] stream.c:fix a typo
by Nitesh Konkar
Signed-off-by: Nitesh Konkar <nitkon12(a)linux.vnet.ibm.com>
---
daemon/stream.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/stream.c b/daemon/stream.c
index bd0b5d2..533ecf7 100644
--- a/daemon/stream.c
+++ b/daemon/stream.c
@@ -444,7 +444,7 @@ int daemonAddClientStream(virNetServerClientPtr client,
*
* Removes a stream from the list of active streams for the client
*
- * Returns 0 if the stream was removd, -1 if it doesn't exist
+ * Returns 0 if the stream was removed, -1 if it doesn't exist
*/
int
daemonRemoveClientStream(virNetServerClientPtr client,
--
2.1.0
8 years, 3 months