Re: [libvirt] [PATCH 5/5] qemu: Add support for setting the TSEG size

2018-06-02 Thread Martin Kletzander
On Thu, May 31, 2018 at 03:52:26PM +0200, Pavel Hrdina wrote: On Thu, May 31, 2018 at 02:22:05PM +0200, Martin Kletzander wrote: On Thu, May 31, 2018 at 10:52:08AM +0200, Pavel Hrdina wrote: > On Thu, May 31, 2018 at 10:09:46AM +0200, Martin Kletzander wrote: > > On Thu, May 31, 2018 at 08:45:39

Re: [libvirt] [PATCH 3/5] conf, schema, docs: Add support for TSEG size setting

2018-06-02 Thread Martin Kletzander
On Fri, Jun 01, 2018 at 08:21:52AM -0400, John Ferlan wrote: [...] First thanks for taking the time to elaborate - it is helpful. Much better than just stating no because I don't like it ;-). And thanks for appreciating that =) 1. Add poll-max-ns property of each iothread: https://www.re

Re: [libvirt] [tck PATCH v2 09/13] scripts: fix the various hotplug tests

2018-06-02 Thread Laine Stump
On 05/21/2018 12:46 PM, Daniel P. Berrangé wrote: > PCI device hotunplug requires a running guest OS that cooperates with > the ACPI unplug request. We must thus boot a real guest and wait for it > to be ready before running the tests. > > Signed-off-by: Daniel P. Berrangé Reviewed-by: Laine Stum

Re: [libvirt] [PATCH v2 2/2] qemu: Remove code for setting up disk passphrases

2018-06-02 Thread Ján Tomko
On Fri, Jun 01, 2018 at 02:06:38PM +0200, Peter Krempa wrote: Now that the old qcow2 encryption is removed we can safely delete all this code since it's not needed any more. Signed-off-by: Peter Krempa --- src/qemu/qemu_monitor.c | 13 -- src/qemu/qemu_monitor.h | 4 -- src/qemu/

Re: [libvirt] [PATCH v2 1/2] qemu: domain: Forbid storage with old QCOW2 encryption

2018-06-02 Thread Ján Tomko
On Fri, Jun 01, 2018 at 02:06:37PM +0200, Peter Krempa wrote: The encryption was buggy and qemu actually dropped it upstream. Forbid it for all versions since it would cause other problems too. Problems with the old encryption include weak crypto, corruption of images with blockjobs and a lot of

Re: [libvirt] [PATCH 9/9] qemu: command: Refactor disk commandline formatting

2018-06-02 Thread Ján Tomko
On Fri, Jun 01, 2018 at 05:51:12PM +0200, Peter Krempa wrote: Now that we have one place that sets up all disk-related objects to qemuBlockStorageSourceAttachDataPtr we can easily reuse the data in the command-line formatter by implementing a worker which will convert the data. A huge advantage

Re: [libvirt] [PATCH 8/9] qemu: command: Extract setup of one disk's command line

2018-06-02 Thread Ján Tomko
On Fri, Jun 01, 2018 at 05:51:11PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 106 1 file changed, 62 insertions(+), 44 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: Digital sig

Re: [libvirt] [PATCH 7/9] qemu: command: Rename qemuBuildDiskDriveCommandLine

2018-06-02 Thread Ján Tomko
On Fri, Jun 01, 2018 at 05:51:10PM +0200, Peter Krempa wrote: It prepares all disk so use the plural form. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: Digital s

Re: [libvirt] [PATCH 6/9] qemu: hotplug: Extract hotplug of TLS into qemuBlockStorageSourceAttachApply

2018-06-02 Thread Ján Tomko
On Fri, Jun 01, 2018 at 05:51:09PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 9 + src/qemu/qemu_block.h | 3 +++ src/qemu/qemu_command.c | 9 - src/qemu/qemu_command.h | 3 ++- src/qemu/qemu_hotplug.c | 37 +

Re: [libvirt] [PATCH 5/9] qemu: hotplug: Extract hotplug of secrets into qemuBlockStorageSourceAttachApply

2018-06-02 Thread Ján Tomko
On Fri, Jun 01, 2018 at 05:51:08PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 21 + src/qemu/qemu_block.h | 6 ++ src/qemu/qemu_command.c | 13 + src/qemu/qemu_hotplug.c | 37 - 4 fil

Re: [libvirt] [PATCH 4/9] qemu: hotplug: Extract hotplug of PR into qemuBlockStorageSourceAttachApply

2018-06-02 Thread Ján Tomko
On Fri, Jun 01, 2018 at 05:51:07PM +0200, Peter Krempa wrote: Introduce a new setup function for all the related configuration and move the setup and attachment of the PR code. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 8 src/qemu/qemu_block.h | 3 +++ src/qemu/qemu_c

Re: [libvirt] [PATCH 3/9] qemu: Reuse qemuBlockStorageSourceAttachApply in disk hotplug

2018-06-02 Thread Ján Tomko
On Fri, Jun 01, 2018 at 05:51:06PM +0200, Peter Krempa wrote: Create a new "Prepare" function and move the drive add code into the new helpers. This will eventually allow to simplify and unify the attaching code for use with blockdev at the same time as providing compatibility with older qemus.

Re: [libvirt] [PATCH 2/9] qemu: alias: Rename qemuAliasFromDisk to qemuAliasDiskDriveFromDisk

2018-06-02 Thread Ján Tomko
On Fri, Jun 01, 2018 at 05:51:05PM +0200, Peter Krempa wrote: Emphasize that it's for the 'drive' part of the disk. Signed-off-by: Peter Krempa --- src/qemu/qemu_alias.c | 4 ++-- src/qemu/qemu_alias.h | 2 +- src/qemu/qemu_block.c | 2 +- src/qemu/qemu_command.c | 4 ++-- src/qem

Re: [libvirt] [PATCH 1/9] qemu: hotplug: Remove qemuDomainDelDiskSrcTLSObject

2018-06-02 Thread Ján Tomko
On Fri, Jun 01, 2018 at 05:51:04PM +0200, Peter Krempa wrote: Replace access via wrapper by direct call to monitor API. Signed-off-by: Peter Krempa --- src/qemu/qemu_hotplug.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Des

Re: [libvirt] [PATCH 4/4] qemu: Split handling of managed and unmanaged persistent reservations

2018-06-02 Thread Ján Tomko
On Thu, May 31, 2018 at 07:59:35PM +0200, Peter Krempa wrote: On Thu, May 31, 2018 at 19:30:25 +0200, Peter Krempa wrote: Add code that will handle the managed persistent reservations object separately from the unmanaged one. There is only one managed object so handling it with disks is awkward

Re: [libvirt] [PATCH 3/4] qemu: command: Return props as return value in qemuBuildPRManagerInfoProps

2018-06-02 Thread Ján Tomko
On Thu, May 31, 2018 at 07:30:24PM +0200, Peter Krempa wrote: Also since we don't do any conditional formatting, fix the comment for the function. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 22 +++--- src/qemu/qemu_command.h | 3 +-- src/qemu/qemu_hotplug.c | 5 ++

Re: [libvirt] [PATCH 2/4] qemu: command: Pass in 'src' rather than 'disk' to qemuBuildPRManagerInfoProps

2018-06-02 Thread Ján Tomko
On Thu, May 31, 2018 at 07:30:23PM +0200, Peter Krempa wrote: Everything is contained in the virStorageSourceStructure. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 12 +--- src/qemu/qemu_command.h | 2 +- src/qemu/qemu_hotplug.c | 2 +- 3 files changed, 7 insertions(+), 9 d

Re: [libvirt] [PATCH 1/4] util: storage: Add helper for determining whether a backing chain requires PR

2018-06-02 Thread Ján Tomko
On Thu, May 31, 2018 at 07:30:22PM +0200, Peter Krempa wrote: With blockdev support we will need to introspect whether any of the backing chain members requires PR rather just one of them. Add a helper and reuse it in virDomainDefHasManagedPR. Signed-off-by: Peter Krempa --- src/conf/domain_con

Re: [libvirt] [PATCH v2 3/3] tests: qemublock: Test NBD with TLS in the JSON generator

2018-06-02 Thread Ján Tomko
On Thu, May 31, 2018 at 08:51:14PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 1 + tests/qemublocktestdata/xml2json/network-nbd-tls.json | 19 +++ tests/qemublocktestdata/xml2json/network-nbd-tls.xml | 18 +++

Re: [libvirt] [PATCH v2 2/3] qemu: domain: Add support for TLS for NBD

2018-06-02 Thread Ján Tomko
On Thu, May 31, 2018 at 08:51:13PM +0200, Peter Krempa wrote: https://bugzilla.redhat.com/show_bug.cgi?id=1544869 Signed-off-by: Peter Krempa --- docs/formatdomain.html.in | 8 - docs/schemas/domaincommon.rng | 5 +++ src/qemu/qemu_command.c

Re: [libvirt] [PATCH v2 1/3] qemu: conf: Add qemu.conf knobs for setting up TLS for NBD

2018-06-02 Thread Ján Tomko
On Thu, May 31, 2018 at 08:51:12PM +0200, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/qemu/libvirtd_qemu.aug | 4 src/qemu/qemu.conf | 34 ++ src/qemu/qemu_conf.c | 15 +++ src/qemu/qemu_conf.h

Re: [libvirt] [RFC PATCH 2/2] conf: Extend cputune/cachetune to support memory bandwidth allocation

2018-06-02 Thread Ján Tomko
On Tue, May 29, 2018 at 06:58:03PM +0800, bing@intel.com wrote: From: Bing Niu Extend current cachetune section to support memory bandwidth allocation. Add a new cachetune element llc for memory allocation. As the example below: id--- on which last

Re: [libvirt] [RFC PATCH 1/2] util: Add memory bandwidth support to resctrl

2018-06-02 Thread Ján Tomko
On Tue, May 29, 2018 at 06:58:02PM +0800, bing@intel.com wrote: From: Bing Niu Add memory bandwidth allocation support basing on existing virresctrl implementation. Two new structures virResctrlInfoMB and virResctrlAllocMB are introduced. virResctrlInfoMB is used to record host system MBA

Re: [libvirt] [PATCH 11/13] tests: Add new tests for zPCI

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 02:24:36PM +0200, Xiao Feng Ren wrote: From: Yi Min Zhao This patch adds new test cases for zPCI when 'uid' and 'fid' are defined with different conditions in XML. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Bjoern Walk Reviewed-by: Stefan Z

Re: [libvirt] [PATCH 06/13] qemu: Generate and use zPCI device in QEMU command line

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 02:24:31PM +0200, Xiao Feng Ren wrote: From: Yi Min Zhao Add new functions to generate zPCI command string and append it to QEMU command line. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk --- src/qe

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

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 02:24:30PM +0200, Xiao Feng Ren wrote: From: 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 --- src/qemu/q

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

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 02:24:29PM +0200, Xiao Feng Ren wrote: From: Yi Min Zhao QEMU on s390 supports PCI multibus since forever. But zPCI, as extension of PCI device on s390, is the significant capability. Only when zPCI capability is existing, we consider QEMU supports PCI multibus properly.

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

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 02:24:28PM +0200, Xiao Feng Ren wrote: From: 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 -

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

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 02:24:26PM +0200, Xiao Feng Ren wrote: From: 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

Re: [libvirt] [PATCH v8 16/18] conf: Audit TPM emulator device at domain startup

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:12PM -0400, Stefan Berger wrote: Extend the existing auditing with auditing for the TPM emulator. Signed-off-by: Stefan Berger --- docs/auditlog.html.in | 2 +- src/conf/domain_audit.c | 16 +--- 2 files changed, 14 insertions(+), 4 deletions(-) Rev

Re: [libvirt] [PATCH v8 17/18] conf: Use resrc=tpm in case of TPM passthrough following docs

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:13PM -0400, Stefan Berger wrote: Fix the resrc field for the TPM passthrough case to show tpm. This fixes the code to follow the documentation. Signed-off-by: Stefan Berger --- src/conf/domain_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed

Re: [libvirt] [PATCH v8 18/18] conf: Use virDomainChrSourceDefClear() rather than VIR_FREE()

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:14PM -0400, Stefan Berger wrote: Signed-off-by: Stefan Berger --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Ján Tomko Jano signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redh

Re: [libvirt] [PATCH v8 15/18] qemu: Validate chosen TPM model rather than overwriting it

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:11PM -0400, Stefan Berger wrote: TPM 1.2 does not support a CRB interface but only TIS. So, in this case we need to alert the user and request a change to the XML rather than silently overwriting it. Signed-off-by: Stefan Berger --- src/conf/domain_conf.c | 15

Re: [libvirt] [PATCH v8 14/18] qemu: Run swtpm_setup in unprivileged mode for a TPM 2

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:10PM -0400, Stefan Berger wrote: swtpm_setup can be run for a TPM 2 in unprivileged mode assuming XDG_CONFIG_HOME has been set and the necessary configuration files have been put into that directory. For current reference also see this link: https://github.com/stef

Re: [libvirt] [PATCH v8 13/18] security: Add swtpm paths to the domain's AppArmor profile

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:09PM -0400, Stefan Berger wrote: This patch extends the AppArmor domain profile with file paths the swtpm accesses for state, log, pid, and socket files. Both, QEMU and swtpm, use this AppArmor profile. Signed-off-by: Stefan Berger Cc: Christian Ehrhardt --- exam

Re: [libvirt] [PATCH v8 12/18] news: Update news with new TPM emulator feature

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:08PM -0400, Stefan Berger wrote: Signed-off-by: Stefan Berger --- docs/news.xml | 13 + 1 file changed, 13 insertions(+) Reviewed-by: Ján Tomko Jano signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com htt

Re: [libvirt] [PATCH v8 11/18] qemu: Add swtpm to emulator cgroup

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:07PM -0400, Stefan Berger wrote: Add the external swtpm to the emulator cgroup so that upper limits of CPU usage can be enforced on the emulated TPM. To enable this we need to have the swtpm write its process id (pid) into a file. We then read it from the file to co

Re: [libvirt] [PATCH v8 10/18] conf: Add support for choosing emulation of a TPM 2

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:06PM -0400, Stefan Berger wrote: This patch extends the TPM's device XML with TPM 2 support. This only works for the emulator type backend and looks as follows: The swtpm process now has --tpm2 as an additional parameter: system_u:system_r:svirt_t:s0

Re: [libvirt] [PATCH v8 09/18] security: Label the external swtpm with SELinux labels

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:05PM -0400, Stefan Berger wrote: In this patch we label the swtpm process with SELinux labels. We give it the same label as the QEMU process has. We label its state directory and files as well. We restore the old security labels once the swtpm has terminated. The fi

Re: [libvirt] [PATCH v8 08/18] tests: Add test cases for external swtpm TPM emulator

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:04PM -0400, Stefan Berger wrote: This patch adds extensions to existing test cases and specific test cases for the tpm-emulator. Signed-off-by: Stefan Berger Reviewed-by: John Ferlan --- .../tpm-emulator.x86_64-latest.args| 33 +

Re: [libvirt] [PATCH v8 07/18] qemu: Add support for external swtpm TPM emulator

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:03PM -0400, Stefan Berger wrote: This patch adds support for an external swtpm TPM emulator. The XML for this type of TPM looks as follows: The XML will currently only start a TPM 1.2. Upon first start, libvirt will run `swtpm_setup`, which will simulate the

Re: [libvirt] [PATCH v8 06/18] qemu: Extend QEMU with external TPM support

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:02PM -0400, Stefan Berger wrote: Implement functions for managing the storage of the external swtpm as well as starting and stopping it. Also implement functions to use swtpm_setup, which simulates the manufacturing of a TPM, which includes creation of certificates f

Re: [libvirt] [PATCH v8 05/18] qemu: Extend qemu_conf with tpm-emulator support

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:01PM -0400, Stefan Berger wrote: Extend qemu_conf with user and group for running the tpm-emulator and add directories to the configuration for the locations of the log, state, and socket of the tpm-emulator. Also add these new directories to the QEMU Makefile.inc.a

Re: [libvirt] [PATCH v8 04/18] security: Add DAC and SELinux security for tpm-emulator

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:26:00PM -0400, Stefan Berger wrote: Extend the DAC and SELinux modules with support for the tpm-emulator. We label the Unix socket that QEMU connects to after starting swtmp with DAC and SELinux labels. We do not have to restore the labels in this case since the tpm-emu

Re: [libvirt] [PATCH v8 03/18] util: Implement virFileChownFiles()

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:25:59PM -0400, Stefan Berger wrote: Implement virFileChownFiles() which changes file ownership of all files in a given directory. Signed-off-by: Stefan Berger Reviewed-by: John Ferlan --- src/libvirt_private.syms | 1 + src/util/virfile.c | 55 +

Re: [libvirt] [PATCH v8 02/18] qemu: Extend QEMU capabilities with 'tpm-emulator'

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:25:58PM -0400, Stefan Berger wrote: Extend the QEMU capabilities with tpm-emulator support. Signed-off-by: Stefan Berger Reviewed-by: John Ferlan --- src/qemu/qemu_capabilities.c | 5 + src/qemu/qemu_capabilities.h | 1 +

Re: [libvirt] [PATCH v8 01/18] conf: Add support for external swtpm TPM emulator to domain XML

2018-06-02 Thread Ján Tomko
On Thu, May 24, 2018 at 04:25:57PM -0400, Stefan Berger wrote: This patch adds support for an external swtpm TPM emulator. The XML for this type of TPM looks as follows: The XML will currently only define a TPM 1.2. Extend the documentation. Add a test case testing the XML parser and for

Re: [libvirt] [PATCH] virDomainDefCopy: Skip ostype checks

2018-06-02 Thread Ján Tomko
On Sat, Jun 02, 2018 at 12:57:39PM +0200, Michal Privoznik wrote: When parsing domain XML the virCapsDomainData lookup is performed in order to fill in missing def->os.arch and def->os.machine strings. Well, when doing copy of already existing virDomainDef we don't want any automagic fill in of d

Re: [libvirt] [RFC PATCH 0/2] Introduce RDT memory bandwidth allocation support

2018-06-02 Thread bing.niu
ping for this series. thanks a lot bing On 2018年05月29日 18:58, bing@intel.com wrote: From: Bing Niu This series is to introduce RDT memory bandwidth allocation support by extending current virresctrl implementation. The Memory Bandwidth Allocation (MBA) feature provides indirect and a

[libvirt] [PATCH] virDomainDefCopy: Skip ostype checks

2018-06-02 Thread Michal Privoznik
When parsing domain XML the virCapsDomainData lookup is performed in order to fill in missing def->os.arch and def->os.machine strings. Well, when doing copy of already existing virDomainDef we don't want any automagic fill in of defaults (and those two strings are going to be provided at this poin