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

2018-06-04 Thread Yi Min Zhao
在 2018/6/2 下午10:15, 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 Z

Re: [libvirt] [PATCH v6 6/9] libvirt: add new public API to get launch security info

2018-06-04 Thread Erik Skultety
On Fri, Jun 01, 2018 at 11:34:19AM -0500, Brijesh Singh wrote: > > > On 05/28/2018 09:36 AM, Erik Skultety wrote: > > On Wed, May 23, 2018 at 04:18:31PM -0500, Brijesh Singh wrote: > > > The API can be used outside the libvirt to get the launch security > > > information. When SEV is enabled, the A

[libvirt] [PATCH 02/10] qemu: conf: Remove 'allow_disk_format_probing' config option

2018-06-04 Thread Peter Krempa
The option is insecure and it has been long enough for users to migrate their disk files to use explicit format. Drop the option and related code. The config parser still parses it and rejects statup if it's still present in the config in enabled state. The augeas lens is also kept so that users

[libvirt] [PATCH 00/10] qemu: Drop 'allow_disk_format_probing' config option

2018-06-04 Thread Peter Krempa
An upstream discussion resulted into an agreement that this can be finally deleted. https://www.redhat.com/archives/libvir-list/2018-June/msg00079.html This applies on top of my branch collecting all ACKed postings of recent blockdev-related work. Current version can be fetched by: git fetch gi

[libvirt] [PATCH 07/10] tests: storage: Absorb ALLOW_PROBE flag into the TEST_CHAIN macro

2018-06-04 Thread Peter Krempa
The second set of arguments for TEST_CHAIN always specifies the 'ALLOW_PROBE' flag. Make it part of the macro. Signed-off-by: Peter Krempa --- tests/virstoragetest.c | 48 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/virst

[libvirt] [PATCH 01/10] tests: Drop tests enabling allowDiskFormatProbing

2018-06-04 Thread Peter Krempa
Format probing will be dropped so remove the tests which will become obsolete. Signed-off-by: Peter Krempa --- .../qemuxml2argvdata/disk-many-format-probing.args | 32 - .../qemuxml2argvdata/disk-many-format-probing.xml | 48 tests/qemuxml2argvtest.c

[libvirt] [PATCH 03/10] qemu: driver: Remove impossible code path in qemuDomainSnapshotCreateInactiveExternal

2018-06-04 Thread Peter Krempa
Previous patch naively removed all code relevant to disk format checking. The semantics now dictate that the format check when creating external snapshots is now impossible as we always fill in the format for disks in domain definition in the post-parse callback. Remove the impossible code path.

[libvirt] [PATCH 08/10] tests: storage: Drop format probing from tests

2018-06-04 Thread Peter Krempa
Storage drivers now don't allow it so there's no need to test it. Signed-off-by: Peter Krempa --- tests/virstoragetest.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 0fe8ac7e7f..4d98310ee1 10

[libvirt] [PATCH 04/10] security: Remove VIR_SECURITY_MANAGER_ALLOW_DISK_PROBE

2018-06-04 Thread Peter Krempa
Nothing is setting that flag now so it can be removed. Note that removing 'mgr' from 'load_profile' in the apparmor driver would create a lot of churn. Signed-off-by: Peter Krempa --- src/security/security_apparmor.c | 6 ++ src/security/security_manager.c | 7 --- src/security/security

[libvirt] [PATCH 09/10] tests: storage: Drop duplicate tests with TEST_CHAIN

2018-06-04 Thread Peter Krempa
Now that all test cases with TEST_CHAIN were testing the same thing twice drop one of them. Note that some of the cases were duplicate even before dropping the image format probing tests. Signed-off-by: Peter Krempa --- tests/virstoragetest.c | 93 +---

[libvirt] [PATCH 10/10] util: storage: remove 'allow_probe' from virStorageFileGetMetadata

2018-06-04 Thread Peter Krempa
All callers pass 'false' now so it's no longer needed. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c| 4 +--- src/security/virt-aa-helper.c | 2 +- src/util/virstoragefile.c | 18 +++--- src/util/virstoragefile.h | 1 - tests/virstoragetest.c| 2 +

[libvirt] [PATCH 06/10] tests: virstoragetest: Add complementary test case for QED format

2018-06-04 Thread Peter Krempa
We have a test case for QED disk image with autodetection but not with the format explicitly specified. Signed-off-by: Peter Krempa --- tests/virstoragetest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 0e11602e84..f3b96a9b87 10064

[libvirt] [PATCH 05/10] security: aa-helper: Remove the -p parameter

2018-06-04 Thread Peter Krempa
As the aa-helper binary is supposed to be used only with libvirt, we can fully remove it. Signed-off-by: Peter Krempa --- src/security/virt-aa-helper.c | 15 ++- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper

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

2018-06-04 Thread Michal Privoznik
On 06/02/2018 02:23 PM, Ján Tomko wrote: > 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 vir

[libvirt] [PATCH v3] Loop through all resolved addresses in virNetSocketNewListenTCP

2018-06-04 Thread Olaf Hering
Currently virNetSocketNewListenTCP bails out early under the following conditions: - the hostname resolves to at least one IPv4 and at least one IPv6 address - the local interfaces have that one IPv4 address assigned, but not any of the IPv6 addresses - the local interfaces have just IPv6 link-

[libvirt] [dbus PATCH] gdbus: Don't report libvirt errors for GetAll method on properties

2018-06-04 Thread Pavel Hrdina
According to D-Bus specification if some property is not accessible it may be omitted in the returned list of properties. However, such error needs to be reported for Get method on that property. In libvirt-dbus this can happen for Domain.SchedulerType property for QEMU session connection. Signe

Re: [libvirt] [RFC PATCH 0/7] Enable vfio-pci 'property' for mediated devices

2018-06-04 Thread Erik Skultety
CC'ing Gerd to comment since he implemented the feature in QEMU. Erik On Wed, May 30, 2018 at 03:42:54PM +0200, Erik Skultety wrote: > Since QEMU 2.12 there's a new vfio-pci device property 'display' with values > on/off/auto. This special kind of display allows using a mediated device which > is

Re: [libvirt] [ v3 1/4] Schema: Introduce XML schema for network-backed loader and nvram elements.

2018-06-04 Thread John Ferlan
That's a long $SUBJ On 05/21/2018 07:10 AM, Prerna Saxena wrote: > Today, 'loader' and 'nvram' elements are supposed to be backed by a local > disk. > Given that NVRAM data could be network-backed for high availability, this > patch > defines XML spec for serving loader & nvram disks via t

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

2018-06-04 Thread Stefan Berger
On 06/02/2018 09:38 AM, Ján Tomko wrote: 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 Be

Re: [libvirt] [ v3 2/4] 1) Loader: Add a more elaborate definition.

2018-06-04 Thread John Ferlan
On 05/21/2018 07:10 AM, Prerna Saxena wrote: > Augment definition to include virStorageSourcePtr that > more comprehensively describes the nature of backing element. > Also include flags for annotating if input XML definition is > old-style or new-style. > > 2) Parse domain XML to generate virDo

Re: [libvirt] [dbus PATCH] gdbus: Don't report libvirt errors for GetAll method on properties

2018-06-04 Thread Katerina Koukiou
On Mon, 2018-06-04 at 13:13 +0200, Pavel Hrdina wrote: > According to D-Bus specification if some property is not accessible > it may be omitted in the returned list of properties. However, such > error needs to be reported for Get method on that property. > > In libvirt-dbus this can happen for

[libvirt] [PATCH] tests: qemuxml2argv: Make tests based on DO_TEST_CAPS_INTERNAL stable

2018-06-04 Thread Peter Krempa
To avoid problems with test cases specifying an alias machine type which would change once capabilities for a newer version are added strip all alias machine types for the DO_TEST_CAPS_INTERNAL based tests. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c|

[libvirt] [PATCH] docs: Use proper article in formatdomain.html.in

2018-06-04 Thread Martin Kletzander
It's "a hard_limit", not "an hard_limit". Probably that was just a typo. Signed-off-by: Martin Kletzander --- Pushed as trivial. I was *so* tempted to write "Fix an typo in a article...". I'm glad I was because that made me triple check the commit message. Otherwise I would have a typo like t

[libvirt] [PATCH v2] tests: qemuxml2argv: Make tests based on DO_TEST_CAPS_LATEST stable

2018-06-04 Thread Peter Krempa
To avoid problems with test cases specifying an alias machine type which would change once capabilities for a newer version are added strip all alias machine types for the DO_TEST_CAPS_LATEST based tests. Signed-off-by: Peter Krempa --- src/qemu/qemu_capabilities.c| 1

Re: [libvirt] [PATCH] tests: qemuxml2argv: Make tests based on DO_TEST_CAPS_INTERNAL stable

2018-06-04 Thread Peter Krempa
On Mon, Jun 04, 2018 at 15:33:03 +0200, Peter Krempa wrote: > To avoid problems with test cases specifying an alias machine type which > would change once capabilities for a newer version are added strip all > alias machine types for the DO_TEST_CAPS_INTERNAL based tests. > > Signed-off-by: Peter

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

2018-06-04 Thread Ján Tomko
On Mon, Jun 04, 2018 at 12:23:50PM +0200, Michal Privoznik wrote: On 06/02/2018 02:23 PM, Ján Tomko wrote: 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.mac

[libvirt] [tck PATCH] Don't assume the domain's network interface tap device is named "vnet0"

2018-06-04 Thread Laine Stump
Some of the tests perform operations on the tap device of the test domain's network interface. They mostly assume that this tap device is named "vnet0", which is the case if there is no other domain running on the host, but isn't true if some other domain was running. This patch adds a utility fun

[libvirt] [PATCH 00/10] tests: qemucapabilities: Record and test commands used to gather qemuCaps

2018-06-04 Thread Peter Krempa
The '.replies' files are quite confusing since we don't record which command created the given reply. Also our tests did not validate whether the correct command was called. Address this by recording which command was called and reuse qemuMonitorTestNewFromFileFull which allows checking the comman

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

2018-06-04 Thread Stefan Berger
On 06/02/2018 09:18 AM, Ján Tomko wrote: On Thu, May 24, 2018 at 04:26:05PM -0400, Stefan Berger wrote: +/* + * _virSecuritySELinuxRestoreFileLabels: + * + * @mgr: the virSecurityManager + * @path: path to a directory or a file + * + * Restore the file labels on the given path; if the path is a

[libvirt] [PATCH 01/10] qemu: monitor: Add possibility to reset command sequence in tests

2018-06-04 Thread Peter Krempa
qemucapabilitiestest for simplicity uses one test monitor object for simulating work of two separate inquiries of the qemu process. To allow better testing in the future it will be required to reset the counter so that it accurately simulates how qemu would behave. This patch adds a private monito

[libvirt] [PATCH 04/10] tests: qemumonitor: Optimize control flow when concatenating replies

2018-06-04 Thread Peter Krempa
The test file can be broken up by newlines and is automatically concatenated back. Fix the control flow so that the concatenation code 'continues' the loop rather than branching out. Also add an anotation to the concatenation code. Signed-off-by: Peter Krempa --- tests/qemumonitortestutils.c |

[libvirt] [PATCH 02/10] tests: qemucapabilities: Reset command sequence before second probe

2018-06-04 Thread Peter Krempa
The test data for capabilities is obtained from two consecutive qemu runs when the regular monitor object will be reset. Do the same for the test monitor object which is not disposed between runs by calling qemuMonitorResetCommandID. Signed-off-by: Peter Krempa --- tests/qemucapabilitiestest.c |

[libvirt] [PATCH 03/10] tests: qemumonitor: Simplify handling of end of file in full file test

2018-06-04 Thread Peter Krempa
On EOF, the loop can be terminated right away since most of it is skipped anyways and the handling of the last command is repeated after the loop. Signed-off-by: Peter Krempa --- tests/qemumonitortestutils.c | 24 +++- 1 file changed, 11 insertions(+), 13 deletions(-) diff -

[libvirt] [PATCH 06/10] tests: qemucapsprobemock: Fail if JSON reply from qemu can't be reformatted

2018-06-04 Thread Peter Krempa
Rather than skipping output on failure fail loudly. Signed-off-by: Peter Krempa --- tests/qemucapsprobemock.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/qemucapsprobemock.c b/tests/qemucapsprobemock.c index f26fa6b285..a0d2acb69a 100644 --- a/tests/qemucap

[libvirt] [PATCH 05/10] tests: qemucapsprobemock: Simplify and extract skipping of empty lines

2018-06-04 Thread Peter Krempa
The prettyfied output may sometimes contain empty lines which would desynchonize the test monitor workers. The skipping code can be much simplified though. Also a extract it so so that it's obvious what it's doing and can be reused. Signed-off-by: Peter Krempa --- tests/qemucapsprobemock.c | 26

[libvirt] [PATCH 07/10] tests: qemucapsprobemock: Prepare 'qemucapsprobe' for the new format

2018-06-04 Thread Peter Krempa
Change the output of qemucapsprobe to record the commands used for querying. This allows to easily identify which reply belongs to which command and also will allow to test whether we use stable queries. This change includes changing dropping of the QMP greeting from the file and reformatting of t

[libvirt] [PATCH 08/10] tests: qemucapabilities: Test commands used to query capabilities

2018-06-04 Thread Peter Krempa
Use qemuMonitorTestNewFromFileFull which allows to test commands used along with providing replies. This has two advantages: 1) It's easier to see which command was used when looking at the files 2) We check that the used commands are actually in the correct order Signed-off-by: Peter Krempa ---

[libvirt] [PATCH 10/10] DO_NOT_APPLY: HACK: Regenerate qemucapabilitiestest data

2018-06-04 Thread Peter Krempa
Use the LD_PRELOAD .so library used in 'qemucapsprobe' to regenerate the files. The library is instrumented to write the replies to 'caps.json' and instrumentation in the test move it to the correct place. Use 'fix-files.sh' to do so as it's using a static variable to track the initial newline. --

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

2018-06-04 Thread Ján Tomko
On Mon, Jun 04, 2018 at 03:52:31PM +0800, Yi Min Zhao wrote: 在 2018/6/2 下午10:15, 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

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

2018-06-04 Thread Ján Tomko
On Mon, Jun 04, 2018 at 01:57:04PM +0800, Yi Min Zhao wrote: 在 2018/6/2 下午10:16, 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

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

2018-06-04 Thread Ján Tomko
On Mon, Jun 04, 2018 at 02:05:17PM +0800, Yi Min Zhao wrote: 在 2018/6/2 下午10:18, 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 Revi

[libvirt] [PATCH v1 00/18] use VIR_AUTOFREE in src/util

2018-06-04 Thread Sukrit Bhatnagar
This series of patches modifies some files in src/util to use VIR_AUTOFREE for automatic freeing of memory and get rid of some VIR_FREE macro invocations. Sukrit Bhatnagar (18): add macros for implementing automatic cleanup functionality use VIR_AUTOFREE in src/util/virarptable.c use VIR_AUT

[libvirt] [PATCH v1 02/18] use VIR_AUTOFREE in src/util/virarptable.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virarptable.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/util/virarptable.c b/src/util/virarptable.c index c0e90dc..f53a479 100644 --- a/src/util/virarptabl

[libvirt] [PATCH v1 01/18] add macros for implementing automatic cleanup functionality

2018-06-04 Thread Sukrit Bhatnagar
New macros are added to src/util/viralloc.h which help in adding cleanup attribute to variable declarations. Signed-off-by: Sukrit Bhatnagar --- src/util/viralloc.h | 69 + 1 file changed, 69 insertions(+) diff --git a/src/util/viralloc.h b/sr

[libvirt] [PATCH v1 06/18] use VIR_AUTOFREE in src/util/viraudit.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/viraudit.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/viraudit.c b/src/util/viraudit.c index 0085dc3..a49d458 100644 --- a/src/util/viraudit.c +++ b/src/util/

[libvirt] [PATCH v1 03/18] use VIR_AUTOFREE in src/util/virauth.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virauth.c | 60 +++--- 1 file changed, 21 insertions(+), 39 deletions(-) diff --git a/src/util/virauth.c b/src/util/virauth.c index adb093e..089a

[libvirt] [PATCH v1 08/18] use VIR_AUTOFREE in src/util/vircgroup.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/vircgroup.c | 526 ++- 1 file changed, 179 insertions(+), 347 deletions(-) diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 0a31947

[libvirt] [PATCH v1 04/18] use VIR_AUTOFREE in src/util/virauthconfig.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virauthconfig.c | 34 -- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c index 91c9c0c..66f7f7

[libvirt] [PATCH v1 17/18] use VIR_AUTOFREE in src/util/virfirewall.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virfirewall.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index 10c370a..568612c 100644 --- a/src/util/virfi

[libvirt] [PATCH v1 09/18] use VIR_AUTOFREE in src/util/virfcp.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virfcp.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/util/virfcp.c b/src/util/virfcp.c index 7660ba7..b703744 100644 --- a/src/util/virfcp.c +++

[libvirt] [PATCH v1 05/18] use VIR_AUTOFREE in src/util/iohelper.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/iohelper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/util/iohelper.c b/src/util/iohelper.c index bb8a8dd..f7794dc 100644 --- a/src/util/iohelper.c +++ b/src/util

[libvirt] [PATCH v1 16/18] use VIR_AUTOFREE in src/util/virfilecache.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virfilecache.c | 35 +++ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/src/util/virfilecache.c b/src/util/virfilecache.c index dab7216..49049b7

[libvirt] [PATCH v1 07/18] use VIR_AUTOFREE in src/util/virbuffer.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virbuffer.c | 33 - 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index 3d6defb..5152f73 100644 ---

[libvirt] [PATCH v1 18/18] use VIR_AUTOFREE in src/util/virhook.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virhook.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/util/virhook.c b/src/util/virhook.c index facd74a..51f0eb5 100644 --- a/src/util/virhook.c +++

[libvirt] [PATCH v1 10/18] use VIR_AUTOFREE in src/util/virdnsmasq.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virdnsmasq.c | 116 +- 1 file changed, 39 insertions(+), 77 deletions(-) diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index 492dcad

[libvirt] [PATCH v1 11/18] use VIR_AUTOFREE in src/util/vireventpoll.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/vireventpoll.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/util/vireventpoll.c b/src/util/vireventpoll.c index 81ecab4..13d278d 100644 --- a/src/util/vireventp

[libvirt] [PATCH v1 12/18] use VIR_AUTOFREE in src/util/virdbus.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virdbus.c | 28 +++- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/src/util/virdbus.c b/src/util/virdbus.c index ba8b684..66dbe41 100644 --- a/src/util/v

[libvirt] [PATCH v1 14/18] use VIR_AUTOFREE in src/util/virfile.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virfile.c | 303 + 1 file changed, 99 insertions(+), 204 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 523241f..52b

[libvirt] [PATCH v1 15/18] use VIR_AUTOFREE in src/util/virconf.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virconf.c | 42 -- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/src/util/virconf.c b/src/util/virconf.c index e0a3fd1..7dd8820 100644 -

[libvirt] [PATCH v1 13/18] use VIR_AUTOFREE in src/util/virfdstream.c

2018-06-04 Thread Sukrit Bhatnagar
Modify code to use VIR_AUTOFREE macro wherever required. Signed-off-by: Sukrit Bhatnagar --- src/util/virfdstream.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c index e4973a2..e7befbc 100644 --- a/src/util/virfdstream.c +++

[libvirt] [PATCH] qemu: Fix domain resume after failed migration

2018-06-04 Thread Jiri Denemark
Libvirt relies on being able to kill the destination domain and resume the source one during migration until we called "cont" on the destination. Unfortunately, QEMU automatically activates block devices at the end of migration even when it's called with -S. This wasn't a big issue in the past sinc

Re: [libvirt] [PATCH v6 0/9] x86: Secure Encrypted Virtualization (AMD)

2018-06-04 Thread Brijesh Singh
On 05/29/2018 10:28 AM, Brijesh Singh wrote: ... On 05/28/2018 05:06 AM, Erik Skultety wrote: On Wed, May 23, 2018 at 04:18:25PM -0500, Brijesh Singh wrote: This patch series provides support for launching an encrypted guest using AMD's new Secure Encrypted  Virtualization (SEV) feature.

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

2018-06-04 Thread Cornelia Huck
On Mon, 4 Jun 2018 16:17:52 +0200 Ján Tomko wrote: > On Mon, Jun 04, 2018 at 02:05:17PM +0800, Yi Min Zhao wrote: > > > > > >在 2018/6/2 下午10:18, 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

[libvirt] [PATCH v9 09/17] security: Label the external swtpm with SELinux labels

2018-06-04 Thread Stefan Berger
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 file and process labels now look as follows: Directory: /var/lib/l

[libvirt] [PATCH v9 03/17] util: Implement virFileChownFiles()

2018-06-04 Thread Stefan Berger
Implement virFileChownFiles() which changes file ownership of all files in a given directory. Signed-off-by: Stefan Berger Reviewed-by: John Ferlan Reviewed-by: Ján Tomko --- src/libvirt_private.syms | 1 + src/util/virfile.c | 55 src/ut

[libvirt] [PATCH v9 01/17] conf: Add support for external swtpm TPM emulator to domain XML

2018-06-04 Thread Stefan Berger
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 formatter. Signed-off-by: Stefan Berger Reviewed-by: John Ferla

[libvirt] [PATCH v9 12/17] news: Update news with new TPM emulator feature

2018-06-04 Thread Stefan Berger
Signed-off-by: Stefan Berger Reviewed-by: Ján Tomko --- docs/news.xml | 13 + 1 file changed, 13 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index a2829eff6a..05a5b76e63 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -33,6 +33,19 @@ --> + + + +

[libvirt] [PATCH v9 06/17] qemu: Extend QEMU with external TPM support

2018-06-04 Thread Stefan Berger
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 for the device. Further, the external TPM needs storage on the ho

[libvirt] [PATCH v9 05/17] qemu: Extend qemu_conf with tpm-emulator support

2018-06-04 Thread Stefan Berger
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.am and the RPM spec file libvirt.spec.in. Signed-off-by: Stefan B

[libvirt] [PATCH v9 17/17] conf: Use virDomainChrSourceDefClear() rather than VIR_FREE()

2018-06-04 Thread Stefan Berger
Signed-off-by: Stefan Berger Reviewed-by: Ján Tomko --- src/conf/domain_conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index d99fa8f297..899fd3021d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -264

[libvirt] [PATCH v9 13/17] security: Add swtpm paths to the domain's AppArmor profile

2018-06-04 Thread Stefan Berger
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 --- examples/apparmor/libvirt-qemu | 3 +++ src/security/virt-aa-helper

[libvirt] [PATCH v9 07/17] qemu: Add support for external swtpm TPM emulator

2018-06-04 Thread Stefan Berger
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 manufacturing of a TPM and create certificates for it and writ

[libvirt] [PATCH v9 00/17] Add support for TPM emulator

2018-06-04 Thread Stefan Berger
This series of patches adds support for the TPM emulator backend that is available in QEMU and based on swtpm + libtpms. It allows to attach a TPM 1.2 or 2.0 to a QEMU VM. sVirt labels are used for labeling the swtpm process, its Unix socket, and log file with the same label that the QEMU process g

[libvirt] [PATCH v9 10/17] conf: Add support for choosing emulation of a TPM 2.0

2018-06-04 Thread Stefan Berger
This patch extends the TPM's device XML with TPM 2.0 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:c597,c632 tss 18477 11.8 0.0 28364 3868 ? Rs 11

[libvirt] [PATCH v9 04/17] security: Add DAC and SELinux security for tpm-emulator

2018-06-04 Thread Stefan Berger
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-emulator will remove the Unix socket when it terminates. Signed-off

[libvirt] [PATCH v9 14/17] qemu: Run swtpm_setup in unprivileged mode for a TPM 2.0

2018-06-04 Thread Stefan Berger
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/stefanberger/swtpm/pull/63 Signed-off-by: Stefan Berger Reviewed-by

[libvirt] [PATCH v9 16/17] conf: Use resrc=tpm in case of TPM passthrough following docs

2018-06-04 Thread Stefan Berger
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 Reviewed-by: Ján Tomko --- src/conf/domain_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conf/domain_audit.c b/src/conf/d

[libvirt] [PATCH v9 11/17] qemu: Add swtpm to emulator cgroup

2018-06-04 Thread Stefan Berger
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 configure the emulator cgroup. The PID file is created in /var/run

[libvirt] [PATCH v9 08/17] tests: Add test cases for external swtpm TPM emulator

2018-06-04 Thread Stefan Berger
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 Reviewed-by: Ján Tomko --- .../tpm-emulator.x86_64-latest.args| 33 ++ tests/qemuxml2argvtest.c

[libvirt] [PATCH v9 15/17] conf: Audit TPM emulator device at domain startup

2018-06-04 Thread Stefan Berger
Extend the existing auditing with auditing for the TPM emulator. Signed-off-by: Stefan Berger Reviewed-by: Ján Tomko --- docs/auditlog.html.in | 2 +- src/conf/domain_audit.c | 16 +--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/docs/auditlog.html.in b/docs/a

[libvirt] [PATCH v9 02/17] qemu: Extend QEMU capabilities with 'tpm-emulator'

2018-06-04 Thread Stefan Berger
Extend the QEMU capabilities with tpm-emulator support. Signed-off-by: Stefan Berger Reviewed-by: John Ferlan Reviewed-by: Ján Tomko --- src/qemu/qemu_capabilities.c | 5 + src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.11.

[libvirt] [RFC] proposal for libiscsi storage pool

2018-06-04 Thread Clementine Hayat
Hi everybody! I am starting this thread to discuss a new storage pool backend for iSCSI using libiSCSI. There already is an iSCSI backend, however, it uses iscsiadm binary to execute the desired operation. The binary can be spawned multiple times during single execution of an API. This is subopt

Re: [libvirt] [PATCH 1/8] qemu: split out qemuBuildVsockDevStr

2018-06-04 Thread John Ferlan
On 05/30/2018 10:57 AM, Ján Tomko wrote: > Split out the device string building to allow reusal in hotplug. s/reusal in hotplug/reuse for hotplug/ > > https://bugzilla.redhat.com/show_bug.cgi?id=1291851 > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_command.c | 36 ++

Re: [libvirt] [PATCH 2/8] qemuBuildVsockDevStr: allow passing a fdprefix

2018-06-04 Thread John Ferlan
$subj: qemu: Add prefix for vsock vhostfd On 05/30/2018 10:57 AM, Ján Tomko wrote: > A string prefix for the file descriptor name. Domain startup consider: Alter qemuBuildVsockDevStr to allow passing a prefix for the vhostfd file descriptor name. > uses the numeric value of fd without a prefi

Re: [libvirt] [PATCH 3/8] export virDomainVsockDefFree

2018-06-04 Thread John Ferlan
On 05/30/2018 10:57 AM, Ján Tomko wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1291851 > > Signed-off-by: Ján Tomko > --- > src/libvirt_private.syms | 1 + > 1 file changed, 1 insertion(+) > I think this should just be merged w/ patch 5 since that's where it's first used... Reviewed

Re: [libvirt] [PATCH 4/8] qemu: export vsock-related functions

2018-06-04 Thread John Ferlan
On 05/30/2018 10:57 AM, Ján Tomko wrote: > Export qemuAssignDeviceVsockAlias, qemuBuildVsockDevStr > and qemuProcessOpenVhostVsock for reuse in hotplug. > > https://bugzilla.redhat.com/show_bug.cgi?id=1291851 > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_alias.c | 2 +- > src/qemu/qemu

Re: [libvirt] [PATCH 5/8] qemu: implement vsock hotplug

2018-06-04 Thread John Ferlan
On 05/30/2018 10:57 AM, Ján Tomko wrote: > Allow hotplugging the vsock device. > > https://bugzilla.redhat.com/show_bug.cgi?id=1291851 > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_driver.c | 9 ++- > src/qemu/qemu_hotplug.c | 70 > +

Re: [libvirt] [PATCH 8/8] qemu: implement vsock coldplug/coldunplug

2018-06-04 Thread John Ferlan
On 05/30/2018 10:57 AM, Ján Tomko wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1291851 > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_driver.c | 22 -- > 1 file changed, 20 insertions(+), 2 deletions(-) > Reviewed-by: John Ferlan John -- libvir-list mailing

Re: [libvirt] [PATCH 7/8] qemu: implement vsock hotunplug

2018-06-04 Thread John Ferlan
On 05/30/2018 10:57 AM, Ján Tomko wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=1291851 > > Signed-off-by: Ján Tomko > --- > src/qemu/qemu_driver.c | 5 +++- > src/qemu/qemu_hotplug.c | 68 > - > src/qemu/qemu_hotplug.h | 3 +++ > 3 fi

Re: [libvirt] [PATCH 6/8] conf: introduce virDomainVsockDefEquals

2018-06-04 Thread John Ferlan
On 05/30/2018 10:57 AM, Ján Tomko wrote: > Introduce a function for comparing two vsock definitions. > > https://bugzilla.redhat.com/show_bug.cgi?id=1291851 > > Signed-off-by: Ján Tomko > --- > src/conf/domain_conf.c | 18 ++ > src/conf/domain_conf.h | 3 +++ > src/libvir

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

2018-06-04 Thread John Ferlan
[...] >> >> True virsh uses NULL so it's fine; however, I was thinking about more >> generically - why would a Register routine with a callback to free >> memory free the memory upon successful register. >> >> I'm still not sure I understand why the API cannot return a failure, but >> Daniel says

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

2018-06-04 Thread Daniel P . Berrangé
On Thu, Apr 26, 2018 at 08:16:54PM -0400, John Ferlan wrote: > > > On 04/26/2018 12:09 PM, Marc Hartmayer wrote: > > On Thu, Apr 26, 2018 at 05:06 PM +0200, John Ferlan > > wrote: > >> On 04/12/2018 08:40 AM, Marc Hartmayer wrote: > >>> The commit 'close callback: move it to driver' (88f09b75eb

Re: [libvirt] [tck PATCH v2 02/13] scripts: strip quotes from URI before checking it

2018-06-04 Thread Daniel P . Berrangé
On Fri, Jun 01, 2018 at 04:04:09PM -0400, Laine Stump wrote: > On 05/21/2018 12:46 PM, Daniel P. Berrangé wrote: > > The config file may have the URI listed with or without quotes, and the > > nwfilter tests didn't strip quotes before checking against the > > whitelisted URI. > > I'm curious what

Re: [libvirt] [tck PATCH v2 07/13] scripts: switch to using luks encryption with QEMU

2018-06-04 Thread Daniel P . Berrangé
On Fri, Jun 01, 2018 at 09:52:50PM -0400, Laine Stump wrote: > On 06/01/2018 09:06 PM, Laine Stump wrote: > > On 05/21/2018 12:46 PM, Daniel P. Berrangé wrote: > >> The ability to use qcow legacy encryption is disabled with QEMU for a > >> long time. Switch to using luks encryption, although this i

Re: [libvirt] [tck PATCH] Don't assume the domain's network interface tap device is named "vnet0"

2018-06-04 Thread Daniel P . Berrangé
On Mon, Jun 04, 2018 at 09:52:52AM -0400, Laine Stump wrote: > Some of the tests perform operations on the tap device of the test > domain's network interface. They mostly assume that this tap device is > named "vnet0", which is the case if there is no other domain running > on the host, but isn't

Re: [libvirt] [PATCH] Add Virtlyst web application to apps.html

2018-06-04 Thread John Ferlan
Missing the SoB. >From https://libvirt.org/hacking.html ... Contributors to libvirt projects must assert that they are in compliance with the Developer Certificate of Origin 1.1. This is achieved by adding a "Signed-off-by" line containing the contributor's name and e-mail to every commit message

[libvirt] [PATCH] qemu: check for QEMU_CAPS_DEVICE_VHOST_VSOCK

2018-06-04 Thread Ján Tomko
My commit b8b42ca added support for formatting the vsock command line without actually checking if it's supported. Add it to the per-device validation function. https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Reported-by: John Ferlan Signed-off-by: Ján Tomko --- src/qemu/qemu_domain.c |

Re: [libvirt] [PATCH V2] tests: xmconfigtest: add tests for cmdline formating

2018-06-04 Thread John Ferlan
On 05/23/2018 05:31 PM, Jim Fehlig wrote: > Commit 656151bf fixed formatting of the element. Perhaps it > would have been noticed and fixed earlier if we had a test. With this > change, all possible cases of formating from xmconfig are formatting > covered > > 1. no 'extra=' or 'root=' in x

Re: [libvirt] [PATCH 5/8] qemu: implement vsock hotplug

2018-06-04 Thread Ján Tomko
On Mon, Jun 04, 2018 at 12:13:07PM -0400, John Ferlan wrote: On 05/30/2018 10:57 AM, Ján Tomko wrote: Allow hotplugging the vsock device. https://bugzilla.redhat.com/show_bug.cgi?id=1291851 Signed-off-by: Ján Tomko --- src/qemu/qemu_driver.c | 9 ++- src/qemu/qemu_hotplug.c | 70

Re: [libvirt] [PATCH] Add Virtlyst web application to apps.html

2018-06-04 Thread Daniel Nicoletti
Thanks, just finishing the fixes and will send it again. Hmm I didn know about NWFilter feature, will leave that as a feature request that I need to study :) 2018-06-04 15:23 GMT-03:00 John Ferlan : > Missing the SoB. > > From https://libvirt.org/hacking.html > > ... > Contributors to libvirt pr

  1   2   >