[libvirt] [PATCH] docs: Update the format of the generate metadata example

2018-04-04 Thread John Ferlan
Initially, update the UUID field to have the proper format, but then also changed the type, id, and name fields. Signed-off-by: John Ferlan --- While beginning to think more about the vmgenid RFC and creating a element under the , I noted that the existing name and uuid

Re: [libvirt] [PATCH 7/7] remote: use a separate connection for storage APIs

2018-04-04 Thread John Ferlan
On 03/28/2018 11:18 AM, Daniel P. Berrangé wrote: > Signed-off-by: Daniel P. Berrangé > --- > src/remote/remote_daemon.h | 1 + > src/remote/remote_daemon_dispatch.c | 17 ++--- > src/rpc/gendispatch.pl | 6 ++ > 3 files changed, 17

Re: [libvirt] [PATCH 6/7] remote: use a separate connection for secret APIs

2018-04-04 Thread John Ferlan
On 03/28/2018 11:18 AM, Daniel P. Berrangé wrote: > Signed-off-by: Daniel P. Berrangé > --- > src/remote/remote_daemon.h | 1 + > src/remote/remote_daemon_dispatch.c | 19 +++ > src/rpc/gendispatch.pl | 6 ++ > 3 files changed,

Re: [libvirt] [PATCH 5/7] remote: use a separate connection for nwfilter APIs

2018-04-04 Thread John Ferlan
On 03/28/2018 11:18 AM, Daniel P. Berrangé wrote: > Signed-off-by: Daniel P. Berrangé > --- > src/remote/remote_daemon.h | 1 + > src/remote/remote_daemon_dispatch.c | 3 +++ > src/rpc/gendispatch.pl | 6 ++ > 3 files changed, 10 insertions(+) >

Re: [libvirt] [PATCH 4/7] remote: use a separate connection for nodedev APIs

2018-04-04 Thread John Ferlan
On 03/28/2018 11:18 AM, Daniel P. Berrangé wrote: > Signed-off-by: Daniel P. Berrangé > --- > src/remote/remote_daemon.h | 1 + > src/remote/remote_daemon_dispatch.c | 19 +++ > src/rpc/gendispatch.pl | 6 ++ > 3 files changed,

Re: [libvirt] [PATCH 1/7] rpc: refactor way connection object is generated for remote dispatch

2018-04-04 Thread John Ferlan
On 03/28/2018 11:18 AM, Daniel P. Berrangé wrote: > Calling a push_privconn method to directly push the connection object > name into the arg list is inconvenient. Refactor so that we acquire > the connection variable name upfront, and push it to the arg list > separately. This allows various

Re: [libvirt] [PATCH 3/7] remote: use a separate connection for network APIs

2018-04-04 Thread John Ferlan
On 03/28/2018 11:18 AM, Daniel P. Berrangé wrote: > Signed-off-by: Daniel P. Berrangé > --- > src/remote/remote_daemon.h | 1 + > src/remote/remote_daemon_dispatch.c | 19 +++ > src/rpc/gendispatch.pl | 6 ++ > 3 files changed,

Re: [libvirt] [PATCH 2/7] remote: use a separate connection for interface APIs

2018-04-04 Thread John Ferlan
On 03/28/2018 11:18 AM, Daniel P. Berrangé wrote: > Signed-off-by: Daniel P. Berrangé > --- > src/remote/remote_daemon.h | 1 + > src/remote/remote_daemon_dispatch.c | 4 > src/rpc/gendispatch.pl | 25 - > 3 files

[libvirt] [PATCH v3 1/2] util: Add helper APIs to get/verify VF Representor name

2018-04-04 Thread Jai Singh Rana
Switchdev VF representor interface name on host is queried based on Bus:Device:Function information of pci SR-IOV device in Domain's 'hostdev' structure and subsequently verifying the required net sysfs directory and file entries of VF representor according to switchdev model. --- v3 includes

Re: [libvirt] [ovirt-devel] [kubevirt-dev] Re: [virt-tools-list] Project for profiles and defaults for libvirt domains

2018-04-04 Thread Yaniv Lavi
Hi, I'd like to go one step back and discuss why we should try to do this on the high level. For the last 5-10 years of KVM development, we are pragmatically providing the Linux host level APIs via project specific host agents/integration code (Nova agent, oVirt host agent, virt-manager). In

Re: [libvirt] [ovirt-devel] [kubevirt-dev] Re: [virt-tools-list] Project for profiles and defaults for libvirt domains

2018-04-04 Thread Yaniv Lavi
[resending to include KubeVirt devs ] YANIV LAVI SENIOR TECHNICAL PRODUCT MANAGER Red Hat Israel Ltd. 34 Jerusalem Road, Building A, 1st floor Ra'anana, Israel 4350109 yl...@redhat.comT: +972-9-7692306/8272306 F: +972-9-7692223IM: ylavi

[libvirt] [PATCH v3 2/2] qemu: conf: Network stats support for VF Representors

2018-04-04 Thread Jai Singh Rana
In case of pci SR-IOV device with interface_type as 'hostdev', return network stats if it has a VF Representor interface on host for pci SR-IOV device according to switchdev model. --- v3 includes changes based on v2's[1] feedback and suggestions. Includes fix for hostdev to net mapping in a given

[libvirt] [PATCH v3 0/2] Support network stats for VF representor interface

2018-04-04 Thread Jai Singh Rana
With availability of switchdev model in linux, it is possible to capture stats for SR-IOV device with interface_type as 'hostdev' provided device supports VF represontor in switchdev mode[1] on host. These stats are supported by adding helper APIs for getting/verifying VF representor name based

Re: [libvirt] [dbus PATCH v2 5/5] Implement NetworkLookupByName method for Connect interface

2018-04-04 Thread Pavel Hrdina
On Wed, Apr 04, 2018 at 02:26:13PM +0200, Katerina Koukiou wrote: > Signed-off-by: Katerina Koukiou > --- > data/org.libvirt.Connect.xml | 6 ++ > src/connect.c| 29 + > test/test_connect.py | 11 +++ > 3 files

Re: [libvirt] [dbus PATCH v2 4/5] Implement Name property for Network interface

2018-04-04 Thread Pavel Hrdina
On Wed, Apr 04, 2018 at 02:26:12PM +0200, Katerina Koukiou wrote: > This commit also introduces the virtDBusNetworkGetVirNetwork > static function which is needed for the virtDBusNetworkGetName. > > Signed-off-by: Katerina Koukiou > --- > data/org.libvirt.Network.xml | 4

Re: [libvirt] [dbus PATCH v2 3/5] Implement virtDBusUtilVirNetworkFromBusPath helper function.

2018-04-04 Thread Pavel Hrdina
On Wed, Apr 04, 2018 at 02:26:11PM +0200, Katerina Koukiou wrote: > Signed-off-by: Katerina Koukiou > --- > src/util.c | 13 + > src/util.h | 5 + > 2 files changed, 18 insertions(+) This can be squashed into the first patch. You are introducing support

Re: [libvirt] [dbus PATCH v2 2/5] Implement ListNetworks method for Connect interface

2018-04-04 Thread Pavel Hrdina
On Wed, Apr 04, 2018 at 02:26:10PM +0200, Katerina Koukiou wrote: > Signed-off-by: Katerina Koukiou > --- > data/org.libvirt.Connect.xml | 6 ++ > src/connect.c| 41 + > 2 files changed, 47 insertions(+) > > diff

Re: [libvirt] [PATCH v3 2/3] qemu_cgroup: Handle device mapper targets properly

2018-04-04 Thread Peter Krempa
On Tue, Apr 03, 2018 at 11:03:26 +0200, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1557769 > > Problem with device mapper targets is that there can be several > other devices 'hidden' behind them. For instance, /dev/dm-1 can > consist of /dev/sda, /dev/sdb and /dev/sdc.

Re: [libvirt] [PATCH v3 3/3] news: Document device mapper fix

2018-04-04 Thread Peter Krempa
On Tue, Apr 03, 2018 at 11:03:27 +0200, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > docs/news.xml | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/docs/news.xml b/docs/news.xml > index 87f52e83ef..065b60b6eb 100644 > ---

Re: [libvirt] [PATCH v3 2/3] qemu_cgroup: Handle device mapper targets properly

2018-04-04 Thread Peter Krempa
On Tue, Apr 03, 2018 at 11:03:26 +0200, Michal Privoznik wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1557769 This BZ is private. Please don't use links which can't be viewed by the public. > > Problem with device mapper targets is that there can be several > other devices 'hidden'

Re: [libvirt] [PATCH v3 1/3] util: Introduce virDevMapperGetTargets

2018-04-04 Thread Peter Krempa
On Tue, Apr 03, 2018 at 11:03:25 +0200, Michal Privoznik wrote: > This helper fetches dependencies for given device mapper target. > > At the same time, we need to provide a dummy log function because > by default libdevmapper prints out error messages to stderr which > we need to suppress. > >

[libvirt] [PATCH 66/68] qemu: Store API flags for async jobs in status XML

2018-04-04 Thread Jiri Denemark
This will help us decide what to do when libvirtd is restarted while an async job is running. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c| 8 + .../migration-out-nbd-out.xml | 450 +- 2 files changed, 457

[libvirt] [PATCH 67/68] qemu: Don't delete TLS objects unless TLS migration was requested

2018-04-04 Thread Jiri Denemark
Trying to delete the non-existent TLS objects results in ugly error messages in the log, which could easily confuse users. Let's avoid this confusion by not trying to delete the objects if we were not asked to enable TLS migration and thus we didn't created the objects anyway. This patch restores

[libvirt] [PATCH 46/68] qemu: Drop qemuMigrationCompression structure

2018-04-04 Thread Jiri Denemark
By merging qemuMigrationAnyCompressionParse into qemuMigrationParamsSetCompression we can drop the useless intermediate qemuMigrationCompression structure and parse compression related typed parameters and flags directly into qemuMigrationParams. Signed-off-by: Jiri Denemark

[libvirt] [PATCH 65/68] qemu: Drop priv->job.postcopyEnabled bool

2018-04-04 Thread Jiri Denemark
We store the flags passed to the API which started the migration. Let's use them instead of a separate bool to check if post-copy migration was requested. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c| 1 - src/qemu/qemu_domain.h| 1 -

[libvirt] [PATCH 61/68] qemumigparamstest: Add test data for TLS parameters

2018-04-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- tests/qemumigparamsdata/tls-enabled.json | 11 +++ tests/qemumigparamsdata/tls-enabled.reply | 14 ++ tests/qemumigparamsdata/tls-enabled.xml| 13 + tests/qemumigparamsdata/tls-hostname.json | 11

[libvirt] [PATCH 50/68] util: Introduce virJSONValueObjectStealObject

2018-04-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/libvirt_private.syms | 1 + src/util/virjson.c | 8 src/util/virjson.h | 2 ++ 3 files changed, 11 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index f6897915ce..9d98ee54df 100644

[libvirt] [PATCH 57/68] qemu: Properly reset migration params when libvirtd restarts

2018-04-04 Thread Jiri Denemark
To be able to restore all migration parameters when libvirtd is restarting during an active migration job, we need to store the original values of all parameters (stored in priv->job.migParams) in the status XML. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c

[libvirt] [PATCH 58/68] qemu: Export qemuMigrationParams{To, From}JSON for tests

2018-04-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/Makefile.inc.am | 1 + src/qemu/qemu_migration_params.c | 5 +++-- src/qemu/qemu_migration_paramspriv.h | 31 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644

[libvirt] [PATCH 62/68] qemu: Store API flags for async jobs in qemuDomainJobObj

2018-04-04 Thread Jiri Denemark
When an async job is running, we sometimes need to know how it was started to distinguish between several types of the job, e.g., post-copy vs. normal migration. So far we added a specific bool item to qemuDomainJobObj for such cases, which doesn't scale very well and storing such bools in status

[libvirt] [PATCH 17/68] qemu: Drop qemuMigrationParamsCheckTLSCreds

2018-04-04 Thread Jiri Denemark
The function checks whether QEMU supports TLS migration and stores the original value of tls-creds parameter to priv->migTLSAlias. This is no longer needed because we already have the original value stored in priv->migParams. Signed-off-by: Jiri Denemark ---

[libvirt] [PATCH 40/68] qemu: Generalize macro for getting VIR_MIGRATE_* typed params

2018-04-04 Thread Jiri Denemark
So far it's used only for CPU throttling parameters which are all ints, but we'll soon want to use it for more parameters with different types. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 31 +++ 1 file changed, 15

[libvirt] [PATCH 27/68] qemu: Drop unused qemuMonitorSetMigrationCapability

2018-04-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 14 -- src/qemu/qemu_monitor.h | 3 -- src/qemu/qemu_monitor_json.c | 53 src/qemu/qemu_monitor_json.h | 3 -- 4 files changed, 73 deletions(-) diff --git

[libvirt] [PATCH 47/68] qemu: Introduce qemuMigrationParamsFetch

2018-04-04 Thread Jiri Denemark
Let's separate the code which queries QEMU for migration parameters from qemuMigrationParamsCheck into a dedicated function. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 56 +++- src/qemu/qemu_migration_params.h | 6

[libvirt] [PATCH 28/68] qemu: Add support for xbzrle-cache-size migration parameter

2018-04-04 Thread Jiri Denemark
Originally QEMU provided query-migrate-cache-size and migrate-set-cache-size QMP commands for querying/setting XBZRLE cache size. In version 2.11 QEMU added support for XBZRLE cache size to the general migration paramaters commands. This patch adds support for this parameter to libvirt to make

[libvirt] [PATCH 34/68] qemu: Use qemuMigrationParamsFromFlags everywhere

2018-04-04 Thread Jiri Denemark
Every migration entry point in qemu_driver is supposed to call qemuMigrationParamsFromFlags to transform flags and parameters into qemuMigrationParams structure and pass the result to qemuMigration* APIs. Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c| 64

[libvirt] [PATCH 21/68] qemu: Hide cfg inside qemuMigrationParamsEnableTLS

2018-04-04 Thread Jiri Denemark
There's no real reason for qemuMigrationParamsEnableTLS to require the callers to pass a valid virQEMUDriverConfigPtr, it can just call virQEMUDriverGetConfig. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 10 ++

[libvirt] [PATCH 39/68] qemu: Call qemuMigrationAnyCompressionParse only from driver

2018-04-04 Thread Jiri Denemark
Propagate the calls up the stack to the point where qemuMigrationParamsFromFlags is called. The end goal achieved in the following few patches is to merge compression parameters into the general migration parameters code. Signed-off-by: Jiri Denemark ---

[libvirt] [PATCH 42/68] qemu: Move qemuMigrationParamsSetCompression

2018-04-04 Thread Jiri Denemark
The API will soon be called from qemuMigrationParamsFromFlags. Let's move it to avoid the need to add a forward declaration. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 59 1 file changed, 30 insertions(+), 29

Re: [libvirt] [dbus PATCH v2 1/5] Introduce Network Interface

2018-04-04 Thread Pavel Hrdina
On Wed, Apr 04, 2018 at 02:26:09PM +0200, Katerina Koukiou wrote: > Signed-off-by: Katerina Koukiou > --- > data/Makefile.am | 3 ++- > data/org.libvirt.Network.xml | 7 + > src/Makefile.am | 3 ++- > src/connect.c| 5 >

[libvirt] [PATCH 19/68] qemu: Rename qemuMigrationParamsAddTLSObjects

2018-04-04 Thread Jiri Denemark
The new name is qemuMigrationParamsEnableTLS. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 12 ++-- src/qemu/qemu_migration_params.c | 18 +- src/qemu/qemu_migration_params.h | 16 3 files changed, 23

[libvirt] [PATCH 07/68] qemu: Allocate struct for migration parameters

2018-04-04 Thread Jiri Denemark
It will get a bit more complicated soon and storing it on a stack with {0} initializer will no longer work. We need a proper constructor. Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 20 +++-- src/qemu/qemu_migration.c| 28

[libvirt] [PATCH 06/68] qemu: Make qemuMigrationParamsFree follow common pattern

2018-04-04 Thread Jiri Denemark
Our *Free functions usually do not take a double pointer and the caller has to make sure it doesn't use the stale pointer after the *Free function returns. Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_migration_params.c | 10

[libvirt] [PATCH 23/68] qemu: Hide internals of qemuMigrationParams struct

2018-04-04 Thread Jiri Denemark
All users of migration parameters are supposed to use APIs provided by qemu_migration_params.c without having to worry about the internals. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 5 + src/qemu/qemu_migration_params.h | 3 --- 2 files

[libvirt] [PATCH 10/68] qemu: Introduce qemuMigrationParams struct

2018-04-04 Thread Jiri Denemark
Currently migration parameters are stored in a structure which mimics the QEMU migration parameters handled by query-migrate-parameters and migrate-set-parameters. The new structure will become a libvirt's abstraction on top of QEMU migration parameters, capabilities, and related stuff.

[libvirt] [PATCH 22/68] qemu: Rename qemuMigrationParamsSet

2018-04-04 Thread Jiri Denemark
The new name is qemuMigrationParamsApply and it will soon become the only API which will send all requested migration parameters and capabilities to QEMU. All other qemuMigrationParams* APIs will just operate on the qemuMigrationParams structure. Signed-off-by: Jiri Denemark

[libvirt] [PATCH 05/68] qemu: Reindent qemuMigrationParamsSetEmptyTLS

2018-04-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c index 72ecafd057..69fbeaefa9 100644 ---

[libvirt] [PATCHv3 6/6] qemu: refresh vcpu halted state only via query-cpus-fast

2018-04-04 Thread Viktor Mihajlovski
In order to not affect running VMs, refreshing the halted state is only performed if QEMU supports the query-cpus-fast QAPI. Signed-off-by: Viktor Mihajlovski Reviewed-by: Boris Fiuczynski Reviewed-by: Marc Hartmayer

[libvirt] [PATCHv3 5/6] tests: add testcase for s390 query-cpus-fast

2018-04-04 Thread Viktor Mihajlovski
The s390 testcase verifies that the s390-specific cpu-state field is correctly mapped to the halted property. Signed-off-by: Viktor Mihajlovski --- .../qemumonitorjson-cpuinfo-s390-fast-cpus.json| 25 ++

[libvirt] [PATCHv3 1/6] qemu: add capability detection for query-cpus-fast

2018-04-04 Thread Viktor Mihajlovski
Detect whether QEMU supports the QMP query-cpus-fast API and set QEMU_CAPS_QUERY_CPUS_FAST in this case. Signed-off-by: Viktor Mihajlovski --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 +

[libvirt] [PATCHv3 3/6] tests: add qemumonitorjson tests for query-cpus-fast

2018-04-04 Thread Viktor Mihajlovski
Extended the json monitor test program with support for query-cpus-fast and added a sample file set for x86 data obtained using the it. Also extend the test program to recognize the halted property. Signed-off-by: Viktor Mihajlovski ---

[libvirt] [PATCHv3 0/6] Use query-cpus-fast instead of query-cpus

2018-04-04 Thread Viktor Mihajlovski
The QEMU monitor commmand query-cpus is deprecated starting with QEMU 2.12.0 because it can adversely affect the performance of a running virtual machine. This series enables libvirt to use the new query-cpus-fast interface if supported by the local QEMU instance and is required in order to

[libvirt] [PATCHv3 4/6] qemu: add architecture-specific CPU info handling

2018-04-04 Thread Viktor Mihajlovski
Extract architecture specific data from query-cpus[-fast] if available. A new function qemuMonitorJSONExtractCPUArchInfo() can then call architecture-specific extraction handlers. Initially, there's a handler for s390 cpu info to set the halted property depending on the s390 cpu state returned by

[libvirt] [PATCHv3 2/6] qemu: use query-cpus-fast in JSON monitor

2018-04-04 Thread Viktor Mihajlovski
Use query-cpus-fast instead of query-cpus if supported by QEMU. Based on the QEMU_CAPS_QUERY_CPUS_FAST capability. Signed-off-by: Viktor Mihajlovski --- src/qemu/qemu_domain.c | 14 +++--- src/qemu/qemu_monitor.c | 30

[libvirt] [PATCH 64/68] qemu: Drop priv->job.dump_memory_only bool

2018-04-04 Thread Jiri Denemark
We store the flags passed to the API which started QEMU_ASYNC_JOB_DUMP and we can use them to check whether a memory-only dump is running. There's no need for a specific bool flag. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c | 1 - src/qemu/qemu_domain.h | 1 -

[libvirt] [PATCH 54/68] qemu: Refactor qemuMigrationParams

2018-04-04 Thread Jiri Denemark
Adding support for new migration parameter requires a lot of places to be changed (most likely by copy engineering): new variables to store the parameter value and the associated *_set bool, JSON formatter and parser, XML formatter and parser (to be added soon), and the actual code to set the

[libvirt] [PATCH 68/68] qemuxml2xmltest: Add status XML tests for migration params

2018-04-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- .../migration-in-params-in.xml| 400 + .../migration-in-params-out.xml | 1 + .../migration-out-params-in.xml | 414 ++ .../migration-out-params-out.xml

[libvirt] [PATCH 63/68] qemu: Properly avoid cancelling memory-only dump

2018-04-04 Thread Jiri Denemark
migrate_cancel QMP command cannot be used for cancelling memory-only dumps and priv->job.dump_memory_only is used for reporting an error if someone calls virDomainAbortJob when memory-only dump job is running. Since commit 150930e3098 the dump_memory_only flag is set only dump-guest-memory

[libvirt] [PATCH 31/68] qemu: Move ParamsCheck closer to ParamsApply on Src side

2018-04-04 Thread Jiri Denemark
We reached the point when qemuMigrationParamsApply is the only API which sends migration parameters and capabilities to QEMU. Thus all but the TLS parameters can be set before we ask QEMU for the current values of all parameters in qemuMigrationParamsCheck. Supported migration capabilities are

[libvirt] [PATCH 32/68] qemu: Check supported caps in qemuMigrationParamsCheck

2018-04-04 Thread Jiri Denemark
Instead of checking each capability at the time we want to set it in qemuMigrationParamsSetCapability we can check all of them at once in qemuMigrationParamsCheck. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 6 --

[libvirt] [PATCH 56/68] qemu: Set migration parameters automatically

2018-04-04 Thread Jiri Denemark
Most QEMU migration parameters directly correspond to VIR_MIGRATE_PARAM_* typed parameters and qemuMigrationParamsFromFlags can automatically set them according to a static mapping between libvirt and QEMU parameters. Signed-off-by: Jiri Denemark ---

[libvirt] [PATCH 02/68] qemu: Rename qemuMigrationAnyCapsGet as qemuMigrationCapsGet

2018-04-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c| 4 ++-- src/qemu/qemu_migration.c | 10 +- src/qemu/qemu_migration.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

[libvirt] [PATCH 48/68] qemu: Limit usage of qemuMonitorMigrationParams

2018-04-04 Thread Jiri Denemark
Use this internal structure only in qemu_migration_params.c and change other non-test users to use the high level qemuMigrationParams struct. Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 26 +++--- src/qemu/qemu_migration_params.c

[libvirt] [PATCH 35/68] qemu: Hide qemuMigrationParamsNew

2018-04-04 Thread Jiri Denemark
It is no longer used outside qemu_migration_params.c. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 2 +- src/qemu/qemu_migration_params.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/qemu/qemu_migration_params.c

[libvirt] [PATCH 20/68] qemu: Set tlsHostname inside qemuMigrationParamsEnableTLS

2018-04-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 31 --- src/qemu/qemu_migration_params.c | 9 +++-- src/qemu/qemu_migration_params.h | 1 + 3 files changed, 20 insertions(+), 21 deletions(-) diff --git

[libvirt] [PATCH 29/68] qemu: Set XBZRLE cache size via migration parameters

2018-04-04 Thread Jiri Denemark
Prefer xbzrle-cache-size migration parameter over the special migrate-set-cache-size QMP command. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 6 ++--- src/qemu/qemu_migration_params.c | 42 +---

[libvirt] [PATCH 30/68] qemu: Move ParamsCheck closer to ParamsApply on Dst side

2018-04-04 Thread Jiri Denemark
We reached the point when qemuMigrationParamsApply is the only API which sends migration parameters and capabilities to QEMU. Thus all but the TLS parameters can be set before we ask QEMU for the current values of all parameters in qemuMigrationParamsCheck. Supported migration capabilities are

[libvirt] [PATCH 03/68] qemu: Rename qemuMigrationParams

2018-04-04 Thread Jiri Denemark
The function is now called qemuMigrationParamsFromFlags to better reflect what it is doing: taking migration flags and params and producing a struct with QEMU migration parameters. Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c| 2 +- src/qemu/qemu_migration.c

[libvirt] [PATCH 55/68] qemu: Generalize qemuMigrationParamsGetDowntimeLimit

2018-04-04 Thread Jiri Denemark
The API is renamed as qemuMigrationParamsGetULL and it can be used with any migration parameter stored as unsigned long long. Signed-off-by: Jiri Denemark --- src/qemu/qemu_driver.c | 9 - src/qemu/qemu_migration_params.c | 15 ++-

[libvirt] [PATCH 16/68] qemu: Drop qemuMigrationParamsCheckSetupTLS

2018-04-04 Thread Jiri Denemark
The code can be merged directly in qemuMigrationParamsAddTLSObjects. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 15 --- src/qemu/qemu_migration_params.c | 73 ++-- src/qemu/qemu_migration_params.h | 6 --- 3 files

[libvirt] [PATCH 38/68] qemu: Set migration capabilities automatically

2018-04-04 Thread Jiri Denemark
Most migration capabilities are directly connected with virDomainMigrateFlags so qemuMigrationParamsFromFlags can automatically enable them. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 30 --- src/qemu/qemu_migration_params.c | 42

[libvirt] [PATCH 53/68] qemu: Move qemuMonitorMigrationParams structure

2018-04-04 Thread Jiri Denemark
It's no longer used by the monitor code so we can hide it inside qemu_migration_params.c. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 36 src/qemu/qemu_monitor.h | 36 2 files

[libvirt] [PATCH 26/68] qemu: Do not use qemuMonitorSetMigrationCapability

2018-04-04 Thread Jiri Denemark
Rework all remaining callers of qemuMonitorSetMigrationCapability to use the new qemuMonitorSetMigrationCapabilities API. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c | 11 --- tests/qemumonitorjsontest.c | 16 +++- 2 files changed, 19

[libvirt] [PATCH 44/68] qemu: Hide qemuMigrationParamsSetCompression

2018-04-04 Thread Jiri Denemark
There's no need to call this API explicitly in the migration code. We can pass the compression parameters to qemuMigrationParamsFromFlags and it can internally call qemuMigrationParamsSetCompression to apply them to the qemuMigrationParams structure. Signed-off-by: Jiri Denemark

[libvirt] [PATCH 60/68] qemumigparamstest: Add basic test data

2018-04-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- tests/qemumigparamsdata/basic.json | 9 + tests/qemumigparamsdata/basic.reply | 12 tests/qemumigparamsdata/basic.xml | 11 +++ tests/qemumigparamsdata/empty.json | 3 +++ tests/qemumigparamsdata/empty.reply

[libvirt] [PATCH 25/68] qemu: Set migration caps via migration params APIs

2018-04-04 Thread Jiri Denemark
Migration capabilities are closely related to migration parameters and it makes sense to keep them in a single data structure. Similarly to migration parameters the capabilities are all send to QEMU at once in qemuMigrationParamsApply, all other APIs operate on the qemuMigrationParams structure.

[libvirt] [PATCH 36/68] qemu: Drop qemuMigrationParamsSetPostCopy

2018-04-04 Thread Jiri Denemark
It's just a tiny wrapper around qemuMigrationParamsSetCapability and setting priv->job.postcopyEnabled is not something qemuMigrationParams code should be doing anyway so let the callers do it. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 16

[libvirt] [PATCH 59/68] tests: Add tests for QEMU migration parameters

2018-04-04 Thread Jiri Denemark
This is an enhanced replacement for the original test from qemumonitorjsontest which was dropped earlier in this series. More data files with some real data will be added in the following patches. Signed-off-by: Jiri Denemark --- tests/Makefile.am |

[libvirt] [PATCH 49/68] qemumonitorjsontest: Drop migration params test

2018-04-04 Thread Jiri Denemark
The test is mostly useless and we want to refactor migration parameters even further. The refactoring will allow us to introduce enhanced tests for migration parameters. Signed-off-by: Jiri Denemark --- tests/qemumonitorjsontest.c | 99 -

[libvirt] [PATCH 12/68] qemu: Store original migration params in job

2018-04-04 Thread Jiri Denemark
Any job which touches migration parameters will first store their original values (i.e., QEMU defaults) to qemuDomainJobObj to make it easier to reset them back once the job finishes. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c | 3 +++

[libvirt] [PATCH 09/68] qemu: Move qemuMigrationCompression struct

2018-04-04 Thread Jiri Denemark
It provides just another view on some migration parameters so let's move it close to them. The end goal is to merge compression parameters with the rest of migration parameters since it doesn't make any sense to handle them differently. Signed-off-by: Jiri Denemark ---

[libvirt] [PATCH 41/68] qemu: Drop qemuMigrationParamsSetCapability

2018-04-04 Thread Jiri Denemark
It's become only a tiny wrapper around virBitmapSetBit, which can easily be called directly. We don't need to call virBitmapClearBit since migParams->caps bitmap is initialized with zeros. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 35

[libvirt] [PATCH 15/68] qemu: Reset all migration parameters

2018-04-04 Thread Jiri Denemark
Restore the original values of all migration parameters we store in qemuDomainJobObj instead of explicitly resting only a limited set of them. The result is not strictly equivalent to the previous code wrt reseting TLS state because the previous code would only reset it if we changed it before

[libvirt] [PATCH 45/68] qemu: Replace qemuMigrationAnyCompressionDump

2018-04-04 Thread Jiri Denemark
Since every parameter or capability set in qemuMigrationCompression structure is now reflected in qemuMigrationParams structure, we can replace qemuMigrationAnyCompressionDump with a new API which will work on qemuMigrationParams. Signed-off-by: Jiri Denemark ---

[libvirt] [PATCH 24/68] qemu: Introduce qemuMonitorSetMigrationCapabilities

2018-04-04 Thread Jiri Denemark
Our current monitor API forces the caller to call migrate-set-capabilities QMP command for each capability separately, which is quite suboptimal. Let's add a new API for setting all capabilities at once. Signed-off-by: Jiri Denemark --- src/qemu/qemu_monitor.c | 19

[libvirt] [PATCH 33/68] qemu: Introduce qemuMigrationParty enum

2018-04-04 Thread Jiri Denemark
Some migration parameters and capabilities are supposed to be set on both sides of migration while others should only be set on one side. For example, CPU throttling parameters make no sense on the destination and they can be used even if the destination is too old to support them. To make

[libvirt] [PATCH 11/68] qemu: Reset migration parameters in qemuMigrationSrcCleanup

2018-04-04 Thread Jiri Denemark
When connection to the client which controls a non-p2p migration gets closed between Perform and Confirm phase, we don't know whether the domain was successfully migrated or not. Thus, we have to leave the domain paused and just cleanup the migration job and reset migration parameters. Previously

[libvirt] [PATCH 37/68] qemu: Set always-on migration caps in ParamsCheck

2018-04-04 Thread Jiri Denemark
Some migration capabilities are always enabled if QEMU supports them. We can just drop the explicit code for them and let qemuMigrationParamsCheck automatically set such capabilities. QEMU_MONITOR_MIGRATION_CAPS_EVENTS would normally be one of the always on features, but it is the only feature we

[libvirt] [PATCH 43/68] qemu: Move qemuMigrationAnyCompression*

2018-04-04 Thread Jiri Denemark
The code really belongs to qemu_migration_params.c. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 140 - src/qemu/qemu_migration.h| 19 src/qemu/qemu_migration_params.c | 147 +++

[libvirt] [PATCH 51/68] qemu: Move migration parameters JSON parsing

2018-04-04 Thread Jiri Denemark
We want to have all migration parameters parsing and formatting at once place, i.e., in qemu_migration_params.c. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 74 +--- src/qemu/qemu_monitor.c | 13 +-

[libvirt] [PATCH 52/68] qemu: Move migration parameters JSON formatting

2018-04-04 Thread Jiri Denemark
We want to have all migration parameters parsing and formatting at one place, i.e., in qemu_migration_params.c. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 68 +++- src/qemu/qemu_monitor.c | 35

[libvirt] [PATCH 18/68] qemu: Rename qemuMigrationParamsSetEmptyTLS

2018-04-04 Thread Jiri Denemark
The new name is qemuMigrationParamsDisableTLS. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration.c| 4 ++-- src/qemu/qemu_migration_params.c | 6 +++--- src/qemu/qemu_migration_params.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git

[libvirt] [PATCH 14/68] qemu: Pass job object to qemuProcessRecoverMigration{In, Out}

2018-04-04 Thread Jiri Denemark
Currently, only job->phase is passed and both APIs will need to look at more details about the job. Signed-off-by: Jiri Denemark --- src/qemu/qemu_process.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_process.c

[libvirt] [PATCH 13/68] qemu: Typedef struct qemuDomainJobObj

2018-04-04 Thread Jiri Denemark
Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c | 6 +++--- src/qemu/qemu_domain.h | 8 +--- src/qemu/qemu_process.c | 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index

[libvirt] [PATCH 08/68] qemu: Drop qemuMigrationParamsClear

2018-04-04 Thread Jiri Denemark
It's no longer used since we do not store the struct on a stack anymore. Signed-off-by: Jiri Denemark --- src/qemu/qemu_migration_params.c | 12 +--- src/qemu/qemu_migration_params.h | 3 --- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git

[libvirt] [PATCH 00/68] qemu: Refactor migration parameters

2018-04-04 Thread Jiri Denemark
This series changes the way we handle migration parameters and capabilities with several goals: - make it all consistent and avoid storing the same parameters in several structs - reduce the number of QMP commands we use for setting migration capabilities - concentrate the logic in a separate

[libvirt] [PATCH 01/68] qemu: Move qemuDomainCheckMigrationCapabilities

2018-04-04 Thread Jiri Denemark
Since the function is tightly connected to migration, it was renamed as qemuMigrationCapsCheck and moved to qemu_migration.c. Signed-off-by: Jiri Denemark --- src/qemu/qemu_domain.c| 72 --- src/qemu/qemu_domain.h| 4 ---

[libvirt] [PATCH 04/68] qemu: New file for all APIs related to migration parameters

2018-04-04 Thread Jiri Denemark
In the end, this will allow us to have most of the logic around migration parameters done in one place. Signed-off-by: Jiri Denemark --- po/POTFILES.in | 1 + src/qemu/Makefile.inc.am | 2 + src/qemu/qemu_driver.c | 1 +

Re: [libvirt] [PATCH v5 03/10] conf: introduce launch-security element in domain

2018-04-04 Thread John Ferlan
[...] >> >> Hopefully hexuint will suffice over time... On the other hand, this >> patch uses virXPathULongHex in order to parse. >> > > IIRC, I was not able to find anything other than hexuint in > basictypes.rng and also was not able to a function like > virXPathUIntHex(..). If you can point

Re: [libvirt] [PATCH v5 05/10] qemu: add support to launch SEV guest

2018-04-04 Thread John Ferlan
[...] >>> +VIR_DEBUG("policy=0x%x cbitpos=%d reduced_phys_bits=%d", >>> + sev->policy, sev->cbitpos, sev->reduced_phys_bits); >>> + >>> +virBufferAsprintf(, "sev-guest,id=sev0,cbitpos=%d", sev->cbitpos); >>> +virBufferAsprintf(, ",reduced-phys-bits=%d", >>>

  1   2   >