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

2018-08-16 Thread Bjoern Walk
Andrea Bolognani [2018-08-16, 04:44PM +0200]: > On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: > [...] > > +qemuDomainDeviceSupportZPCI(virDomainDeviceDefPtr device) > > +{ > > +switch ((virDomainDeviceType) device->type) { > > +case VIR_DOMAIN_DEVICE_CHR: > > +return

Re: [libvirt] [PATCH v2 4/7] lockd_driver_lockd: Implement metadata flag

2018-08-16 Thread John Ferlan
On 08/14/2018 07:19 AM, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > src/locking/lock_daemon_dispatch.c | 12 ++-- > src/locking/lock_driver_lockd.c| 31 +-- > src/locking/lock_driver_lockd.h| 1 + > 3 files changed, 32

Re: [libvirt] [PATCH v2 3/7] lock_driver.h: Introduce metadata flag

2018-08-16 Thread John Ferlan
On 08/14/2018 07:19 AM, Michal Privoznik wrote: > Signed-off-by: Michal Privoznik > --- > src/locking/lock_driver.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/locking/lock_driver.h b/src/locking/lock_driver.h > index 8b7521..7c8f79520a 100644 > ---

[libvirt] clean/simple Q35 support in libvirt+QEMU for guest OSes that don't support virtio-1.0

2018-08-16 Thread Laine Stump
(Several of us started an offline discussion on this topic, and it quickly became complicated, so we decided it should continue upstream. Here is a synopsis of the discussion so far (as *I've* interpreted it, so corrections are welcome and apologies in advance for anything I got wrong!) Some of

Re: [libvirt] [PATCH v2 2/7] virlockspace: Introduce VIR_LOCK_SPACE_ACQUIRE_WAIT

2018-08-16 Thread John Ferlan
On 08/14/2018 07:19 AM, Michal Privoznik wrote: > This flag modifies the way the lock is acquired. It waits for the > lock to be set instead of usual set-or-fail logic that happens > without this flag. > > Signed-off-by: Michal Privoznik > --- > src/util/virlockspace.c | 14 ++ >

Re: [libvirt] [PATCH v2 1/7] virlockspace: Allow caller to specify start and length offset in virLockSpaceAcquireResource

2018-08-16 Thread John Ferlan
On 08/14/2018 07:19 AM, Michal Privoznik wrote: > So far the virLockSpaceAcquireResource() locks the first byte in > the underlying file. But caller might want to lock other range. > > Signed-off-by: Michal Privoznik > --- > src/locking/lock_daemon_dispatch.c | 3 +++ >

Re: [libvirt] Investigation and possible fix of 1361592 - apparmor profiles do not include backing files

2018-08-16 Thread Povilas Kanapickas
On 16/08/2018 10:38, Peter Krempa wrote: > To fix this you should record the backing format [1] into your overlay > image. If we'd relax the code we'd face the regression in the security > fix we've done. > > [1] qemu-img creage -f qcow2 -F qcow2 -b backing-qcow2 overlay.qcow2 > > -F option

Re: [libvirt] [PATCH 0/3] conf: qemu: support new Hyper-V enlightenments

2018-08-16 Thread John Ferlan
On 08/09/2018 09:14 AM, Vitaly Kuznetsov wrote: > Several new Hyper-V enlightenments were recently added to Qemu: > - hv-frequencies > - hv-reenlightenment > - hv-tlbflush > > Support these in libvirt. > > Vitaly Kuznetsov (3): > conf: qemu: add support for Hyper-V frequency MSRs > conf:

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

2018-08-16 Thread Andrea Bolognani
On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: [...] > +char * > +qemuBuildZPCIDevStr(virDomainDeviceInfoPtr dev) > +{ > +virBuffer buf = VIR_BUFFER_INITIALIZER; > + > +virBufferAddLit(, "zpci"); > +virBufferAsprintf(, ",uid=%u", dev->addr.pci.zpci->zpci_uid); > +

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

2018-08-16 Thread Andrea Bolognani
On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: [...] > +static inline bool > +virDeviceInfoPCIAddressExtensionPresent(const virDomainDeviceInfo *info) > +{ > +return info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && > +info->addr.pci.zpci; > +} This should be called

Re: [libvirt] [PATCHv2 50/62] qemu: driver: Don't pass 'virDomainDiskDefPtr' to qemuDomainGetStatsOneBlock

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:24PM +0200, Peter Krempa wrote: 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,

Re: [libvirt] [PATCHv2 49/62] qemu: monitor: Add APIs for refreshing disk capacity when using -blockdev

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:23PM +0200, Peter Krempa wrote: 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.

Re: [libvirt] [PATCHv2 47/62] qemu: Explicitly find disks for stats totals

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:21PM +0200, Peter Krempa wrote: 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

Re: [libvirt] [PATCHv2 48/62] qemu: monitor: Retrieve blockstats also by qdev and node-names

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:22PM +0200, Peter Krempa wrote: For use with -blockdev we need to be able to retrieve the stats by 'qdev' for the frontend device stats since 'device' will be empty. Note that for non-blockdev case qdev and 'device' with 'drive-' skipped would be the same.

Re: [libvirt] [PATCH] storage: Don't hold storage pool locked during wipeVol

2018-08-16 Thread John Ferlan
On 08/13/2018 06:49 AM, Michal Privoznik wrote: > Currently the way virStorageVolWipe() works is it looks up > pool containing given volume and hold it locked throughout while > API execution. This is suboptimal because wiping a volume means > writing data to it which can take ages. And if the

Re: [libvirt] [PATCH 0/4] Fix a SIGSEGV in libvirtd when querying AMD SEV info

2018-08-16 Thread Brijesh Singh
Hi Erik, On 08/15/2018 10:02 AM, Erik Skultety wrote: This series fixes the following BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1612009 TL;DR: We don't format SEV platform data (PDH, certificate chain,...) into our qemu caps cache which poses a problem after libvirtd restart when we

Re: [libvirt] [PATCH v3 07/12] conf: Introduce parser, formatter for uid and fid

2018-08-16 Thread Andrea Bolognani
On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: [...] > +static int > +virZPCIDeviceAddressIsValid(virZPCIDeviceAddressPtr zpci) > +{ > +if (zpci->uid_assigned && > +(zpci->zpci_uid > VIR_DOMAIN_DEVICE_ZPCI_MAX_UID || > + zpci->zpci_uid == 0)) { > +

[libvirt] [PATCH 2/3] qemu: rename method for getting preferred machine type

2018-08-16 Thread Daniel P . Berrangé
The virQEMUCapsGetDefaultMachine() method doesn't get QEMU's default machine any more, instead it gets the historical default that libvirt prefers for each arch. Rename it, so that the old name can be used for getting QEMU's default. Signed-off-by: Daniel P. Berrangé ---

[libvirt] [PATCH 3/3] qemu: fix default machine for argv -> xml convertor

2018-08-16 Thread Daniel P . Berrangé
Historically the argv -> xml convertor wanted the same default machine as we'd set when parsing xml. The latter has now changed, however, to use a default defined by libvirt. The former needs fixing to again honour the default QEMU machine. This exposed a bug in handling for the aarch64 target,

[libvirt] [PATCH 1/3] qemu: record the QEMU default machine in capabilities

2018-08-16 Thread Daniel P . Berrangé
We don't honour the QEMU default machine type anymore, always using the libvirt chosen default instead. The QEMU argv parser, however, will need to know the exacty QEMU default, so we must record that info. Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_capabilities.c | 14 --

[libvirt] [PATCH 0/3] Fix default machine when converting argv to xml

2018-08-16 Thread Daniel P . Berrangé
We must honour the QEMU built-in default machine when converting from argv Daniel P. Berrangé (3): qemu: record the QEMU default machine in capabilities qemu: rename method for getting preferred machine type qemu: fix default machine for argv -> xml convertor src/qemu/qemu_capabilities.c

Re: [libvirt] [PATCH v3 06/12] conf: Introduce address caching for PCI extensions

2018-08-16 Thread Andrea Bolognani
On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: > This patch provides a caching mechanism for the device address > extensions uid and fid on S390. For efficient sparse address allocation, > we introduce two hash tables for uid/fid which hold the address set > information per domain. Also in

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

2018-08-16 Thread Cornelia Huck
On Thu, 16 Aug 2018 16:52:18 +0200 Andrea Bolognani wrote: > On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: > > 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:

Re: [libvirt] [PATCHv2 46/62] qemu: driver: Don't copy disk alias in qemuDomainBlocksStatsGather

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:20PM +0200, Peter Krempa wrote: 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(-) Reviewed-by: Ján Tomko Jano

Re: [libvirt] [PATCHv2 45/62] qemu: hotplug: Implement removable media change for -blockdev

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:19PM +0200, Peter Krempa wrote: 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

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

2018-08-16 Thread Andrea Bolognani
On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: > 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 >

Re: [libvirt] [PATCH v3 04/12] qemu: Enable PCI multi bus for S390 guests

2018-08-16 Thread Andrea Bolognani
On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: > QEMU on s390 supports PCI multibus since forever. > > 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_capabilities.c

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

2018-08-16 Thread Andrea Bolognani
On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: [...] > +qemuDomainDeviceSupportZPCI(virDomainDeviceDefPtr device) > +{ > +switch ((virDomainDeviceType) device->type) { > +case VIR_DOMAIN_DEVICE_CHR: > +return false; > + > +case VIR_DOMAIN_DEVICE_CONTROLLER: > +case

Re: [libvirt] [PATCH v3 02/12] qemu: Introduce zPCI capability

2018-08-16 Thread Andrea Bolognani
On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: > Let's introduce zPCI capability. > > 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_capabilities.c

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

2018-08-16 Thread Andrea Bolognani
On Tue, 2018-08-07 at 17:10 +0800, Yi Min Zhao wrote: > +typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress; > +typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr; > +struct _virZPCIDeviceAddress { > +unsigned int zpci_fid; > +unsigned int zpci_uid; > +bool fid_assigned; > +

Re: [libvirt] [RFC PATCH 01/17] qemu: setup shared memory without explicit numa configuration

2018-08-16 Thread Marc-André Lureau
Hi On Thu, Aug 16, 2018 at 12:48 PM Daniel P. Berrangé wrote: > > On Fri, Jul 13, 2018 at 03:28:08PM +0200, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > When a domain is configured with 'shared' memory backing: > > > > > > > > > > > > But no explicit NUMA

Re: [libvirt] [PATCHv2 44/62] qemu: monitor: Add APIs for cdrom tray handling for -blockdev

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:18PM +0200, Peter Krempa wrote: 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

Re: [libvirt] [PATCHv2 43/62] qemu: hotplug: Prepare for blockdev-add/blockdev-del with backing chains

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:17PM +0200, Peter Krempa wrote: 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

Re: [libvirt] [PATCHv2 42/62] qemu: monitor: Handle BLOCK_IO_ERROR event properly with -blockdev

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:16PM +0200, Peter Krempa wrote: Use the 'node-name' provided in the event if 'device' is empty to look up the disk. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 3 ++- src/qemu/qemu_monitor.h | 2 ++ src/qemu/qemu_monitor_json.c | 5 -

Re: [libvirt] [libvirt-glib][PATCH] configure: Drop GLIB2_TEST_REQUIRED

2018-08-16 Thread Andrea Bolognani
On Thu, 2018-08-16 at 14:56 +0200, Michal Privoznik wrote: > Introduced in eb1f97a4b49a6e it is not needed anymore. The > minimal required version of glib is now the same as the one > required for tests. > > This practically reverts the referenced commit. > > Signed-off-by: Michal Privoznik >

Re: [libvirt] [PATCHv2 41/62] qemu: monitor: Handle TRAY_MOVED event correctly with -blockdev

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:15PM +0200, Peter Krempa wrote: Add handling of the 'id' field in the event which corresponds to the QDEV id of the device. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 3 ++- src/qemu/qemu_monitor.h | 2 ++ src/qemu/qemu_monitor_json.c | 11

Re: [libvirt] [PATCH v3 1/2] process: wait longer on kill per assigned Hostdev

2018-08-16 Thread Christian Ehrhardt
On Tue, Aug 14, 2018 at 12:13 PM Bjoern Walk wrote: > Christian Ehrhardt [2018-08-14, > 11:27AM +0200]: > > diff --git a/src/util/virprocess.c b/src/util/virprocess.c > > index ecea27a2d4..46360cc051 100644 > > --- a/src/util/virprocess.c > > +++ b/src/util/virprocess.c > > @@ -341,15 +341,19

Re: [libvirt] [PATCHv2 40/62] qemu: process: Add lookup via QOM id to qemuProcessFindDomainDiskByAlias

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:14PM +0200, Peter Krempa wrote: Allow looking up also via QOM id and rename the function accordingly. Also add documentation of the specifics. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_process.c | 42

Re: [libvirt] [PATCHv2 39/62] qemu: driver: Prepare qemuDomainBlockResize for blockdev

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:13PM +0200, Peter Krempa wrote: 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(-) Reviewed-by: Ján Tomko Jano

Re: [libvirt] [PATCHv2 38/62] qemu: driver: Use QOM backend name for disk IO throttling APIs

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:12PM +0200, Peter Krempa wrote: 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(-)

Re: [libvirt] [PATCHv2 37/62] qemu: process: Setup disk io throttling for -blockdev

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:11PM +0200, Peter Krempa wrote: 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

Re: [libvirt] [PATCHv2 36/62] qemu: command: Add helper to check if disk throttling is enabled

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:10PM +0200, Peter Krempa wrote: 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

[libvirt] [libvirt-glib][PATCH] configure: Drop GLIB2_TEST_REQUIRED

2018-08-16 Thread Michal Privoznik
Introduced in eb1f97a4b49a6e it is not needed anymore. The minimal required version of glib is now the same as the one required for tests. This practically reverts the referenced commit. Signed-off-by: Michal Privoznik --- configure.ac | 8 +--- tests/Makefile.am | 3 --- 2 files

Re: [libvirt] [PATCHv2 35/62] qemu: command: format disk source commandline for -blockdev

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:09PM +0200, Peter Krempa wrote: 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

Re: [libvirt] [PATCHv2 34/62] qemu: domain: Prepare qemuDomainDiskGetBackendAlias for -blockdev

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:08PM +0200, Peter Krempa wrote: 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

Re: [libvirt] [PATCHv2 33/62] qemu: block: Add generator for the 'copy-on-read' blockdev driver

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:07PM +0200, Peter Krempa wrote: 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

Re: [libvirt] [PATCHv2 32/62] qemu: proces: assign node names for user defined backing chains

2018-08-16 Thread Ján Tomko
s/proces/process/ On Mon, Aug 13, 2018 at 06:00:06PM +0200, Peter Krempa wrote: 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

Re: [libvirt] [PATCHv2 31/62] qemu: domain: Add field for storing node name for copy-on-read

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:05PM +0200, Peter Krempa wrote: 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.

Re: [libvirt] [PATCHv2 30/62] qemu: command: Setup floppy drives via -device for blockdev

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:04PM +0200, Peter Krempa wrote: To allow referring to the drives via the QOM id we need to setup the floppy drives with a proper ID. This means that -device should be used for them. There are the following quirks: - FDC needs to be instantiated prior to any floppy

Re: [libvirt] [PATCH v2 0/8] cpu: modularize the CPU map data file

2018-08-16 Thread no-reply
Hi, This series was run against 'syntax-check' test by patchew.org, which failed, please find the details below: Type: series Message-id: 20180816121031.10902-1-berra...@redhat.com Subject: [libvirt] [PATCH v2 0/8] cpu: modularize the CPU map data file === TEST SCRIPT BEGIN === #!/bin/bash #

Re: [libvirt] [libvirt-glib][PATCH v2] Use new GObject define macros with private

2018-08-16 Thread Michal Privoznik
On 08/16/2018 12:24 PM, Andrea Bolognani wrote: > On Thu, 2018-08-16 at 10:06 +0200, Michal Privoznik wrote: > [...] >> -GLIB2_REQUIRED=2.36.0 >> +GLIB2_REQUIRED=2.38.0 >> AC_SUBST([GLIB2_REQUIRED]) dnl used in the .spec file >> GLIB2_TEST_REQUIRED=2.38.0 > > We can now get rid of

Re: [libvirt] [PATCHv2 29/62] qemu: alias: Generate QDEV name of the block backend for disks

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:03PM +0200, Peter Krempa wrote: When we stop using -drive qemu stops reporting it in some of the monitor commands. To allow referring the disk frontends and the corresponding referring to block backends we need to know these names. Unfortunately different buses

Re: [libvirt] [PATCHv2 28/62] qemu: Add field to store QDEV path of a disk in private data

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:02PM +0200, Peter Krempa wrote: 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. frontends Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c|

Re: [libvirt] [PATCH v3 1/3] vsh: Add API for printing tables.

2018-08-16 Thread Daniel P . Berrangé
On Thu, Aug 16, 2018 at 02:05:45PM +0200, Ján Tomko wrote: > On Thu, Aug 16, 2018 at 12:56:24PM +0200, Simon Kobyda wrote: > > It solves problems with alignment of columns. Width of each column > > is calculated by its biggest cell. Should solve unicode bug. > > In future, it may be implemented in

[libvirt] Investigation and possible fix of 1361592 - apparmor profiles do not include backing files

2018-08-16 Thread Povilas Kanapickas
Hi, I've looked into why apparmor profiles do not contain exceptions for backing files of images which later leads to permission errors due to apparmor containment. As of newest libvirt git master, only the first level backing image is included, the subsequent images are omitted. Below is my

Re: [libvirt] [PATCH v3 3/3] vsh: Added tests

2018-08-16 Thread Ján Tomko
On Thu, Aug 16, 2018 at 12:56:26PM +0200, Simon Kobyda wrote: For now, there are 5 test cases - testVshTableNew: Creating table with empty header - testVshTableHeader: Printing table with/without header - testVshTableRowAppend: Appending row with various number of cells. Only row with same

[libvirt] [PATCH v2 1/8] cpu: allow include files for CPU definition

2018-08-16 Thread Daniel P . Berrangé
Allow for syntax to reference other files in the CPU database directory Signed-off-by: Daniel P. Berrangé --- src/cpu/cpu_map.c | 87 +-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/src/cpu/cpu_map.c b/src/cpu/cpu_map.c index

[libvirt] [PATCH v2 6/8] cpu: split PPC64 map data into separate files

2018-08-16 Thread Daniel P . Berrangé
Signed-off-by: Daniel P. Berrangé --- src/cpu_map/Makefile.inc.am | 7 + src/cpu_map/index.xml | 41 + src/cpu_map/ppc64_POWER6.xml| 6 + src/cpu_map/ppc64_POWER7.xml| 7 + src/cpu_map/ppc64_POWER8.xml| 8

[libvirt] [PATCH v2 3/8] cpu: push more parsing logic into common code

2018-08-16 Thread Daniel P . Berrangé
The x86 and ppc impls both duplicate some logic when parsing CPU features. Change the callback signature so that this duplication can be pushed up a level to common code. Signed-off-by: Daniel P. Berrangé --- src/cpu/cpu_map.c | 98 +- src/cpu/cpu_map.h | 22 ++---

[libvirt] [PATCH v2 4/8] cpu: simplify failure cleanup paths

2018-08-16 Thread Daniel P . Berrangé
Get rid of the separate 'error:' label, so all code paths jump straight to the 'cleanup:' label. Signed-off-by: Daniel P. Berrangé --- src/cpu/cpu_ppc64.c | 38 src/cpu/cpu_x86.c | 71 - 2 files changed, 49 insertions(+), 60

[libvirt] [PATCH v2 8/8] xml: report the filename (if any) when parsing files

2018-08-16 Thread Daniel P . Berrangé
A generic "failed to parse xml document" message without telling us which XML file failed is quite unhelpful. Signed-off-by: Daniel P. Berrangé --- src/util/virxml.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util/virxml.c b/src/util/virxml.c index

[libvirt] [PATCH v2 0/8] cpu: modularize the CPU map data file

2018-08-16 Thread Daniel P . Berrangé
Currently we have a cpu_map.xml file that contains all the features and CPU models for all architectures in one place. I frequently find myself wondering about the differences between CPU models, but it is hard to compare them as the list of features is huge. With this patch series we end up with

[libvirt] [PATCH v2 2/8] cpu: fix cleanup when signature parsing fails

2018-08-16 Thread Daniel P . Berrangé
Two pieces of code accidentally jumped to the wrong label when they failed causing incorrect cleanup, returning a partially initialized CPU model struct. Signed-off-by: Daniel P. Berrangé --- src/cpu/cpu_x86.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[libvirt] [PATCH v2 5/8] cpu: move the CPU map data files into a src/cpu_map directory

2018-08-16 Thread Daniel P . Berrangé
In preparation for splitting up the CPU map data file, move it into a dedicated directory of its own. Signed-off-by: Daniel P. Berrangé --- libvirt.spec.in| 2 +- mingw-libvirt.spec.in | 4 ++-- src/Makefile.am| 7

Re: [libvirt] [PATCH v3 1/3] vsh: Add API for printing tables.

2018-08-16 Thread Ján Tomko
On Thu, Aug 16, 2018 at 12:56:24PM +0200, Simon Kobyda wrote: It solves problems with alignment of columns. Width of each column is calculated by its biggest cell. Should solve unicode bug. In future, it may be implemented in virsh, virt-admin... This API has 5 public functions: - vshTableNew -

Re: [libvirt] [RFC PATCH 01/17] qemu: setup shared memory without explicit numa configuration

2018-08-16 Thread Daniel P . Berrangé
On Thu, Aug 16, 2018 at 07:32:57AM -0400, John Ferlan wrote: > > > On 08/16/2018 06:31 AM, Marc-André Lureau wrote: > > Hi > > > > On Thu, Aug 16, 2018 at 4:35 AM, John Ferlan wrote: > >> > >> > >> On 07/13/2018 09:28 AM, marcandre.lur...@redhat.com wrote: > >>> From: Marc-André Lureau > >>>

Re: [libvirt] [PATCHv2 27/62] qemu: Use proper backingIndex when reporting stats for backing chain

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:01PM +0200, Peter Krempa wrote: 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

Re: [libvirt] [RFC PATCH 01/17] qemu: setup shared memory without explicit numa configuration

2018-08-16 Thread John Ferlan
On 08/16/2018 06:31 AM, Marc-André Lureau wrote: > Hi > > On Thu, Aug 16, 2018 at 4:35 AM, John Ferlan wrote: >> >> >> On 07/13/2018 09:28 AM, marcandre.lur...@redhat.com wrote: >>> From: Marc-André Lureau >>> >>> When a domain is configured with 'shared' memory backing: >>> >>> >>>

Re: [libvirt] [PATCHv2 26/62] conf: Allow formatting and parsing of 'index' for disk source image

2018-08-16 Thread Ján Tomko
On Mon, Aug 13, 2018 at 06:00:00PM +0200, Peter Krempa wrote: 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

Re: [libvirt] [PATCH v3 1/3] vsh: Add API for printing tables.

2018-08-16 Thread Daniel P . Berrangé
On Thu, Aug 16, 2018 at 12:56:24PM +0200, Simon Kobyda wrote: > It solves problems with alignment of columns. Width of each column > is calculated by its biggest cell. Should solve unicode bug. > In future, it may be implemented in virsh, virt-admin... > > This API has 5 public functions: > -

Re: [libvirt] [PATCH v2 0/5] Extend apparmor rules for libvirt 4.6

2018-08-16 Thread Christian Ehrhardt
Ok, with acks of last year and new ones in and no other feedback nor any Freeze atm I'm pushing these changes any minute. The qemu-smb related one will be dropped, the others pushed with the latest cleanups as discussed in the per-patch threads. Thanks everybody for your participation! On Tue,

Re: [libvirt] [PATCH v2 4/5] apparmor: allow qemu-smb access in /tmp

2018-08-16 Thread Christian Ehrhardt
On Wed, Aug 15, 2018 at 7:35 PM Jamie Strandboge wrote: > On Tue, 2018-08-14 at 08:18 +0200, Christian Ehrhardt wrote: > > The samba feature of qemu will place the samba config file in > > /tmp/qemu-smb.. > > > > But at least it has a predictable path identifying qemu-smb feature > > itself by

[libvirt] [PATCH v3 2/3] virsh: Implement new table API for virsh list

2018-08-16 Thread Simon Kobyda
Instead of printing it straight in virsh, it creates table struct which is filled with header and rows(domains). It allows us to know more about table before printing to calculate alignment right. Signed-off-by: Simon Kobyda --- tests/virshtest.c| 14 ++--

[libvirt] [PATCH v3 0/3] vsh: Introduce new API for printing tables

2018-08-16 Thread Simon Kobyda
Created new API for priting tables, mainly to solve alignment problems. Implemented these test to virsh list. In the future, API may be everywhere in virsh and virt-admin. Also wrote basic tests for the new API, and corrected tests in virshtest which are influenced by implementation of the API in

[libvirt] [PATCH v3 1/3] vsh: Add API for printing tables.

2018-08-16 Thread Simon Kobyda
It solves problems with alignment of columns. Width of each column is calculated by its biggest cell. Should solve unicode bug. In future, it may be implemented in virsh, virt-admin... This API has 5 public functions: - vshTableNew - adds new table and defines its header - vshTableRowAppend -

[libvirt] [PATCH v3 3/3] vsh: Added tests

2018-08-16 Thread Simon Kobyda
For now, there are 5 test cases - testVshTableNew: Creating table with empty header - testVshTableHeader: Printing table with/without header - testVshTableRowAppend: Appending row with various number of cells. Only row with same number of cells as in header is accepted. - testVshTableNewUnicode:

Re: [libvirt] [RFC PATCH 01/17] qemu: setup shared memory without explicit numa configuration

2018-08-16 Thread Daniel P . Berrangé
On Fri, Jul 13, 2018 at 03:28:08PM +0200, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau > > When a domain is configured with 'shared' memory backing: > > > > > > But no explicit NUMA configuration, let's configure a shared memory > backend associated with default

[libvirt] [PATCH v2 3/4] qemu: Fix probing of AMD SEV support

2018-08-16 Thread Erik Skultety
So the procedure to detect SEV support works like this: 1) we detect that sev-guest is among the QOM types and set the cap flag 2) we probe the monitor for SEV support - this is tricky, because QEMU with compiled SEV support will always report -object sev-guest and query-sev-capabilities

[libvirt] [PATCH v2 4/4] qemu: caps: Format SEV platform data into qemuCaps cache

2018-08-16 Thread Erik Skultety
Since we're not saving the platform-specific data into a cache, we're not going to populate the structure, which in turn will cause a crash upon calling virNodeGetSEVInfo because of a NULL pointer dereference. Ultimately, we should start caching this data along with host-specific capabilities like

[libvirt] [PATCH v2 1/4] tests: sev: Test launch-security with specific QEMU version

2018-08-16 Thread Erik Skultety
In order to test SEV we need real QEMU capabilities. Ideally, this would be tested with -latest capabilities, however, our capabilities are currently tied to Intel HW, even the 2.12.0 containing SEV were edited by hand, so we can only use that one for now, as splitting the capabilities according

[libvirt] [PATCH v2 2/4] qemu: Define and use a auto cleanup function with virSEVCapability

2018-08-16 Thread Erik Skultety
Keep with the recent effort of replacing as many explicit *Free functions with their automatic equivalents. Signed-off-by: Erik Skultety Acked-by: Peter Krempa --- src/conf/domain_capabilities.h | 4 src/qemu/qemu_capabilities.c | 12 src/qemu/qemu_monitor_json.c | 11

[libvirt] [PATCH v2 0/4] Fix a SIGSEGV in libvirtd when querying AMD SEV info

2018-08-16 Thread Erik Skultety
This series fixes the following BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1612009 TL;DR: We don't format SEV platform data (PDH, certificate chain,...) into our qemu caps cache which poses a problem after libvirtd restart when we restore from the cache and get a segfault upon issuing

Re: [libvirt] [PATCH v2 0/2] spec: Add more nvram firmware paths

2018-08-16 Thread Andrea Bolognani
On Wed, 2018-08-15 at 18:29 -0400, Cole Robinson wrote: > Add nvram firmware paths for ovmf ia32 and ovmf arm32. The latter > is at least useful for upcoming Fedora which will support arm32 > installs, rather than just pre-created disk image imports > > First patch is just a comment

Re: [libvirt] [PATCH] qemu_command: Fix memleak in qemuBuildFloppyCommandLineControllerOptions

2018-08-16 Thread Erik Skultety
On Thu, Aug 16, 2018 at 12:22:24PM +0200, Michal Privoznik wrote: > Even though the buffer is passed to virCommand we still need to > free it. > > ==191201== 1,010 bytes in 1 blocks are definitely lost in loss record 826 of > 836 > ==191201==at 0x4C2CE3F: malloc (vg_replace_malloc.c:298) >

Re: [libvirt] [RFC PATCH 01/17] qemu: setup shared memory without explicit numa configuration

2018-08-16 Thread Marc-André Lureau
Hi On Thu, Aug 16, 2018 at 4:35 AM, John Ferlan wrote: > > > On 07/13/2018 09:28 AM, marcandre.lur...@redhat.com wrote: >> From: Marc-André Lureau >> >> When a domain is configured with 'shared' memory backing: >> >> >> >> >> >> But no explicit NUMA configuration, let's configure a

Re: [libvirt] [PATCH] qemu_command: Fix memleak in qemuBuildFloppyCommandLineControllerOptions

2018-08-16 Thread Peter Krempa
On Thu, Aug 16, 2018 at 12:22:24 +0200, Michal Privoznik wrote: > Even though the buffer is passed to virCommand we still need to > free it. This is misleading. In fact we are NOT passing it to virCommandAddArgBuffer in some cases as it would be properly freed in that case. > ==191201== 1,010

Re: [libvirt] [PATCH v2 0/6] fdaskljrew

2018-08-16 Thread Michal Privoznik
On 08/16/2018 12:22 PM, Simon Kobyda wrote: > I send this by mistake. Sorry. > Also, please don't top post on technical lists. Always use either inline or bottom post replies. Michal -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] [libvirt-glib][PATCH v2] Use new GObject define macros with private

2018-08-16 Thread Andrea Bolognani
On Thu, 2018-08-16 at 10:06 +0200, Michal Privoznik wrote: [...] > -GLIB2_REQUIRED=2.36.0 > +GLIB2_REQUIRED=2.38.0 > AC_SUBST([GLIB2_REQUIRED]) dnl used in the .spec file > GLIB2_TEST_REQUIRED=2.38.0 We can now get rid of GLIB2_TEST_REQUIRED. Would you mind sending a follow-up patch that does

[libvirt] [PATCH] qemu_command: Fix memleak in qemuBuildFloppyCommandLineControllerOptions

2018-08-16 Thread Michal Privoznik
Even though the buffer is passed to virCommand we still need to free it. ==191201== 1,010 bytes in 1 blocks are definitely lost in loss record 826 of 836 ==191201==at 0x4C2CE3F: malloc (vg_replace_malloc.c:298) ==191201==by 0x4C2F1BF: realloc (vg_replace_malloc.c:785) ==191201==by

Re: [libvirt] [PATCH v2 0/6] fdaskljrew

2018-08-16 Thread Simon Kobyda
I send this by mistake. Sorry. Simon On Thu, 2018-08-16 at 10:48 +0100, Daniel P. Berrangé wrote: > On Thu, Aug 16, 2018 at 11:11:26AM +0200, Simon Kobyda wrote: > > rpdwrewrewr > > Please use a sensible subject line, and provide useful information > about > the patch series in this cover

Re: [libvirt] [PATCH 1/5] tests: qemuxml2argvmock: Don't mock virCommandPassFD

2018-08-16 Thread Peter Krempa
On Thu, Aug 16, 2018 at 12:08:12 +0200, Michal Privoznik wrote: > On 08/14/2018 03:21 PM, Peter Krempa wrote: > > This function does not modify the host. It merely puts the file > > descriptor into a list in virCommandPtr. > > > > Signed-off-by: Peter Krempa > > --- > > tests/qemuxml2argvmock.c

Re: [libvirt] [PATCH 1/4] cpu: allow include files for CPU definition

2018-08-16 Thread Daniel P . Berrangé
On Tue, Aug 14, 2018 at 12:55:19PM +0200, Jiri Denemark wrote: > On Wed, Aug 01, 2018 at 18:02:29 +0100, Daniel P. Berrangé wrote: > > Allow for syntax > > > > > > It seems the code should just work with > > > > but Makefile.am and libvirt.spec would need some adjustment. > > > to

Re: [libvirt] [PATCH 1/5] tests: qemuxml2argvmock: Don't mock virCommandPassFD

2018-08-16 Thread Michal Privoznik
On 08/14/2018 03:21 PM, Peter Krempa wrote: > This function does not modify the host. It merely puts the file > descriptor into a list in virCommandPtr. > > Signed-off-by: Peter Krempa > --- > tests/qemuxml2argvmock.c | 8 > 1 file changed, 8 deletions(-) > > diff --git

Re: [libvirt] [PATCH 2/5] qemu: command: Extract opening of TPM backend FDs for mocking purposes

2018-08-16 Thread Michal Privoznik
On 08/14/2018 03:21 PM, Peter Krempa wrote: > Allow mocking of the file descriptor numbers used for the TPM > passthrough mode by extracting the relevant code into an exported > function. > > Signed-off-by: Peter Krempa > --- > src/qemu/qemu_command.c | 41

Re: [libvirt] [PATCH 4/5] qemu: capabilities: Always assume QEMU_CAPS_ADD_FD

2018-08-16 Thread Michal Privoznik
On 08/14/2018 03:21 PM, Peter Krempa wrote: > The capability was usable since qemu 1.3 so we can remove all the > detection code. > > Signed-off-by: Peter Krempa > --- > > Note that the *replies files need to be renumbered. I've split that to a > separate patch for ease of review. Notably

Re: [libvirt] [PATCH 5/5] FIXUP: renumber replies lines after deleting section

2018-08-16 Thread Michal Privoznik
On 08/14/2018 03:21 PM, Peter Krempa wrote: > For simpler review. > Not only that. It's even to stop qemucapabilitiestest from failing after previous patch. > Done via tests/qemucapsfixreplies. > --- > .../qemucapabilitiesdata/caps_1.5.3.x86_64.replies | 152 >

Re: [libvirt] [PATCH 3/5] tests: qemuxml2argv: modernize TPM passthrough tests

2018-08-16 Thread Michal Privoznik
On 08/14/2018 03:21 PM, Peter Krempa wrote: > All supported qemus support FD passing so modify the tests to test the > proper code path. > > Signed-off-by: Peter Krempa > --- > tests/qemuxml2argvdata/tpm-passthrough-crb.args | 5 +++-- > tests/qemuxml2argvdata/tpm-passthrough.args | 5

Re: [libvirt] [PATCH v2 0/6] fdaskljrew

2018-08-16 Thread Ján Tomko
On Thu, Aug 16, 2018 at 11:11:26AM +0200, Simon Kobyda wrote: rpdwrewrewr Grafsjlankladhyr. Wnab Simon Kobyda (6): vsh: Add API for printing tables. virsh: Implement new table API for virsh list vsh: Added tests virsh: Implement vsh-table to iface-list virsh: Implement vshTable API to

Re: [libvirt] [PATCH v2 0/6] fdaskljrew

2018-08-16 Thread Daniel P . Berrangé
On Thu, Aug 16, 2018 at 11:11:26AM +0200, Simon Kobyda wrote: > rpdwrewrewr Please use a sensible subject line, and provide useful information about the patch series in this cover letter. > > Simon Kobyda (6): > vsh: Add API for printing tables. > virsh: Implement new table API for virsh

[libvirt] [PATCH v2 3/6] vsh: Added tests

2018-08-16 Thread Simon Kobyda
For now, there are 5 test cases - testVshTableNew: Creating table with empty header - testVshTableHeader: Printing table with/without header - testVshTableRowAppend: Appending row with various number of cells. Only row with same number of cells as in header is accepted. - testVshTableNewUnicode:

  1   2   >