[libvirt] [PATCH v4 5/8] perf: add new xml element
Daniel P. Berrange
berrange at redhat.com
Tue Mar 29 12:12:48 UTC 2016
On Mon, Mar 28, 2016 at 09:30:30PM +0800, Qiaowei Ren wrote:
> This patch adds new xml element, and so we can have the option of
> also having perf events enabled immediately at startup.
>
> Signed-off-by: Qiaowei Ren <qiaowei.ren at intel.com>
> ---
> docs/schemas/domaincommon.rng | 27 +++++++
> src/conf/domain_conf.c | 111 ++++++++++++++++++++++++++
> src/conf/domain_conf.h | 10 +++
> src/qemu/qemu_driver.c | 26 ++++++
> src/qemu/qemu_process.c | 8 +-
> tests/domainschemadata/domain-perf-simple.xml | 20 +++++
> 6 files changed, 200 insertions(+), 2 deletions(-)
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index f7d30e9..cf7df1a 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -5254,8 +5254,12 @@ qemuProcessLaunch(virConnectPtr conn,
> goto cleanup;
>
> priv->perf = virPerfNew();
> - if (!priv->perf)
> - goto cleanup;
> + if (priv->perf) {
> + for (size_t i = 0; i < VIR_PERF_EVENT_LAST; i++) {
We don't declare variables in the for loop
> + if (vm->def->perf->events[i] == VIR_TRISTATE_BOOL_YES)
> + virPerfEventEnable(priv->perf, i, vm->pid);
> + }
> + }
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the libvir-list
mailing list