[PATCH v3 12/15] tests: qemublock: Add cases for creating image overlays on top of disks with

2020-02-12 Thread Peter Krempa
Add a set of test data to see whether the backing store strings are formatted reasonably. Note that we don't support direct creation of such images so those tests are not enabled. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 2 ++

[PATCH v3 13/15] qemu: Add support for slices of type 'storage'

2020-02-12 Thread Peter Krempa
Implement support for the slice of type 'storage' which allows to set the offset and size which modifies where qemu should look for the start of the format container inside the image. Since slicing is done using the 'raw' driver we need to add another layer into the blockdev tree if there's any

[PATCH v3 14/15] tests: qemu: Add test data for the new element

2020-02-12 Thread Peter Krempa
Signed-off-by: Peter Krempa --- .../disk-slices.x86_64-latest.args| 53 ++ tests/qemuxml2argvdata/disk-slices.xml| 45 +++ tests/qemuxml2argvtest.c | 2 + .../disk-slices.x86_64-latest.xml | 56 +++

[PATCH v3 08/15] docs: Document the new sub-element of disk's

2020-02-12 Thread Peter Krempa
We are going to add support for specifying offset and size attributes which will allow controling where the image and where the guest data itself starts in the source of the disk. This will be represented by a element filled with either a for the offset of the image format itself. then controls

[PATCH v3 10/15] qemu: domain: Store nodenames of slice in status XML

2020-02-12 Thread Peter Krempa
The storage slice will require a specific node name in cases when the image format is not raw. Store and format them in the status XML. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c| 7 +++ tests/qemustatusxml2xmldata/modern-in.xml | 4 2 files changed, 11

[PATCH v3 15/15] virStorageSourceParseBackingJSONRaw: Parse 'offset' and 'size' attributes

2020-02-12 Thread Peter Krempa
If the parsed 'raw' format JSON string has 'offset' or 'size' attributes parse them as the format slice. https://bugzilla.redhat.com/show_bug.cgi?id=1791788 Signed-off-by: Peter Krempa --- src/util/virstoragefile.c | 20 tests/virstoragetest.c| 6 +- 2 files

[PATCH v3 09/15] conf: Implement support for of disk source

2020-02-12 Thread Peter Krempa
Implement parsing and formatting of the 'source' and 'format' slices. Signed-off-by: Peter Krempa --- src/conf/domain_conf.c | 86 ++ 1 file changed, 86 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index

[PATCH v3 11/15] qemu: block: Properly format storage slice into backing store strings

2020-02-12 Thread Peter Krempa
When creating overlay images e.g. for snapshots or when merging snapshots we often specify the backing store string to use. Make the formatter aware of backing chain entries which have a configured so that we record it properly. Otherwise such images would not work without the XML (when detecting

[PATCH v3 06/15] qemuDomainValidateStorageSource: Reject unsupported slices

2020-02-12 Thread Peter Krempa
We will currently support slice only for the 'raw' format slice reject any other option. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 12 1 file changed, 12 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 139496307f..d24d1c81db 100644

[PATCH v3 04/15] util: virstoragefile: Add data structure for storing storage source slices

2020-02-12 Thread Peter Krempa
Introduce virStorageSourceSlice which will store the 'offset' and 'size' of a virStorageSource and declare it as 'sliceStorage' and 'sliceFormat' attributes of a virStorageSource. Signed-off-by: Peter Krempa --- src/util/virstoragefile.c | 29 +

[PATCH v3 02/15] docs: formatdomain: Close on one of disk examples

2020-02-12 Thread Peter Krempa
Signed-off-by: Peter Krempa --- docs/formatdomain.html.in | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 5ccf39abd1..200a9cb79a 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2881,6 +2881,7 @@

[PATCH v3 03/15] tests: virstorage: Add test data for json specified raw image with offset/size

2020-02-12 Thread Peter Krempa
QEMU allows specifying the offset and size into a raw file to expose a sub-slice of the image to the guest with the raw driver. Libvirt currently doesn't support it but we can add test case for future reference. Signed-off-by: Peter Krempa --- tests/virstoragetest.c | 9 + 1 file

[PATCH v3 07/15] qemu: block: forbid creation of storage sources with

2020-02-12 Thread Peter Krempa
Specifically creating such images via libvirt during blockjobs would be much more hassle than it's worth. Just forbid them for now. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index

[PATCH v3 01/15] qemu: domain: Refactor formatting of node names into status XML

2020-02-12 Thread Peter Krempa
Use virXMLFormatElement to simplify the logic. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6fc0bd4e68..139496307f 100644 ---

[PATCH v3 00/15] qemu: Handle 'size' and 'offset' attributes of 'raw' format

2020-02-12 Thread Peter Krempa
This series fixes and improves the 'json:' pseudo-protocol parser and implements the 'offset' and 'size' attributes and exposes them as in the XML. The previous version attempted an easy route, but that didn't cover all cases. This version adds storage slice support for everything except image

[PATCH v3 05/15] qemuBlockStorageSourceGetFormatRawProps: format 'offset' and 'size' for slice

2020-02-12 Thread Peter Krempa
If we have a 'format' type slice for a raw driver we can directly format the values. Signed-off-by: Peter Krempa --- src/qemu/qemu_block.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index

Re: [PATCH v2 6/7] apparmor: Allow some more BIOS/UEFI paths

2020-02-12 Thread Michal Privoznik
On 2/12/20 11:38 AM, Christian Ehrhardt wrote: On Thu, Jan 30, 2020 at 8:05 AM Michal Privoznik > wrote: There are two more paths that we are missing in the default domain profile: /usr/share/edk2-ovmf/ and /usr/share/sgabios/. These exist on my Gentoo

[PULL 07/10] ui/gtk: implement show-cursor option

2020-02-12 Thread Gerd Hoffmann
When specified just set null_cursor to NULL so we get the default pointer instead of a blank pointer. Signed-off-by: Gerd Hoffmann Reviewed-by: Ján Tomko --- ui/gtk.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index

[PULL 02/10] ui/gtk: Fix gd_refresh_rate_millihz() when widget window is not realized

2020-02-12 Thread Gerd Hoffmann
From: Philippe Mathieu-Daudé gtk_widget_get_window() returns NULL if the widget's window is not realized, and QEMU crashes. Example under gtk 3.22.30 (mate 1.20.1): qemu-system-x86_64: Gdk: gdk_window_get_origin: assertion 'GDK_IS_WINDOW (window)' failed (gdb) bt #0 0x7496cf70

[PULL 10/10] ui/cocoa: Drop workarounds for pre-10.12 OSX

2020-02-12 Thread Gerd Hoffmann
From: Peter Maydell Our official OSX support policy covers the last two released versions. Currently that is 10.14 and 10.15. We also may work on older versions, but don't guarantee it. In commit 50290c002c045280f8d in mid-2019 we introduced some uses of CLOCK_MONOTONIC which incidentally

[PULL 06/10] ui/cocoa: switch to new show-cursor option

2020-02-12 Thread Gerd Hoffmann
Use DisplayOpts settings to set the new file-global cursor_hide variable, stop using the qemu-global cursor_hide variable. Signed-off-by: Gerd Hoffmann Reviewed-by: Ján Tomko --- ui/cocoa.m | 4 1 file changed, 4 insertions(+) diff --git a/ui/cocoa.m b/ui/cocoa.m index

[PULL 04/10] ui: wire up legacy -show-cursor option

2020-02-12 Thread Gerd Hoffmann
Set new show-cursor display option when legacy -show-cursor is specified on the command line. Signed-off-by: Gerd Hoffmann Reviewed-by: Ján Tomko --- vl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vl.c b/vl.c index 7dcb0879c497..5419b3d68200 100644 --- a/vl.c +++ b/vl.c @@ -3554,6

[PULL 01/10] ui/gtk: Update gd_refresh_rate_millihz() to handle VirtualConsole

2020-02-12 Thread Gerd Hoffmann
From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Tested-by: Jan Kiszka Message-id: 20200208161048.11311-2-f4...@amsat.org Signed-off-by: Gerd Hoffmann --- ui/gtk.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/gtk.c b/ui/gtk.c index

[PULL 05/10] ui/sdl: switch to new show-cursor option

2020-02-12 Thread Gerd Hoffmann
Use DisplayOpts settings instead of cursor_hide global variable. Also make "-display sdl,show-cursor=on" work. Signed-off-by: Gerd Hoffmann Reviewed-by: Ján Tomko --- ui/sdl2.c | 16 vl.c | 10 ++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git

[PULL 09/10] ui: deprecate legacy -show-cursor option

2020-02-12 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Ján Tomko --- vl.c | 2 ++ qemu-deprecated.texi | 5 + 2 files changed, 7 insertions(+) diff --git a/vl.c b/vl.c index 62efcd15c0bf..001be469c2e9 100644 --- a/vl.c +++ b/vl.c @@ -3562,6 +3562,8 @@ int main(int argc, char **argv,

[PULL 03/10] ui: add show-cursor option

2020-02-12 Thread Gerd Hoffmann
When enabled, this forces showing the mouse cursor, i.e. do not hide the pointer on mouse grabs. Defaults to off. Signed-off-by: Gerd Hoffmann Reviewed-by: Markus Armbruster Reviewed-by: Ján Tomko --- qapi/ui.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qapi/ui.json

[PULL 00/10] Ui 20200212 patches

2020-02-12 Thread Gerd Hoffmann
The following changes since commit e18e5501d8ac692d32657a3e1ef545b14e72b730: Merge remote-tracking branch 'remotes/dgilbert-gitlab/tags/pull-virtiofs-20200210' into staging (2020-02-10 18:09:14 +) are available in the Git repository at: git://git.kraxel.org/qemu tags/ui-20200212-pull

[PULL 08/10] ui: drop curor_hide global variable.

2020-02-12 Thread Gerd Hoffmann
No users left. Signed-off-by: Gerd Hoffmann Reviewed-by: Ján Tomko --- include/sysemu/sysemu.h | 1 - vl.c| 2 -- 2 files changed, 3 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 6358a324a711..7956e9054ade 100644 ---

Re: [libvirt PATCH v2] qemu: drop support for monitor connections on PTYs

2020-02-12 Thread Peter Krempa
On Wed, Feb 12, 2020 at 11:41:08 +, Daniel Berrange wrote: > Libvirt switched to using a UNIX socket for monitors in > 2009 for version 0.7.0. It seems unlikely that there is > a running QEMU process that hasn't been restarted for > 11 years while also taking a libvirt upgrade. Therefore > we

Re: [PATCH 1/2] qemu: monitor:Prevent a NULl pointer from being accessed

2020-02-12 Thread Peter Krempa
On Wed, Feb 12, 2020 at 22:09:42 +0800, Yi Wang wrote: > From: Huang Zijiang > > virJSONValueObjectGetObject maybe return NULL if the key is > missing or if value is not the correct TYPE, so we have to prevent > a NULl pointer from being accessed. If you see below we already check that the

Re: [PATCH] util: Prevent a NULl pointer from being accessed

2020-02-12 Thread Peter Krempa
On Wed, Feb 12, 2020 at 22:10:20 +0800, Yi Wang wrote: > From: Huang Zijiang > > virJSONValueObjectGetObject maybe return NULL if the key is > missing or if value is not the correct TYPE, so we have to prevent > a NULl pointer from being accessed. > > Signed-off-by: Huang Zijiang >

Re: [PATCH] util: Prevent a NULl pointer from being accessed

2020-02-12 Thread Peter Krempa
On Wed, Feb 12, 2020 at 22:10:42 +0800, Yi Wang wrote: > From: Huang Zijiang > > virJSONValueObjectGetObject maybe return NULL if the key is > missing or if value is not the correct TYPE, so we have to prevent > a NULl pointer from being accessed. > > Signed-off-by: Huang Zijiang >

[PATCH] util: Prevent a NULl pointer from being accessed

2020-02-12 Thread Yi Wang
From: Huang Zijiang virJSONValueObjectGetObject maybe return NULL if the key is missing or if value is not the correct TYPE, so we have to prevent a NULl pointer from being accessed. Signed-off-by: Huang Zijiang Signed-off-by: Yi Wang --- src/util/virqemu.c | 5 + 1 file changed, 5

Re: [PATCH v3 5/7] ui/gtk: implement show-cursor option

2020-02-12 Thread Gerd Hoffmann
> > +if (s->opts->has_show_cursor && s->opts->show_cursor) { > > +s->null_cursor = NULL; /* default pointer */ > > +} else { > > +s->null_cursor = gdk_cursor_new_for_display(window_display, > > +GDK_BLANK_CURSOR); > > +

[libvirt PATCH] qemu: drop support for monitor connections on PTYs

2020-02-12 Thread Daniel P . Berrangé
Libvirt switched to using a UNIX socket for monitors in 2009 for version 0.7.0. It seems unlikely that there is a running QEMU process that hasn't been restarted for 11 years while also taking a libvirt upgrade. Therefore we can drop support for opening a PTY for the QEMU monitor. Signed-off-by:

Re: [libvirt PATCH 2/5] qemu: check if 'floor' is supported for given interface and network

2020-02-12 Thread Ján Tomko
On Wed, Feb 12, 2020 at 09:20:55AM +0100, Michal Privoznik wrote: On 2/10/20 5:10 PM, Pavel Mores wrote: Even if an interface of type 'network', setting 'floor' is only supported if the network's forward type is nat, route, open or none. Signed-off-by: Pavel Mores ---

Re: [PATCH v2 6/7] apparmor: Allow some more BIOS/UEFI paths

2020-02-12 Thread Christian Ehrhardt
On Thu, Jan 30, 2020 at 8:05 AM Michal Privoznik wrote: > There are two more paths that we are missing in the default > domain profile: /usr/share/edk2-ovmf/ and /usr/share/sgabios/. > These exist on my Gentoo box and contain UEFI and BIOS images > respectively. > > Signed-off-by: Michal

Re: [patch v2 1/1] virt-aa-helper: Add support for smartcard host-certificates

2020-02-12 Thread Christian Ehrhardt
On Mon, Feb 10, 2020 at 7:36 AM Christian Ehrhardt < christian.ehrha...@canonical.com> wrote: > > > On Fri, Jan 24, 2020 at 2:15 PM Arnaud Patard > wrote: > >> Christian Ehrhardt writes: >> >> > On Thu, Dec 5, 2019 at 6:25 PM Arnaud Patard >> wrote: >> > >> >> When emulating smartcard with

Re: [libvirt PATCH 4/5] docs: QoS parameter 'floor' is supported for 'open' networks too

2020-02-12 Thread Michal Privoznik
On 2/10/20 5:10 PM, Pavel Mores wrote: Relevant code seems to treat forward modes 'route', 'nat', 'open' and none s/none/'none'/ the same but documentation hasn't reflected that so far. Signed-off-by: Pavel Mores --- docs/formatnetwork.html.in | 2 +- 1 file changed, 1 insertion(+), 1

Re: [libvirt PATCH 5/5] qemu: reuse convenience variable introduced in a00b97f27672b3

2020-02-12 Thread Michal Privoznik
On 2/10/20 5:10 PM, Pavel Mores wrote: Since we have the result of a compound condition named now we can use it to simplify another complex condition to make it more readable. Signed-off-by: Pavel Mores --- src/network/bridge_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)

Re: [libvirt PATCH 2/5] qemu: check if 'floor' is supported for given interface and network

2020-02-12 Thread Michal Privoznik
On 2/10/20 5:10 PM, Pavel Mores wrote: Even if an interface of type 'network', setting 'floor' is only supported if the network's forward type is nat, route, open or none. Signed-off-by: Pavel Mores --- src/network/bridge_driver.c | 17 + 1 file changed, 17 insertions(+)

Re: [libvirt PATCH 1/5] qemu: fail on attempt to set 'floor' if interface type is not 'network'

2020-02-12 Thread Michal Privoznik
On 2/10/20 5:10 PM, Pavel Mores wrote: QoS 'floor' setting is documented to be only supported for interfaces of type 'network'. Fail with an error message on attempt to set 'floor' on an interface of any other type. Signed-off-by: Pavel Mores --- src/qemu/qemu_driver.c | 13 ++---

Re: [libvirt PATCH 3/5] qemu: call networkPlugBandwidth() for all types of network

2020-02-12 Thread Michal Privoznik
On 2/10/20 5:10 PM, Pavel Mores wrote: To fix the actual bug, it was necessary to make networkPlugBandwidth() be called also for 'bridge'-type networks implemented using macvtap's 'bridge' mode (previously it was only called for those implemented on top of an existing bridge). However, it seems

Re: [libvirt PATCH 0/5] qemu: add stricter checks of permissibility of the QoS parameter 'floor'

2020-02-12 Thread Michal Privoznik
On 2/10/20 5:10 PM, Pavel Mores wrote: Aims to fix https://bugzilla.redhat.com/show_bug.cgi?id=1750219 Libvirt previously silently accepted attempts to set 'floor' even for direct bridge interface types where the parameter is not supported. This could happen when manipulating both inactive