[libvirt] [PATCH v4 0/2] parallels: use parallels SDK instead of prlctl tool
by Dmitry Guryanov
This patchset begins reworking of parallels driver. We have
published Opensource version of parallels SDK (under LGPL license),
so libvirt can link with it.
Changes in v4:
* Remove reference counting for PrlApi_InitEx and PrlApi_Deinit
* remove Parallels SDK prefix in log messages
* rename 'out' labels to 'cleanup'
Dmitry Guryanov (2):
parallels: build with parallels SDK
parallels: login to parallels SDK
configure.ac | 24 ++--
po/POTFILES.in | 1 +
src/Makefile.am | 8 +-
src/parallels/parallels_driver.c | 16 ++-
src/parallels/parallels_sdk.c | 241 +++++++++++++++++++++++++++++++++++++++
src/parallels/parallels_sdk.h | 30 +++++
src/parallels/parallels_utils.h | 4 +
7 files changed, 310 insertions(+), 14 deletions(-)
create mode 100644 src/parallels/parallels_sdk.c
create mode 100644 src/parallels/parallels_sdk.h
--
1.9.3
10 years, 2 months
[libvirt] [PATCH] storage: Fix logical pool fmt type unknown->auto
by Erik Skultety
According to our documentation logical pool supports formats 'auto' and
'lvm2'. However, in storage_conf.c we prevously defined storage pool
formats: unknown, lvm2. Format 'auto' does make more sense than
format 'unknown', so we should probably stay consistent with the
documentation
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1123767
---
src/conf/storage_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index 36696a4..75004fe 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -81,7 +81,7 @@ VIR_ENUM_IMPL(virStoragePoolFormatDisk,
VIR_ENUM_IMPL(virStoragePoolFormatLogical,
VIR_STORAGE_POOL_LOGICAL_LAST,
- "unknown", "lvm2")
+ "auto", "lvm2")
VIR_ENUM_IMPL(virStorageVolFormatDisk,
--
1.9.3
10 years, 2 months
[libvirt] [PATCH 0/6] Post-copy live migration support
by Cristian Klein
Qemu currently implements pre-copy live migration. VM memory pages are
first copied from the source hypervisor to the destination, potentially
multiple times as pages get dirtied during transfer, then VCPU state
is migrated. Unfortunately, if the VM dirties memory faster than the
network bandwidth, then pre-copy cannot finish. `virsh` currently
includes an option to suspend a VM after a timeout, so that migration
may finish, but at the expense of downtime.
A future version of qemu will implement post-copy live migration. The
VCPU state is first migrated to the destination hypervisor, then
memory pages are pulled from the source hypervisor. Post-copy has the
potential to do migration with zero-downtime, despite the VM dirtying
pages fast, with minimum performance impact. On the other hand, one
post-copy is in progress, any network failure would render the VM
unusable, as its memory is partitioned between the source and
destination hypervisor. Therefore, post-copy should only be used when
necessary.
Post-copy migration in qemu will work as follows:
(1) The `x-postcopy-ram` migration capability needs to be set.
(2) Migration is started.
(3) When the user decides so, post-copy migration is activated by
sending the `migrate-start-postcopy` command. Qemu acknowledges by
setting migration status to `postcopy-active`.
Cristian Klein (6):
Added qemu postcopy-active migration status
Added public API to enable post-copy migration
Added new public API virDomainMigrateStartPostCopy
Added domainMigrateStartPostCopy in qemu driver
Added domainMigrateStartPostCopy in remote driver
virsh: added migrate --postcopy-after
include/libvirt/libvirt.h.in | 3 ++
src/driver.h | 4 +++
src/libvirt.c | 44 +++++++++++++++++++++++++++
src/libvirt_public.syms | 5 +++
src/qemu/qemu_driver.c | 44 +++++++++++++++++++++++++++
src/qemu/qemu_migration.c | 44 +++++++++++++++++++++++++++
src/qemu/qemu_migration.h | 3 +-
src/qemu/qemu_monitor.c | 21 ++++++++++++-
src/qemu/qemu_monitor.h | 3 ++
src/qemu/qemu_monitor_json.c | 21 ++++++++++++-
src/qemu/qemu_monitor_json.h | 1 +
src/qemu/qemu_monitor_text.c | 14 ++++++++-
src/qemu/qemu_monitor_text.h | 2 ++
src/remote/remote_driver.c | 1 +
src/remote/remote_protocol.x | 12 +++++++-
tools/virsh-domain.c | 72 ++++++++++++++++++++++++++++++++++++++++++--
tools/virsh.pod | 5 +++
17 files changed, 292 insertions(+), 7 deletions(-)
--
1.9.1
10 years, 2 months
[libvirt] [PATCH] virnetserver: Raise log level of max_clients related messages
by Michal Privoznik
We have these configuration knobs, like max_clients and
max_anonymous_clients. They limit the number of clients
connected. Whenever the limit is reached, the daemon stops
accepting new ones and resumes if one of the connected clients
disconnects. If that's the case, a debug message is printed into
the logs. And when the daemon starts over to accept new clients
too. However, the problem is the messages have debug priority.
This may be unfortunate, because if the daemon stops accepting
new clients all of a sudden, and users don't have debug logs
enabled they have no idea what's going on. Raise the messages
level to INFO at least.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/rpc/virnetserver.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c
index 7e3fc0a..762c185 100644
--- a/src/rpc/virnetserver.c
+++ b/src/rpc/virnetserver.c
@@ -285,14 +285,14 @@ static int virNetServerAddClient(virNetServerPtr srv,
if (srv->nclients_unauth_max &&
srv->nclients_unauth == srv->nclients_unauth_max) {
/* Temporarily stop accepting new clients */
- VIR_DEBUG("Temporarily suspending services "
- "due to max_anonymous_clients");
+ VIR_INFO("Temporarily suspending services "
+ "due to max_anonymous_clients");
virNetServerUpdateServicesLocked(srv, false);
}
if (srv->nclients == srv->nclients_max) {
/* Temporarily stop accepting new clients */
- VIR_DEBUG("Temporarily suspending services due to max_clients");
+ VIR_INFO("Temporarily suspending services due to max_clients");
virNetServerUpdateServicesLocked(srv, false);
}
@@ -1080,7 +1080,7 @@ virNetServerCheckLimits(virNetServerPtr srv)
(!srv->nclients_unauth_max ||
srv->nclients_unauth < srv->nclients_unauth_max)) {
/* Now it makes sense to accept() a new client. */
- VIR_DEBUG("Re-enabling services");
+ VIR_INFO("Re-enabling services");
virNetServerUpdateServicesLocked(srv, true);
}
}
--
1.8.5.5
10 years, 2 months
[libvirt] [PATCH 0/7] Improve performance of polkit checks
by Daniel P. Berrange
This series improves the performance of the polkit driver by
switching from use of the pk-check command, to the DBus APIs.
As a convenient side effect, this means we are no longer
vulnerable to CVE-2013-4311, on any polkit version, since we
no longer need pk-check (which is what had the flaw).
In terms of performance, with access control checking turned
on for all APIs, the time to list 100 VMs dropps from 2.7 secs
to 1 sec on my machine. To improve on this further, we would
need to find a way to parallelize the issuing of DBus calls
for each VM, instead of serialize the access checks.
Daniel P. Berrange (7):
Add common API for doing polkit authentication
Add typesafe APIs for virIdentity attributes
Convert callers to use typesafe APIs for setting identity attrs
Convert callers to use typesafe APIs for getting identity attrs
Convert remote daemon & acl code to use polkit API
Support passing dict by reference for dbus messages
Convert polkit code to use DBus API instead of CLI helper
cfg.mk | 3 +
daemon/remote.c | 235 ++----------------------
include/libvirt/virterror.h | 2 +
po/POTFILES.in | 2 +
src/Makefile.am | 1 +
src/access/viraccessdriverpolkit.c | 97 ++++------
src/libvirt_private.syms | 22 +++
src/rpc/virnetserverclient.c | 115 +++---------
src/util/virdbus.c | 274 +++++++++++++++++++---------
src/util/virerror.c | 2 +
src/util/viridentity.c | 320 +++++++++++++++++++++++++++------
src/util/viridentity.h | 40 +++++
src/util/virpolkit.c | 255 ++++++++++++++++++++++++++
src/util/virpolkit.h | 34 ++++
src/util/virstring.c | 14 ++
src/util/virstring.h | 2 +
tests/Makefile.am | 9 +-
tests/virdbustest.c | 218 +++++++++++++++++++++-
tests/virpolkittest.c | 360 +++++++++++++++++++++++++++++++++++++
19 files changed, 1485 insertions(+), 520 deletions(-)
create mode 100644 src/util/virpolkit.c
create mode 100644 src/util/virpolkit.h
create mode 100644 tests/virpolkittest.c
--
1.9.3
10 years, 2 months
[libvirt] [PATCH] conf: report error in virCPUDefParseXML
by Jincheng Miao
When detected invalid 'memAccess', virCPUDefParseXML should report error.
Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1146334
Signed-off-by: Jincheng Miao <jmiao(a)redhat.com>
---
src/conf/cpu_conf.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
index 116aa58..a1081b9 100644
--- a/src/conf/cpu_conf.c
+++ b/src/conf/cpu_conf.c
@@ -510,13 +510,13 @@ virCPUDefParseXML(xmlNodePtr node,
def->cells[cur_cell].memAccess =
virMemAccessTypeFromString(memAccessStr);
- if (def->cells[cur_cell].memAccess <= 0) {
+ if ((int)def->cells[cur_cell].memAccess <= 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Invalid 'memAccess' attribute "
"value '%s'"),
memAccessStr);
VIR_FREE(memAccessStr);
- goto cleanup;
+ goto error;
}
VIR_FREE(memAccessStr);
}
--
1.9.3
10 years, 2 months
[libvirt] [PATCH v2] polkit_driver: fix possible segfault
by Pavel Hrdina
The changes in commit c7542573 introduced possible segfault. Looking
deeper into the code and the original code before the patch series were
applied I think that we should report error for each function failure
and also we shouldn't call some of the function twice.
Found by coverity.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/access/viraccessdriverpolkit.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/access/viraccessdriverpolkit.c b/src/access/viraccessdriverpolkit.c
index 2bc1842..3136be7 100644
--- a/src/access/viraccessdriverpolkit.c
+++ b/src/access/viraccessdriverpolkit.c
@@ -87,24 +87,22 @@ virAccessDriverPolkitGetCaller(const char *actionid,
actionid);
return -1;
}
- if (virIdentityGetUNIXProcessID(identity, pid) < 0)
- goto cleanup;
- if (virIdentityGetUNIXProcessTime(identity, startTime) < 0)
- goto cleanup;
- if (virIdentityGetUNIXUserID(identity, uid) < 0)
- goto cleanup;
- if (!pid) {
+ if (virIdentityGetUNIXProcessID(identity, pid) < 0) {
virAccessError(VIR_ERR_INTERNAL_ERROR, "%s",
_("No UNIX process ID available"));
goto cleanup;
}
-
- if (virIdentityGetUNIXProcessTime(identity, startTime) < 0)
+ if (virIdentityGetUNIXProcessTime(identity, startTime) < 0) {
+ virAccessError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("No UNIX process start time available"));
goto cleanup;
-
- if (virIdentityGetUNIXUserID(identity, uid) < 0)
+ }
+ if (virIdentityGetUNIXUserID(identity, uid) < 0) {
+ virAccessError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("No UNIX caller UID available"));
goto cleanup;
+ }
ret = 0;
--
1.8.5.5
10 years, 2 months
[libvirt] [PATCHv5 0/8] bulk stats: QEMU implementation
by Francesco Romani
This patchset enhances the QEMU support
for the new bulk stats API to include
equivalents of these APIs:
virDomainBlockInfo
virDomainGetInfo - for balloon stats
virDomainGetCPUStats
virDomainBlockStatsFlags
virDomainInterfaceStats
virDomainGetVcpusFlags
virDomainGetVcpus
This subset of API is the one oVirt relies on.
Scale/stress test on an oVirt test environment is in progress.
The patchset is organized as follows:
- the first patch enhances the internal stats gathering API
to accomodate the needs of the groups which extract information
using QEMU monitor jobs.
- the next five patches implement the bulk stats groups, extracting
helpers where do refactoring to extract internal helpers every time
it is feasible and convenient.
- the seventh patch enhances the virsh domstats command with options
to use the new bulk stats.
- the last patch enhances the block stats group adding the wr_highest_offset
information, needed by oVirt for thin provisioned disks.
ChangeLog
v5: address reviewer's comment
- Eric pointed out a possible flaw in balloon stats if QEMU monitor needs
to be queried. A proper fix require further discussion and API changes
(possbily just a new flag); However, since the balloon event is available
in QEMU >= 1.2, I just dropped the query and relied on the event instead.
Support for older QEMUs will be reintroduced, if needed, with following
patches.
- fix: per-domain monitor check and reporting. (pointed out by Peter)
- reset last error when fail silently. (pointed out by Peter)
v4: address reviewer's comment
- addressed reviewers comments (Peter, Wang Rui).
- pushed domain check into group stats functions. This follows
the strategy to gather and report as much data as possible,
silently skipping errors along the way.
- moved the block allocation patch to the end of the series.
v3: more polishing and fixes after first review
- addressed Eric's comments.
- squashed patches which extracts helpers with patches which
use them.
- changed gathering strategy: now code tries to reap as much
information as possible instead to give up and bail out with
error. Only critical errors cause the bulk stats to fail.
- moved away from the transfer semantics. I find it error-prone
and not flexible enough, I'd like to avoid as much as possible.
- rearranged helpers to have one single QEMU query job with
many monitor jobs nested inside.
- fixed docs.
- implemented missing virsh domstats bits.
in v2: polishing and optimizations.
- incorporated feedback from Li Wei (thanks).
- added documentation.
- optimized block group to gather all the information with just
one call to QEMU monitor.
- stripped to bare bones merged the 'block info' group into the
'block' group - oVirt actually needs just one stat from there.
- reorganized the keys to be more consistent and shorter.
Francesco Romani (8):
qemu: bulk stats: extend internal collection API
qemu: bulk stats: implement CPU stats group
qemu: bulk stats: implement balloon group
qemu: bulk stats: implement VCPU group
qemu: bulk stats: implement interface group
qemu: bulk stats: implement block group
virsh: add options to query bulk stats group
qemu: bulk stats: add block allocation information
include/libvirt/libvirt.h.in | 5 +
src/libvirt.c | 61 +++++
src/qemu/qemu_driver.c | 530 +++++++++++++++++++++++++++++++++++++------
src/qemu/qemu_monitor.c | 26 +++
src/qemu/qemu_monitor.h | 21 ++
src/qemu/qemu_monitor_json.c | 227 +++++++++++++-----
src/qemu/qemu_monitor_json.h | 4 +
tools/virsh-domain-monitor.c | 35 +++
tools/virsh.pod | 4 +-
9 files changed, 777 insertions(+), 136 deletions(-)
--
1.9.3
10 years, 2 months
[libvirt] [PATCH] polkit_driver: fix possible segfault
by Pavel Hrdina
The changes in commit c7542573 introduced a segfault. Found by coverity.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/access/viraccessdriverpolkit.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/access/viraccessdriverpolkit.c b/src/access/viraccessdriverpolkit.c
index 2bc1842..2fd4fed 100644
--- a/src/access/viraccessdriverpolkit.c
+++ b/src/access/viraccessdriverpolkit.c
@@ -87,6 +87,12 @@ virAccessDriverPolkitGetCaller(const char *actionid,
actionid);
return -1;
}
+ if (!pid) {
+ virAccessError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("No UNIX process ID available"));
+ goto cleanup;
+ }
+
if (virIdentityGetUNIXProcessID(identity, pid) < 0)
goto cleanup;
if (virIdentityGetUNIXProcessTime(identity, startTime) < 0)
@@ -94,12 +100,6 @@ virAccessDriverPolkitGetCaller(const char *actionid,
if (virIdentityGetUNIXUserID(identity, uid) < 0)
goto cleanup;
- if (!pid) {
- virAccessError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("No UNIX process ID available"));
- goto cleanup;
- }
-
if (virIdentityGetUNIXProcessTime(identity, startTime) < 0)
goto cleanup;
--
1.8.5.5
10 years, 2 months
[libvirt] [PATCH] blkdeviotune: trigger tunable event for blkdeviotune updates
by Pavel Hrdina
With the blkdeviotune event this patch also fixes a bug that the updated
live values weren't saved to the live XML so they won't survive
restarting the libvirtd.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
include/libvirt/libvirt.h.in | 56 ++++++++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_driver.c | 54 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 110 insertions(+)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 898f8b5..32930e2 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -5262,6 +5262,61 @@ typedef void (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn,
*/
#define VIR_DOMAIN_EVENT_CPUTUNE_EMULATOR_QUOTA "cputune.emulator_quota"
+/**
+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_DISK:
+ *
+ * Macro represents the name of guest disk for which the values are updated,
+ * as VIR_TYPED_PARAM_STRING.
+ */
+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_DISK "blkdeviotune.disk"
+
+/**
+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_BYTES_SEC:
+ *
+ * Marco represents the total throughput limit in bytes per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_BYTES_SEC "blkdeviotune.total_bytes_sec"
+
+/**
+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_BYTES_SEC:
+ *
+ * Marco represents the read throughput limit in bytes per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_BYTES_SEC "blkdeviotune.read_bytes_sec"
+
+/**
+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_BYTES_SEC:
+ *
+ * Macro represents the write throughput limit in bytes per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_BYTES_SEC "blkdeviotune.write_bytes_sec"
+
+/**
+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_IOPS_SEC:
+ *
+ * Macro represents the total I/O operations per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_IOPS_SEC "blkdeviotune.total_iops_sec"
+
+/**
+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_IOPS_SEC:
+ *
+ * Macro represents the read I/O operations per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_IOPS_SEC "blkdeviotune.read_iops_sec"
+
+/**
+ * VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_IOPS_SEC:
+ *
+ * Macro represents the write I/O operations per second,
+ * as VIR_TYPED_PARAM_ULLONG.
+ */
+#define VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_IOPS_SEC "blkdeviotune.write_iops_sec"
/**
* virConnectDomainEventTunableCallback:
@@ -5277,6 +5332,7 @@ typedef void (*virConnectDomainEventDeviceRemovedCallback)(virConnectPtr conn,
*
* Currently supported name spaces:
* "cputune.*"
+ * "blkdeviotune.*"
*
* The callback signature to use when registering for an event of type
* VIR_DOMAIN_EVENT_ID_TUNABLE with virConnectDomainEventRegisterAny()
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d1a0657..173333a 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16274,6 +16274,10 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
bool set_iops = false;
virQEMUDriverConfigPtr cfg = NULL;
virCapsPtr caps = NULL;
+ virObjectEventPtr event = NULL;
+ virTypedParameterPtr eventParams = NULL;
+ int eventNparams = 0;
+ int eventMaxparams = 0;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG, -1);
@@ -16315,6 +16319,10 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
&persistentDef) < 0)
goto endjob;
+ if (virTypedParamsAddString(&eventParams, &eventNparams, &eventMaxparams,
+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_DISK, disk) < 0)
+ goto endjob;
+
for (i = 0; i < nparams; i++) {
virTypedParameterPtr param = ¶ms[i];
@@ -16328,26 +16336,56 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
if (STREQ(param->field, VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_BYTES_SEC)) {
info.total_bytes_sec = param->value.ul;
set_bytes = true;
+ if (virTypedParamsAddULLong(&eventParams, &eventNparams,
+ &eventMaxparams,
+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_BYTES_SEC,
+ param->value.ul) < 0)
+ goto endjob;
} else if (STREQ(param->field,
VIR_DOMAIN_BLOCK_IOTUNE_READ_BYTES_SEC)) {
info.read_bytes_sec = param->value.ul;
set_bytes = true;
+ if (virTypedParamsAddULLong(&eventParams, &eventNparams,
+ &eventMaxparams,
+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_BYTES_SEC,
+ param->value.ul) < 0)
+ goto endjob;
} else if (STREQ(param->field,
VIR_DOMAIN_BLOCK_IOTUNE_WRITE_BYTES_SEC)) {
info.write_bytes_sec = param->value.ul;
set_bytes = true;
+ if (virTypedParamsAddULLong(&eventParams, &eventNparams,
+ &eventMaxparams,
+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_BYTES_SEC,
+ param->value.ul) < 0)
+ goto endjob;
} else if (STREQ(param->field,
VIR_DOMAIN_BLOCK_IOTUNE_TOTAL_IOPS_SEC)) {
info.total_iops_sec = param->value.ul;
set_iops = true;
+ if (virTypedParamsAddULLong(&eventParams, &eventNparams,
+ &eventMaxparams,
+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_TOTAL_IOPS_SEC,
+ param->value.ul) < 0)
+ goto endjob;
} else if (STREQ(param->field,
VIR_DOMAIN_BLOCK_IOTUNE_READ_IOPS_SEC)) {
info.read_iops_sec = param->value.ul;
set_iops = true;
+ if (virTypedParamsAddULLong(&eventParams, &eventNparams,
+ &eventMaxparams,
+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_READ_IOPS_SEC,
+ param->value.ul) < 0)
+ goto endjob;
} else if (STREQ(param->field,
VIR_DOMAIN_BLOCK_IOTUNE_WRITE_IOPS_SEC)) {
info.write_iops_sec = param->value.ul;
set_iops = true;
+ if (virTypedParamsAddULLong(&eventParams, &eventNparams,
+ &eventMaxparams,
+ VIR_DOMAIN_EVENT_BLKDEVIOTUNE_WRITE_IOPS_SEC,
+ param->value.ul) < 0)
+ goto endjob;
}
}
@@ -16405,6 +16443,20 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
if (ret < 0)
goto endjob;
vm->def->disks[idx]->blkdeviotune = info;
+
+ ret = virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm);
+ if (ret < 0) {
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("Saving live XML config failed"));
+ goto endjob;
+ }
+
+ if (eventNparams) {
+ event = virDomainEventTunableNewFromDom(dom, eventParams, eventNparams);
+ eventNparams = 0;
+ if (event)
+ qemuDomainEventQueue(driver, event);
+ }
}
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
@@ -16437,6 +16489,8 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
VIR_FREE(device);
if (vm)
virObjectUnlock(vm);
+ if (eventNparams)
+ virTypedParamsFree(eventParams, eventNparams);
virObjectUnref(caps);
virObjectUnref(cfg);
return ret;
--
1.8.5.5
10 years, 2 months