Re: [libvirt] [PATCH] qemu: ensure "pc" machine is always used as default if available

2018-08-07 Thread Eduardo Habkost
On Tue, Aug 07, 2018 at 12:17:33PM +0100, Daniel P. Berrangé wrote: > On Fri, Aug 03, 2018 at 01:05:49PM -0300, Eduardo Habkost wrote: > > On Fri, Aug 03, 2018 at 01:59:47PM +0100, Daniel P. Berrangé wrote: > > > It is increasingly likely that some distro is going to change the > > > default "x86"

Re: [libvirt] [PATCH libvirt v2 1/9] virConnectRegisterCloseCallback: Cleanup 'opaque' if there is no connectRegisterCloseCallback

2018-08-07 Thread Daniel P . Berrangé
On Tue, Aug 07, 2018 at 06:40:46PM +0200, Marc Hartmayer wrote: > On Wed, Jun 13, 2018 at 10:22 AM +0200, Marc Hartmayer > wrote: > > On Mon, Jun 04, 2018 at 06:25 PM +0200, "Daniel P. Berrangé" > > wrote: > >> On Thu, Apr 26, 2018 at 08:16:54PM -0400, John Ferlan wrote: > > […snip…] > > >>

Re: [libvirt] [PATCH libvirt v2 1/9] virConnectRegisterCloseCallback: Cleanup 'opaque' if there is no connectRegisterCloseCallback

2018-08-07 Thread Marc Hartmayer
On Wed, Jun 13, 2018 at 10:22 AM +0200, Marc Hartmayer wrote: > On Mon, Jun 04, 2018 at 06:25 PM +0200, "Daniel P. Berrangé" > wrote: >> On Thu, Apr 26, 2018 at 08:16:54PM -0400, John Ferlan wrote: […snip…] >> >> If the application wants to access 'opaque' outside the context of the >>

Re: [libvirt] [PATCH v1 05/32] util: netdev: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-07 Thread Daniel P . Berrangé
On Tue, Aug 07, 2018 at 06:04:37PM +0200, Erik Skultety wrote: > On Tue, Aug 07, 2018 at 04:14:06PM +0100, Daniel P. Berrangé wrote: > > On Sat, Jul 28, 2018 at 11:31:20PM +0530, Sukrit Bhatnagar wrote: > > > Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in > > > src/util/viralloc.h, define

Re: [libvirt] [PATCH v1 05/32] util: netdev: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-07 Thread Erik Skultety
On Tue, Aug 07, 2018 at 04:14:06PM +0100, Daniel P. Berrangé wrote: > On Sat, Jul 28, 2018 at 11:31:20PM +0530, Sukrit Bhatnagar wrote: > > Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in > > src/util/viralloc.h, define a new wrapper around an existing > > cleanup function which will be

Re: [libvirt] [PATCH v1 05/32] util: netdev: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-07 Thread Daniel P . Berrangé
On Sat, Jul 28, 2018 at 11:31:20PM +0530, Sukrit Bhatnagar wrote: > Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in > src/util/viralloc.h, define a new wrapper around an existing > cleanup function which will be called when a variable declared > with VIR_AUTOPTR macro goes out of scope.

Re: [libvirt] [PATCH] qemu: ensure default machine types don't change if QEMU changes

2018-08-07 Thread Daniel P . Berrangé
On Tue, Aug 07, 2018 at 04:57:28PM +0200, Andrea Bolognani wrote: > On Tue, 2018-08-07 at 15:28 +0100, Daniel P. Berrangé wrote: > > On Tue, Aug 07, 2018 at 03:54:06PM +0200, Andrea Bolognani wrote: > > > I wonder if we shouldn't just drop the default machine type handling > > > altogether at this

Re: [libvirt] [PATCH] qemu: ensure default machine types don't change if QEMU changes

2018-08-07 Thread Andrea Bolognani
On Tue, 2018-08-07 at 15:28 +0100, Daniel P. Berrangé wrote: > On Tue, Aug 07, 2018 at 03:54:06PM +0200, Andrea Bolognani wrote: > > I wonder if we shouldn't just drop the default machine type handling > > altogether at this point, though. > > That's impossible as it violates the back

Re: [libvirt] [PATCH v1 00/32] use GNU C's cleanup attribute in src/util (batch III)

2018-08-07 Thread Erik Skultety
On Sat, Jul 28, 2018 at 11:31:15PM +0530, Sukrit Bhatnagar wrote: > This third series of patches also modifies a few files in src/util > to use VIR_AUTOFREE and VIR_AUTOPTR for automatic freeing of memory > and get rid of some VIR_FREE macro invocations and *Free function > calls. So I went ahead

Re: [libvirt] [PATCH 6/9] docs: move storage initiator def into storagecommon.rng

2018-08-07 Thread Ján Tomko
On Tue, Aug 07, 2018 at 03:55:25PM +0200, Pavel Hrdina wrote: Signed-off-by: Pavel Hrdina --- docs/schemas/storagecommon.rng | 11 +++ docs/schemas/storagepool.rng | 11 --- 2 files changed, 11 insertions(+), 11 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc

Re: [libvirt] [PATCH] qemu: ensure default machine types don't change if QEMU changes

2018-08-07 Thread Daniel P . Berrangé
On Tue, Aug 07, 2018 at 03:54:06PM +0200, Andrea Bolognani wrote: > On Tue, 2018-08-07 at 13:22 +0100, Daniel P. Berrangé wrote: > [...] > > + * Our preferred pmachine might have been compiled out of > > s/pmachine/machine/ > > > + * QEMU at build time though, so we still fallback to

Re: [libvirt] [PATCH 5/9] conf: use virStorageSourceInitiator functions

2018-08-07 Thread Ján Tomko
On Tue, Aug 07, 2018 at 03:55:24PM +0200, Pavel Hrdina wrote: Signed-off-by: Pavel Hrdina --- src/conf/storage_conf.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: Digital signature -- libvir-list mailing

Re: [libvirt] [PATCH 4/9] util: introduce virStorageSourceInitiator functions

2018-08-07 Thread Ján Tomko
On Tue, Aug 07, 2018 at 03:55:23PM +0200, Pavel Hrdina wrote: The same code would be used for storage pools and domain disks. Signed-off-by: Pavel Hrdina --- src/util/virstoragefile.c | 34 ++ src/util/virstoragefile.h | 15 +++ 2 files changed, 49

Re: [libvirt] [PATCH 3/9] conf: rename and move virStoragePoolSourceInitiatorAttr

2018-08-07 Thread Ján Tomko
On Tue, Aug 07, 2018 at 03:55:22PM +0200, Pavel Hrdina wrote: This structure will be reused by domain disk images as well. Signed-off-by: Pavel Hrdina --- src/conf/storage_conf.h | 7 +-- src/util/virstoragefile.h | 6 ++ 2 files changed, 7 insertions(+), 6 deletions(-) Reviewed-by:

Re: [libvirt] [PATCH 2/9] conf: properly translate iscsi-direct storage pool

2018-08-07 Thread Ján Tomko
On Tue, Aug 07, 2018 at 03:55:21PM +0200, Pavel Hrdina wrote: We cannot simply used the same code as for iscsi storage pool because the default mode is 'host' which is not possible with iscsi-direct. Signed-off-by: Pavel Hrdina --- src/conf/domain_conf.c | 61

[libvirt] [PATCH 53/55] qemu: driver: Allow using blockdev with qemuDomainBlocksStatsGather

2018-08-07 Thread Peter Krempa
Use the 'qdev' instead of the disk alias to lookup the stats and transfer the capacity from the appropriate node name so that the function works with -blockdev. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 45 +++-- 1 file changed, 35

[libvirt] [PATCH 55/55] DO NOT APPLY: Enable QEMU_CAPS_BLOCKDEV if 'query-blockstats' works with -blockdev

2018-08-07 Thread Peter Krempa
'query-blockstats' did not report the 'qdev' field prior to fixing it so that it works with our setup. Use that as a witness to enable -blockdev Note that the blockjobs were NOT adapted yet so any blockjob will desync the state of qemu. This patch needs to wait until blockjobs are fixed. ---

[libvirt] [PATCH 50/55] qemu: Export stats relevant for the storage backend

2018-08-07 Thread Peter Krempa
Data relevant for the storage of a backing chain member will need to be reported separately when switching to blockdev. Prepare a function that extracts the appropriate data. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 28 +++- 1 file changed, 27

[libvirt] [PATCH 45/55] qemu: Extract exporting of disk block statistics

2018-08-07 Thread Peter Krempa
Split out the code which converts the stats gathered in qemuDomainGetStatsBlock into typed parameters so that it will look less ugly when extending it. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 73 +- 1 file changed, 49

[libvirt] [PATCH 43/55] qemu: driver: Don't pass 'virDomainDiskDefPtr' to qemuDomainGetStatsOneBlock

2018-08-07 Thread Peter Krempa
Allow reuse of qemuDomainGetStatsOneBlock to work with nodenames by removing the code that looks up the stats data to the caller. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git

[libvirt] [PATCH 35/55] qemu: driver: Prepare qemuDomainBlockResize for blockdev

2018-08-07 Thread Peter Krempa
Use the nodename to resize the device rather than the drive alias. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f994eb1538..7541beb718 100644

[libvirt] [PATCH 13/55] tests: qemu: Add test data for backing chains and indexes

2018-08-07 Thread Peter Krempa
Add test data for nested backing chains with/without indexes (used in status XMLs) which will excercise blockdev and the related work. Signed-off-by: Peter Krempa --- .../disk-backing-chains-index.x86_64-2.12.0.args | 1 + .../disk-backing-chains-index.x86_64-latest.args | 1 +

[libvirt] [PATCH 24/55] qemu: Use proper backingIndex when reporting stats for backing chain

2018-08-07 Thread Peter Krempa
Use the index stored in virStorageSource struct rather than recalculating it. Currently we'd report proper numbers but that will change with blockdev. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git

[libvirt] [PATCH 38/55] qemu: hotplug: Implement removable media change for -blockdev

2018-08-07 Thread Peter Krempa
Use the new APIs which allow to manipulate the tray and media separately and also allow using a nodename to refer to a media to implement media changing. With the new approach we don't have to call eject twice as the media is removed by calling qemuMonitorBlockdevMediumRemove. Signed-off-by:

[libvirt] [PATCH 26/55] qemu: alias: Generate QDEV name of the block backend for disks

2018-08-07 Thread Peter Krempa
When we stop using -drive qemu stops reporting it in some of the monitor commands. To allow referring the disk frontends and the corresponding block backends we need to know these names. Unfortunately different buses require different names. Signed-off-by: Peter Krempa --- src/qemu/qemu_alias.c

[libvirt] [PATCH 19/55] qemu: process: Don't detect nodenames when we support -blockdev

2018-08-07 Thread Peter Krempa
We'll specify them ourselves so it's pointless to attempt to redetect them. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b01bb4fb5c..0a072c990d 100644 ---

[libvirt] [PATCH 29/55] qemu: block: Add generator for the 'copy-on-read' blockdev driver

2018-08-07 Thread Peter Krempa
The copy on read functionality is done using a separate layer in the backing chain. Add function to generate properties for it. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 22 ++ src/qemu/qemu_block.h | 2 ++ 2 files changed, 24 insertions(+) diff --git

[libvirt] [PATCH 28/55] qemu: proces: assign node names for user defined backing chains

2018-08-07 Thread Peter Krempa
Prepare the full backing chain by instantiating authentication and TLS transport secrets and other necessary objects so that we can add the full backing chain explicitly to qemu. This also includes allocation of nodenames for the individual backing chain members. Signed-off-by: Peter Krempa ---

[libvirt] [PATCH 21/55] qemu: domain: Add infrastructure to generate block node names

2018-08-07 Thread Peter Krempa
Node names for block objects in qemu need to be unique for an instance of the qemu process. Add a counter to generate objects sequentially and store it in the status XML so that we can restore it. The helpers added allow to create new node names and reset the counter after the VM process

[libvirt] [PATCH 18/55] qemu: domain: Don't redetect backing chain when using -blockdev

2018-08-07 Thread Peter Krempa
We need to load the backing chain from the XML when using -blockdev. Signed-off-by: Peter Krempa --- src/qemu/qemu_process.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 6b59dbc1c3..b01bb4fb5c 100644 ---

[libvirt] [PATCH 11/55] tests: qemu: Drop disk from hostdev-mdev tests

2018-08-07 Thread Peter Krempa
The disk is not necessary to test the mdevs. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/hostdev-mdev-display-missing-graphics.xml| 6 -- .../hostdev-mdev-display-spice-egl-headless.x86_64-latest.args | 2 --

[libvirt] [PATCH 10/55] qemu: monitor: Add 'nodename' argument for 'block_resize'

2018-08-07 Thread Peter Krempa
Allow referring to individual node name to rezise. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_monitor.c | 12 ++-- src/qemu/qemu_monitor.h | 3 ++- src/qemu/qemu_monitor_json.c | 4 +++- src/qemu/qemu_monitor_json.h | 3 ++-

[libvirt] [PATCH 09/55] qemu: monitor: Allow using 'qdev' instead of 'device' for getting disk throttling

2018-08-07 Thread Peter Krempa
The 'device' field reported by 'query-block' is empty when -blockdev is used. Add an argument which will allow matching disk by using the qdev id so we can use this code with -blockdev. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_monitor.c | 8

[libvirt] [PATCH 54/55] qemu: driver: Prepare qemuDomainGetStatsBlock (bulk disk stats) for -blockdev

2018-08-07 Thread Peter Krempa
Add code paths which call into the new functions to gather the data on a per-node-name basis and tweak the aliases used for extracting the data. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 54 +++--- 1 file changed, 38 insertions(+), 16

[libvirt] [PATCH 42/55] qemu: monitor: Add APIs for refreshing disk capacity when using -blockdev

2018-08-07 Thread Peter Krempa
Disk image size data are not contained in the reply of query-blockstats but need to be gathered from query-block. For use with -blockdev we really need to call 'query-named-block-nodes' and process it to retrieve the correct data. This patch introduces qemuMonitorBlockStatsUpdateCapacityBlockdev

[libvirt] [PATCH 41/55] qemu: monitor: Retrieve blockstats also by qdev and node-names

2018-08-07 Thread Peter Krempa
For use with -blockdev we need to be able to retrieve the stats by 'qdev' for the frontend device stats since 'device' will be NULL. Additionally so that we can report the highest written offset we need to also be able to access them by node-name for backing chain purposes. In cases when

[libvirt] [PATCH 52/55] qemu: Use QOM path with query-block when using -blockdev

2018-08-07 Thread Peter Krempa
Switch to using the QOM/qdev handles in all calls to qemuMonitorGetBlockInfo when using -blockdev. The callers also need to make sure to use the correct handle afterwards to extract the data. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 9 - src/qemu/qemu_process.c | 7

[libvirt] [PATCH 51/55] qemu: monitor: Report data also for 'qdev' entry in qemuMonitorJSONGetBlockInfo

2018-08-07 Thread Peter Krempa
With -blockdev qemu will not report any useful "device" for the data returned by 'query-block'. We need to start using the 'qdev' field to do so. This patch adds data for the 'qdev' field into the returned data structure. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 69

[libvirt] [PATCH 49/55] qemu: Report frontend stats only for the frontend entry

2018-08-07 Thread Peter Krempa
When reporting stats for the backing chain some of them make sense only for the topmost entry as they are actually tied to the frontend device. We unfortunately can't change that fact, but we can stop reporting all zero stats for the backing chain members where they don't make any sense.

[libvirt] [PATCH 46/55] qemu: Extract exporting of the header for block stats

2018-08-07 Thread Peter Krempa
Split out the header so that the loop can be refactored later. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 38 -- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

[libvirt] [PATCH 47/55] qemu: Export stats relevant for the frontend separately

2018-08-07 Thread Peter Krempa
While we report the read and written byte stats for every single layer of the backing chain, qemu in fact reports them only for the frontend. Split out the relevant stats into a separate function so that we can later fix this bug and stop reporting it for backing chain entries where they don't

[libvirt] [PATCH 48/55] qemu: Refactor control flow in qemuDomainGetStatsBlockExportDisk

2018-08-07 Thread Peter Krempa
Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index d8a202fa47..d0a680629e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -20208,20

[libvirt] [PATCH 40/55] qemu: Explicitly find disks for stats totals

2018-08-07 Thread Peter Krempa
Rather than totalling every entry from 'query-block' for stats provided by qemuDomainBlocksStatsGather total only stats for known disks. This will allow to return data for nodenames and qdevs in the same hash so that we can use them with -blockdev. Signed-off-by: Peter Krempa ---

[libvirt] [PATCH 44/55] qemu: monitor: Extract 'write-threshold' automatically for -blockdev

2018-08-07 Thread Peter Krempa
In cases when -blockdev is used we need to use 'query-named-block-nodes' instead of 'query-block'. This means that we can extract the write-threshold variable right away. To keep compatibility with old VMs modify the code which was extracting the value previously so that it updates the stats

[libvirt] [PATCH 27/55] qemu: domain: Add field for storing node name for copy-on-read

2018-08-07 Thread Peter Krempa
The copy-on-read feature is expressed by adding a new node layer in qemu when using -blockdev. Since we will keep these per-disk (as opposed to per storage source) we need to store the appropriate node names in the disk definition. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c

[libvirt] [PATCH 32/55] qemu: command: Add helper to check if disk throttling is enabled

2018-08-07 Thread Peter Krempa
Add a helper which will use a collection of other helpers to determine whether a disk requires throttling to be enabled. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 10 ++ src/qemu/qemu_command.h | 3 +++ 2 files changed, 13 insertions(+) diff --git

[libvirt] [PATCH 36/55] qemu: hotplug: Prepare for blockdev-add/blockdev-del with backing chains

2018-08-07 Thread Peter Krempa
Initialize data for the whole backing chain when plugging in or removing disks when a machine supports -blockdev. Similarly to startup we need to prepare the structures for the whole backing chain and take care of the copy-on-read feature. Signed-off-by: Peter Krempa ---

[libvirt] [PATCH 39/55] qemu: driver: Don't copy disk alias in qemuDomainBlocksStatsGather

2018-08-07 Thread Peter Krempa
The string is not modified so it does not make sense to have a copy. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 7541beb718..c941e502e5 100644 ---

[libvirt] [PATCH 30/55] qemu: domain: Prepare qemuDomainDiskGetBackendAlias for -blockdev

2018-08-07 Thread Peter Krempa
Pass in the node name as the backend alias when -blockdev is used. As copy-on-read is expressed by a separate -blockdev backing chain member we need to decide which node name to use here. For empty cdroms when using -blockdev there is no backend at all so NULL is returned. Signed-off-by: Peter

[libvirt] [PATCH 33/55] qemu: process: Setup disk io throttling for -blockdev

2018-08-07 Thread Peter Krempa
The proper way to do this would be to use the 'throttle' driver but unfortunately it can't change the 'throttle_group' so we can't provide feature parity. This hack uses the block_set_io_throttle command to do so until we can properly replace it. Signed-off-by: Peter Krempa ---

[libvirt] [PATCH 34/55] qemu: driver: Use QOM backend name for disk IO throttling APIs

2018-08-07 Thread Peter Krempa
With -blockdev the drive alias can't be used any more so we need to switch to the QOM name. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 30 -- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c

[libvirt] [PATCH 37/55] qemu: monitor: Add APIs for cdrom tray handling for -blockdev

2018-08-07 Thread Peter Krempa
With blockdev we can use the full range of commands to manipulate the tray and the medium separately. Implement monitor code for this. Schema testing done in the qemumonitorjsontest allows us to verify that we generate the commands correctly. Signed-off-by: Peter Krempa ---

[libvirt] [PATCH 05/55] tests: qemucapabilities: Update capability data for qemu 3.0.0

2018-08-07 Thread Peter Krempa
The diff contains changes from the change of the JSON library reformatting as well as dropping of the preconfig state and adding of the 'qdev' field to output of 'query-blockstats'. Signed-off-by: Peter Krempa --- .../qemucapabilitiesdata/caps_3.0.0.x86_64.replies | 591 +++--

[libvirt] [PATCH 12/55] tests: qemuxml2argv: Fork CAPS_LATEST test cases for 'blockdev'

2018-08-07 Thread Peter Krempa
The blockdev support will change existing approach to add disks to VMs so all tests using the DO_TEST_CAPS_LATEST approach which have any disks need to be forked so that the changes can be applied. Signed-off-by: Peter Krempa --- tests/qemuxml2argvdata/disk-aio.x86_64-2.12.0.args | 37

[libvirt] [PATCH 31/55] qemu: command: format disk source commandline for -blockdev

2018-08-07 Thread Peter Krempa
Format the backing chain onto the commandline using the 'json' syntax with -blockdev. The command line formatter needs only minor tweaks to add the new entries but we now need to initialize the strucutres that are used for every layer of the backing chain. Signed-off-by: Peter Krempa ---

[libvirt] [PATCH 23/55] conf: Allow formatting and parsing of 'index' for disk source image

2018-08-07 Thread Peter Krempa
Similarly to backing store indexes which will become stable eventually we need also to be able to format and store in the status XML for later use the index for the top level of the backing chain. Add XML formatter, parser, schema and docs. Signed-off-by: Peter Krempa ---

[libvirt] [PATCH 07/55] qemu: monitor: Reuse qemuMonitorJSONQueryBlock in qemuMonitorJSONBlockIoThrottleInfo

2018-08-07 Thread Peter Krempa
The wrapper executes the command and does error detection so there's no need to open-code all of those things. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 37 + 1 file changed, 5 insertions(+), 32 deletions(-) diff --git

[libvirt] [PATCH 20/55] conf: domain: Format out user provided backing chains in XML

2018-08-07 Thread Peter Krempa
If a user configures the backing chain in the XML we should not ignore it. We already do parse it but don't format it out. As a safety-precaution don't attempt to format detected chain into the inactive XML. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 8

[libvirt] [PATCH 25/55] qemu: Add field to store QDEV path of a disk in private data

2018-08-07 Thread Peter Krempa
When using -blockdev you need to use the qdev path to refer to the disk fronends. Add means for storing the path and getting it after restart. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c| 27 +++ src/qemu/qemu_domain.h|

[libvirt] [PATCH 22/55] conf: Implement private data formatting and parsing for disks

2018-08-07 Thread Peter Krempa
Allow storing of private data in the status XML for disks. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 60 ++ src/conf/domain_conf.h | 7 ++ 2 files changed, 67 insertions(+) diff --git a/src/conf/domain_conf.c

[libvirt] [PATCH 16/55] qemu: caps: Add capability for using the blockdev infrastructure

2018-08-07 Thread Peter Krempa
The capability currently is not enabled so that we can add individual bits first. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 1 + src/qemu/qemu_capabilities.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c

[libvirt] [PATCH 14/55] qemu: hotplug: Don't generate alias when detaching disk

2018-08-07 Thread Peter Krempa
It should be impossible to lack an alias in the domain definition. Other disk types don't generate it so remove it here as well. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 5 - 1 file changed, 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c

[libvirt] [PATCH 17/55] qemu: process: clear QEMU_CAPS_BLOCKDEV for VMs where we can't support it

2018-08-07 Thread Peter Krempa
SD cards are currently passed by using -drive only which would not be compatible with using -blockdev fully. Floppies at least in the case of the i440 machine type don't have a reasonable qdev ID if -drive is not used and thus would not allow queries and other operations. Since floppy drives are

[libvirt] [PATCH 08/55] qemu: monitor: Allow using 'id' instead of 'device' for 'block_set_io_throttle'

2018-08-07 Thread Peter Krempa
The 'device' argument matches only the legacy drive alias. For blockdev we need to set the throttling for a QOM id and thus we'll need to use the 'id' field. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_monitor.c | 8 +--- src/qemu/qemu_monitor.h

[libvirt] [PATCH 06/55] Revert "qemu: monitor: Add the 'query-nodes' argument for query-blockstats"

2018-08-07 Thread Peter Krempa
Turns out that 'query-nodes' is not what we want and the 'query-blockstats' command was in fact buggy. Revert the new field since it's not needed. This reverts commit 50edca1331298bfcb2622e8fe588d493aff9ab68. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c| 2 +-

[libvirt] [PATCH 00/55] qemu: Add support for -blockdev

2018-08-07 Thread Peter Krempa
In this version everything except blockjobs should work properly. Stats were fixed so that they are properly extracted from the new output in qemu. Additionally I've also fixed the disk resize API which I forgot last time. The blockjobs support is still missing so they either will not work or

[libvirt] [PATCH 15/55] util: virqemu: Simplify debugging if building QOM object with missing args

2018-08-07 Thread Peter Krempa
Print the values so it's simpler to debug. Signed-off-by: Peter Krempa --- src/util/virqemu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/virqemu.c b/src/util/virqemu.c index 30b8dc18d4..7ffa9f780e 100644 --- a/src/util/virqemu.c +++ b/src/util/virqemu.c @@

[libvirt] [PATCH 03/55] qemu: monitor: Remove unsupported function check for 'block_resize'

2018-08-07 Thread Peter Krempa
QEMU supports 'block_resize' since 0.14 so we don't need to do explicit checking. Additionally the caller did not use the different value at all. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor_json.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/src/qemu/qemu_monitor_json.c

[libvirt] [PATCH 04/55] qemu: monitor: Remove useless 'locked' property from struct qemuDomainDiskInfo

2018-08-07 Thread Peter Krempa
We don't use it for anything useful so it does not make much sense to extract it. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.h | 1 - src/qemu/qemu_monitor_json.c | 7 --- tests/qemumonitorjsontest.c | 1 - 3 files changed, 9 deletions(-) diff --git

[libvirt] [PATCH 02/55] qemu: Improve errors in qemuDomainBlockResize

2018-08-07 Thread Peter Krempa
Remove the pointless "empty path" check and use a better error message if the disk was not found. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index

[libvirt] [PATCH 01/55] tests: qemumonitorjson: Simplify debugging of 'blockInfo' test

2018-08-07 Thread Peter Krempa
Print the differences in case when the expected data does not match. Signed-off-by: Peter Krempa --- tests/qemumonitorjsontest.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index

Re: [libvirt] [PATCH 1/9] docs: fix iscsi-direct XML example

2018-08-07 Thread Ján Tomko
On Tue, Aug 07, 2018 at 03:55:20PM +0200, Pavel Hrdina wrote: The element is part of element. Signed-off-by: Pavel Hrdina --- docs/storage.html.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: Digital signature --

[libvirt] [PATCH 9/9] qemu: add support for domain disk initiator IQN

2018-08-07 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/qemu/qemu_block.c | 2 ++ src/qemu/qemu_domain.c| 9 + tests/qemuxml2argvdata/disk-network-iscsi-modern.args | 8 +++- tests/qemuxml2argvdata/disk-network-iscsi-modern.xml | 10

[libvirt] [PATCH 8/9] tests: introduce qemu disk-network-iscsi-modern test cases

2018-08-07 Thread Pavel Hrdina
This uses the new -drive options instead of iSCSI URI. Signed-off-by: Pavel Hrdina --- .../disk-network-iscsi-modern.args| 52 +++ .../disk-network-iscsi-modern.xml | 65 +++ tests/qemuxml2argvtest.c | 4 ++ 3 files

[libvirt] [PATCH 6/9] docs: move storage initiator def into storagecommon.rng

2018-08-07 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- docs/schemas/storagecommon.rng | 11 +++ docs/schemas/storagepool.rng | 11 --- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/schemas/storagecommon.rng b/docs/schemas/storagecommon.rng index cb4f14f52f..9d17d934de 100644

[libvirt] [PATCH 5/9] conf: use virStorageSourceInitiator functions

2018-08-07 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- src/conf/storage_conf.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index a0c92af820..50dbc937e7 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@

[libvirt] [PATCH 7/9] conf: introduce initiator IQN support for domain disks

2018-08-07 Thread Pavel Hrdina
Signed-off-by: Pavel Hrdina --- docs/formatdomain.html.in | 20 docs/schemas/domaincommon.rng | 3 +++ src/conf/domain_conf.c| 10 ++ src/util/virstoragefile.c | 5 + src/util/virstoragefile.h | 2 ++ 5 files changed, 40 insertions(+) diff

[libvirt] [PATCH 1/9] docs: fix iscsi-direct XML example

2018-08-07 Thread Pavel Hrdina
The element is part of element. Signed-off-by: Pavel Hrdina --- docs/storage.html.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/storage.html.in b/docs/storage.html.in index 744819d99d..e9e6ec7423 100644 --- a/docs/storage.html.in +++ b/docs/storage.html.in

[libvirt] [PATCH 3/9] conf: rename and move virStoragePoolSourceInitiatorAttr

2018-08-07 Thread Pavel Hrdina
This structure will be reused by domain disk images as well. Signed-off-by: Pavel Hrdina --- src/conf/storage_conf.h | 7 +-- src/util/virstoragefile.h | 6 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index

[libvirt] [PATCH 4/9] util: introduce virStorageSourceInitiator functions

2018-08-07 Thread Pavel Hrdina
The same code would be used for storage pools and domain disks. Signed-off-by: Pavel Hrdina --- src/util/virstoragefile.c | 34 ++ src/util/virstoragefile.h | 15 +++ 2 files changed, 49 insertions(+) diff --git a/src/util/virstoragefile.c

[libvirt] [PATCH 0/9] iSCSI fixes and improvements

2018-08-07 Thread Pavel Hrdina
Pavel Hrdina (9): docs: fix iscsi-direct XML example conf: properly translate iscsi-direct storage pool conf: rename and move virStoragePoolSourceInitiatorAttr util: introduce virStorageSourceInitiator functions conf: use virStorageSourceInitiator functions docs: move storage initiator

[libvirt] [PATCH 2/9] conf: properly translate iscsi-direct storage pool

2018-08-07 Thread Pavel Hrdina
We cannot simply used the same code as for iscsi storage pool because the default mode is 'host' which is not possible with iscsi-direct. Signed-off-by: Pavel Hrdina --- src/conf/domain_conf.c | 61 +- 1 file changed, 43 insertions(+), 18 deletions(-)

Re: [libvirt] [PATCH] qemu: ensure default machine types don't change if QEMU changes

2018-08-07 Thread Andrea Bolognani
On Tue, 2018-08-07 at 13:22 +0100, Daniel P. Berrangé wrote: [...] > +/* Historically QEMU x86 targets defaulted to 'pc' machine type but > + * in future x86_64 might switch 'q35'. Such a change is considered s/switch/switch to/ > + * an ABI break from libvirt's POV. Other QEMU targets may not

Re: [libvirt] [PATCH] qemu: ensure "pc" machine is always used as default if available

2018-08-07 Thread Andrea Bolognani
On Tue, 2018-08-07 at 13:19 +0100, Daniel P. Berrangé wrote: > On Mon, Aug 06, 2018 at 11:38:06AM +0200, Andrea Bolognani wrote: > > I wonder how to handle architectures where QEMU never declared a > > default machine type, such as aarch64 and riscv64, though: I think > > it would make sense to

Re: [libvirt] [PATCH v3 0/3] qemu: Support vhost-vsock-ccw

2018-08-07 Thread Ján Tomko
On Mon, Aug 06, 2018 at 05:41:05PM +0200, Boris Fiuczynski wrote: Support the vhost-vsock-ccw device on S390. Since v2 - instead of reusing CAPS_LATEST adding CAPS_ARCH_LATEST (Peter Krempa) Since v1 - adjusted vsock command line generation (Ján Tomko) - added CAPS_LATEST test coverage to s390

[libvirt] [PATCH] qemu: ensure default machine types don't change if QEMU changes

2018-08-07 Thread Daniel P . Berrangé
It is increasingly likely that some distro is going to change the default "x86" machine type in QEMU from "pc" to "q35". This will certainly break existing applications which write their XML on the assumption that it is using a "pc" machine by default. For example they'll lack a IDE CDROM and get

Re: [libvirt] [PATCH] qemu: ensure "pc" machine is always used as default if available

2018-08-07 Thread Daniel P . Berrangé
On Mon, Aug 06, 2018 at 11:38:06AM +0200, Andrea Bolognani wrote: > On Fri, 2018-08-03 at 13:59 +0100, Daniel P. Berrangé wrote: > > It is increasingly likely that some distro is going to change the > > default "x86" machine type in QEMU from "pc" to "q35". This will > > certainly break existing

[libvirt] [PATCH] Fix snapshot creating with vm xml persistent

2018-08-07 Thread Bobo Du
Bobo Du (1): qemu:Fix snapshot creating with vm xml persistent src/qemu/qemu_driver.c | 1 + 1 file changed, 1 insertion(+) -- 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

[libvirt] [PATCH] qemu:Fix snapshot creating with vm xml persistent

2018-08-07 Thread Bobo Du
the vm xml will be existed when the vm is undefined after started. blockcommit interface also has the bug with above. Step1:prepare a vm,eg:test1,start it and undefined Step2: virsh snapshot-create-as test1 --disk-only --no-metadata Step3:ls /etc/libvirt/qemu/test1.xml,then it will be exist here

[libvirt] [PATCH] rpc: Initialize a worker pool for max_workers=0 as well

2018-08-07 Thread Marc Hartmayer
Semantically, there is no difference between an uninitialized worker pool and an initialized worker pool with zero workers. Let's allow the worker pool to be initialized for max_workers=0 as well then which makes the API more symmetric and simplifies code. Validity of the worker pool is delegated

Re: [libvirt] [PATCH v1 10/32] util: socketaddr: use VIR_AUTOPTR for aggregate types

2018-08-07 Thread Erik Skultety
On Fri, Aug 03, 2018 at 02:52:12PM +0200, Erik Skultety wrote: > On Sat, Jul 28, 2018 at 11:31:25PM +0530, Sukrit Bhatnagar wrote: > > By making use of GNU C's cleanup attribute handled by the > > VIR_AUTOPTR macro for declaring aggregate pointer variables, > > majority of the calls to *Free

Re: [libvirt] [PATCH v1 08/32] util: socketaddr: define cleanup function using VIR_DEFINE_AUTOPTR_FUNC

2018-08-07 Thread Erik Skultety
On Sat, Jul 28, 2018 at 11:31:23PM +0530, Sukrit Bhatnagar wrote: > Using the new VIR_DEFINE_AUTOPTR_FUNC macro defined in > src/util/viralloc.h, define a new wrapper around an existing > cleanup function which will be called when a variable declared > with VIR_AUTOPTR macro goes out of scope.

Re: [libvirt] [PATCH] qemu: ensure "pc" machine is always used as default if available

2018-08-07 Thread Daniel P . Berrangé
On Fri, Aug 03, 2018 at 01:05:49PM -0300, Eduardo Habkost wrote: > On Fri, Aug 03, 2018 at 01:59:47PM +0100, Daniel P. Berrangé wrote: > > It is increasingly likely that some distro is going to change the > > default "x86" machine type in QEMU from "pc" to "q35". This will > > certainly break

[libvirt] [PATCH v3 01/12] conf: Add definitions for 'uid' and 'fid' PCI address attributes

2018-08-07 Thread Yi Min Zhao
Add zPCI definitions in preparation of extending the PCI address with parameters uid (user-defined identifier) and fid (PCI function identifier). Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko ---

Re: [libvirt] [PATCH] qemu: Check sev capability pointer before using it

2018-08-07 Thread Erik Skultety
On Tue, Aug 07, 2018 at 09:05:09AM +0200, Peter Krempa wrote: > On Tue, Aug 07, 2018 at 09:42:05 +0800, Han Han wrote: > > https://bugzilla.redhat.com/show_bug.cgi?id=1612009 > > > > Check sev capability pointer in function qemuGetSEVInfoToParams to avoid > > null pointer dereferences. > > > >

[libvirt] [PATCH v3 05/12] qemu: Auto add pci-root for s390/s390x guests

2018-08-07 Thread Yi Min Zhao
The pci-root depends on zpci capability. So autogenerate pci-root if zpci exists. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko --- src/qemu/qemu_domain.c | 1 + 1 file changed, 1 insertion(+) diff

[libvirt] [PATCH v3 09/12] qemu: Generate and use zPCI device in QEMU command line

2018-08-07 Thread Yi Min Zhao
Add new functions to generate zPCI command string and append it to QEMU command line. And the related tests are added. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko --- src/qemu/qemu_command.c

[libvirt] [PATCH v3 03/12] conf: Introduce a new PCI address extension flag

2018-08-07 Thread Yi Min Zhao
This patch introduces a new attribute PCI address extension flag to deal with the extension PCI attributes such as 'uid' and 'fid' on the S390 platform. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Ján Tomko --- src/conf/device_conf.h | 1 +

[libvirt] [PATCH v3 08/12] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-08-07 Thread Yi Min Zhao
This patch adds new functions for reservation, assignment and release to handle the uid/fid. If the uid/fid is defined in the domain XML, they will be reserved directly in collecting phase. If any of them is not defined, we will find out an available value for it from zPCI address hashtable, and

[libvirt] [PATCH v3 11/12] docs: Add 'uid' and 'fid' information

2018-08-07 Thread Yi Min Zhao
Update 'Device address' section to describe the 'uid' and 'fid' attributes. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Ján Tomko --- docs/formatdomain.html.in | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git

  1   2   >