[PATCH v4 0/4] Drop deprecated floppy config & bogus -drive if=T

2021-03-10 Thread Markus Armbruster
v4: * PATCH 3: Move a declaration into a loop [Richard] * PATCH 4: Drop a superfluous call to drive_check_orphaned() [Daniel], fix comments [John] v3: * PATCH 1: New [Daniel] v2: * Rebased, straightforward conflict with commit f5d33dd51f "hw/block/fdc: Remove the check_media_rate property"

[PATCH v4 2/4] fdc: Drop deprecated floppy configuration

2021-03-10 Thread Markus Armbruster
Drop the crap deprecated in commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" (v5.1.0). Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrangé --- docs/system/deprecated.rst | 49 --- docs/system/removed-features.rst | 49 +++ hw/block/fdc.c

[PATCH v4 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common()

2021-03-10 Thread Markus Armbruster
The previous commit rendered the name fdctrl_connect_drives() somewhat misleading. Get rid of it by inlining the (now pretty simple) function into its only caller. Signed-off-by: Markus Armbruster Reviewed-by: Daniel P. Berrangé --- hw/block/fdc.c | 23 --- 1 file changed,

[PATCH v4 4/4] blockdev: Drop deprecated bogus -drive interface type

2021-03-10 Thread Markus Armbruster
Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate -drive with bogus interface type" (v5.1.0). drive_check_orphaned() no longer depends on qemu_create_cli_devices(). Call it right after board initialization for clarity. Signed-off-by: Markus Armbruster ---

[PATCH v4 1/4] docs/system/deprecated: Fix note on fdc drive properties

2021-03-10 Thread Markus Armbruster
Commit 4a27a638e7 "fdc: Deprecate configuring floppies with -global isa-fdc" actually deprecated any use of floppy controller driver properties, not just with -global. Correct the deprecation note accordingly. Fixes: 4a27a638e718b445648de6b27c709353551d9b44 Signed-off-by: Markus Armbruster

Re: [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

2021-03-10 Thread Peter Krempa
On Wed, Mar 10, 2021 at 18:30:44 +0100, Kevin Wolf wrote: > Am 10.03.2021 um 15:31 hat Paolo Bonzini geschrieben: > > On 10/03/21 15:22, Peter Krempa wrote: [...] > The keyval parser would create a list if multiple values are given for > the same key. Some care needs to be taken to avoid mixing

Re: [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type

2021-03-10 Thread Markus Armbruster
John Snow writes: > On 3/9/21 11:12 AM, Markus Armbruster wrote: >> Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate >> -drive with bogus interface type" (v5.1.0). >> >> Signed-off-by: Markus Armbruster >> --- >> docs/system/deprecated.rst | 7 -- >>

Re: [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type

2021-03-10 Thread John Snow
On 3/9/21 11:12 AM, Markus Armbruster wrote: Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate -drive with bogus interface type" (v5.1.0). Signed-off-by: Markus Armbruster --- docs/system/deprecated.rst | 7 -- docs/system/removed-features.rst | 7 ++

[PATCH] vm : forbid to start a removing vm

2021-03-10 Thread Hogan Wang
From: Zhuang Shengen When a vm is doing migration phase confirm, and then start it concurrently, it will lead to the vm out of libvirtd control. Cause Analysis: 1. thread1 migrate vm out. 2. thread2 start the migrating vm. 3. thread1 remove vm from domain list after migrate success. 4. thread2

Re: [PATCH v2 04/12] qemu: capabilities: Introduce QEMU_CAPS_OBJECT_QAPIFIED

2021-03-10 Thread Ján Tomko
On a Wednesday in 2021, Peter Krempa wrote: Starting from qemu-6.0 the parameters of -object/object-add are formally described by the QAPI schema. Additionally this changes the nesting of the properties as the 'props' nested object will be flattened to the parent. We'll need to detect whether

Re: [PATCH v2 03/12] qemu: command: Generate commandline of iothread objects JSON

2021-03-10 Thread Ján Tomko
On a Wednesday in 2021, Peter Krempa wrote: The commandline generator for 'iothread' objects has a private implementation of the properties. Convert it to JSON so that it can be later validated. Signed-off-by: Peter Krempa --- src/qemu/qemu_command.c | 18 +++--- 1 file changed, 11

Re: [PATCH v2 02/12] qemu: command: Generate commandline of 'sev0' sev-guest object via JSON

2021-03-10 Thread Ján Tomko
On a Wednesday in 2021, Peter Krempa wrote: While the 'sev0' sev-guest object will never be hotplugged, but we want to generate it through JSON so that we'll be able to validate all parameters of '-object' against the QAPI schema once 'object-add' is qapified in qemu. Signed-off-by: Peter

Re: [PATCH v2 01/12] qemu: command: Generate commandline of 'masterKey0' secret via JSON

2021-03-10 Thread Ján Tomko
On a Wednesday in 2021, Peter Krempa wrote: While the 'masterKey0' secret object will never be hotplugged we want to generate it through JSON so that we'll be able to validate all parameters of '-object' against the QAPI schema once 'object-add' is qapified in qemu. Signed-off-by: Peter Krempa

Re: [PATCH] XML validate that 'ramfb' has no address

2021-03-10 Thread Ján Tomko
On a Friday in 2021, Kristina Hanicova wrote: With this, XML fails if config video type 'ramfb' contains address, since address is not supported for 'ramfb' video devices. Previously it didn't raise error. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1891416 Signed-off-by: Kristina

Re: [PATCH] virQEMUCapsInitQMPArch: Refactor cleanup

2021-03-10 Thread Ján Tomko
On a Wednesday in 2021, Yi Li wrote: Switch to using the 'g_auto*' helpers. Signed-off-by: Yi Li --- src/qemu/qemu_capabilities.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 3/3] selinux: Remove 'make' dependency

2021-03-10 Thread Neal Gompa
On Wed, Mar 10, 2021 at 7:43 AM Nikola Knazekova wrote: > > From: Vit Mojzis > > Compile the policy using a shell script executed by meson. > > Signed-off-by: Vit Mojzis > --- > libvirt.spec.in | 12 > meson.build | 12 >

Re: [PATCH 3/4] syntax-check: Update list of gethostname exceptions

2021-03-10 Thread Ján Tomko
On a Tuesday in 2021, Michal Privoznik wrote: The only place where gethostname() is acceptable is in virGetHostnameImpl() which lives in src/util/virutil.c. Reflect this in the list of exceptions for the syntax-check rule. Signed-off-by: Michal Privoznik --- build-aux/syntax-check.mk | 2 +- 1

Re: [PATCH 2/4] virutil: Do not use g_get_host_name() to obtain hostname

2021-03-10 Thread Ján Tomko
On a Tuesday in 2021, Michal Privoznik wrote: The problem is that g_get_host_name() caches the hostname in a thread local variable. Therefore, it doesn't reflect any subsequent hostname changes. While this might be acceptable for logs where the hostname is printed exactly once when the libvirtd

Re: [PATCH 16/16] util: virstring: Remove virStrncpy

2021-03-10 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: The function is now unused and motivated users to write crazy parsers which were hard to understand, had pointless error paths just to avoid few memory allocations. Remove the function as we're fine with g_strndup and virStrcpy. Signed-off-by: Peter

Re: [PATCH 15/16] virNetLibsshAuthenticatePrivkeyCb: Use virStrcpy instead of virStrncpy

2021-03-10 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: We already assume that 'retr_passphrase.result' is a string, thus we can use virStrcpy instead. Signed-off-by: Peter Krempa --- src/rpc/virnetlibsshsession.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) Reviewed-by: Ján Tomko Jano

Re: [PATCH 14/16] virNetLibsshAuthenticatePrivkeyCb: Use g_autofree for 'actual_prompt'

2021-03-10 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: So that the 'error' label can be removed. Signed-off-by: Peter Krempa --- src/rpc/virnetlibsshsession.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 13/16] xenParseXLUSB: Rewrite to avoid virStrncpy

2021-03-10 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: Signed-off-by: Peter Krempa --- src/libxl/xen_xl.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc Description: PGP signature

Re: [PATCH 12/16] xenParseXLUSBController: Avoid use of virStrndup

2021-03-10 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: Use g_strndup with a freed buffer instead of the more complex approach using virStrndup. s/virStrndup/virStrncpy/ here and in the commit summary. Signed-off-by: Peter Krempa --- src/libxl/xen_xl.c | 51 ++

Re: RFC: do we want/need the "Ptr" typedefs for internal code ?

2021-03-10 Thread Daniel P . Berrangé
On Wed, Mar 10, 2021 at 06:41:35PM +0100, Michal Privoznik wrote: > On 3/10/21 4:36 PM, Michal Privoznik wrote: > > On 3/9/21 6:44 PM, Daniel P. Berrangé wrote: > > > One of the conventions we have had since the early days of libvirt is > > > that every struct typedef, has a corresponding "Ptr"

Re: [PATCH 11/16] xenParseXLChannel: Use g_strndup instead of virStrndup

2021-03-10 Thread Ján Tomko
s/virStrndup/virStrncpy/ On a Wednesday in 2021, Ján Tomko wrote: On a Tuesday in 2021, Peter Krempa wrote: Make the temporary string a autofree-ing pointer and copy the contents. an Signed-off-by: Peter Krempa --- src/libxl/xen_xl.c | 9 +++-- 1 file changed, 3 insertions(+), 6

Re: [PATCH 11/16] xenParseXLChannel: Use g_strndup instead of virStrndup

2021-03-10 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: Make the temporary string a autofree-ing pointer and copy the contents. an Signed-off-by: Peter Krempa --- src/libxl/xen_xl.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) Reviewed-by: Ján Tomko Jano signature.asc

Re: RFC: do we want/need the "Ptr" typedefs for internal code ?

2021-03-10 Thread Peter Krempa
On Wed, Mar 10, 2021 at 18:41:35 +0100, Michal Privoznik wrote: > On 3/10/21 4:36 PM, Michal Privoznik wrote: > > On 3/9/21 6:44 PM, Daniel P. Berrangé wrote: > > > One of the conventions we have had since the early days of libvirt is > > > that every struct typedef, has a corresponding "Ptr"

Re: [PATCH 10/16] openvzReadNetworkConf: Rework parser

2021-03-10 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: Rewrite so that the parser doesn't use virStrncpy by employing g_strsplit. Signed-off-by: Peter Krempa --- src/openvz/openvz_conf.c | 77 ++-- 1 file changed, 26 insertions(+), 51 deletions(-) diff --git

Re: RFC: do we want/need the "Ptr" typedefs for internal code ?

2021-03-10 Thread Michal Privoznik
On 3/10/21 4:36 PM, Michal Privoznik wrote: On 3/9/21 6:44 PM, Daniel P. Berrangé wrote: One of the conventions we have had since the early days of libvirt is that every struct typedef, has a corresponding "Ptr" typedef too. For example typedef struct _virDomainDef virDomainDef;

Re: [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

2021-03-10 Thread Kevin Wolf
Am 10.03.2021 um 15:31 hat Paolo Bonzini geschrieben: > On 10/03/21 15:22, Peter Krempa wrote: > > I've stumbled upon a regression with this patchset applied: > > > > error: internal error: process exited while connecting to monitor: > > qemu-system-x86_64: -object > >

[PATCH v2] qemu: don't raise error upon interface update without for in coalesce

2021-03-10 Thread Kristina Hanicova
With this, incomplete XML without for in coalesce won't raise error as before. It will leave the coalesce parameter empty, thanks to passing it as a parameter and return an integer to indicate error state - previously it returned pointer (or NULL for both error and incomplete XML). I also added

Re: [PATCH v2 0/2] XML non-virtio video device validation

2021-03-10 Thread Kristina Hanicova
Sorry everyone, it should have been v1. :) On Wed, Mar 10, 2021 at 5:43 PM Kristina Hanicova wrote: > > Kristina Hanicova (2): > move virDomainCheckVirtioOptionsAreAbsent a few lines forward > XML validate that non-virtio video devices have none virtio options > >

[PATCH v2 2/2] XML validate that non-virtio video devices have none virtio options

2021-03-10 Thread Kristina Hanicova
With this, XML fails if non-virtio video devices have virtio options. Previously it didn't raise error. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1922093 Signed-off-by: Kristina Hanicova --- src/conf/domain_validate.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH v2 0/2] XML non-virtio video device validation

2021-03-10 Thread Kristina Hanicova
Kristina Hanicova (2): move virDomainCheckVirtioOptionsAreAbsent a few lines forward XML validate that non-virtio video devices have none virtio options src/conf/domain_validate.c | 60 -- 1 file changed, 32 insertions(+), 28 deletions(-) -- 2.29.2

[PATCH v2 1/2] move virDomainCheckVirtioOptionsAreAbsent a few lines forward

2021-03-10 Thread Kristina Hanicova
Moving this function in order to use it in the next patch before its previous declaration. Signed-off-by: Kristina Hanicova --- src/conf/domain_validate.c | 56 +++--- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/conf/domain_validate.c

[PATCH 2/2] virtlo(g|ck)d: Fix exec-restart

2021-03-10 Thread Peter Krempa
Commit 94e45d1042e broke exec-restart of virtlogd and virtlockd as the code waiting for the daemon shutdown closed the daemons before exec-restarting. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1912243 Fixes: 94e45d1042e Signed-off-by: Peter Krempa --- src/locking/lock_daemon.c | 2

[PATCH 1/2] virnetdaemon: Introduce virNetDaemonQuitExecRestart

2021-03-10 Thread Peter Krempa
Recent changes which meant to fix daemon shutdown broke the exec-restart capability of virtlogd and virtlockd, since the code actually closed all the sockets and shut down all the internals. Add virNetDaemonQuitExecRestart, which requests a shutdown of the process, but keeps all the services open

[PATCH 0/2] Fix exec-restart of virtlogd and virtlockd

2021-03-10 Thread Peter Krempa
Peter Krempa (2): virnetdaemon: Introduce virNetDaemonQuitExecRestart virtlo(g|ck)d: Fix exec-restart src/libvirt_remote.syms | 1 + src/locking/lock_daemon.c | 2 +- src/logging/log_daemon.c | 2 +- src/rpc/virnetdaemon.c| 19 +++ src/rpc/virnetdaemon.h| 1 +

Re: [PATCH 09/16] xenParseSxprSound: Refactor parsing of model list

2021-03-10 Thread Ján Tomko
On a Tuesday in 2021, Peter Krempa wrote: Copy the input string so that we don't have to use a static buffer and virStrncpy. Signed-off-by: Peter Krempa --- src/libxl/xen_common.c | 46 +- 1 file changed, 19 insertions(+), 27 deletions(-) Reviewed-by:

Re: RFC: do we want/need the "Ptr" typedefs for internal code ?

2021-03-10 Thread Michal Privoznik
On 3/9/21 6:44 PM, Daniel P. Berrangé wrote: One of the conventions we have had since the early days of libvirt is that every struct typedef, has a corresponding "Ptr" typedef too. For example typedef struct _virDomainDef virDomainDef; typedef virDomainDef *virDomainDefPtr;

Re: [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

2021-03-10 Thread Peter Krempa
On Wed, Mar 10, 2021 at 15:31:57 +0100, Paolo Bonzini wrote: > On 10/03/21 15:22, Peter Krempa wrote: > > I've stumbled upon a regression with this patchset applied: > > > > error: internal error: process exited while connecting to monitor: > > qemu-system-x86_64: -object > >

Re: [PATCH 0/2] fix crash on invalid construction of a gvariant

2021-03-10 Thread Pavel Hrdina
On Wed, Mar 10, 2021 at 02:40:34PM +0100, Peter Krempa wrote: > Peter Krempa (2): > virSystemdCreateMachine: Use proper format string for uint64_t when > constructing gvariant > virsystemdtest: Call at least one virSystemdCreateMachine with > 'maxthreads' > 0 Reviewed-by: Pavel Hrdina

Re: [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

2021-03-10 Thread Paolo Bonzini
On 10/03/21 15:22, Peter Krempa wrote: I've stumbled upon a regression with this patchset applied: error: internal error: process exited while connecting to monitor: qemu-system-x86_64: -object memory-backend-ram,id=pc.ram,size=1048576000,host-nodes=0,policy=bind: Invalid parameter type for

Re: [PATCH v3 00/30] qapi/qom: QAPIfy --object and object-add

2021-03-10 Thread Peter Krempa
On Mon, Mar 08, 2021 at 17:54:10 +0100, Kevin Wolf wrote: > This series adds a QAPI type for the properties of all user creatable > QOM types and finally makes the --object command line option (in all > binaries) and the object-add monitor commands (in QMP and HMP) use the > new ObjectOptions

[PATCH 2/2] virsystemdtest: Call at least one virSystemdCreateMachine with 'maxthreads' > 0

2021-03-10 Thread Peter Krempa
There was a bug in the code adding TasksMax property. It remained undetected because all tests used '0' for @maxthreads. Signed-off-by: Peter Krempa --- tests/virsystemdtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c

[PATCH 0/2] fix crash on invalid construction of a gvariant

2021-03-10 Thread Peter Krempa
Peter Krempa (2): virSystemdCreateMachine: Use proper format string for uint64_t when constructing gvariant virsystemdtest: Call at least one virSystemdCreateMachine with 'maxthreads' > 0 src/util/virsystemd.c | 5 +++-- tests/virsystemdtest.c | 2 +- 2 files changed, 4

[PATCH 1/2] virSystemdCreateMachine: Use proper format string for uint64_t when constructing gvariant

2021-03-10 Thread Peter Krempa
g_variant_new_parsed uses '%t' for a uint64_t rather than printf-like %llu. Additionally ensure that the passed value is a uint64_t since the argument used is a 'unsigned int'. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1937287 Fixes: bf5f2ed09c2 Signed-off-by: Peter Krempa ---

[PATCH 1/3] Add SELinux policy for virt

2021-03-10 Thread Nikola Knazekova
SELinux policy was created for: Hypervisor drivers: - virtqemud (QEMU/KVM) - virtlxcd (LXC) - virtvboxd (VirtualBox) Secondary drivers: - virtstoraged (host storage mgmt) - virtnetworkd (virtual network mgmt) - virtinterface (network interface mgmt) - virtnodedevd (physical device mgmt) -

[PATCH 3/3] selinux: Remove 'make' dependency

2021-03-10 Thread Nikola Knazekova
From: Vit Mojzis Compile the policy using a shell script executed by meson. Signed-off-by: Vit Mojzis --- libvirt.spec.in | 12 meson.build | 12 selinux/compile_policy.sh | 39 +++ selinux/meson.build

[PATCH 2/3] [DO NOT MERGE] Install selinux-policy-devel in test environment

2021-03-10 Thread Nikola Knazekova
From: Vit Mojzis Temporary commit for testing purposes. The change needs to be done in https://gitlab.com/libvirt/libvirt-ci/-/blob/master/guests/lcitool/lcitool/ansible/vars/projects/libvirt.yml Signed-off-by: Vit Mojzis --- ci/containers/ci-centos-8.Dockerfile | 1 +

Add SELinux policy for Virt

2021-03-10 Thread Nikola Knazekova
Hi, I created SELinux policy for Libvirt drivers, as part of Decentralized SELinux Policy (DSP) project. DSP guidelines is available: https://fedoraproject.org/wiki/SELinux/IndependentPolicy Discussion about the first version of SELinux policy for Libvirt is available on gitlab:

Libvirt has been accepted into GSoC 2021

2021-03-10 Thread Michal Privoznik
Dear list, let me share great news: just like in the past years, libvirt is going to be part of Google Summer of Code also this year [1]. We can expect interested students to show up and discuss possible projects to work on. However, there are some changes made to this year's run [2]: 1)

Re: [PATCH v3 3/4] fdc: Inline fdctrl_connect_drives() into fdctrl_realize_common()

2021-03-10 Thread Markus Armbruster
Richard Henderson writes: > On 3/9/21 8:12 AM, Markus Armbruster wrote: >> @@ -2565,6 +2551,7 @@ static void fdctrl_realize_common(DeviceState *dev, >> FDCtrl *fdctrl, >> Error **errp) >> { >> int i, j; >> +FDrive *drive; >> static int

Re: [PATCH v3 4/4] blockdev: Drop deprecated bogus -drive interface type

2021-03-10 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Tue, Mar 09, 2021 at 05:12:13PM +0100, Markus Armbruster wrote: >> Drop the crap deprecated in commit a1b40bda08 "blockdev: Deprecate >> -drive with bogus interface type" (v5.1.0). >> >> Signed-off-by: Markus Armbruster >> --- >> docs/system/deprecated.rst