Re: [PATCH] virtManager: Folder sharing implementation for SPICE session

2020-08-13 Thread Marc-André Lureau
Hi

On Thu, Aug 13, 2020 at 8:24 PM Cole Robinson  wrote:
>
> On 8/13/20 11:44 AM, Victor Toso wrote:
> > On Thu, Aug 13, 2020 at 10:34:52AM +0800, dianlujitao wrote:
> >> Thanks for reviewing.
> >>
> >> I agree that it's a big mess to maintain its availability, do
> >> you have connections with the SPICE team so there's chance to
> >> work together to improve the protocol? Essentially virt-viewer
> >> suffers from the same problem and can benefit from the
> >> enhancement if it happens.
> >>
> >> For the planned virt-viewer integration, since virt-manager's
> >> built-in viewer has implemented most of virt-viewer's feature,
> >> I don't quite understand the intuition behind, would that bring
> >> much advantages over the built-in viewer?
> >
> > So, the problem is the client (virt-manager here) not being able
> > to tell that "a sharing is happening now"? I think you can watch
> > over "port-opened" [0] for that.
> >
> > [0] 
> > https://www.spice-space.org/api/spice-gtk/SpicePortChannel.html#SpicePortChannel--port-opened
> >
>
> No, what we mean is some notification from spice that there is actually
> a webdav agent listening/ready in the VM. Something akin to
> agent-connected signal but for webdav or similar. Does that exist?

If I remember correctly, you can check and listen on channel
"port-opened" property. It means there is something that opened the
channel in the guest.

>
> >> 鍦? 2020/8/13 涓婂崍4:29, Cole Robinson 鍐欓亾:
> >>> On 7/25/20 9:30 AM, Jitao Lu wrote:
>    * This implements folder sharing for the built-in Spice client, tested
>  working with Win10 guest.
>    * The basic idea is taken from virt-viewer.
> 
>  Signed-off-by: Jitao Lu 
>  ---
>    ui/spicewebdav.ui  | 129 +
>    ui/vmwindow.ui |  17 +++-
>    virtManager/details/console.py |   8 ++
>    virtManager/details/spicewebdav.py |  60 ++
>    virtManager/details/viewers.py |  68 +++
>    virtManager/vmwindow.py|   8 ++
>    6 files changed, 286 insertions(+), 4 deletions(-)
>    create mode 100644 ui/spicewebdav.ui
>    create mode 100644 virtManager/details/spicewebdav.py
> 
> >>> This looks pretty good, thanks. The only bits I would like to add are:
> >>>
> >>> * Tooltip when the Menu item is disabled, indicating the reason it's not
> >>> enabled: not using SPICE, or no webdav channel enabled
> >>> * Probably a warning label in the dialog that webdav requires an agent
> >>> running the guest OS.
> >>>
> >>> But honestly I'm trying to decide if this is worth it for
> >>> virt-manager.  Generally these types of features that require
> >>> external config just to get working are a big pain for
> >>> support. spice doesn't have any mechanism that I can tell to
> >>> inform us if anything is listening on the other side of the
> >>> webdav channel so we can't give good feedback in the UI if
> >>> this even has a chance of working. And specifically for spice
> >>> features, per the design[1] document, anything advanced I
> >>> would prefer to leave for virt-viewer to do (which obviously
> >>> already handles this as you mention).  Because it's not
> >>> something that works out of the box and requires external
> >>> config, it's not a stretch to ask users to also use
> >>> virt-viewer when they need it.
> >>>
> >>> [1]: https://github.com/virt-manager/virt-manager/blob/master/DESIGN.md
> >>>
> >>> So I'm unsure what to do. I was planning for the next release
> >>> to investigate some ways to make it easier to use virt-viewer
> >>> side by side with virt-manager, maybe an option to have
> >>> virt-manager not autoconnect to the console, and possibly
> >>> even a button or menu option to launch virt-viewer directly,
> >>> but I need to play with it.
> >
> > IMHO, this is the way to go. I actually suggested the same thing
> > to GNOME Boxes in the past.
> >
>
> Interesting, thanks for the comment.
>
> - Cole
>




Re: virt-manager and virgl / Spice / OpenGL

2020-05-19 Thread Marc-André Lureau
Hi

On Tue, May 19, 2020 at 6:13 PM Scott Talbert  wrote:
>
> On Tue, 19 May 2020, Marc-André Lureau wrote:
>
> >>>> Hi,
> >>>>
> >>>> Is virgl/OpenGL support through virt-manager supposed to work and perform
> >>>> well?
> >>>>
> >>>> I have the following:
> >>>> Host OS: Fedora 32
> >>>> Guest OS: Debian Unstable
> >>>>
> >>>> In virt-manager, I have the following:
> >>>> Display Spice
> >>>>Type: Spice server
> >>>>Listen type: None
> >>>>Password: Blank
> >>>>Keymap: Blank
> >>>>OpenGL: Checked & /dev/dri/renderD128
> >>>>
> >>>> Video Virtio
> >>>>Model: Virtio
> >>>>Ram: -
> >>>>Heads: 1
> >>>>3D acceleration: Checked
> >>>>
> >>>> In the guest OS:
> >>>> talbert@debian-unstable:~$ sudo dmesg | grep '\[drm\]'
> >>>> [1.947975] [drm] pci: virtio-vga detected at :00:01.0
> >>>> [2.019988] [drm] features: +virgl +edid
> >>>> [2.022522] [drm] number of scanouts: 1
> >>>> [2.022529] [drm] number of cap sets: 2
> >>>> [2.048982] [drm] cap set 0: id 1, max-version 1, max-size 308
> >>>> [2.049125] [drm] cap set 1: id 2, max-version 2, max-size 688
> >>>> [2.049332] [drm] Initialized virtio_gpu 0.1.0 0 for virtio0 on minor > >>>> 0
> >>>>
> >>>> So it *seems* like things are configured correctly?  However, performance
> >>>> is not great.  Performance is much better if I switch back to QXL video.
> >>>
> >>> It looks like your setup should be fine. What performance are you
> >>> running? Local or remote? If it's 2D based anyway, chances are you get
> >>> similar results with QXL or virtio, probably with better QXL results
> >>> with the QXL Xorg driver.
> >>
> >> It's local.  I don't have any quantitative data on performance, just my
> >> observations on performance.  In the guest, I'm just running the default
> >> Debian DE (Gnome Shell) on Xorg.  Wayland performs worse.  Gnome Shell is
> >> 3D, right?
> >
> > Yes. With virgl, make sure the virtio-gpu DRI driver is loaded (and
> > not the sw/llvmpipe). On Xorg, make sure glamor is running.
> >
> > What's your host gpu?
>
> It looks as if virtio-gpu and glamor are loaded/running:
>
> talbert@debian-unstable:~$ grep virtio ~/.local/share/xorg/Xorg.0.log
> [28.590] (II) modeset(0): [DRI2]   DRI driver: virtio_gpu
> [28.590] (II) modeset(0): [DRI2]   VDPAU driver: virtio_gpu
> [28.603] (II) AIGLX: Loaded and initialized virtio_gpu
>
> talbert@debian-unstable:~$ grep glamor ~/.local/share/xorg/Xorg.0.log
> [28.451] (II) Loading sub module "glamoregl"
> [28.451] (II) LoadModule: "glamoregl"
> [28.451] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
> [28.456] (II) Module glamoregl: vendor="X.Org Foundation"
> [28.527] (II) modeset(0): glamor X acceleration enabled on virgl
> [28.528] (II) modeset(0): glamor initialized
>
> Host GPU is:
> [talbert@deasil ~]$ lspci | grep VGA
> 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI]
> Venus XTX [Radeon HD 8890M / R9 M275X/M375X] (rev 83)
>

Looks all good to me, you may check your guest performance vs host
performance with various GL benchmarks.

What is left after that is the display scanout refresh, going through
SPICE etc, which may add some visible slowness. You may try running
straight from QEMU -display gtk instead, to check if that makes a
difference.

At this point, you may have more hints about performance issues by
discussing on dri-devel or virgl ML.

> One other note: there is some intermittent display corruption while the
> guest OS is booting.

Yeah, such issues are hard to debug, and not exactly a priority.




Re: virt-manager and virgl / Spice / OpenGL

2020-05-19 Thread Marc-André Lureau
Hi

On Tue, May 19, 2020 at 5:40 PM Scott Talbert  wrote:
>
> On Tue, 19 May 2020, Marc-André Lureau wrote:
>
> >> Hi,
> >>
> >> Is virgl/OpenGL support through virt-manager supposed to work and perform
> >> well?
> >>
> >> I have the following:
> >> Host OS: Fedora 32
> >> Guest OS: Debian Unstable
> >>
> >> In virt-manager, I have the following:
> >> Display Spice
> >>Type: Spice server
> >>Listen type: None
> >>Password: Blank
> >>Keymap: Blank
> >>OpenGL: Checked & /dev/dri/renderD128
> >>
> >> Video Virtio
> >>Model: Virtio
> >>Ram: -
> >>Heads: 1
> >>3D acceleration: Checked
> >>
> >> In the guest OS:
> >> talbert@debian-unstable:~$ sudo dmesg | grep '\[drm\]'
> >> [1.947975] [drm] pci: virtio-vga detected at :00:01.0
> >> [2.019988] [drm] features: +virgl +edid
> >> [2.022522] [drm] number of scanouts: 1
> >> [2.022529] [drm] number of cap sets: 2
> >> [2.048982] [drm] cap set 0: id 1, max-version 1, max-size 308
> >> [2.049125] [drm] cap set 1: id 2, max-version 2, max-size 688
> >> [2.049332] [drm] Initialized virtio_gpu 0.1.0 0 for virtio0 on minor 0
> >>
> >> So it *seems* like things are configured correctly?  However, performance
> >> is not great.  Performance is much better if I switch back to QXL video.
> >
> > It looks like your setup should be fine. What performance are you
> > running? Local or remote? If it's 2D based anyway, chances are you get
> > similar results with QXL or virtio, probably with better QXL results
> > with the QXL Xorg driver.
>
> It's local.  I don't have any quantitative data on performance, just my
> observations on performance.  In the guest, I'm just running the default
> Debian DE (Gnome Shell) on Xorg.  Wayland performs worse.  Gnome Shell is
> 3D, right?

Yes. With virgl, make sure the virtio-gpu DRI driver is loaded (and
not the sw/llvmpipe). On Xorg, make sure glamor is running.

What's your host gpu?




Re: virt-manager and virgl / Spice / OpenGL

2020-05-19 Thread Marc-André Lureau
Hi

On Fri, May 15, 2020 at 5:36 PM Scott Talbert  wrote:
>
> Hi,
>
> Is virgl/OpenGL support through virt-manager supposed to work and perform
> well?
>
> I have the following:
> Host OS: Fedora 32
> Guest OS: Debian Unstable
>
> In virt-manager, I have the following:
> Display Spice
>Type: Spice server
>Listen type: None
>Password: Blank
>Keymap: Blank
>OpenGL: Checked & /dev/dri/renderD128
>
> Video Virtio
>Model: Virtio
>Ram: -
>Heads: 1
>3D acceleration: Checked
>
> In the guest OS:
> talbert@debian-unstable:~$ sudo dmesg | grep '\[drm\]'
> [1.947975] [drm] pci: virtio-vga detected at :00:01.0
> [2.019988] [drm] features: +virgl +edid
> [2.022522] [drm] number of scanouts: 1
> [2.022529] [drm] number of cap sets: 2
> [2.048982] [drm] cap set 0: id 1, max-version 1, max-size 308
> [2.049125] [drm] cap set 1: id 2, max-version 2, max-size 688
> [2.049332] [drm] Initialized virtio_gpu 0.1.0 0 for virtio0 on minor 0
>
> So it *seems* like things are configured correctly?  However, performance
> is not great.  Performance is much better if I switch back to QXL video.

It looks like your setup should be fine. What performance are you
running? Local or remote? If it's 2D based anyway, chances are you get
similar results with QXL or virtio, probably with better QXL results
with the QXL Xorg driver.



Re: Permanent folder share with virt-viewer/manager?

2020-05-15 Thread Marc-André Lureau
Hi

On Fri, May 15, 2020 at 1:42 PM Phil Kulak  wrote:
>
> I've got folder sharing to a Windows VM working, but only if I start up 
> virt-viewer and edit preferences to select the folder every time. The next 
> time the machine starts, the setting is reset and the network drive won't 
> mount. Is there any way to make this permanent? Thanks for any help!

I don't think that's possible yet. You should open issues to the
respective client projects. (I don't think we should have a global
spice-gtk config for that, but perhaps it would be useful?)

And with virtiofs we may have other ways to share a directory,
although locally only to start with.




Re: Re: shm as domain to virt-viewer protocol? (Daniel P. Berrang?)

2020-03-27 Thread Marc-André Lureau
Hi David

On Fri, Mar 27, 2020 at 9:52 PM David Geise  wrote:
[..]
> I'm still just skimming & sizing things but it appears the options are:
>
> 1. Fork viewer at some level and become a downstream source code consumer; 
> don't worry about compatibility, etc but don't expect pull requests to be 
> accepted. I.e. add to the open-source jungle.
>
> 2. Similar to #1 but minimize the jungle-effect, try to only fork only 
> Gtk-Spice. To support this downstream environment try to minimize changes to 
> a hook into a separate module that implements shm I/O. Limit shm usage to 
> guest->viewer bitmap transfers. Try to avoid memcpy's, ideally point shm 
> directly into video card's output buffer to minimize cpu/bus overhead if 
> possible. Alternately use RLE or other low-overhead compression. Virt-viewer 
> project's PR acceptance possible but unlikely.
>
> 3. I haven't looked at the spice api yet, but look for the opportunity to 
> re-impliment spice on a shm transport that would partially or entirely 
> replace tcp for standalone scenarios. This seems unlikely unless spice has a 
> good transport abstraction layer.
>
> 4. Look for extensibility hooks in the spice api itself which could be 
> leveraged to implement a 'sideband' shm i/o to offload the high-bandwidth 
> traffic (screen refresh) without changing the spice itself. Just need some 
> way to xfer a pointer & probably a few event notifications.
>
> Your thoughts?
>

As you probably realize, this is not as simple as it may look like.
There are various approaches doing hw accelerated rendering, and
various combinations are possible with virtio-gpu, vgpu, and
passthrough, spice or not.

I think there has been some discussion about combining virtio-gpu &
passthrough to do better gpu display scraping somehow. But for now, it
is probably easier to setup some process in the guest, like
looking-glass/streaming-agent, and give that display content somehow
to the host via different means (ivshmem is probably easy, but
fragile/hackish).

At the client end, I would highly recommend to reuse the dmabuf
mechanism we have in place to share GPU buffers/display from qemu.
That dmabuf mechanism is also used by the spice client, and by vgpu,
so in theory you won't have to touch spice, or spice-gtk, or
virt-viewer. Iow, basic screen scraping could be done by modifying
guest side and qemu only. But I believe there are better plans being
discussed. I think the discussion should be moved to qemu.




Re: [virt-tools-list] [PATCH virt-viewer v2] Fix a regression when initial connection fails

2019-04-10 Thread Marc-André Lureau
ewer_session_spice_channel_destroyed), self, 0);
> >  virt_viewer_signal_connect_object(self->priv->session, "disconnected",
> >
> > G_CALLBACK(virt_viewer_session_spice_session_disconnected), self, 0);
> >
> > @@ -776,14 +776,14 @@ 
> > virt_viewer_session_spice_main_channel_event(SpiceChannel *channel,
> >  spice_session_connect(self->priv->session);
> >  }
> >  } else {
> > -virt_viewer_session_spice_channel_destroy(NULL, channel, 
> > session);
> > +spice_session_disconnect(self->priv->session);
> >  }
> >  break;
> >  }
> >  case SPICE_CHANNEL_ERROR_IO:
> >  case SPICE_CHANNEL_ERROR_LINK:
> >  case SPICE_CHANNEL_ERROR_TLS:
> > -virt_viewer_session_spice_channel_destroy(NULL, channel, session);
> > +spice_session_disconnect(self->priv->session);
> >  break;
> >  default:
> >  g_warning("unhandled spice main channel event: %d", event);
> > @@ -,10 +,11 @@ 
> > virt_viewer_session_spice_session_disconnected(G_GNUC_UNUSED SpiceSession 
> > *s,
> >  g_signal_emit_by_name(self, "session-disconnected", error ? 
> > error->message : NULL);
> >  }
> >
> > +/* called when the spice session indicates that a session has been 
> > destroyed */
> >  static void
> > -virt_viewer_session_spice_channel_destroy(G_GNUC_UNUSED SpiceSession *s,
> > -  SpiceChannel *channel,
> > -  VirtViewerSession *session)
> > +virt_viewer_session_spice_channel_destroyed(G_GNUC_UNUSED SpiceSession *s,
> > +SpiceChannel *channel,
> > +VirtViewerSession *session)
> >  {
> >  VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
> >  int id;
> > --
> > 2.17.2
> >
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list



-- 
Marc-André Lureau

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v4] remote-viewer: Allow toggling shared clipboard

2019-03-07 Thread Marc-André Lureau
Hi

On Thu, Mar 7, 2019 at 12:36 PM Aleksei Nikiforov
 wrote:
>
> 04.03.2019 19:38, Marc-André Lureau пишет:
> > On Mon, Mar 4, 2019 at 3:39 PM Aleksei Nikiforov  
> > wrote:
> >>
> >> Signed-off-by: Aleksei Nikiforov 
> >
> > Reviewed-by: Marc-André Lureau 
> >
>
> Thanks. Is anything else needed from me to merge it? Or will someone
> merge it some time later?

pushed,
thanks

>
> >> ---
> >>   man/remote-viewer.pod   |  3 +
> >>   src/resources/ui/virt-viewer-preferences.ui | 16 +++-
> >>   src/virt-viewer-app.c   | 93 +
> >>   src/virt-viewer-app.h   |  6 ++
> >>   src/virt-viewer-session-spice.c |  9 +-
> >>   5 files changed, 125 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/man/remote-viewer.pod b/man/remote-viewer.pod
> >> index 4b683cf..ed76af5 100644
> >> --- a/man/remote-viewer.pod
> >> +++ b/man/remote-viewer.pod
> >> @@ -360,6 +360,9 @@ The monitor-mapping must contain ids of all displays 
> >> from 1 to the last
> >>   desired display id, e.g. "monitor-mapping=3:3" is invalid because 
> >> mappings
> >>   for displays 1 and 2 are not specified.
> >>
> >> +Configuration key B contains a boolean value. If it's 
> >> "true",
> >> +then clipboard is shared with guests if clipboard sharing is supported by 
> >> used protocol.
> >> +
> >>   =head1 EXAMPLES
> >>
> >>   To connect to SPICE server on host "makai" with port 5900
> >> diff --git a/src/resources/ui/virt-viewer-preferences.ui 
> >> b/src/resources/ui/virt-viewer-preferences.ui
> >> index f9738c5..0b88da4 100644
> >> --- a/src/resources/ui/virt-viewer-preferences.ui
> >> +++ b/src/resources/ui/virt-viewer-preferences.ui
> >> @@ -61,7 +61,7 @@
> >>   True
> >>   False
> >>   6
> >> -2
> >> +3
> >>   2
> >>   12
> >>   6
> >> @@ -91,6 +91,20 @@
> >>   2
> >> 
> >>   
> >> +
> >> +   >> id="cbshareclipboard">
> >> +Share 
> >> clipboard
> >> +True
> >> +True
> >> +False
> >> +True
> >> +  
> >> +  
> >> +2
> >> +2
> >> +3
> >> +  
> >> +
> >>   
> >>  >> id="fcsharefolder">
> >>   True
> >> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> >> index 2684263..da8cfa9 100644
> >> --- a/src/virt-viewer-app.c
> >> +++ b/src/virt-viewer-app.c
> >> @@ -157,6 +157,7 @@ struct _VirtViewerAppPrivate {
> >>   guint remove_smartcard_accel_key;
> >>   GdkModifierType remove_smartcard_accel_mods;
> >>   gboolean quit_on_disconnect;
> >> +gboolean supports_share_clipboard;
> >>   };
> >>
> >>
> >> @@ -176,6 +177,8 @@ enum {
> >>   PROP_UUID,
> >>   PROP_VM_UI,
> >>   PROP_VM_RUNNING,
> >> +PROP_CONFIG_SHARE_CLIPBOARD,
> >> +PROP_SUPPORTS_SHARE_CLIPBOARD,
> >>   };
> >>
> >>   void
> >> @@ -1588,6 +1591,14 @@ virt_viewer_app_get_property (GObject *object, 
> >> guint property_id,
> >>   g_value_set_boolean(value, priv->vm_running);
> >>   break;
> >>
> >> +case PROP_CONFIG_SHARE_CLIPBOARD:
> >> +g_value_set_boolean(value, 
> >> virt_viewer_app_get_config_share_clipboard(self));
> >> +break;
> >> +
> >> +case PROP_SUPPORTS_SHARE_CLIPBOARD:
> >> +g_value_set_boolean(value, 
> >> virt_viewer_app_get_supports_share_clipboard(self));
> >> +break;
> >> +
> >>   default:
> >>   G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, 

Re: [virt-tools-list] [PATCH v4] remote-viewer: Allow toggling shared clipboard

2019-03-04 Thread Marc-André Lureau
On Mon, Mar 4, 2019 at 3:39 PM Aleksei Nikiforov  wrote:
>
> Signed-off-by: Aleksei Nikiforov 

Reviewed-by: Marc-André Lureau 

> ---
>  man/remote-viewer.pod   |  3 +
>  src/resources/ui/virt-viewer-preferences.ui | 16 +++-
>  src/virt-viewer-app.c   | 93 +
>  src/virt-viewer-app.h   |  6 ++
>  src/virt-viewer-session-spice.c |  9 +-
>  5 files changed, 125 insertions(+), 2 deletions(-)
>
> diff --git a/man/remote-viewer.pod b/man/remote-viewer.pod
> index 4b683cf..ed76af5 100644
> --- a/man/remote-viewer.pod
> +++ b/man/remote-viewer.pod
> @@ -360,6 +360,9 @@ The monitor-mapping must contain ids of all displays from 
> 1 to the last
>  desired display id, e.g. "monitor-mapping=3:3" is invalid because mappings
>  for displays 1 and 2 are not specified.
>
> +Configuration key B contains a boolean value. If it's 
> "true",
> +then clipboard is shared with guests if clipboard sharing is supported by 
> used protocol.
> +
>  =head1 EXAMPLES
>
>  To connect to SPICE server on host "makai" with port 5900
> diff --git a/src/resources/ui/virt-viewer-preferences.ui 
> b/src/resources/ui/virt-viewer-preferences.ui
> index f9738c5..0b88da4 100644
> --- a/src/resources/ui/virt-viewer-preferences.ui
> +++ b/src/resources/ui/virt-viewer-preferences.ui
> @@ -61,7 +61,7 @@
>  True
>  False
>  6
> -2
> +3
>  2
>  12
>  6
> @@ -91,6 +91,20 @@
>  2
>
>  
> +
> +  
> +Share 
> clipboard
> +True
> +True
> +False
> +True
> +  
> +  
> +2
> +2
> +3
> +  
> +
>  
> id="fcsharefolder">
>  True
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index 2684263..da8cfa9 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -157,6 +157,7 @@ struct _VirtViewerAppPrivate {
>  guint remove_smartcard_accel_key;
>  GdkModifierType remove_smartcard_accel_mods;
>  gboolean quit_on_disconnect;
> +gboolean supports_share_clipboard;
>  };
>
>
> @@ -176,6 +177,8 @@ enum {
>  PROP_UUID,
>  PROP_VM_UI,
>  PROP_VM_RUNNING,
> +PROP_CONFIG_SHARE_CLIPBOARD,
> +PROP_SUPPORTS_SHARE_CLIPBOARD,
>  };
>
>  void
> @@ -1588,6 +1591,14 @@ virt_viewer_app_get_property (GObject *object, guint 
> property_id,
>  g_value_set_boolean(value, priv->vm_running);
>  break;
>
> +case PROP_CONFIG_SHARE_CLIPBOARD:
> +g_value_set_boolean(value, 
> virt_viewer_app_get_config_share_clipboard(self));
> +break;
> +
> +case PROP_SUPPORTS_SHARE_CLIPBOARD:
> +g_value_set_boolean(value, 
> virt_viewer_app_get_supports_share_clipboard(self));
> +break;
> +
>  default:
>  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
>  }
> @@ -1650,6 +1661,14 @@ virt_viewer_app_set_property (GObject *object, guint 
> property_id,
>  priv->vm_running = g_value_get_boolean(value);
>  break;
>
> +case PROP_CONFIG_SHARE_CLIPBOARD:
> +virt_viewer_app_set_config_share_clipboard(self, 
> g_value_get_boolean(value));
> +break;
> +
> +case PROP_SUPPORTS_SHARE_CLIPBOARD:
> +virt_viewer_app_set_supports_share_clipboard(self, 
> g_value_get_boolean(value));
> +break;
> +
>  default:
>  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
>  }
> @@ -1867,6 +1886,9 @@ virt_viewer_app_on_application_startup(GApplication 
> *app)
>  gtk_accel_map_add_entry("/view/zoom-in", GDK_KEY_plus, 
> GDK_CONTROL_MASK);
>  gtk_accel_map_add_entry("/send/secure-attention", 
> GDK_KEY_End, GDK_CONTROL_MASK | GDK_MOD1_MASK);
>
> +// Restore initial state of config-share-clipboard property from config 
> and notify about it
> +virt_viewer_app_set_config_share_clipboard(self, 
> virt_viewer_app_get_config_share_clipboard(self));
> +
>  if (!virt_viewer_app_start(self, &error)) {
>   

Re: [virt-tools-list] [PATCH v3] remote-viewer: Allow toggling shared clipboard

2019-03-04 Thread Marc-André Lureau
Hi Aleksei,

On Mon, Mar 4, 2019 at 1:13 PM Aleksei Nikiforov  wrote:
>
> Signed-off-by: Aleksei Nikiforov 
> ---
>  man/remote-viewer.pod   |  3 +
>  src/resources/ui/virt-viewer-preferences.ui | 16 +++-
>  src/virt-viewer-app.c   | 93 +
>  src/virt-viewer-app.h   |  6 ++
>  src/virt-viewer-session-spice.c |  9 +-
>  5 files changed, 125 insertions(+), 2 deletions(-)
>

The patch doesn't seem to apply on master, could you rebase?

thanks

> diff --git a/man/remote-viewer.pod b/man/remote-viewer.pod
> index 8cf5ee4..c009fb9 100644
> --- a/man/remote-viewer.pod
> +++ b/man/remote-viewer.pod
> @@ -354,6 +354,9 @@ The monitor-mapping must contain ids of all displays from 
> 1 to the last
>  desired display id, e.g. "monitor-mapping=3:3" is invalid because mappings
>  for displays 1 and 2 are not specified.
>
> +Configuration key B contains a boolean value. If it's 
> "true",
> +then clipboard is shared with guests if clipboard sharing is supported by 
> used protocol.
> +
>  =head1 EXAMPLES
>
>  To connect to SPICE server on host "makai" with port 5900
> diff --git a/src/resources/ui/virt-viewer-preferences.ui 
> b/src/resources/ui/virt-viewer-preferences.ui
> index f9738c5..0b88da4 100644
> --- a/src/resources/ui/virt-viewer-preferences.ui
> +++ b/src/resources/ui/virt-viewer-preferences.ui
> @@ -61,7 +61,7 @@
>  True
>  False
>  6
> -2
> +3
>  2
>  12
>  6
> @@ -91,6 +91,20 @@
>  2
>
>  
> +
> +  
> +Share 
> clipboard
> +True
> +True
> +False
> +True
> +  
> +  
> +2
> +2
> +3
> +  
> +
>  
> id="fcsharefolder">
>  True
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index e0e6e63..c91a828 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -153,6 +153,7 @@ struct _VirtViewerAppPrivate {
>  guint remove_smartcard_accel_key;
>  GdkModifierType remove_smartcard_accel_mods;
>  gboolean quit_on_disconnect;
> +gboolean supports_share_clipboard;
>  };
>
>
> @@ -172,6 +173,8 @@ enum {
>  PROP_KIOSK,
>  PROP_QUIT_ON_DISCONNECT,
>  PROP_UUID,
> +PROP_CONFIG_SHARE_CLIPBOARD,
> +PROP_SUPPORTS_SHARE_CLIPBOARD,
>  };
>
>  void
> @@ -1549,6 +1552,14 @@ virt_viewer_app_get_property (GObject *object, guint 
> property_id,
>  g_value_set_string(value, priv->uuid);
>  break;
>
> +case PROP_CONFIG_SHARE_CLIPBOARD:
> +g_value_set_boolean(value, 
> virt_viewer_app_get_config_share_clipboard(self));
> +break;
> +
> +case PROP_SUPPORTS_SHARE_CLIPBOARD:
> +g_value_set_boolean(value, 
> virt_viewer_app_get_supports_share_clipboard(self));
> +break;
> +
>  default:
>  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
>  }
> @@ -1603,6 +1614,14 @@ virt_viewer_app_set_property (GObject *object, guint 
> property_id,
>  virt_viewer_app_set_uuid_string(self, g_value_get_string(value));
>  break;
>
> +case PROP_CONFIG_SHARE_CLIPBOARD:
> +virt_viewer_app_set_config_share_clipboard(self, 
> g_value_get_boolean(value));
> +break;
> +
> +case PROP_SUPPORTS_SHARE_CLIPBOARD:
> +virt_viewer_app_set_supports_share_clipboard(self, 
> g_value_get_boolean(value));
> +break;
> +
>  default:
>  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
>  }
> @@ -1815,6 +1834,9 @@ virt_viewer_app_on_application_startup(GApplication 
> *app)
>  gtk_accel_map_add_entry("/view/zoom-in", GDK_KEY_plus, 
> GDK_CONTROL_MASK);
>  gtk_accel_map_add_entry("/send/secure-attention", 
> GDK_KEY_End, GDK_CONTROL_MASK | GDK_MOD1_MASK);
>
> +// Restore initial state of config-share-clipboard property from config 
> and notify about it
> +virt_viewer_app_set_config_share_clipboard(self, 
> virt_viewer_app_get_config_share_clipboard(self));
> +
>  if (!virt_viewer_app_start(self, &error)) {
>  if (error && !g_error_matches(error, VIRT_VIEWER_ERROR, 
> VIRT_VIEWER_ERROR_CANCELLED))
>  virt_viewer_app_simple_message_dialog(self, error->message);
> @@ -1994,6 +2016,24 @@ virt_viewer_app_class_init (VirtViewerAppClass *klass)
>  G_PARAM_READABLE |
>  G_PARAM_WRITABLE |
>

Re: [virt-tools-list] [PATCH] remote-viewer: Allow toggling shared clipboard

2019-02-26 Thread Marc-André Lureau
Hi

On Tue, Feb 26, 2019 at 3:08 PM Aleksei Nikiforov
 wrote:
>
> Hi
>
> 26.02.2019 15:42, Marc-André Lureau пишет:
> > Hi
> >
> > On Tue, Feb 26, 2019 at 1:19 PM Aleksei Nikiforov
> >  wrote:
> >>
> >> Signed-off-by: Aleksei Nikiforov 
> >
> > looks good overall,
> >
> > please update the man page for the new key
> >
>
> Should I add a small description for share-clipboard configuration key
> in CONFIGURATION section of remote-viewer(1) man page, or do you mean
> something else?

Yes, that would be useful (unless we consider it a "private" key
setting, like ask-quit, which was not documented so far).

thanks!

>
> >> ---
> >>   src/resources/ui/virt-viewer.ui | 11 +++
> >>   src/virt-viewer-app.c   | 25 +
> >>   src/virt-viewer-app.h   |  3 +++
> >>   src/virt-viewer-session-spice.c | 32 ++--
> >>   src/virt-viewer-session.h   |  2 ++
> >>   src/virt-viewer-window.c| 28 
> >>   6 files changed, 99 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/src/resources/ui/virt-viewer.ui 
> >> b/src/resources/ui/virt-viewer.ui
> >> index e9609ec..1eccd35 100644
> >> --- a/src/resources/ui/virt-viewer.ui
> >> +++ b/src/resources/ui/virt-viewer.ui
> >> @@ -42,6 +42,17 @@
> >>>> handler="virt_viewer_window_menu_file_screenshot" swapped="no"/>
> >> 
> >>   
> >> +
> >> +   >> id="menu-file-share-clipboard">
> >> +True
> >> +False
> >> + >> name="use_action_appearance">False
> >> + >> name="accel_path"><virt-viewer>/file/share-clipboard
> >> + >> translatable="yes">Share clipboard
> >> +True
> >> + >> handler="virt_viewer_window_menu_file_share_clipboard" swapped="no"/>
> >> +  
> >> +
> >
> > I'd rather have it under "Preferences" dialog (it's not an "action").
> >
>
> I'll try to rework it and return with result when done.
>
> >>   
> >>  >> id="menu-file-usb-device-selection">
> >>   True
> >> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> >> index e0e6e63..6b50e5f 100644
> >> --- a/src/virt-viewer-app.c
> >> +++ b/src/virt-viewer-app.c
> >> @@ -2571,6 +2571,31 @@ gboolean 
> >> virt_viewer_app_get_session_cancelled(VirtViewerApp *self)
> >>   return self->priv->cancelled;
> >>   }
> >>
> >> +gboolean virt_viewer_app_get_config_share_clipboard(VirtViewerApp *self)
> >> +{
> >> +VirtViewerAppPrivate *priv = self->priv;
> >> +
> >> +GError *error = NULL;
> >> +
> >> +gboolean share_clipboard = g_key_file_get_boolean(priv->config,
> >> +  "virt-viewer", 
> >> "share-clipboard", &error);
> >> +
> >> +if (error) {
> >> +share_clipboard = TRUE; /* backwards-compatible default value */
> >> +g_clear_error(&error);
> >> +}
> >> +
> >> +return share_clipboard;
> >> +}
> >> +
> >> +void virt_viewer_app_set_config_share_clipboard(VirtViewerApp *self, 
> >> gboolean enable)
> >> +{
> >> +VirtViewerAppPrivate *priv = self->priv;
> >> +
> >> +g_key_file_set_boolean(priv->config,
> >> +   "virt-viewer", "share-clipboard", enable);
> >> +}
> >> +
> >>   /*
> >>* Local variables:
> >>*  c-indent-level: 4
> >> diff --git a/src/virt-viewer-app.h b/src/virt-viewer-app.h
> >> index 16b1c8c..962226b 100644
> >> --- a/src/virt-viewer-app.h
> >> +++ b/src/virt-viewer-app.h
> >> @@ -99,6 +99,9 @@ void virt_viewer_app_show_preferences(VirtView

Re: [virt-tools-list] [PATCH] remote-viewer: Allow toggling shared clipboard

2019-02-26 Thread Marc-André Lureau
Hi

On Tue, Feb 26, 2019 at 1:19 PM Aleksei Nikiforov
 wrote:
>
> Signed-off-by: Aleksei Nikiforov 

looks good overall,

please update the man page for the new key

> ---
>  src/resources/ui/virt-viewer.ui | 11 +++
>  src/virt-viewer-app.c   | 25 +
>  src/virt-viewer-app.h   |  3 +++
>  src/virt-viewer-session-spice.c | 32 ++--
>  src/virt-viewer-session.h   |  2 ++
>  src/virt-viewer-window.c| 28 
>  6 files changed, 99 insertions(+), 2 deletions(-)
>
> diff --git a/src/resources/ui/virt-viewer.ui b/src/resources/ui/virt-viewer.ui
> index e9609ec..1eccd35 100644
> --- a/src/resources/ui/virt-viewer.ui
> +++ b/src/resources/ui/virt-viewer.ui
> @@ -42,6 +42,17 @@
>   handler="virt_viewer_window_menu_file_screenshot" swapped="no"/>
>
>  
> +
> +   id="menu-file-share-clipboard">
> +True
> +False
> + name="use_action_appearance">False
> + name="accel_path">/file/share-clipboard
> +Share 
> clipboard
> +True
> + handler="virt_viewer_window_menu_file_share_clipboard" swapped="no"/>
> +  
> +

I'd rather have it under "Preferences" dialog (it's not an "action").

>  
> id="menu-file-usb-device-selection">
>  True
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index e0e6e63..6b50e5f 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -2571,6 +2571,31 @@ gboolean 
> virt_viewer_app_get_session_cancelled(VirtViewerApp *self)
>  return self->priv->cancelled;
>  }
>
> +gboolean virt_viewer_app_get_config_share_clipboard(VirtViewerApp *self)
> +{
> +VirtViewerAppPrivate *priv = self->priv;
> +
> +GError *error = NULL;
> +
> +gboolean share_clipboard = g_key_file_get_boolean(priv->config,
> +  "virt-viewer", 
> "share-clipboard", &error);
> +
> +if (error) {
> +share_clipboard = TRUE; /* backwards-compatible default value */
> +g_clear_error(&error);
> +}
> +
> +return share_clipboard;
> +}
> +
> +void virt_viewer_app_set_config_share_clipboard(VirtViewerApp *self, 
> gboolean enable)
> +{
> +VirtViewerAppPrivate *priv = self->priv;
> +
> +g_key_file_set_boolean(priv->config,
> +   "virt-viewer", "share-clipboard", enable);
> +}
> +
>  /*
>   * Local variables:
>   *  c-indent-level: 4
> diff --git a/src/virt-viewer-app.h b/src/virt-viewer-app.h
> index 16b1c8c..962226b 100644
> --- a/src/virt-viewer-app.h
> +++ b/src/virt-viewer-app.h
> @@ -99,6 +99,9 @@ void virt_viewer_app_show_preferences(VirtViewerApp *app, 
> GtkWidget *parent);
>  void virt_viewer_app_set_menus_sensitive(VirtViewerApp *self, gboolean 
> sensitive);
>  gboolean virt_viewer_app_get_session_cancelled(VirtViewerApp *self);
>
> +gboolean virt_viewer_app_get_config_share_clipboard(VirtViewerApp *self);
> +void virt_viewer_app_set_config_share_clipboard(VirtViewerApp *self, 
> gboolean enable);
> +
>  G_END_DECLS
>
>  #endif /* VIRT_VIEWER_APP_H */
> diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
> index fdc7004..2e8b6a8 100644
> --- a/src/virt-viewer-session-spice.c
> +++ b/src/virt-viewer-session-spice.c
> @@ -62,7 +62,8 @@ enum {
>  PROP_MAIN_WINDOW
>  };
>
> -
> +static gboolean 
> virt_viewer_session_spice_get_share_clipboard(VirtViewerSession* session);
> +static void virt_viewer_session_spice_set_share_clipboard(VirtViewerSession* 
> session, gboolean value);
>  static void virt_viewer_session_spice_close(VirtViewerSession *session);
>  static gboolean virt_viewer_session_spice_open_fd(VirtViewerSession 
> *session, int fd);
>  static gboolean virt_viewer_session_spice_open_host(VirtViewerSession 
> *session, const gchar *host, const gchar *port, const gchar *tlsport);
> @@ -247,6 +248,8 @@ 
> virt_viewer_session_spice_class_init(VirtViewerSessionSpiceClass *klass)
>  oclass->constructed = virt_viewer_session_spice_constructed;
>
>  dclass->close = virt_viewer_session_spice_close;
> +dclass->get_share_clipboard = 
> virt_viewer_session_spice_get_share_clipboard;
> +dclass->set_share_clipboard = 
> virt_viewer_session_spice_set_share_clipboard;
>  dclass->open_fd = virt_viewer_session_spice_open_fd;
>  dclass->open_host = virt_viewer_session_spice_open_host;
>  dclass->open_uri = virt_viewer_session_spice_open_uri;
> @@ -392,7 +395,9 @@ create_spice_session(VirtViewerSessionSpice *self)
>  spice_set_session_option(self->priv->session);
>
>  sel

Re: [virt-tools-list] [virt-viewer PATCH] msi: record full build environment in MSI installer

2019-02-19 Thread Marc-André Lureau
On Tue, Feb 19, 2019 at 4:02 PM Daniel P. Berrangé  wrote:
>
> For proper compliance with the GPL and other licenses we need to be
> clear about exactly what toolchain and dependent packages we used in
> order to build the MSI installer we distribute.
>
> Historically we've done this by including a "deps.txt" file which
> provides a list of all the mingw{32,64}-* RPMs on the host system.
>
> This is not sufficient information, however, because the build system
> will in fact use various native packages too from the toolchain too,
> notably including any program run by "configure" which covers various
> shell utilities, and pkg-config, and then of course make & msitools
> itself.
>
> Rather than try to figure out which subset of host RPMs are used,
> just list every single host RPM that is installed.
>
> A key implication of this is that formal release builds should always
> be done in a pristine build root populated with the minimal content
> required for the build.
>
> Signed-off-by: Daniel P. Berrangé 

Reviewed-by: Marc-André Lureau 
> ---
>  data/Makefile.am| 8 
>  data/virt-viewer.wxs.in | 6 +++---
>  2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/data/Makefile.am b/data/Makefile.am
> index 54be2b1..1f6c8bf 100644
> --- a/data/Makefile.am
> +++ b/data/Makefile.am
> @@ -36,10 +36,10 @@ else
>  HaveGtkVnc = False
>  endif
>
> -deps.txt:
> -   $(AM_V_GEN)rpm -qa | grep $(host_os) | sort | unix2dos > $@
> +buildenv.txt:
> +   $(AM_V_GEN)rpm -qa | sort | unix2dos > $@
>
> -virt-viewer-$(WIXL_ARCH)-$(VERSION).msi: virt-viewer.wxs deps.txt
> +virt-viewer-$(WIXL_ARCH)-$(VERSION).msi: virt-viewer.wxs buildenv.txt
> $(AM_V_GEN)DESTDIR=`mktemp -d` &&   \
> make -C $(top_builddir) install DESTDIR=$$DESTDIR >/dev/null && \
> find $$DESTDIR | wixl-heat -p $$DESTDIR$(prefix)/   \
> @@ -59,7 +59,7 @@ virt-viewer-$(WIXL_ARCH)-$(VERSION).msi: virt-viewer.wxs 
> deps.txt
>  msi: virt-viewer-$(WIXL_ARCH)-$(VERSION).msi
>
>  CLEANFILES +=  \
> -   deps.txt\
> +   buildenv.txt\
> virt-viewer-$(WIXL_ARCH)-$(VERSION).msi \
> $(NULL)
>
> diff --git a/data/virt-viewer.wxs.in b/data/virt-viewer.wxs.in
> index 2047720..99d70d5 100644
> --- a/data/virt-viewer.wxs.in
> +++ b/data/virt-viewer.wxs.in
> @@ -68,8 +68,8 @@
>  
>
>  
> -  
> - Source="deps.txt"/>
> +  
> + Source="buildenv.txt"/>
>
>  
>
> @@ -117,7 +117,7 @@
>
>
>
> -  
> +  
>
>
>
> --
> 2.20.1
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [virt-viewer PATCH] Add a git-publish configuration file

2019-02-19 Thread Marc-André Lureau
Hi
On Tue, Feb 19, 2019 at 4:03 PM Daniel P. Berrangé  wrote:
>
> Signed-off-by: Daniel P. Berrangé 
> ---
>  .gitpublish | 4 
>  1 file changed, 4 insertions(+)
>  create mode 100644 .gitpublish
>
> diff --git a/.gitpublish b/.gitpublish
> new file mode 100644
> index 000..bf82571
> --- /dev/null
> +++ b/.gitpublish
> @@ -0,0 +1,4 @@
> +[gitpublishprofile "default"]
> +base = master
> +to = virt-tools-list@redhat.com
> +prefix = virt-viewer PATCH

In general, I believe "PATCH virt-viewer" order is more common.

> --
> 2.20.1
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [virt-viewer PATCH 5/5] Switch to gnulib's compiler warning flags

2019-02-13 Thread Marc-André Lureau
Hi

On Wed, Feb 13, 2019 at 6:05 PM Daniel P. Berrangé  wrote:
>
> This enables many more compiler warnings than the current code. It also
> ensures that -Werror is enabled by default when building from GIT so
> that maintainers see regressions as hard failures.
>
> Signed-off-by: Daniel P. Berrangé 

Reviewed-by: Marc-André Lureau 

But soon we will switch to meson :) oh well!

> ---
>  acinclude.m4   |  98 ---
>  configure.ac   |   2 +-
>  m4/manywarnings.m4 | 334 +
>  m4/virt-viewer-warnings.m4 | 159 ++
>  m4/warnings.m4 | 115 +
>  prepare-release.sh |   2 +-
>  6 files changed, 610 insertions(+), 100 deletions(-)
>  delete mode 100644 acinclude.m4
>  create mode 100644 m4/manywarnings.m4
>  create mode 100644 m4/virt-viewer-warnings.m4
>  create mode 100644 m4/warnings.m4
>
> diff --git a/acinclude.m4 b/acinclude.m4
> deleted file mode 100644
> index 68398a6..000
> --- a/acinclude.m4
> +++ /dev/null
> @@ -1,98 +0,0 @@
> -dnl
> -dnl Taken from gnome-common/macros2/gnome-compiler-flags.m4
> -dnl
> -dnl We've added:
> -dnl   -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return 
> -Wstrict-prototypes -Winline -Wredundant-decls
> -dnl We've removed
> -dnl   CFLAGS="$realsave_CFLAGS"
> -dnl   to avoid clobbering user-specified CFLAGS
> -dnl
> -AC_DEFUN([VIRT_VIEWER_COMPILE_WARNINGS],[
> -dnl **
> -dnl More compiler warnings
> -dnl **
> -
> -AC_ARG_ENABLE(compile-warnings,
> -  
> AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
> - [Turn on compiler warnings]),,
> -  [enable_compile_warnings="m4_default([$1],[maximum])"])
> -
> -warnCFLAGS=
> -
> -try_compiler_flags="-fexceptions -fstack-protector 
> --param=ssp-buffer-size=4 -fasynchronous-unwind-tables"
> -
> -case "$enable_compile_warnings" in
> -no)
> -   ;;
> -minimum)
> -   try_compiler_flags="$try_compiler_flags -Wall"
> -   ;;
> -yes)
> -   try_compiler_flags="$try_compiler_flags -Wall -Wmissing-prototypes 
> -std=c99"
> -   ;;
> -maximum|error)
> -   try_compiler_flags="$try_compiler_flags -Wall -Wmissing-prototypes 
> -std=c99 -Wnested-externs -Wpointer-arith"
> -try_compiler_flags="$try_compiler_flags -Wextra -Wshadow 
> -Wcast-align -Wwrite-strings -Waggregate-return"
> -# Removed -Wstrict-prototypes to avoid GTK bug
> -   try_compiler_flags="$try_compiler_flags -Winline -Wredundant-decls 
> -Wdeprecated-declarations -Wno-sign-compare"
> -   # Remove as glib function casts hit
> -   try_compiler_flags="$try_compiler_flags -Wno-cast-function-type"
> -   if test "$enable_compile_warnings" = "error" ; then
> -   try_compiler_flags="$try_compiler_flags -Werror"
> -   fi
> -   ;;
> -*)
> -   AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to 
> --enable-compile-warnings)
> -   ;;
> -esac
> -
> -AH_VERBATIM([FORTIFY_SOURCE],
> -[/* Enable compile-time and run-time bounds-checking, and 
> some warnings. */
> - #if !defined _FORTIFY_SOURCE && defined __OPTIMIZE__ && 
> __OPTIMIZE__
> - # define _FORTIFY_SOURCE 2
> - #endif
> -])
> -
> -compiler_flags=
> -for option in $try_compiler_flags; do
> -   SAVE_CFLAGS="$CFLAGS"
> -   CFLAGS="$CFLAGS $option"
> -   AC_MSG_CHECKING([whether gcc understands $option])
> -   AC_TRY_COMPILE([], [],
> -   has_option=yes,
> -   has_option=no,)
> -   CFLAGS="$SAVE_CFLAGS"
> -   AC_MSG_RESULT($has_option)
> -   if test $has_option = yes; then
> - compiler_flags="$compiler_flags $option"
> -   fi
> -   unset has_option
> -   unset SAVE_CFLAGS
> -done
> -unset option
> -unset try_compiler_flags
> -
> -AC_ARG_ENABLE(iso-c,
> -  AC_HELP_STRING([--enable-iso-c],
> - [Try to warn if code is not ISO C ]),,
> -  [enable_iso_c=no])
> -
> -AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
> -complCFLAGS=
> -if test "x$enable_iso_c" != "xno"; then
> -

Re: [virt-tools-list] [virt-viewer PATCH 4/5] Declare VirtViewerFile variable at start of method

2019-02-13 Thread Marc-André Lureau
On Wed, Feb 13, 2019 at 6:06 PM Daniel P. Berrangé  wrote:
>
> virt_viewer_session_vnc_auth_credential uses gotos which jump over the
> declaration of 'file', meaning its contents are uninitialized in the
> jump target.
>
> Signed-off-by: Daniel P. Berrangé 

Reviewed-by: Marc-André Lureau 


> ---
>  src/virt-viewer-session-vnc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/virt-viewer-session-vnc.c b/src/virt-viewer-session-vnc.c
> index e7c8cad..31d5361 100644
> --- a/src/virt-viewer-session-vnc.c
> +++ b/src/virt-viewer-session-vnc.c
> @@ -273,6 +273,7 @@ virt_viewer_session_vnc_auth_credential(GtkWidget *src 
> G_GNUC_UNUSED,
>  VirtViewerSessionVnc *self = VIRT_VIEWER_SESSION_VNC(session);
>  char *username = NULL, *password = NULL;
>  gboolean wantPassword = FALSE, wantUsername = FALSE;
> +VirtViewerFile *file = NULL;
>  int i;
>
>  g_debug("Got VNC credential request for %u credential(s)", 
> credList->n_values);
> @@ -295,7 +296,7 @@ virt_viewer_session_vnc_auth_credential(GtkWidget *src 
> G_GNUC_UNUSED,
>  }
>  }
>
> -VirtViewerFile *file = 
> virt_viewer_session_get_file(VIRT_VIEWER_SESSION(self));
> +file = virt_viewer_session_get_file(VIRT_VIEWER_SESSION(self));
>  if (file != NULL) {
>  if (wantUsername) {
>  if (virt_viewer_file_is_set(file, "username")) {
> --
> 2.20.1
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [virt-viewer PATCH 3/5] Fix prototype of function with no arguments

2019-02-13 Thread Marc-André Lureau
On Wed, Feb 13, 2019 at 6:06 PM Daniel P. Berrangé  wrote:
>
> Modern C standard requires the function to be "void"
>
> Signed-off-by: Daniel P. Berrangé 

Reviewed-by: Marc-André Lureau 

> ---
>  src/virt-viewer-app.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index 03a7c00..c46ce15 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -315,7 +315,7 @@ virt_viewer_app_quit(VirtViewerApp *self)
>  }
>
>  static gint
> -get_n_client_monitors()
> +get_n_client_monitors(void)
>  {
>  return gdk_screen_get_n_monitors(gdk_screen_get_default());
>  }
> --
> 2.20.1
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [virt-viewer PATCH 2/5] Annotate message dialog helpers with format(gnu_printf)

2019-02-13 Thread Marc-André Lureau
Hi
On Wed, Feb 13, 2019 at 6:05 PM Daniel P. Berrangé  wrote:
>
> This allows the compiler to validate the format string and args passed
> to the function.
>
> Signed-off-by: Daniel P. Berrangé 

Could we consider the slightly less uglier and foreign
compiler-friendly G_GNUC_PRINTF?


> ---
>  src/virt-viewer-app.c  | 38 +++---
>  src/virt-viewer-notebook.c |  4 ++--
>  2 files changed, 25 insertions(+), 17 deletions(-)
>
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index fd48014..03a7c00 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -197,19 +197,16 @@ virt_viewer_app_set_debug(gboolean debug)
>  doDebug = debug;
>  }
>
> -static GtkWidget*
> -virt_viewer_app_make_message_dialog(VirtViewerApp *self,
> -const char *fmt, ...)
> +__attribute__((format(gnu_printf, 2, 0))) static GtkWidget*
> +virt_viewer_app_make_message_dialogv(VirtViewerApp *self,
> + const char *fmt, va_list vargs)
>  {
>  g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), NULL);
>  GtkWindow *window = 
> GTK_WINDOW(virt_viewer_window_get_window(self->priv->main_window));
>  GtkWidget *dialog;
>  char *msg;
> -va_list vargs;
>
> -va_start(vargs, fmt);
>  msg = g_strdup_vprintf(fmt, vargs);
> -va_end(vargs);
>
>  dialog = gtk_message_dialog_new(window,
>  GTK_DIALOG_MODAL |
> @@ -224,23 +221,34 @@ virt_viewer_app_make_message_dialog(VirtViewerApp *self,
>  return dialog;
>  }
>
> -void
> +__attribute__((format(gnu_printf, 2, 3))) static GtkWidget*
> +virt_viewer_app_make_message_dialog(VirtViewerApp *self,
> +const char *fmt, ...)
> +{
> +g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), NULL);
> +GtkWidget *dialog;
> +va_list vargs;
> +
> +va_start(vargs, fmt);
> +dialog = virt_viewer_app_make_message_dialogv(self, fmt, vargs);
> +va_end(vargs);
> +
> +return dialog;
> +}
> +
> +__attribute__((format(gnu_printf, 2, 3))) void
>  virt_viewer_app_simple_message_dialog(VirtViewerApp *self,
>const char *fmt, ...)
>  {
>  GtkWidget *dialog;
> -char *msg;
>  va_list vargs;
>
>  va_start(vargs, fmt);
> -msg = g_strdup_vprintf(fmt, vargs);
> +dialog = virt_viewer_app_make_message_dialogv(self, fmt, vargs);
>  va_end(vargs);
>
> -dialog = virt_viewer_app_make_message_dialog(self, msg);
>  gtk_dialog_run(GTK_DIALOG(dialog));
>  gtk_widget_destroy(dialog);
> -
> -g_free(msg);
>  }
>
>  static void
> @@ -668,7 +676,7 @@ virt_viewer_app_open_unix_sock(const char *unixsock, 
> GError **error)
>
>  #endif /* defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK) */
>
> -void
> +__attribute__((format(gnu_printf, 2, 3))) void
>  virt_viewer_app_trace(VirtViewerApp *self,
>const char *fmt, ...)
>  {
> @@ -1871,7 +1879,7 @@ virt_viewer_app_on_application_startup(GApplication 
> *app)
>
>  if (!virt_viewer_app_start(self, &error)) {
>  if (error && !g_error_matches(error, VIRT_VIEWER_ERROR, 
> VIRT_VIEWER_ERROR_CANCELLED))
> -virt_viewer_app_simple_message_dialog(self, error->message);
> +virt_viewer_app_simple_message_dialog(self, "%s", 
> error->message);
>
>  g_clear_error(&error);
>  g_application_quit(app);
> @@ -2477,7 +2485,7 @@ show_status_cb(gpointer value,
>  virt_viewer_notebook_show_status(nb, text);
>  }
>
> -void
> +__attribute__((format(gnu_printf, 2, 3))) void
>  virt_viewer_app_show_status(VirtViewerApp *self, const gchar *fmt, ...)
>  {
>  va_list args;
> diff --git a/src/virt-viewer-notebook.c b/src/virt-viewer-notebook.c
> index 3a74e9f..a2092d2 100644
> --- a/src/virt-viewer-notebook.c
> +++ b/src/virt-viewer-notebook.c
> @@ -82,7 +82,7 @@ virt_viewer_notebook_init (VirtViewerNotebook *self)
>  gtk_notebook_append_page(GTK_NOTEBOOK(self), priv->status, NULL);
>  }
>
> -void
> +__attribute__((format(gnu_printf, 2, 0))) void
>  virt_viewer_notebook_show_status_va(VirtViewerNotebook *self, const gchar 
> *fmt, va_list args)
>  {
>  VirtViewerNotebookPrivate *priv;
> @@ -99,7 +99,7 @@ virt_viewer_notebook_show_status_va(VirtViewerNotebook 
> *self, const gchar *fmt,
>  g_free(text);
>  }
>
> -void
> +__attribute__((format(gnu_printf, 2, 3))) void
>  virt_viewer_notebook_show_status(VirtViewerNotebook *self, const gchar *fmt, 
> ...)
>  {
>  va_list args;
> --
> 2.20.1
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [virt-viewer PATCH 1/5] Fix signed/unsigned mixup in format args

2019-02-13 Thread Marc-André Lureau
Hi

On Wed, Feb 13, 2019 at 6:05 PM Daniel P. Berrangé  wrote:
>
> Signed-off-by: Daniel P. Berrangé 

Reviewed-by: Marc-André Lureau 

> ---
>  src/ovirt-foreign-menu.c   | 2 +-
>  src/remote-viewer.c| 6 +++---
>  src/virt-viewer-file-transfer-dialog.c | 4 ++--
>  src/virt-viewer-session-spice.c| 2 +-
>  src/virt-viewer-session-vnc.c  | 4 ++--
>  src/virt-viewer.c  | 6 +++---
>  6 files changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c
> index d234a27..5cfd70b 100644
> --- a/src/ovirt-foreign-menu.c
> +++ b/src/ovirt-foreign-menu.c
> @@ -367,7 +367,7 @@ ovirt_foreign_menu_next_async_step(OvirtForeignMenu *menu,
>  default:
>  g_warn_if_reached();
>  g_task_return_new_error(task, OVIRT_ERROR, OVIRT_ERROR_FAILED,
> -"Invalid state: %d", current_state);
> +"Invalid state: %u", current_state);
>  g_object_unref(task);
>  }
>  }
> diff --git a/src/remote-viewer.c b/src/remote-viewer.c
> index 989466b..509b82a 100644
> --- a/src/remote-viewer.c
> +++ b/src/remote-viewer.c
> @@ -505,10 +505,10 @@ create_ovirt_session(VirtViewerApp *app, const char 
> *uri, GError **err)
>   "proxy-url", &proxy_url,
>   NULL);
>  if (port != 0) {
> -gport = g_strdup_printf("%d", port);
> +gport = g_strdup_printf("%u", port);
>  }
>  if (secure_port != 0) {
> -gtlsport = g_strdup_printf("%d", secure_port);
> +gtlsport = g_strdup_printf("%u", secure_port);
>  }
>
>  if (ghost == NULL) {
> @@ -524,7 +524,7 @@ create_ovirt_session(VirtViewerApp *app, const char *uri, 
> GError **err)
>  session_type = "vnc";
>  } else {
>  g_set_error(&error, VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_FAILED,
> -_("oVirt VM %s has unknown display type: %d"), vm_name, 
> type);
> +_("oVirt VM %s has unknown display type: %u"), vm_name, 
> type);
>  g_debug("%s", error->message);
>  goto error;
>  }
> diff --git a/src/virt-viewer-file-transfer-dialog.c 
> b/src/virt-viewer-file-transfer-dialog.c
> index dcf99a3..6cc397d 100644
> --- a/src/virt-viewer-file-transfer-dialog.c
> +++ b/src/virt-viewer-file-transfer-dialog.c
> @@ -153,8 +153,8 @@ static void 
> update_global_progress(VirtViewerFileTransferDialog *self)
>  if (self->priv->num_files == 1) {
>  message = g_strdup(_("Transferring 1 file..."));
>  } else {
> -message = g_strdup_printf(ngettext("Transferring %d file of %d...",
> -   "Transferring %d files of %d...", 
> n_files),
> +message = g_strdup_printf(ngettext("Transferring %u file of %u...",
> +   "Transferring %u files of %u...", 
> n_files),
>n_files, self->priv->num_files);
>  }
>  gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(self->priv->progressbar), 
> fraction);
> diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
> index c28afc5..463f30b 100644
> --- a/src/virt-viewer-session-spice.c
> +++ b/src/virt-viewer-session-spice.c
> @@ -799,7 +799,7 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel 
> *channel,
>  virt_viewer_session_spice_channel_destroy(NULL, channel, session);
>  break;
>  default:
> -g_warning("unhandled spice main channel event: %d", event);
> +g_warning("unhandled spice main channel event: %u", event);
>  break;
>  }
>
> diff --git a/src/virt-viewer-session-vnc.c b/src/virt-viewer-session-vnc.c
> index c79b63c..e7c8cad 100644
> --- a/src/virt-viewer-session-vnc.c
> +++ b/src/virt-viewer-session-vnc.c
> @@ -159,7 +159,7 @@ virt_viewer_session_vnc_auth_unsupported(VncDisplay *vnc 
> G_GNUC_UNUSED,
>   unsigned int authType,
>   VirtViewerSession *session)
>  {
> -gchar *msg = g_strdup_printf(_("Unsupported authentication type %d"),
> +gchar *msg = g_strdup_printf(_("Unsupported authentication type %u"),
>   authType);
>  g_signal_emit_by_name(session, "session-auth-unsupported", msg);
>  g_free(msg);
> @@ -275,7 +275,7 @@ virt_viewer_ses

Re: [virt-tools-list] [PATCH] build-sys: lower spice-gtk requirement to 0.35 again

2019-02-04 Thread Marc-André Lureau
Hi

Subject should be "[PATCH virt-viewer]..."

On Mon, Feb 4, 2019 at 10:05 AM  wrote:
>
> From: Marc-André Lureau 
>
> Compile out QMP channel support if spice-gtk version < 0.36.
>
> (note: I didn't bother adding configure switch to enable it
> explicitly, this could be added later if necessary)
>
> Signed-off-by: Marc-André Lureau 
> ---
>  configure.ac|  2 +-
>  src/virt-viewer-session-spice.c | 18 --
>  2 files changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 50cd91a..5598c61 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -24,7 +24,7 @@ LIBXML2_REQUIRED="2.6.0"
>  LIBVIRT_REQUIRED="0.10.0"
>  LIBVIRT_GLIB_REQUIRED="0.1.8"
>  GTK_VNC_REQUIRED="0.4.0"
> -SPICE_GTK_REQUIRED="0.36"
> +SPICE_GTK_REQUIRED="0.35"
>  SPICE_PROTOCOL_REQUIRED="0.12.7"
>  GOVIRT_REQUIRED="0.3.3"
>  REST_REQUIRED="0.8"
> diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
> index 0c58133..c28afc5 100644
> --- a/src/virt-viewer-session-spice.c
> +++ b/src/virt-viewer-session-spice.c
> @@ -37,6 +37,10 @@
>  #include "virt-viewer-display-vte.h"
>  #include "virt-viewer-auth.h"
>
> +#if SPICE_GTK_CHECK_VERSION(0,36,0)
> +#define WITH_QMP_PORT 1
> +#endif
> +
>  G_DEFINE_TYPE (VirtViewerSessionSpice, virt_viewer_session_spice, 
> VIRT_VIEWER_TYPE_SESSION)
>
>  struct _VirtViewerSessionSpicePrivate {
> @@ -52,7 +56,9 @@ struct _VirtViewerSessionSpicePrivate {
>  gboolean did_auto_conf;
>  VirtViewerFileTransferDialog *file_transfer_dialog;
>  GError *disconnect_error;
> +#ifdef WITH_QMP_PORT
>  SpiceQmpPort *qmp;
> +#endif
>  };
>
>  #define VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(o) 
> (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION_SPICE, 
> VirtViewerSessionSpicePrivate))
> @@ -464,8 +470,9 @@ virt_viewer_session_spice_close(VirtViewerSession 
> *session)
>
>  g_object_add_weak_pointer(G_OBJECT(self), (gpointer*)&self);
>
> +#ifdef WITH_QMP_PORT
>  g_clear_object(&self->priv->qmp);
> -
> +#endif
>  virt_viewer_session_spice_clear_displays(self);
>
>  if (self->priv->session) {
> @@ -1016,8 +1023,10 @@ port_name_to_vte_name(const char *name)
>  }
>
>  static void
> -virt_viewer_session_spice_vm_action(VirtViewerSession *sess, gint action)
> +virt_viewer_session_spice_vm_action(VirtViewerSession *sess G_GNUC_UNUSED,
> +gint action G_GNUC_UNUSED)
>  {
> +#ifdef WITH_QMP_PORT
>  VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(sess);
>
>  switch (action) {
> @@ -1041,8 +1050,10 @@ virt_viewer_session_spice_vm_action(VirtViewerSession 
> *sess, gint action)
>  }
>
>  spice_qmp_port_vm_action_async(self->priv->qmp, action, NULL, NULL, 
> NULL);
> +#endif
>  }
>
> +#ifdef WITH_QMP_PORT
>  static void
>  set_vm_running(VirtViewerSessionSpice *self, gboolean running)
>  {
> @@ -1093,6 +1104,7 @@ static void qmp_event_cb(VirtViewerSessionSpice *self, 
> const gchar *event,
>  set_vm_running(self, TRUE);
>  }
>  }
> +#endif /* WITH_QMP_PORT */
>
>  static void
>  spice_port_opened(SpiceChannel *channel, GParamSpec *pspec G_GNUC_UNUSED,
> @@ -1115,6 +1127,7 @@ spice_port_opened(SpiceChannel *channel, GParamSpec 
> *pspec G_GNUC_UNUSED,
>  g_debug("port#%d %s: %s", id, name, opened ? "opened" : "closed");
>  vte_name = port_name_to_vte_name(name);
>
> +#ifdef WITH_QMP_PORT
>  if (g_str_equal(name, "org.qemu.monitor.qmp.0")) {
>  if (opened) {
>  g_return_if_fail(!self->priv->qmp);
> @@ -1133,6 +1146,7 @@ spice_port_opened(SpiceChannel *channel, GParamSpec 
> *pspec G_GNUC_UNUSED,
>  g_free(name);
>  return;
>  }
> +#endif
>
>  g_free(name);
>  vte = g_object_get_data(G_OBJECT(port), "virt-viewer-vte");
> --
> 2.20.1.98.gecbdaf0899
>

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH virt-viewer v2] Add missing G_MODULE_EXPORT to signal handler

2019-01-18 Thread Marc-André Lureau
On Fri, Jan 18, 2019 at 11:53 PM Eduardo Lima (Etrunko)
 wrote:
>
> Fixes the Windows case where the dialog fails to show with the following
> message:
>
> warning: "Could not find signal handler 
> 'virt_viewer_window_menu_change_cd_activate'"
>
> Signed-off-by: Eduardo Lima (Etrunko) 

ack

> ---
>
> in v2:
>  - Apply similar fix to handlers in remote-viewer-iso-list-dialog.c
>
> ---
>  src/remote-viewer-iso-list-dialog.c | 4 ++--
>  src/virt-viewer-window.c| 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/remote-viewer-iso-list-dialog.c 
> b/src/remote-viewer-iso-list-dialog.c
> index 745768a..3505211 100644
> --- a/src/remote-viewer-iso-list-dialog.c
> +++ b/src/remote-viewer-iso-list-dialog.c
> @@ -216,7 +216,7 @@ remote_viewer_iso_list_dialog_response(GtkDialog *dialog,
>  remote_viewer_iso_list_dialog_refresh_iso_list(self);
>  }
>
> -void
> +G_MODULE_EXPORT void
>  remote_viewer_iso_list_dialog_toggled(GtkCellRendererToggle *cell_renderer 
> G_GNUC_UNUSED,
>gchar *path,
>gpointer user_data)
> @@ -247,7 +247,7 @@ 
> remote_viewer_iso_list_dialog_toggled(GtkCellRendererToggle *cell_renderer 
> G_GNU
>  g_free(name);
>  }
>
> -void
> +G_MODULE_EXPORT void
>  remote_viewer_iso_list_dialog_row_activated(GtkTreeView *view G_GNUC_UNUSED,
>  GtkTreePath *path,
>  GtkTreeViewColumn *col 
> G_GNUC_UNUSED,
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index 9b8e409..a7b2deb 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -1211,7 +1211,7 @@ iso_dialog_response(GtkDialog *dialog,
>  }
>  #endif
>
> -void
> +G_MODULE_EXPORT void
>  virt_viewer_window_menu_change_cd_activate(GtkWidget *menu G_GNUC_UNUSED,
> VirtViewerWindow *self 
> G_GNUC_UNUSED)
>  {
> --
> 2.20.1
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] [PATCH virt-viewer] Add missing G_MODULE_EXPORT to signal handler

2019-01-18 Thread Marc-André Lureau
On Fri, Jan 18, 2019 at 6:58 PM Eduardo Lima (Etrunko)
 wrote:
>
> Fixes the Windows case where the dialog fails to show with the following
> message:
>
> warning: "Could not find signal handler 
> 'virt_viewer_window_menu_change_cd_activate'"
>
> Signed-off-by: Eduardo Lima (Etrunko) 

ack

> ---
>  src/virt-viewer-window.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index 2be230a..b2f29a3 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -1131,7 +1131,7 @@ iso_dialog_response(GtkDialog *dialog,
>  }
>  #endif
>
> -void
> +G_MODULE_EXPORT void
>  virt_viewer_window_menu_change_cd_activate(GtkWidget *menu G_GNUC_UNUSED,
> VirtViewerWindow *self 
> G_GNUC_UNUSED)
>  {
> --
> 2.20.1
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] [PATCH virt-viewer] Spice: listen for new 'SpiceSession::disconnected' signal

2019-01-16 Thread Marc-André Lureau
Hi

On Fri, Jan 4, 2019 at 11:08 PM Marc-André Lureau
 wrote:
>
> Hi
>
> On Tue, Sep 18, 2018 at 8:25 PM Jonathon Jongsma  wrote:
> >
> > Previously we were emitting the VirtViewerSession::session-disconnected
> > when we got the Spice::session::channel-destroy signal for the last
> > channel. However, since the channels are still valid at this point, and
> > because VirtViewerApp quits the application in response to the
> > session-disconnected signal, that means that the channels were never
> > being properly freed. This was particularly problematic for the usbredir
> > channel, which must disconnect any connected USB devices as part of its
> > destruction. By using the new SpiceSession::disconnected signal instead,
> > we can ensure that all channels have been disconnected and properly
> > destroyed before quitting the application.
> > ---
> >
> > NOTE: this is an older patch fell through the cracks. I added the
> > SpiceSession::disconnected signal a while ago and was waiting for an
> > official spice-gtk release before adding this patch to virt-viewer. The
> > new spice-gtk release has been out for a while, but this patch was
> > forgotten until now.
> >
> >  src/virt-viewer-session-spice.c | 24 +++-
> >  1 file changed, 19 insertions(+), 5 deletions(-)
>
> This patch introduces a regression, virt-viewer now hangs when the
> initial connection fails.
> Reverting the patch works again
>
> Jonathon, can you take a look?

To not loose track of this regression, I opened
https://bugzilla.redhat.com/show_bug.cgi?id=1666869

Daniel, Bugzilla is not that great to track upstream issues. Would
pagure issues be better?

>
> thanks
>
> >
> > diff --git a/src/virt-viewer-session-spice.c 
> > b/src/virt-viewer-session-spice.c
> > index fdc7004..cb06af2 100644
> > --- a/src/virt-viewer-session-spice.c
> > +++ b/src/virt-viewer-session-spice.c
> > @@ -50,7 +50,7 @@ struct _VirtViewerSessionSpicePrivate {
> >  guint pass_try;
> >  gboolean did_auto_conf;
> >  VirtViewerFileTransferDialog *file_transfer_dialog;
> > -
> > +GError *disconnect_error;
> >  };
> >
> >  #define VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(o) 
> > (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION_SPICE, 
> > VirtViewerSessionSpicePrivate))
> > @@ -75,6 +75,8 @@ static void 
> > virt_viewer_session_spice_channel_new(SpiceSession *s,
> >  static void virt_viewer_session_spice_channel_destroy(SpiceSession *s,
> >SpiceChannel 
> > *channel,
> >VirtViewerSession 
> > *session);
> > +static void virt_viewer_session_spice_session_disconnected(SpiceSession *s,
> > +   
> > VirtViewerSessionSpice *session);
> >  static void virt_viewer_session_spice_smartcard_insert(VirtViewerSession 
> > *session);
> >  static void virt_viewer_session_spice_smartcard_remove(VirtViewerSession 
> > *session);
> >  static gboolean 
> > virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice 
> > *self);
> > @@ -152,6 +154,7 @@ virt_viewer_session_spice_dispose(GObject *obj)
> >  gtk_widget_destroy(GTK_WIDGET(spice->priv->file_transfer_dialog));
> >  spice->priv->file_transfer_dialog = NULL;
> >  }
> > +g_clear_error(&spice->priv->disconnect_error);
> >
> >  G_OBJECT_CLASS(virt_viewer_session_spice_parent_class)->dispose(obj);
> >  }
> > @@ -398,6 +401,8 @@ create_spice_session(VirtViewerSessionSpice *self)
> >
> > G_CALLBACK(virt_viewer_session_spice_channel_new), self, 0);
> >  virt_viewer_signal_connect_object(self->priv->session, 
> > "channel-destroy",
> >
> > G_CALLBACK(virt_viewer_session_spice_channel_destroy), self, 0);
> > +virt_viewer_signal_connect_object(self->priv->session, "disconnected",
> > +  
> > G_CALLBACK(virt_viewer_session_spice_session_disconnected), self, 0);
> >
> >  usb_manager = spice_usb_device_manager_get(self->priv->session, NULL);
> >  if (usb_manager) {
> > @@ -1091,6 +1096,13 @@ 
> > virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice *self)
> >  return TRUE;
> >  }
> >
> > +static void
> > +virt_viewer_se

Re: [virt-tools-list] [PATCH 1/2] Report gtk_accel_map_change_entry() failures

2019-01-05 Thread Marc-André Lureau
Hi

On Mon, Aug 6, 2018 at 1:09 AM Paul Donohue  wrote:
>
> Signed-off-by: Paul Donohue 

Sorry for the late review,
Reviewed-by: Marc-André Lureau 

> ---
>  src/virt-viewer-app.c | 30 +++---
>  1 file changed, 19 insertions(+), 11 deletions(-)
>
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index 2a2..3a31bbb 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -1790,15 +1790,20 @@ virt_viewer_update_smartcard_accels(VirtViewerApp 
> *self)
>  sw_smartcard = FALSE;
>  }
>  if (sw_smartcard) {
> +gboolean r;
>  g_debug("enabling smartcard shortcuts");
> -gtk_accel_map_change_entry("/file/smartcard-insert",
> -   priv->insert_smartcard_accel_key,
> -   priv->insert_smartcard_accel_mods,
> -   TRUE);
> -gtk_accel_map_change_entry("/file/smartcard-remove",
> -   priv->remove_smartcard_accel_key,
> -   priv->remove_smartcard_accel_mods,
> -   TRUE);
> +r = gtk_accel_map_change_entry("/file/smartcard-insert",
> +   priv->insert_smartcard_accel_key,
> +   priv->insert_smartcard_accel_mods,
> +   TRUE);
> +if (!r)
> +g_warning("Unable to set hotkey for 'smartcard-insert' due to a 
> conflict in GTK");
> +r = gtk_accel_map_change_entry("/file/smartcard-remove",
> +   priv->remove_smartcard_accel_key,
> +   priv->remove_smartcard_accel_mods,
> +   TRUE);
> +if (!r)
> +g_warning("Unable to set hotkey for 'smartcard-remove' due to a 
> conflict in GTK");
>  } else {
>  g_debug("disabling smartcard shortcuts");
>  gtk_accel_map_change_entry("/file/smartcard-insert", 0, 
> 0, TRUE);
> @@ -2109,12 +2114,13 @@ virt_viewer_app_set_hotkeys(VirtViewerApp *self, 
> const gchar *hotkeys_str)
>  continue;
>  }
>
> +gboolean status = TRUE;
>  if (g_str_equal(*hotkey, "toggle-fullscreen")) {
> -
> gtk_accel_map_change_entry("/view/toggle-fullscreen", accel_key, 
> accel_mods, TRUE);
> +status = 
> gtk_accel_map_change_entry("/view/toggle-fullscreen", accel_key, 
> accel_mods, TRUE);
>  } else if (g_str_equal(*hotkey, "release-cursor")) {
> -gtk_accel_map_change_entry("/view/release-cursor", 
> accel_key, accel_mods, TRUE);
> +status = 
> gtk_accel_map_change_entry("/view/release-cursor", accel_key, 
> accel_mods, TRUE);
>  } else if (g_str_equal(*hotkey, "secure-attention")) {
> -
> gtk_accel_map_change_entry("/send/secure-attention", accel_key, 
> accel_mods, TRUE);
> +status = 
> gtk_accel_map_change_entry("/send/secure-attention", accel_key, 
> accel_mods, TRUE);
>  } else if (g_str_equal(*hotkey, "smartcard-insert")) {
>  virt_viewer_set_insert_smartcard_accel(self, accel_key, 
> accel_mods);
>  } else if (g_str_equal(*hotkey, "smartcard-remove")) {
> @@ -2122,6 +2128,8 @@ virt_viewer_app_set_hotkeys(VirtViewerApp *self, const 
> gchar *hotkeys_str)
>  } else {
>  g_warning("Unknown hotkey command %s", *hotkey);
>  }
> +if (!status)
> +g_warning("Unable to set hotkey for '%s' due to a conflict in 
> GTK", *hotkey);
>  }
>  g_strfreev(hotkeys);
>
> --
> 2.17.1
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH virt-viewer] Spice: listen for new 'SpiceSession::disconnected' signal

2019-01-04 Thread Marc-André Lureau
;channel_count == 0)
> -g_signal_emit_by_name(self, "session-disconnected", error ? 
> error->message : NULL);
> +if (error) {
> +g_warning("Channel error: %s", error->message);
> +if (self->priv->disconnect_error == NULL) {
> +self->priv->disconnect_error = g_error_copy(error);
> +}
> +}
>  }
>
>  VirtViewerSession *
> --
> 2.14.4
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list



-- 
Marc-André Lureau

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 11/16] session: do not take VTE display into account for geometry changes

2018-12-21 Thread Marc-André Lureau
Hi

On Thu, Dec 20, 2018 at 8:51 PM Victor Toso  wrote:
>
> Hi,
>
> On Wed, Sep 26, 2018 at 07:26:34PM +0400, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> >
> > Signed-off-by: Marc-André Lureau 
> > ---
> >  src/virt-viewer-session.c | 5 +
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c
> > index cd1f037..a40b0bb 100644
> > --- a/src/virt-viewer-session.c
> > +++ b/src/virt-viewer-session.c
> > @@ -29,6 +29,7 @@
> >
> >  #include "virt-viewer-session.h"
> >  #include "virt-viewer-util.h"
> > +#include "virt-viewer-display-vte.h"
> >
> >  #define VIRT_VIEWER_SESSION_GET_PRIVATE(o) 
> > (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION, 
> > VirtViewerSessionPrivate))
> >
> > @@ -417,6 +418,10 @@ 
> > virt_viewer_session_on_monitor_geometry_changed(VirtViewerSession* self,
> >
> >  for (l = self->priv->displays; l; l = l->next) {
> >  VirtViewerDisplay *d = VIRT_VIEWER_DISPLAY(l->data);
> > +
> > +if (VIRT_VIEWER_IS_DISPLAY_VTE(d))
> > +continue;
> > +
>
> I was thinking about this while seeing 07/16, are both necessary?
> Seems that this one is better than 06 and 07 as
> virt_viewer_display_get_preferred_monitor_geometry is only called
> here.

I don't remember well, but it looks like you might be right, this
patch alone could have been enough.

Nevertheless, as you acked, 6 & 7 are still valid, as they may fix
some initialization races, when the display don't yet have window
associated.

thanks

>
> >  guint nth = 0;
> >  GdkRectangle *rect = g_new0(GdkRectangle, 1);
> >
> > --
> > 2.19.0.271.gfe8321ec05
> >

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 16/16] spice: hook into QMP port

2018-12-21 Thread Marc-André Lureau
Hi

On Fri, Dec 21, 2018 at 5:35 PM Victor Toso  wrote:
>
> Hi,
>
> On Wed, Sep 26, 2018 at 07:26:39PM +0400, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> >
> > If the "org.qemu.monitor.qmp.0" port is available:
> > - enable the VM UI
> > - get and follow the VM state
> > - send the requested VM actions
> >
> > This requires upcoming spice-gtk version 0.36 with SpiceQmpPort
> > helper.
>
> Patch is fine, problem is just doing spice-gtk release and
> builds. If you push it early on, it will break the build.

Indeed, we should make a spice-gtk release before the end of the year :)
>
>
> > Signed-off-by: Marc-André Lureau 
>
> Acked-by: Victor Toso 

thanks
>
> > ---
> >  configure.ac|   2 +-
> >  src/virt-viewer-session-spice.c | 102 
> >  2 files changed, 103 insertions(+), 1 deletion(-)
> >
> > diff --git a/configure.ac b/configure.ac
> > index e2d86a6..3782937 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -24,7 +24,7 @@ LIBXML2_REQUIRED="2.6.0"
> >  LIBVIRT_REQUIRED="0.10.0"
> >  LIBVIRT_GLIB_REQUIRED="0.1.8"
> >  GTK_VNC_REQUIRED="0.4.0"
> > -SPICE_GTK_REQUIRED="0.35"
> > +SPICE_GTK_REQUIRED="0.36"
> >  SPICE_PROTOCOL_REQUIRED="0.12.7"
> >  GOVIRT_REQUIRED="0.3.3"
> >  REST_REQUIRED="0.8"
> > diff --git a/src/virt-viewer-session-spice.c 
> > b/src/virt-viewer-session-spice.c
> > index 8aa2351..7b7bd24 100644
> > --- a/src/virt-viewer-session-spice.c
> > +++ b/src/virt-viewer-session-spice.c
> > @@ -52,6 +52,7 @@ struct _VirtViewerSessionSpicePrivate {
> >  gboolean did_auto_conf;
> >  VirtViewerFileTransferDialog *file_transfer_dialog;
> >  GError *disconnect_error;
> > +SpiceQmpPort *qmp;
> >  };
> >
> >  #define VIRT_VIEWER_SESSION_SPICE_GET_PRIVATE(o) 
> > (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_SESSION_SPICE, 
> > VirtViewerSessionSpicePrivate))
> > @@ -82,6 +83,7 @@ static void 
> > virt_viewer_session_spice_smartcard_insert(VirtViewerSession *sessio
> >  static void virt_viewer_session_spice_smartcard_remove(VirtViewerSession 
> > *session);
> >  static gboolean 
> > virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice 
> > *self);
> >  static void 
> > virt_viewer_session_spice_apply_monitor_geometry(VirtViewerSession *self, 
> > GHashTable *monitors);
> > +static void virt_viewer_session_spice_vm_action(VirtViewerSession *self, 
> > gint action);
> >
> >  static void 
> > virt_viewer_session_spice_clear_displays(VirtViewerSessionSpice *self)
> >  {
> > @@ -262,6 +264,7 @@ 
> > virt_viewer_session_spice_class_init(VirtViewerSessionSpiceClass *klass)
> >  dclass->apply_monitor_geometry = 
> > virt_viewer_session_spice_apply_monitor_geometry;
> >  dclass->can_share_folder = virt_viewer_session_spice_can_share_folder;
> >  dclass->can_retry_auth = virt_viewer_session_spice_can_retry_auth;
> > +dclass->vm_action = virt_viewer_session_spice_vm_action;
> >
> >  g_type_class_add_private(klass, sizeof(VirtViewerSessionSpicePrivate));
> >
> > @@ -461,6 +464,8 @@ virt_viewer_session_spice_close(VirtViewerSession 
> > *session)
> >
> >  g_object_add_weak_pointer(G_OBJECT(self), (gpointer*)&self);
> >
> > +g_clear_object(&self->priv->qmp);
> > +
> >  virt_viewer_session_spice_clear_displays(self);
> >
> >  if (self->priv->session) {
> > @@ -1003,6 +1008,85 @@ port_name_to_vte_name(const char *name)
> >  return NULL;
> >  }
> >
> > +static void
> > +virt_viewer_session_spice_vm_action(VirtViewerSession *sess, gint action)
> > +{
> > +VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(sess);
> > +
> > +switch (action) {
> > +case VIRT_VIEWER_SESSION_VM_ACTION_QUIT:
> > +action = SPICE_QMP_PORT_VM_ACTION_QUIT;
> > +break;
> > +case VIRT_VIEWER_SESSION_VM_ACTION_RESET:
> > +action = SPICE_QMP_PORT_VM_ACTION_RESET;
> > +break;
> > +case VIRT_VIEWER_SESSION_VM_ACTION_POWER_DOWN:
> > +action = SPICE_QMP_PORT_VM_ACTION_POWER_DOWN;
> > +break;
> > +case VIRT_VIEWER_SESSION_VM_ACTION_PAUSE:
> > +action = SPICE_QMP_PORT_VM_ACTION_PAUSE;
> > +break;
> > +case VIRT_VIEWER_SESSION_VM_ACTION_C

Re: [virt-tools-list] [PATCH v2 12/16] app: create a window for VTE displays

2018-12-21 Thread Marc-André Lureau
Hi

On Fri, Dec 21, 2018 at 3:31 PM Victor Toso  wrote:
>
> Hi,
>
> On Wed, Sep 26, 2018 at 07:26:35PM +0400, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> >
> > virt_viewer_app_display_added() now handles VTE displays. They should
> > be skipped for monitor configuration, and they don't emit "show-hint".
> >
> > (a VTE display has a monitor nth == -1, which is now a valid value)
> >
> > The associated window will be hidden when virt-viewer is started.
> >
> > Signed-off-by: Marc-André Lureau 
> > ---
> >  src/virt-viewer-app.c | 69 ---
> >  1 file changed, 52 insertions(+), 17 deletions(-)
> >
> > diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> > index 568af47..376fe98 100644
> > --- a/src/virt-viewer-app.c
> > +++ b/src/virt-viewer-app.c
> > @@ -112,7 +112,7 @@ struct _VirtViewerAppPrivate {
> >  VirtViewerWindow *main_window;
> >  GtkWidget *main_notebook;
> >  GList *windows;
> > -GHashTable *displays;
> > +GHashTable *displays; /* !vte */
> >  GHashTable *initial_display_map;
> >  gchar *clipboard;
> >  GtkWidget *preferences;
> > @@ -822,9 +822,11 @@ virt_viewer_app_window_new(VirtViewerApp *self, gint 
> > nth)
> >  VirtViewerWindow* window;
> >  GtkWindow *w;
> >
> > -window = virt_viewer_app_get_nth_window(self, nth);
> > -if (window)
> > -return window;
> > +if (nth >= 0) {
> > +window = virt_viewer_app_get_nth_window(self, nth);
> > +if (window)
> > +return window;
> > +}
>
> I think it is better to patch virt_viewer_app_get_nth_window() to
> return NULL if nth < 0 ...

ok

>
> >  window = g_object_new(VIRT_VIEWER_TYPE_WINDOW, "app", self, NULL);
> >  virt_viewer_window_set_kiosk(window, self->priv->kiosk);
> > @@ -848,11 +850,27 @@ virt_viewer_app_window_new(VirtViewerApp *self, gint 
> > nth)
> >  return window;
> >  }
> >
> > +static void
> > +window_weak_notify(gpointer data, GObject *where_was G_GNUC_UNUSED)
> > +{
> > +VirtViewerDisplay *display = VIRT_VIEWER_DISPLAY(data);
> > +
> > +g_object_set_data(G_OBJECT(display), "virt-viewer-window", NULL);
> > +}
> > +
> >  static VirtViewerWindow *
> >  ensure_window_for_display(VirtViewerApp *self, VirtViewerDisplay *display)
> >  {
> > -gint nth = virt_viewer_display_get_nth(display);
> > -VirtViewerWindow *win = virt_viewer_app_get_nth_window(self, nth);
> > +VirtViewerWindow *win = NULL;
> > +gint nth = -1;
>
> ... and nth should be -1 on VTE and win NULL here, so you just
> need to add the if below.

Hmm, it's a bit less code, but it is a bit less correct somehow. We
shouldn't need to call virt_viewer_app_get_nth_window() for a vte
display.

Neverthess, l don't mind much, so I'll follow your recommendation.


>
> > +if (VIRT_VIEWER_IS_DISPLAY_VTE(display)) {
> > +win = g_object_get_data(G_OBJECT(display), "virt-viewer-window");
> > +} else {
> > +nth = virt_viewer_display_get_nth(display);
> > +win = virt_viewer_app_get_nth_window(self, nth);
> > +}
> > +
> >  if (win == NULL) {
> >  GList *l = self->priv->windows;
> >
> > @@ -874,12 +892,26 @@ ensure_window_for_display(VirtViewerApp *self, 
> > VirtViewerDisplay *display)
> >  }
> >
> >  virt_viewer_window_set_display(win, display);
> > +if (VIRT_VIEWER_IS_DISPLAY_VTE(display)) {
> > +g_object_set_data(G_OBJECT(display), "virt-viewer-window", 
> > win);
> > +g_object_weak_ref(G_OBJECT(win), window_weak_notify, display);
> > +}
> >  }
> >  virt_viewer_app_set_window_subtitle(self, win, nth);
> >
> >  return win;
> >  }
> >
> > +static VirtViewerWindow *
> > +display_show_get_window(VirtViewerApp *self, VirtViewerDisplay *display)
> > +{
>
> From the name, it seems like a simple getter but it does a bit
> more than that. Perhaps a reference to notebook would improve
> eg: display_show_notebook_get_window() but I'm not famous for my
> name picking ability.
>

Ok

> > +VirtViewerWindow *win = ensure_window_for_display(self, display);
> > +VirtViewerNotebook *nb = virt_viewer_window_get_notebook(win);
> > +
> > +virt_viewer_notebook_show_display(nb);
> > +

Re: [virt-tools-list] [PATCH v2 13/16] spice: hook into port channel to create VTE terminals

2018-12-21 Thread Marc-André Lureau
Hi

On Fri, Dec 21, 2018 at 4:03 PM Victor Toso  wrote:
>
> Hi,
>
> On Wed, Sep 26, 2018 at 07:26:36PM +0400, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> >
> > QEMU defines a few Spice port channel names in
> > docs/spice-port-fqdn.txt that can be interacted with a terminal.
> >
> > Create VirtViewerDisplayVte display for all known terminal channel,
> > and redirect read/write signals.
> >
> > Note that if VTE support is disabled, or if the VTE console isn't
> > shown, spice-gtk will still process those port channels (discarding
> > the read if VTE is disabled).
> >
> > Signed-off-by: Marc-André Lureau 
> > ---
> >  src/virt-viewer-session-spice.c | 118 +++-
> >  1 file changed, 116 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/virt-viewer-session-spice.c 
> > b/src/virt-viewer-session-spice.c
> > index cb06af2..8aa2351 100644
> > --- a/src/virt-viewer-session-spice.c
> > +++ b/src/virt-viewer-session-spice.c
> > @@ -34,6 +34,7 @@
> >  #include "virt-viewer-util.h"
> >  #include "virt-viewer-session-spice.h"
> >  #include "virt-viewer-display-spice.h"
> > +#include "virt-viewer-display-vte.h"
> >  #include "virt-viewer-auth.h"
> >
> >  G_DEFINE_TYPE (VirtViewerSessionSpice, virt_viewer_session_spice, 
> > VIRT_VIEWER_TYPE_SESSION)
> > @@ -955,20 +956,116 @@ on_new_file_transfer(SpiceMainChannel *channel 
> > G_GNUC_UNUSED,
> >task);
> >  }
> >
> > +static void
> > +spice_port_write_finished(GObject *source_object,
> > +  GAsyncResult *res,
> > +  gpointer dup)
> > +{
> > +SpicePortChannel *port = SPICE_PORT_CHANNEL(source_object);
> > +GError *err = NULL;
> > +
> > +spice_port_channel_write_finish(port, res, &err);
> > +if (err) {
> > +g_warning("Spice port write failed: %s", err->message);
> > +g_error_free(err);
> > +}
> > +g_free(dup);
> > +}
> > +
> > +static void
> > +spice_vte_commit(SpicePortChannel *port, const char *text,
> > + guint size, gpointer user_data G_GNUC_UNUSED)
> > +{
> > +void *dup = g_memdup(text, size);
> > +
> > +/* note: spice-gtk queues write */
> > +spice_port_channel_write_async(port, dup, size,
> > +   NULL, spice_port_write_finished, dup);
> > +}
> > +
> > +static void
> > +spice_port_data(VirtViewerDisplayVte *vte, gpointer data, int size,
> > +SpicePortChannel *port G_GNUC_UNUSED)
> > +{
> > +virt_viewer_display_vte_feed(vte, data, size);
> > +}
> > +
> > +static const char *
> > +port_name_to_vte_name(const char *name)
> > +{
> > +if (g_str_equal(name, "org.qemu.console.serial.0"))
> > +return _("Serial");
> > +else if (g_str_equal(name, "org.qemu.monitor.hmp.0"))
> > +return _("QEMU human monitor");
> > +else if (g_str_equal(name, "org.qemu.console.debug.0"))
> > +return _("QEMU debug console");
> > +
> > +return NULL;
> > +}
> > +
> > +static void
> > +spice_port_opened(SpiceChannel *channel, GParamSpec *pspec G_GNUC_UNUSED,
> > +  VirtViewerSessionSpice *self)
> > +{
> > +SpicePortChannel *port = SPICE_PORT_CHANNEL(channel);
> > +int id;
> > +gchar *name = NULL;
> > +gboolean opened = FALSE;
> > +const char *vte_name;
> > +GtkWidget *vte;
> > +
> > +g_object_get(G_OBJECT(port),
> > + "channel-id", &id,
> > + "port-name", &name,
> > + "port-opened", &opened,
> > + NULL);
> > +
> > +g_return_if_fail(name != NULL);
> > +g_debug("port#%d %s: %s", id, name, opened ? "opened" : "closed");
>
> better to set vte_name and check it now and g_free(name) here so
> you can remove the goto ..

ok

>
> > +vte = g_object_get_data(G_OBJECT(port), "virt-viewer-vte");
> > +if (vte) {
> > +if (opened)
> > +goto end;
> > +
>
> No need to unref it?

good catch, added unref.

>
> > +g_object_set_data(G_OBJECT(port), "virt-viewer

Re: [virt-tools-list] [PATCH] spice: add unix-path in .vv file support

2018-12-21 Thread Marc-André Lureau
Hi

On Fri, Dec 21, 2018 at 4:33 PM Christophe Fergeau  wrote:
>
> On Fri, Dec 21, 2018 at 03:27:59PM +0400, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> >
> > This will allow to connect to a Spice server using a unix socket path,
> > for example:
>
> If you want, but are .vv file used for local spice instance?
>

They are not, but they could be useful if you want to store all
various connection settings.

Note: I wrote that patch because Gerd initially preferred to have a
.vv file for connecting remote-viewer to qemu, when using the upcoming
-display spice-app. But then we agreed that a stable Spice URI was
good enough for now.

Given how VNC URI (rfc7869) are being used, I start thinking we could
pass most .vv settings as URI query parameters instead.. Just some
thoughts.

> Reviewed-by: Christophe Fergeau 
>
> Christophe
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list



-- 
Marc-André Lureau

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 10/16] display: allow display without associated monitor number

2018-12-21 Thread Marc-André Lureau
Hi
On Thu, Dec 20, 2018 at 8:45 PM Victor Toso  wrote:
>
> Hi,
>
> On Wed, Sep 26, 2018 at 07:26:33PM +0400, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> >
> > The VTE display will have monitor id -1.
> >
> > Eventually, having a base "console" class without monitor id could
> > avoid this allowance.
> >
> > Signed-off-by: Marc-André Lureau 
> > ---
> >  src/virt-viewer-display.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c
> > index a1fcb82..98d4edd 100644
> > --- a/src/virt-viewer-display.c
> > +++ b/src/virt-viewer-display.c
> > @@ -129,7 +129,7 @@ virt_viewer_display_class_init(VirtViewerDisplayClass 
> > *class)
> >  g_param_spec_int("nth-display",
> >   "Nth display",
> >   "Nth display",
> > - 0,
> > + -1,
>
> I have a feeling that this should be commited before the vte
> introduction?
>

that doesn't make a big difference, since there is no instance created yet.

> Acked-by: Victor Toso 

thanks

>
> >   G_MAXINT32,
> >   0,
> >   G_PARAM_READWRITE |
> > --
> > 2.19.0.271.gfe8321ec05

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 09/16] app: append VTE consoles to display submenu

2018-12-21 Thread Marc-André Lureau
Hi

On Thu, Dec 20, 2018 at 8:43 PM Victor Toso  wrote:
>
> Hi,
>
> On Wed, Sep 26, 2018 at 07:26:32PM +0400, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> >
> > Get the name of the console, and set the subtitle with it.
> >
> > Rename "set_title" to "set_subtitle" while at it, since it is more
> > appropriate.
>
> I'm confused, isn't this the previous patch? :)

indeed

>
> > Signed-off-by: Marc-André Lureau 
> > ---
> >  src/virt-viewer-app.c | 20 
> >  1 file changed, 20 insertions(+)
> >
> > diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> > index 7b750c6..568af47 100644
> > --- a/src/virt-viewer-app.c
> > +++ b/src/virt-viewer-app.c
> > @@ -2294,6 +2294,26 @@ window_update_menu_displays_cb(gpointer value,
> >  tmp = tmp->next;
> >  }
> >
> > +for (GList *l = self->priv->windows; l; l = l->next) {
>
> It would be the first time using this C feature in virt-viewer
> codebase I think. You might use tmp if you don't want to declare
> a new var.

ok

>
> > +VirtViewerWindow *win = VIRT_VIEWER_WINDOW(l->data);
> > +VirtViewerDisplay *display = virt_viewer_window_get_display(win);
> > +
> > +if (VIRT_VIEWER_IS_DISPLAY_VTE(display)) {
> > +gchar *name = NULL;
> > +GtkWidget *item;
> > +
> > +g_object_get(display, "name", &name, NULL);
> > +item = gtk_check_menu_item_new_with_label(name);
> > +g_free(name);
> > +
> > +virt_viewer_signal_connect_object(G_OBJECT(item), "toggled",
> > +G_CALLBACK(menu_display_visible_toggled_cb), display, 0);
> > +gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item),
> > +
> > gtk_widget_get_visible(GTK_WIDGET(virt_viewer_window_get_window(win;
> > +gtk_menu_shell_append(submenu, item);
> > +}
> > +
> > +
>
> Apart from the rename bit on commit log,
> Acked-by: Victor Toso 
>
> >  gtk_widget_show_all(GTK_WIDGET(submenu));
> >  g_list_free(keys);
> >  }
> > --
> > 2.19.0.271.gfe8321ec05
> >

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 05/16] window/zoom: deal with VTE display differently

2018-12-21 Thread Marc-André Lureau
Hi

On Thu, Dec 20, 2018 at 8:14 PM Victor Toso  wrote:
>
> Hi,
>
> On Wed, Sep 26, 2018 at 07:26:28PM +0400, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> >
> > VTE display doesn't use the desktop / window aspect ratio, let's just
> > call directly the functions handling zoom.
> >
> > Signed-off-by: Marc-André Lureau 
> > ---
> >  src/virt-viewer-window.c | 28 ++--
> >  1 file changed, 22 insertions(+), 6 deletions(-)
> >
> > diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> > index e50ac54..67e6f4f 100644
> > --- a/src/virt-viewer-window.c
> > +++ b/src/virt-viewer-window.c
> > @@ -42,6 +42,7 @@
> >  #include "virt-viewer-app.h"
> >  #include "virt-viewer-util.h"
> >  #include "virt-viewer-timed-revealer.h"
> > +#include "virt-viewer-display-vte.h"
> >
> >  #include "remote-viewer-iso-list-dialog.h"
> >
> > @@ -383,23 +384,35 @@ G_MODULE_EXPORT void
> >  virt_viewer_window_menu_view_zoom_out(GtkWidget *menu G_GNUC_UNUSED,
> >VirtViewerWindow *self)
> >  {
> > -virt_viewer_window_set_zoom_level(self,
> > -  
> > virt_viewer_window_get_real_zoom_level(self) - ZOOM_STEP);
> > +if (VIRT_VIEWER_IS_DISPLAY_VTE(self->priv->display)) {
> > +
> > virt_viewer_display_vte_zoom_out(VIRT_VIEWER_DISPLAY_VTE(self->priv->display));
> > +} else {
> > +virt_viewer_window_set_zoom_level(self,
> > +  
> > virt_viewer_window_get_real_zoom_level(self) - ZOOM_STEP);
> > +}
> >  }
> >
> >  G_MODULE_EXPORT void
> >  virt_viewer_window_menu_view_zoom_in(GtkWidget *menu G_GNUC_UNUSED,
> >   VirtViewerWindow *self)
> >  {
> > -virt_viewer_window_set_zoom_level(self,
> > -  
> > virt_viewer_window_get_real_zoom_level(self) + ZOOM_STEP);
> > +if (VIRT_VIEWER_IS_DISPLAY_VTE(self->priv->display)) {
> > +
> > virt_viewer_display_vte_zoom_in(VIRT_VIEWER_DISPLAY_VTE(self->priv->display));
> > +} else {
> > +virt_viewer_window_set_zoom_level(self,
> > +  
> > virt_viewer_window_get_real_zoom_level(self) + ZOOM_STEP);
> > +}
> >  }
> >
> >  G_MODULE_EXPORT void
> >  virt_viewer_window_menu_view_zoom_reset(GtkWidget *menu G_GNUC_UNUSED,
> >  VirtViewerWindow *self)
> >  {
> > -virt_viewer_window_set_zoom_level(self, NORMAL_ZOOM_LEVEL);
> > +if (VIRT_VIEWER_IS_DISPLAY_VTE(self->priv->display)) {
> > +
> > virt_viewer_display_vte_zoom_reset(VIRT_VIEWER_DISPLAY_VTE(self->priv->display));
> > +} else {
> > +virt_viewer_window_set_zoom_level(self, NORMAL_ZOOM_LEVEL);
> > +}
> >  }
> >
> >  /* Kick GtkWindow to tell it to adjust to our new widget sizes */
> > @@ -1521,7 +1534,10 @@ virt_viewer_window_set_zoom_level(VirtViewerWindow 
> > *self, gint zoom_level)
> >
> >  virt_viewer_display_set_zoom_level(VIRT_VIEWER_DISPLAY(priv->display), 
> > priv->zoomlevel);
>
> Maybe move the virt_viewer_display_set_zoom_level() call too?

It is safe common code (zoom-level is not implemented today in VTE
display, but it could be added).

>
> > -virt_viewer_window_queue_resize(self);
> > +if (VIRT_VIEWER_IS_DISPLAY_VTE(priv->display)) {
> > +} else {
> > +virt_viewer_window_queue_resize(self);
> > +}
>
> Any strong reason to keep empty if + else instead of
> if(!_IS_DISPLAY_VTE()) ?

no, fixed

>
> Works without any issues so,
> Acked-by: Victor Toso 

thanks

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 07/16] session: skip monitor changes if there is no sized monitors

2018-12-21 Thread Marc-André Lureau
Hi

On Thu, Dec 20, 2018 at 8:25 PM Victor Toso  wrote:
>
> Hi,
>
> On Wed, Sep 26, 2018 at 07:26:30PM +0400, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> >
> > spice-gtk discards configurations without any sized monitors.
> >
> > Also shuts extra warnings when shifting the monitors.
> >
> > Signed-off-by: Marc-André Lureau 
> > ---
> >  src/virt-viewer-session.c | 6 ++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/src/virt-viewer-session.c b/src/virt-viewer-session.c
> > index 5bac3d9..cd1f037 100644
> > --- a/src/virt-viewer-session.c
> > +++ b/src/virt-viewer-session.c
> > @@ -406,6 +406,7 @@ 
> > virt_viewer_session_on_monitor_geometry_changed(VirtViewerSession* self,
> >  gboolean all_fullscreen = TRUE;
> >  /* GHashTable */
> >  GHashTable *monitors;
> > +gint n_sized_monitors = 0;
> >  GList *l;
> >
> >  klass = VIRT_VIEWER_SESSION_GET_CLASS(self);
> > @@ -421,6 +422,8 @@ 
> > virt_viewer_session_on_monitor_geometry_changed(VirtViewerSession* self,
> >
> >  g_object_get(d, "nth-display", &nth, NULL);
> >  virt_viewer_display_get_preferred_monitor_geometry(d, rect);
> > +if (rect->width > 0 && rect->height > 0)
> > +n_sized_monitors++;
> >
> >  if (virt_viewer_display_get_enabled(d) &&
> >  !virt_viewer_display_get_fullscreen(d))
> > @@ -428,6 +431,9 @@ 
> > virt_viewer_session_on_monitor_geometry_changed(VirtViewerSession* self,
> >  g_hash_table_insert(monitors, GINT_TO_POINTER(nth), rect);
> >  }
> >
> > +if (!n_sized_monitors)
> > +return;
> > +
>
> As non boolean, I'd go with full n_sized_monitors == 0, not sure
> what is preferred in virt-viewer code base tbh.
>

ok

> Either way,
> Acked-by: Victor Toso 

thanks

>
> >  if (!all_fullscreen)
> >  virt_viewer_align_monitors_linear(monitors);
> >
> > --
> > 2.19.0.271.gfe8321ec05
> >

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 00/16] Add QEMU-like UI: VT console & basic VM state

2018-11-28 Thread Marc-André Lureau
Hi

On Wed, Sep 26, 2018 at 7:26 PM  wrote:
>
> From: Marc-André Lureau 
>
> Hi,
>
> QEMU provides multiple display backend, with different set of
> features. One of the richest UI is the -display gtk. It is quite
> minimal, and comparable to remote-viewer UI wrt fullscreen, zooming,
> grabbing. I haven't done a detailed comparison, but for regular use, I
> prefer the remote-viewer UI. The fullscreen mode has a popup toolbar,
> there is a send-key menu, it provides better desktop integration
> support: USB redirection, folder sharing, more complete multi-monitor
> configuration, screenshot. remote-viewer also allows hotkey
> configuration, and has an experimental "kiosk" mode.
>
> However, remote-viewer is lacking 2 important features compared to
> QEMU UI: VT console (for serials, and monitors) and basic VM state
> commands (power off, reset, pause..).
>
> This series add support for VT console over Spice ports, and QMP
> monitor to provide a similar user experience as QEMU -display gtk.
> Another RFC series for QEMU "[PATCH 00/10] RFC: spice: add -display
> app to launch external UI" provides a new "-display app" backend, that
> will configure QEMU appropriately, and start remote-viewer (actually
> any client handling spice+unix://). The result is that the "QEMU UI
> experience" is entirely out of qemu code base and process.
>

ping

> thanks
>
> v2:
>  - rebased
>  - "spice: hook into QMP port" now uses spice-gtk v0.36 SpiceQmpPort
>  - commit message updates
>
> Marc-André Lureau (16):
>   window: do not reset sensitivity of menu-send in rebuild
>   window: set sensitivity based on display capability
>   build-sys: check for VTE library
>   Add a VirtViewerDisplayVte display kind
>   window/zoom: deal with VTE display differently
>   display: ignore display that do not have toplevel window
>   session: skip monitor changes if there is no sized monitors
>   app: set subtitle using VTE name
>   app: append VTE consoles to display submenu
>   display: allow display without associated monitor number
>   session: do not take VTE display into account for geometry changes
>   app: create a window for VTE displays
>   spice: hook into port channel to create VTE terminals
>   app: add "machine" UI
>   app: add "vm-running" property
>   spice: hook into QMP port
>
>  configure.ac|  16 +-
>  src/Makefile.am |   4 +
>  src/resources/ui/virt-viewer.ui |  46 +
>  src/virt-viewer-app.c   | 154 ---
>  src/virt-viewer-display-vte.c   | 319 
>  src/virt-viewer-display-vte.h   |  81 
>  src/virt-viewer-display.c   |   7 +-
>  src/virt-viewer-display.h   |   6 +
>  src/virt-viewer-session-spice.c | 220 +-
>  src/virt-viewer-session.c   |  22 +++
>  src/virt-viewer-session.h   |  11 ++
>  src/virt-viewer-window.c| 107 ++-
>  12 files changed, 955 insertions(+), 38 deletions(-)
>  create mode 100644 src/virt-viewer-display-vte.c
>  create mode 100644 src/virt-viewer-display-vte.h
>
> --
> 2.19.0.271.gfe8321ec05
>

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 00/16] Add QEMU-like UI: VT console & basic VM state

2018-11-16 Thread Marc-André Lureau
Hi

On Tue, Oct 30, 2018 at 8:40 PM Marc-André Lureau
 wrote:
>
> Hi
> On Wed, Sep 26, 2018 at 7:27 PM  wrote:
> >
> > From: Marc-André Lureau 
> >
> > Hi,
> >
> > QEMU provides multiple display backend, with different set of
> > features. One of the richest UI is the -display gtk. It is quite
> > minimal, and comparable to remote-viewer UI wrt fullscreen, zooming,
> > grabbing. I haven't done a detailed comparison, but for regular use, I
> > prefer the remote-viewer UI. The fullscreen mode has a popup toolbar,
> > there is a send-key menu, it provides better desktop integration
> > support: USB redirection, folder sharing, more complete multi-monitor
> > configuration, screenshot. remote-viewer also allows hotkey
> > configuration, and has an experimental "kiosk" mode.
> >
> > However, remote-viewer is lacking 2 important features compared to
> > QEMU UI: VT console (for serials, and monitors) and basic VM state
> > commands (power off, reset, pause..).
> >
> > This series add support for VT console over Spice ports, and QMP
> > monitor to provide a similar user experience as QEMU -display gtk.
> > Another RFC series for QEMU "[PATCH 00/10] RFC: spice: add -display
> > app to launch external UI" provides a new "-display app" backend, that
> > will configure QEMU appropriately, and start remote-viewer (actually
> > any client handling spice+unix://). The result is that the "QEMU UI
> > experience" is entirely out of qemu code base and process.
> >
> > thanks
> >
>
> ping
> thanks

ping

It looks like we are missing reviewers time.
What should we do?

(as I have extra work to do to maintain various pending series.., I'd
need to get them moving)

thanks

>
> > v2:
> >  - rebased
> >  - "spice: hook into QMP port" now uses spice-gtk v0.36 SpiceQmpPort
> >  - commit message updates
> >
> > Marc-André Lureau (16):
> >   window: do not reset sensitivity of menu-send in rebuild
> >   window: set sensitivity based on display capability
> >   build-sys: check for VTE library
> >   Add a VirtViewerDisplayVte display kind
> >   window/zoom: deal with VTE display differently
> >   display: ignore display that do not have toplevel window
> >   session: skip monitor changes if there is no sized monitors
> >   app: set subtitle using VTE name
> >   app: append VTE consoles to display submenu
> >   display: allow display without associated monitor number
> >   session: do not take VTE display into account for geometry changes
> >   app: create a window for VTE displays
> >   spice: hook into port channel to create VTE terminals
> >   app: add "machine" UI
> >   app: add "vm-running" property
> >   spice: hook into QMP port
> >
> >  configure.ac|  16 +-
> >  src/Makefile.am |   4 +
> >  src/resources/ui/virt-viewer.ui |  46 +
> >  src/virt-viewer-app.c   | 154 ---
> >  src/virt-viewer-display-vte.c   | 319 
> >  src/virt-viewer-display-vte.h   |  81 
> >  src/virt-viewer-display.c   |   7 +-
> >  src/virt-viewer-display.h   |   6 +
> >  src/virt-viewer-session-spice.c | 220 +-
> >  src/virt-viewer-session.c   |  22 +++
> >  src/virt-viewer-session.h   |  11 ++
> >  src/virt-viewer-window.c| 107 ++-
> >  12 files changed, 955 insertions(+), 38 deletions(-)
> >  create mode 100644 src/virt-viewer-display-vte.c
> >  create mode 100644 src/virt-viewer-display-vte.h
> >
> > --
> > 2.19.0.271.gfe8321ec05
> >
> > ___
> > virt-tools-list mailing list
> > virt-tools-list@redhat.com
> > https://www.redhat.com/mailman/listinfo/virt-tools-list
>
>
>
> --
> Marc-André Lureau



-- 
Marc-André Lureau

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 00/16] Add QEMU-like UI: VT console & basic VM state

2018-10-30 Thread Marc-André Lureau
Hi
On Wed, Sep 26, 2018 at 7:27 PM  wrote:
>
> From: Marc-André Lureau 
>
> Hi,
>
> QEMU provides multiple display backend, with different set of
> features. One of the richest UI is the -display gtk. It is quite
> minimal, and comparable to remote-viewer UI wrt fullscreen, zooming,
> grabbing. I haven't done a detailed comparison, but for regular use, I
> prefer the remote-viewer UI. The fullscreen mode has a popup toolbar,
> there is a send-key menu, it provides better desktop integration
> support: USB redirection, folder sharing, more complete multi-monitor
> configuration, screenshot. remote-viewer also allows hotkey
> configuration, and has an experimental "kiosk" mode.
>
> However, remote-viewer is lacking 2 important features compared to
> QEMU UI: VT console (for serials, and monitors) and basic VM state
> commands (power off, reset, pause..).
>
> This series add support for VT console over Spice ports, and QMP
> monitor to provide a similar user experience as QEMU -display gtk.
> Another RFC series for QEMU "[PATCH 00/10] RFC: spice: add -display
> app to launch external UI" provides a new "-display app" backend, that
> will configure QEMU appropriately, and start remote-viewer (actually
> any client handling spice+unix://). The result is that the "QEMU UI
> experience" is entirely out of qemu code base and process.
>
> thanks
>

ping
thanks

> v2:
>  - rebased
>  - "spice: hook into QMP port" now uses spice-gtk v0.36 SpiceQmpPort
>  - commit message updates
>
> Marc-André Lureau (16):
>   window: do not reset sensitivity of menu-send in rebuild
>   window: set sensitivity based on display capability
>   build-sys: check for VTE library
>   Add a VirtViewerDisplayVte display kind
>   window/zoom: deal with VTE display differently
>   display: ignore display that do not have toplevel window
>   session: skip monitor changes if there is no sized monitors
>   app: set subtitle using VTE name
>   app: append VTE consoles to display submenu
>   display: allow display without associated monitor number
>   session: do not take VTE display into account for geometry changes
>   app: create a window for VTE displays
>   spice: hook into port channel to create VTE terminals
>   app: add "machine" UI
>   app: add "vm-running" property
>   spice: hook into QMP port
>
>  configure.ac|  16 +-
>  src/Makefile.am |   4 +
>  src/resources/ui/virt-viewer.ui |  46 +
>  src/virt-viewer-app.c   | 154 ---
>  src/virt-viewer-display-vte.c   | 319 
>  src/virt-viewer-display-vte.h   |  81 
>  src/virt-viewer-display.c   |   7 +-
>  src/virt-viewer-display.h   |   6 +
>  src/virt-viewer-session-spice.c | 220 +-
>  src/virt-viewer-session.c   |  22 +++
>  src/virt-viewer-session.h   |  11 ++
>  src/virt-viewer-window.c| 107 ++-
>  12 files changed, 955 insertions(+), 38 deletions(-)
>  create mode 100644 src/virt-viewer-display-vte.c
>  create mode 100644 src/virt-viewer-display-vte.h
>
> --
> 2.19.0.271.gfe8321ec05
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list



-- 
Marc-André Lureau

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 00/16] Add QEMU-like UI: VT console & basic VM state

2018-10-03 Thread Marc-André Lureau
Hi

On Wed, Sep 26, 2018 at 7:27 PM  wrote:
>
> From: Marc-André Lureau 
>
> Hi,
>
> QEMU provides multiple display backend, with different set of
> features. One of the richest UI is the -display gtk. It is quite
> minimal, and comparable to remote-viewer UI wrt fullscreen, zooming,
> grabbing. I haven't done a detailed comparison, but for regular use, I
> prefer the remote-viewer UI. The fullscreen mode has a popup toolbar,
> there is a send-key menu, it provides better desktop integration
> support: USB redirection, folder sharing, more complete multi-monitor
> configuration, screenshot. remote-viewer also allows hotkey
> configuration, and has an experimental "kiosk" mode.
>
> However, remote-viewer is lacking 2 important features compared to
> QEMU UI: VT console (for serials, and monitors) and basic VM state
> commands (power off, reset, pause..).
>
> This series add support for VT console over Spice ports, and QMP
> monitor to provide a similar user experience as QEMU -display gtk.
> Another RFC series for QEMU "[PATCH 00/10] RFC: spice: add -display
> app to launch external UI" provides a new "-display app" backend, that
> will configure QEMU appropriately, and start remote-viewer (actually
> any client handling spice+unix://). The result is that the "QEMU UI
> experience" is entirely out of qemu code base and process.
>
> thanks
>
> v2:
>  - rebased
>  - "spice: hook into QMP port" now uses spice-gtk v0.36 SpiceQmpPort
>  - commit message updates
>

ping

> Marc-André Lureau (16):
>   window: do not reset sensitivity of menu-send in rebuild
>   window: set sensitivity based on display capability
>   build-sys: check for VTE library
>   Add a VirtViewerDisplayVte display kind
>   window/zoom: deal with VTE display differently
>   display: ignore display that do not have toplevel window
>   session: skip monitor changes if there is no sized monitors
>   app: set subtitle using VTE name
>   app: append VTE consoles to display submenu
>   display: allow display without associated monitor number
>   session: do not take VTE display into account for geometry changes
>   app: create a window for VTE displays
>   spice: hook into port channel to create VTE terminals
>   app: add "machine" UI
>   app: add "vm-running" property
>   spice: hook into QMP port
>
>  configure.ac|  16 +-
>  src/Makefile.am |   4 +
>  src/resources/ui/virt-viewer.ui |  46 +
>  src/virt-viewer-app.c   | 154 ---
>  src/virt-viewer-display-vte.c   | 319 
>  src/virt-viewer-display-vte.h   |  81 
>  src/virt-viewer-display.c   |   7 +-
>  src/virt-viewer-display.h   |   6 +
>  src/virt-viewer-session-spice.c | 220 +-
>  src/virt-viewer-session.c   |  22 +++
>  src/virt-viewer-session.h   |  11 ++
>  src/virt-viewer-window.c| 107 ++-
>  12 files changed, 955 insertions(+), 38 deletions(-)
>  create mode 100644 src/virt-viewer-display-vte.c
>  create mode 100644 src/virt-viewer-display-vte.h
>
> --
> 2.19.0.271.gfe8321ec05
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list



-- 
Marc-André Lureau

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH] cli: add memory backing access_mode & source_type

2018-10-01 Thread Marc-André Lureau
Hi

On Mon, Oct 1, 2018 at 9:20 PM Cole Robinson  wrote:
>
> On 09/17/2018 06:59 AM, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> >
> > Allow to set some memory backing options, ex:
> > --memorybacking access_mode=shared,source_type=anonymous
> >
> > Signed-off-by: Marc-André Lureau 
> > ---
> >   .../cli-test-xml/compare/virt-install-singleton-config-2.xml  | 4 
> >   tests/clitest.py  | 2 +-
> >   virtinst/cli.py   | 2 ++
> >   virtinst/domain/memorybacking.py  | 2 ++
> >   4 files changed, 9 insertions(+), 1 deletion(-)
>
> Patch looks good, thanks. I'll push after libvirt patches land

The attributes/properties set here are long supported by libvirt.

Only the value "memfd" for source_type I use in the test isn't yet supported.

thanks

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 22/22] spice: hook into QMP port

2018-09-05 Thread Marc-André Lureau
Hi

On Mon, Sep 3, 2018 at 8:53 AM, Victor Toso  wrote:
> Hi,
>
> On Tue, Jul 31, 2018 at 03:41:25PM +0200, marcandre.lur...@redhat.com wrote:
>> From: Marc-André Lureau 
>>
>> If the "org.qemu.monitor.qmp.0" port is available:
>> - enable the VM UI
>> - get and follow the VM state
>> - send the requested VM actions
>>
>> This adds a json-glib dependency on spice-gtk display. If necessary,
>> we could make it optional.
>
> Having some trouble playing with this. Considering that the
> patches that I'm looking at [0] and this series diverge a bit,
> would you mind sending another version with some info on the
> cover letter in order to have this properly configured to test?
>
> [0] https://pagure.io/fork/elmarco/virt-viewer/branch/qemu-ui
>
> I've configured my fedora 28 vm running on QEMU Session to
> consider org.qemu.console.serial.0 and org.qemu.monitor.qmp.0 as
> spice ports (like webdav) eg:
>
> 
> 
> 
> 
> 
>
> I see the debug of those channels in spice-gtk but nothing on
> virt-viewer. I'm thinking that some other configuration or
> initialization steps are needed to interact with monitor/serial.
>

Try with my qemu branch https://github.com/elmarco/qemu spice

If you start with -display app (with remote-viewer installed in your
prefix, and mime db correctly updated to deal with spice+unix://), it
will do the serial & monitor setup for you.



> Let me know if you need more info from my side.
>
> Also, feel free to push the acked patches as they don't overlap
> with these, I think.
>
> Cheers,
>
>> Signed-off-by: Marc-André Lureau 
>> ---
>>  configure.ac|   8 +-
>>  src/Makefile.am |   2 +
>>  src/virt-viewer-session-spice.c | 166 
>>  3 files changed, 175 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 3c7522d..c5aa0dc 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -27,6 +27,7 @@ GTK_VNC_REQUIRED="0.4.0"
>>  SPICE_GTK_REQUIRED="0.35"
>>  SPICE_PROTOCOL_REQUIRED="0.12.7"
>>  GOVIRT_REQUIRED="0.3.2"
>> +JSON_GLIB_REQUIRED="1.0"
>>
>>  AC_SUBST([GLIB2_REQUIRED])
>>  AC_SUBST([LIBXML2_REQUIRED])
>> @@ -37,6 +38,7 @@ AC_SUBST([GTK_VNC_REQUIRED])
>>  AC_SUBST([SPICE_GTK_REQUIRED])
>>  AC_SUBST([SPICE_PROTOCOL_REQUIRED])
>>  AC_SUBST([GOVIRT_REQUIRED])
>> +AC_SUBST([JSON_GLIB_REQUIRED])
>>
>>  AC_MSG_CHECKING([for native Win32])
>>  case "$host_os" in
>> @@ -159,13 +161,15 @@ AC_ARG_WITH([spice-gtk],
>>  AS_IF([test "x$with_spice_gtk" != "xno" && test "x$with_spice_gtk" != 
>> "xyes"],
>>[PKG_CHECK_EXISTS([spice-client-gtk-3.0 >= $SPICE_GTK_REQUIRED
>>   spice-client-glib-2.0 >= $SPICE_GTK_REQUIRED
>> - spice-protocol >= $SPICE_PROTOCOL_REQUIRED],
>> + spice-protocol >= $SPICE_PROTOCOL_REQUIRED
>> + json-glib-1.0 >= $JSON_GLIB_REQUIRED],
>>  [with_spice_gtk=yes], [with_spice_gtk=no])])
>>
>>  AS_IF([test "x$with_spice_gtk" = "xyes"],
>>[PKG_CHECK_MODULES(SPICE_GTK, [spice-client-gtk-3.0 >= 
>> $SPICE_GTK_REQUIRED
>>   spice-client-glib-2.0 >= 
>> $SPICE_GTK_REQUIRED])]
>>[PKG_CHECK_MODULES(SPICE_PROTOCOL, [spice-protocol >= 
>> $SPICE_PROTOCOL_REQUIRED])]
>> +  [PKG_CHECK_MODULES(JSON_GLIB, [json-glib-1.0 >= JSON_GLIB_REQUIRED])]
>>[AC_DEFINE([HAVE_SPICE_GTK], 1, [Have spice-gtk?])]
>>  )
>>  AM_CONDITIONAL([HAVE_SPICE_GTK], [test "x$with_spice_gtk" = "xyes"])
>> @@ -294,3 +298,5 @@ AC_MSG_NOTICE([ LIBVIRT: $LIBVIRT_CFLAGS 
>> $LIBVIRT_LIBS])
>>  AC_MSG_NOTICE([])
>>  AC_MSG_NOTICE([   OVIRT: $OVIRT_CFLAGS $OVIRT_LIBS])
>>  AC_MSG_NOTICE([])
>> +AC_MSG_NOTICE([   JSON_GLIB: $JSON_GLIB_CFLAGS $JSON_GLIB_LIBS])
>> +AC_MSG_NOTICE([])
>> diff --git a/src/Makefile.am b/src/Makefile.am
>> index 3a5d90d..b2dc786 100644
>> --- a/src/Makefile.am
>> +++ b/src/Makefile.am
>> @@ -114,6 +114,7 @@ COMMON_LIBS = \
>>   $(GTK_VNC_LIBS) \
>>   $(VTE_LIBS) \
>>   $(SPICE_GTK_LIBS)   \
>> + $(JSON_GLIB_LIBS)   \
>>   $(LIBXML2_LIB

Re: [virt-tools-list] [PATCH 07/22] window: set sensitivity based on display capability

2018-08-31 Thread Marc-André Lureau
Hi

On Fri, Aug 31, 2018 at 8:43 AM, Victor Toso  wrote:
> Hi,
>
> On Tue, Jul 31, 2018 at 03:41:10PM +0200, marcandre.lur...@redhat.com wrote:
>> From: Marc-André Lureau 
>
> I take this is a preparatory patch for VTE, could you please add
> some rationale in the commit log on why this was needed?

Indeed, a following patch is adding a new display that won't have the
send_key() or screenshot() callbacks. Activating those menu/actions
would lead to crash. I chose to keep the UI consistent for all
display, but disable the menu sensitivy.

I'll update the commit message.

>> Signed-off-by: Marc-André Lureau 
>> ---
>>  src/virt-viewer-display.h |  6 ++
>>  src/virt-viewer-window.c  | 14 ++
>>  2 files changed, 16 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/virt-viewer-display.h b/src/virt-viewer-display.h
>> index 7016a85..eadc333 100644
>> --- a/src/virt-viewer-display.h
>> +++ b/src/virt-viewer-display.h
>> @@ -86,6 +86,12 @@ struct _VirtViewerDisplayClass {
>>  void (*disable)(VirtViewerDisplay *display);
>>  };
>>
>> +#define VIRT_VIEWER_DISPLAY_CAN_SCREENSHOT(display) \
>> +(VIRT_VIEWER_DISPLAY_GET_CLASS(display)->get_pixbuf != NULL)
>> +
>> +#define VIRT_VIEWER_DISPLAY_CAN_SEND_KEYS(display) \
>> +(VIRT_VIEWER_DISPLAY_GET_CLASS(display)->send_keys != NULL)
>> +
>>  GType virt_viewer_display_get_type(void);
>>
>>  GtkWidget *virt_viewer_display_new(void);
>> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
>> index b9b8ce9..ec9bae6 100644
>> --- a/src/virt-viewer-window.c
>> +++ b/src/virt-viewer-window.c
>> @@ -1339,15 +1339,21 @@ 
>> virt_viewer_window_set_menus_sensitive(VirtViewerWindow *self, gboolean 
>> sensitiv
>>  gtk_widget_set_sensitive(menu, sensitive);
>>
>>  menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, 
>> "menu-file-screenshot"));
>> -gtk_widget_set_sensitive(menu, sensitive);
>> +gtk_widget_set_sensitive(menu, sensitive && self->priv->display != NULL 
>> &&
>> + 
>> VIRT_VIEWER_DISPLAY_CAN_SCREENSHOT(self->priv->display));
>
> Why not moving the display != NULL check into the macro?

ok

>
>>  menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, 
>> "menu-view-zoom"));
>>  gtk_widget_set_sensitive(menu, sensitive);
>>
>> -menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "menu-send"));
>> -gtk_widget_set_sensitive(menu, sensitive);
>> +{
>> +gboolean can_send = sensitive && self->priv->display != NULL &&
>> +VIRT_VIEWER_DISPLAY_CAN_SEND_KEYS(self->priv->display);
>
> Ditto.
>
>>
>> -gtk_widget_set_sensitive(self->priv->toolbar_send_key, sensitive);
>> +menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, 
>> "menu-send"));
>> +gtk_widget_set_sensitive(menu, can_send);
>> +
>> +gtk_widget_set_sensitive(self->priv->toolbar_send_key, can_send);
>> +}
>>  }
>
> Cheers,
> Victor

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 06/22] window: do not reset sensitivity of menu-send in rebuild

2018-08-31 Thread Marc-André Lureau
Hi

On Fri, Aug 31, 2018 at 1:14 PM, Marc-André Lureau
 wrote:
> Hi
>
> On Fri, Aug 31, 2018 at 8:32 AM, Victor Toso  wrote:
>> Hi,
>>
>> On Tue, Jul 31, 2018 at 03:41:09PM +0200, marcandre.lur...@redhat.com wrote:
>>> From: Marc-André Lureau 
>>>
>>> A mere app::enable-accel notification shouldn't modify the
>>> sensitivity, which is handled for all menu items elsewhere, leave the
>>> current state untouched.
>>>
>>> Signed-off-by: Marc-André Lureau 
>>
>> Not sure if this could introduce regression around
>> https://bugzilla.redhat.com/show_bug.cgi?id=1152574
>>
>> Before, the code was always setting sensitive to FALSE on
>> app:enable-accel. With Jonathon's commit 65560fa4664e, it was
>> changed to take in consideration if display existed.
>>
>> Not sure how to test.
>>
>
> I lack arguments on why this patch was needed, let's drop it for now.
> I'll add it back when I remember or can better explain the reason.
>
> thanks
>

Ah, looking at the following patch helps a bit.

The sensitivy of "menu-send" is getting more complex. I tried to have
a single place to put the logic.


So rebuild_combo_menu() is called in 2 cases:
1. notify::enable-accel: there is no need to update the sensitivy of
"menu-send", ok
2. on construction: default to false since display == NULL. It will be
later updated when virt_viewer_window_set_menus_sensitive()

I think the correct patch is to move gtk_widget_set_sensitive(menu,
FALSE) in virt_viewer_window_constructed.

Does it make sense? I'll updatre the patch.

thanks

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 06/22] window: do not reset sensitivity of menu-send in rebuild

2018-08-31 Thread Marc-André Lureau
Hi

On Fri, Aug 31, 2018 at 8:32 AM, Victor Toso  wrote:
> Hi,
>
> On Tue, Jul 31, 2018 at 03:41:09PM +0200, marcandre.lur...@redhat.com wrote:
>> From: Marc-André Lureau 
>>
>> A mere app::enable-accel notification shouldn't modify the
>> sensitivity, which is handled for all menu items elsewhere, leave the
>> current state untouched.
>>
>> Signed-off-by: Marc-André Lureau 
>
> Not sure if this could introduce regression around
> https://bugzilla.redhat.com/show_bug.cgi?id=1152574
>
> Before, the code was always setting sensitive to FALSE on
> app:enable-accel. With Jonathon's commit 65560fa4664e, it was
> changed to take in consideration if display existed.
>
> Not sure how to test.
>

I lack arguments on why this patch was needed, let's drop it for now.
I'll add it back when I remember or can better explain the reason.

thanks

>> ---
>>  src/virt-viewer-window.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
>> index 301a3bf..b9b8ce9 100644
>> --- a/src/virt-viewer-window.c
>> +++ b/src/virt-viewer-window.c
>> @@ -219,7 +219,6 @@ rebuild_combo_menu(GObject*gobject G_GNUC_UNUSED,
>>  menu = GTK_WIDGET(gtk_builder_get_object(self->priv->builder, 
>> "menu-send"));
>>  gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu),
>>
>> GTK_WIDGET(virt_viewer_window_get_keycombo_menu(self)));
>> -gtk_widget_set_sensitive(menu, (self->priv->display != NULL));
>>  }
>>
>>  static void
>> --
>> 2.18.0.321.gffc6fa0e39

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 03/22] app: simplify toggling visibility

2018-08-31 Thread Marc-André Lureau
Hi

On Fri, Aug 31, 2018 at 7:53 AM, Victor Toso  wrote:
> Hi,
>
> Some commit log suggestions but feel free to ignore it.
>
> On Tue, Jul 31, 2018 at 03:24:43PM +0200, marcandre.lur...@redhat.com wrote:
>> From: Marc-André Lureau 
>>
>> There is a hack to maintain the the toggle state to a desired
>
> Removing the double 'the'

ok

>> state within the "toggled" handler. (since there is no way to
>
> I would move this parenthesis to the end of commit log as a 'Note
> that the hack was needed since there is no way to ...'

ok

>
>> hook a signal handler on "clicked" before "toggled" is emitted
>> and handled by Gtk, to avoid the recursion)
>>
>> However it is only necessary for the ask-quit case. In this
>> case, we want to maintain the item active, which is simpler to
>> handle than the general case. Simplify the code by folding
>> virt_viewer_app_window_set_visible() and removing the static
>> "reentering" hack, only maintaining "active" on the last item.
>
> Out of curiosity, why we quit when disabling the last display
> instead of not allowing the last display to be toggled?
>
> I would say that might happen by mistake (disabling last display)
> instead of intentional desire to quit the app.
>

No idea, I like your suggestion. Feel free to send a patch :)

>> Signed-off-by: Marc-André Lureau 
>
> Patch looks fine,
> Acked-by: Victor Toso 

thanks

>
>> ---
>>  src/virt-viewer-app.c | 43 +++
>>  src/virt-viewer-app.h |  2 +-
>>  2 files changed, 12 insertions(+), 33 deletions(-)
>>
>> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
>> index 2a2..62dbf19 100644
>> --- a/src/virt-viewer-app.c
>> +++ b/src/virt-viewer-app.c
>> @@ -502,29 +502,6 @@ virt_viewer_app_get_n_windows_visible(VirtViewerApp 
>> *self)
>>  return n;
>>  }
>>
>> -gboolean
>> -virt_viewer_app_window_set_visible(VirtViewerApp *self,
>> -   VirtViewerWindow *window,
>> -   gboolean visible)
>> -{
>> -g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE);
>> -g_return_val_if_fail(VIRT_VIEWER_IS_WINDOW(window), FALSE);
>> -
>> -if (visible) {
>> -virt_viewer_window_show(window);
>> -return TRUE;
>> -} else {
>> -if (virt_viewer_app_get_n_windows_visible(self) > 1) {
>> -virt_viewer_window_hide(window);
>> -return FALSE;
>> -}
>> -
>> -virt_viewer_app_maybe_quit(self, window);
>> -}
>> -
>> -return FALSE;
>> -}
>> -
>>  static void hide_one_window(gpointer value,
>>  gpointer user_data G_GNUC_UNUSED)
>>  {
>> @@ -2232,19 +2209,21 @@ menu_display_visible_toggled_cb(GtkCheckMenuItem 
>> *checkmenuitem,
>>  {
>>  VirtViewerApp *self = 
>> virt_viewer_session_get_app(virt_viewer_display_get_session(display));
>>  gboolean visible = gtk_check_menu_item_get_active(checkmenuitem);
>> -static gboolean reentering = FALSE;
>>  VirtViewerWindow *vwin;
>>
>> -if (reentering) /* do not reenter if I switch you back */
>> -return;
>> -
>> -reentering = TRUE;
>> -
>>  vwin = ensure_window_for_display(self, display);
>> -visible = virt_viewer_app_window_set_visible(self, vwin, visible);
>>
>> -gtk_check_menu_item_set_active(checkmenuitem, /* will be toggled again 
>> */ !visible);
>> -reentering = FALSE;
>> +if (visible) {
>> +virt_viewer_window_show(vwin);
>> +} else {
>> +if (virt_viewer_app_get_n_windows_visible(self) > 1) {
>> +virt_viewer_window_hide(vwin);
>> +} else {
>> +virt_viewer_app_maybe_quit(self, vwin);
>> +/* the last item remains active, doesn't matter if we quit */
>> +gtk_check_menu_item_set_active(checkmenuitem, TRUE);
>> +}
>> +}
>>
>>  
>> virt_viewer_session_update_displays_geometry(virt_viewer_display_get_session(display));
>>  }
>> diff --git a/src/virt-viewer-app.h b/src/virt-viewer-app.h
>> index 16b1c8c..0321229 100644
>> --- a/src/virt-viewer-app.h
>> +++ b/src/virt-viewer-app.h
>> @@ -84,7 +84,7 @@ void virt_viewer_app_set_connect_info(VirtViewerApp *self,
>>const gchar *user,
>>gint port,
>>const gchar *guri);
>> -gboolean virt_viewer_app_window_set_visible(VirtViewerApp *self, 
>> VirtViewerWindow *window, gboolean visible);
>> +
>>  void virt_viewer_app_show_status(VirtViewerApp *self, const gchar *fmt, 
>> ...);
>>  void virt_viewer_app_show_display(VirtViewerApp *self);
>>  GList* virt_viewer_app_get_windows(VirtViewerApp *self);
>> --
>> 2.18.0.321.gffc6fa0e39

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 22/22] spice: hook into QMP port

2018-08-07 Thread Marc-André Lureau
Hi

On Tue, Aug 7, 2018 at 1:28 PM, Daniel P. Berrangé  wrote:
> On Tue, Aug 07, 2018 at 01:13:38PM +0200, Marc-André Lureau wrote:
>> Hi
>>
>> On Tue, Aug 7, 2018 at 1:02 PM, Daniel P. Berrangé  
>> wrote:
>> > On Tue, Aug 07, 2018 at 12:52:46PM +0200, Marc-André Lureau wrote:
>> >> Hi
>> >>
>> >> On Tue, Aug 7, 2018 at 12:01 PM, Daniel P. Berrangé  
>> >> wrote:
>> >> > I would suggest it should use libvirt for these actions, but that
>> >> > kind of defeats the goal of what you're trying to achieve by providing
>> >> > a UI that is usable by standalone QEMU.
>> >> >
>> >> > The other thing that occurs to me is that the idea of remote power
>> >> > control is interesting / useful for pretty much all uses of SPICE and
>> >> > VNC with QEMU, even when libvirt is managing QEMU.
>> >> >
>> >> > As it stands we would not want to expose the monitor over SPICE in
>> >> > many cases as it gives the SPICE user way too high privileges, but
>> >> > remote power control is useful especially for cloud users. A way
>> >> > to force a reboot of a dead/hung guest from the SPICE client instad
>> >> > of having to jump out to openstack CLI API for example.
>> >> >
>> >> > In VNC there was a 3rd party extension defined to allow remote power
>> >> > control actions over VNC.
>> >> >
>> >> > Thus I think SPICE could define a remote power control extension of
>> >> > its own that could be safely enabled in all cases, even where the
>> >> > remote user is unprivileged. This is portable to all SPICE server
>> >> > side impls that care to provide it since it would not be QMP.
>> >>
>> >> If we have to define a new channel, new protocol messages etc, this
>> >> will overlap with what QMP is already providing.
>> >>
>> >> Qemu or Spice could filter/limit the QMP monitor to a subset of
>> >> commands/events.
>> >
>> > Relying on layering QMP over the chardev channel means the entire
>> > thing it essentially opaque from Spice POV. We have virt-viewer
>> > implementing a QEMU protocol directly. Someone who wires up Spice
>> > to a non-QEMU backend may provide a different way to do the same
>> > thing since nothing is standardized as part of Spice.
>>
>> Ok, Spice could standardize based on QMP protocol though, to avoid
>> reinventing that.
>>
>> > IMHO spice-server library should provide some callbacks hooks for
>> > power control that QEMU can provide the impl for server side, while
>>
>> spice server could embed a small QMP server
>>
>> > spice-gtk should provide some APIs for power control client side.
>>
>> spice-gtk can handle the QMP-subset (essentially moving the 100 loc to
>> spice-gtk and providing new API)
>>
>> > virt-viewer shouldn't see a wire protocol at all.
>>
>> That would achive that goal, but every new functionality would have to
>> go through a bunch of API changes in server and client libraries,
>> making it way less flexible than the current proposal.
>
> QMP as a protocol, however, is not a self-contained general purpose
> mgmt protocol suitable for exposing to all users.
>
> Some of the commands might be generally useful, but a significant part of
> it is poking QEMU internals, and can't be practically used without knowing
> how QEMU is configured in detail, nor used with non-QEMU backend impls.
> Other commands should be exposed, but either represented in a different
> manner than QMP exposes, and/or with very strict restrictions on which
> argument values are permitted.
>
> IMHO requiring explicit modelling in the SPICE library API is thus a
> desirable feature, largely for the same reasons it is better to use
> the QMP protocol, or QEMU guest agent protocol, via libvirt APIs rather
> than directly passed through.

So you are asking that spice and vnc should also do what libvirt is
doing? I disagree.

I suggest we start by exposing a subset of QMP and let virt-viewer
handling it with those 100 loc for this specific use case (qemu
-display app). We wouldn't have to duplicate so much effort to define
new protocols, API etc...

If you need fuller control over a VM in general, you should use
virt-viewer and libvirt, or libgovirt.

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 22/22] spice: hook into QMP port

2018-08-07 Thread Marc-André Lureau
Hi

On Tue, Aug 7, 2018 at 1:02 PM, Daniel P. Berrangé  wrote:
> On Tue, Aug 07, 2018 at 12:52:46PM +0200, Marc-André Lureau wrote:
>> Hi
>>
>> On Tue, Aug 7, 2018 at 12:01 PM, Daniel P. Berrangé  
>> wrote:
>> > I would suggest it should use libvirt for these actions, but that
>> > kind of defeats the goal of what you're trying to achieve by providing
>> > a UI that is usable by standalone QEMU.
>> >
>> > The other thing that occurs to me is that the idea of remote power
>> > control is interesting / useful for pretty much all uses of SPICE and
>> > VNC with QEMU, even when libvirt is managing QEMU.
>> >
>> > As it stands we would not want to expose the monitor over SPICE in
>> > many cases as it gives the SPICE user way too high privileges, but
>> > remote power control is useful especially for cloud users. A way
>> > to force a reboot of a dead/hung guest from the SPICE client instad
>> > of having to jump out to openstack CLI API for example.
>> >
>> > In VNC there was a 3rd party extension defined to allow remote power
>> > control actions over VNC.
>> >
>> > Thus I think SPICE could define a remote power control extension of
>> > its own that could be safely enabled in all cases, even where the
>> > remote user is unprivileged. This is portable to all SPICE server
>> > side impls that care to provide it since it would not be QMP.
>>
>> If we have to define a new channel, new protocol messages etc, this
>> will overlap with what QMP is already providing.
>>
>> Qemu or Spice could filter/limit the QMP monitor to a subset of
>> commands/events.
>
> Relying on layering QMP over the chardev channel means the entire
> thing it essentially opaque from Spice POV. We have virt-viewer
> implementing a QEMU protocol directly. Someone who wires up Spice
> to a non-QEMU backend may provide a different way to do the same
> thing since nothing is standardized as part of Spice.

Ok, Spice could standardize based on QMP protocol though, to avoid
reinventing that.

> IMHO spice-server library should provide some callbacks hooks for
> power control that QEMU can provide the impl for server side, while

spice server could embed a small QMP server

> spice-gtk should provide some APIs for power control client side.

spice-gtk can handle the QMP-subset (essentially moving the 100 loc to
spice-gtk and providing new API)

> virt-viewer shouldn't see a wire protocol at all.

That would achive that goal, but every new functionality would have to
go through a bunch of API changes in server and client libraries,
making it way less flexible than the current proposal.

-- 
Marc-André Lureau

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 22/22] spice: hook into QMP port

2018-08-07 Thread Marc-André Lureau
Hi

On Tue, Aug 7, 2018 at 12:01 PM, Daniel P. Berrangé  wrote:
> On Tue, Jul 31, 2018 at 03:41:25PM +0200, marcandre.lur...@redhat.com wrote:
>> From: Marc-André Lureau 
>>
>> If the "org.qemu.monitor.qmp.0" port is available:
>> - enable the VM UI
>> - get and follow the VM state
>> - send the requested VM actions
>>
>> This adds a json-glib dependency on spice-gtk display. If necessary,
>> we could make it optional.
>
> This patch is something I much don't much like the precedent / idea
> of. Its only stop/pause/resume right now, but over time this will
> inevitably expand and end up re-implementing much of libvirt's QMP
> monitor handling, but worse. For example, the patch below has a CVE
> in it because it is not limiting the amount of data it reads before
> the \r\n pair, so a malicious QEMU can make it consume GB worth of RAM.

True, low impact, easy to fix.

> I would suggest it should use libvirt for these actions, but that
> kind of defeats the goal of what you're trying to achieve by providing
> a UI that is usable by standalone QEMU.
>
> The other thing that occurs to me is that the idea of remote power
> control is interesting / useful for pretty much all uses of SPICE and
> VNC with QEMU, even when libvirt is managing QEMU.
>
> As it stands we would not want to expose the monitor over SPICE in
> many cases as it gives the SPICE user way too high privileges, but
> remote power control is useful especially for cloud users. A way
> to force a reboot of a dead/hung guest from the SPICE client instad
> of having to jump out to openstack CLI API for example.
>
> In VNC there was a 3rd party extension defined to allow remote power
> control actions over VNC.
>
> Thus I think SPICE could define a remote power control extension of
> its own that could be safely enabled in all cases, even where the
> remote user is unprivileged. This is portable to all SPICE server
> side impls that care to provide it since it would not be QMP.

If we have to define a new channel, new protocol messages etc, this
will overlap with what QMP is already providing.

Qemu or Spice could filter/limit the QMP monitor to a subset of commands/events.


>
>
> Regards,
> Daniel
> --
> |: https://berrange.com  -o-https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o-https://fstop138.berrange.com :|
> |: https://entangle-photo.org-o-https://www.instagram.com/dberrange :|

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 00/22] Add QEMU-like UI: VT console &basic VM state

2018-08-02 Thread Marc-André Lureau
Hi Xiaodai

On Thu, Aug 2, 2018 at 10:56 AM, Xiaodai Wang  wrote:
>
> - Original Message -
>> From: "Marc-André Lureau" 
>> To: "Xiaodai Wang" 
>> Cc: "virt-tools-list" 
>> Sent: Wednesday, August 1, 2018 9:46:47 PM
>> Subject: Re: [virt-tools-list] [PATCH 00/22] Add QEMU-like UI: VT console 
>> &basic VM state
>>
>> Hi
>>
>> On Wed, Aug 1, 2018 at 1:50 PM, Xiaodai Wang  wrote:
>> > Sorry, i didn't receive the email of "patch 10/22", but i can find it in
>> > virt-tools-list.
>> > I just Added my comments here.
>> >
>> > 1)
>> > +vte = gtk_label_new(_("Console support is compiled out!"));
>> >
>> > I think the hints could be changed to be more general for all users. It may
>> > be hard to understand
>> > for users who don't know programming.
>>
>> What do you recommend instead?
>>
>   If vte is compiled out, it's better to hide or grey out the menu item and 
> give a warning or debug
> message to show why it's not supported.

I think this is less user friendly though, the user won't notice a
debug log (it might not even be enabled), and a warning is assimilated
to a user or program error, in general.

Tbh, I would rather make VTE a strong dependency.

>
>
> I did not receive this mail '[virt-tools-list] [PATCH 20/22] app: add 
> "machine" UI', either.
> Here is my other comments.
>
> 1. Since virt-viewer have -w and -r options which can wait for a vm to 
> startup, It's better to add a 'Run' menu to start the VM.

the "machine" menu is only for remote-viewer. Furthermore, my goal is
not to make a new virt-manager, it's really just to have a simple UI
like qemu gtk does, so eventually, qemu console user  (mostly
developpers) can switch to it easily.

> 2. The 'Pause' menu item should be changed to 'Resume' after pausing the VM, 
> and changed to 'pause' again after running.

Again, I am just following the current qemu UI, but eventually we
could try to do better.

>
> 3. + translatable="yes">_Machine
>I prefer 'Virtual Machine' to 'Machine'. It's same as virt-manager.
>
> 4. _Reset
>Does 'Reset' means 'Reboot'?
>
>_Power down
>Does 'Power down' means 'Shut Down'?
>

Same here.

Tbh, I think the "File" menu could be merged. and we could adopt some
GNOME3 style icon menu


>I think the menu item name should be same as other products of redhat, 
> like virt-manager, ovirt.

Or be the same as qemu, if your goal is to replace qemu ui :)

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 00/22] Add QEMU-like UI: VT console &basic VM state

2018-08-01 Thread Marc-André Lureau
Hi

On Wed, Aug 1, 2018 at 1:50 PM, Xiaodai Wang  wrote:
> Sorry, i didn't receive the email of "patch 10/22", but i can find it in 
> virt-tools-list.
> I just Added my comments here.
>
> 1)
> +vte = gtk_label_new(_("Console support is compiled out!"));
>
> I think the hints could be changed to be more general for all users. It may 
> be hard to understand
> for users who don't know programming.

What do you recommend instead?

>
> 2) I didn't see any copy&paste function, but i see VteTerminal has related 
> APIs. It would be nice
> to implement Copy&Paste function.

secondary/selection clipboard copy/pase works by default (I suppose
because it mouse input), however primary isn't working (usually bound
to a key binding).

Apparently, qemu gtk ui doesn't have primary clipboard support either.

virt-manager has a context menu for copy/paste. I guess we could have
a similar UI in remote-viewer.

thanks

> - Original Message -
>> From: "marcandre lureau" 
>> To: virt-tools-list@redhat.com
>> Sent: Tuesday, July 31, 2018 9:24:40 PM
>> Subject: [virt-tools-list] [PATCH 00/22] Add QEMU-like UI: VT console &  
>>  basic VM state
>>
>> From: Marc-André Lureau 
>>
>> Hi,
>>
>> QEMU provides multiple display backend, with different set of
>> features. One of the richest UI is the -display gtk. It is quite
>> minimal, and comparable to remote-viewer UI wrt fullscreen, zooming,
>> grabbing. I haven't done a detailed comparison, but for regular use, I
>> prefer the remote-viewer UI. The fullscreen mode has a popup toolbar,
>> there is a send-key menu, it provides better desktop integration
>> support: USB redirection, folder sharing, more complete multi-monitor
>> configuration, screenshot. remote-viewer also allows hotkey
>> configuration, and has an experimental "kiosk" mode.
>>
>> However, remote-viewer is lacking 2 important features compared to
>> QEMU UI: VT console (for serials, and monitors) and basic VM state
>> commands (power off, reset, pause..).
>>
>> This series add support for VT console over Spice ports, and QMP
>> monitor to provide a similar user experience as QEMU -display gtk.
>> Another WIP series (fairly small, everything is there already) for
>> QEMU will provide a new "-display app" backend, that will configure
>> QEMU appropriately, and start remote-viewer (actually any client
>> handling spice+unix://). The result is that the "QEMU UI experience"
>> is entirely out of qemu code base and process.
>>
>> thanks
>>
>> Marc-André Lureau (22):
>>   remote-viewer: add handling of spice+unix and spice+tls schemes
>>   Remove class signal handlers
>>   app: simplify toggling visibility
>>   window: use virt_viewer_window_set_menus_sensitive()
>>   window: move default sensitivity in .ui
>>   window: do not reset sensitivity of menu-send in rebuild
>>   window: set sensitivity based on display capability
>>   display: make klass->close() optional
>>   build-sys: check for VTE library
>>   Add a VirtViewerDisplayVte display kind
>>   window/zoom: deal with VTE display differently
>>   display: ignore display that do not have toplevel window
>>   session: skip monitor changes if there is no sized monitors
>>   app: set subtitle using VTE name
>>   app: append VTE consoles to display submenu
>>   display: allow display without associated monitor number
>>   session: do not take VTE display into account for geometry changes
>>   app: create a window for VTE displays
>>   spice: hook into port channel to create VTE terminals
>>   app: add "machine" UI
>>   app: add "vm-running" property
>>   spice: hook into QMP port
>>
>>  configure.ac|  22 ++-
>>  data/remote-viewer.desktop.in   |   2 +-
>>  src/Makefile.am |   6 +
>>  src/resources/ui/virt-viewer.ui |  50 +
>>  src/virt-viewer-app.c   | 197 ++--
>>  src/virt-viewer-app.h   |   2 +-
>>  src/virt-viewer-display-spice.c |   8 -
>>  src/virt-viewer-display-vte.c   | 319 
>>  src/virt-viewer-display-vte.h   |  81 
>>  src/virt-viewer-display.c   |  22 +--
>>  src/virt-viewer-display.h   |  14 +-
>>  src/virt-viewer-session-spice.c | 284 +++-
>>  src/virt-viewer-session.c   |  48 +++--
>>  src/virt-viewer-session.h   |  30 ++-
>>  src/virt-viewer-window.c| 117 ++--
>>  15 files changed, 1066 insertions(+), 136 deletions(-)
>>  create mode 100644 src/virt-viewer-display-vte.c
>>  create mode 100644 src/virt-viewer-display-vte.h
>>
>> --
>> 2.18.0.321.gffc6fa0e39
>>
>> ___
>> virt-tools-list mailing list
>> virt-tools-list@redhat.com
>> https://www.redhat.com/mailman/listinfo/virt-tools-list

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [virt-viewer PATCH] Bump min spice to 0.35 and address deprecation warnings

2018-07-27 Thread Marc-André Lureau
On Fri, Jul 27, 2018 at 1:39 PM, Daniel P. Berrangé  wrote:
> Signed-off-by: Daniel P. Berrangé 

Reviewed-by: Marc-André Lureau 

> ---
>  README.md   |  2 +-
>  configure.ac|  2 +-
>  src/virt-viewer-display-spice.c |  2 +-
>  src/virt-viewer-session-spice.c | 19 +--
>  4 files changed, 12 insertions(+), 13 deletions(-)
>
> diff --git a/README.md b/README.md
> index ceb01a9..15c07aa 100644
> --- a/README.md
> +++ b/README.md
> @@ -15,7 +15,7 @@ display of the VNC protocol, which is available from
>
>https://wiki.gnome.org/Projects/gtk-vnc
>
> -Virt Viewer uses the SPICE-GTK (>= 0.33) widget to provide a
> +Virt Viewer uses the SPICE-GTK (>= 0.35) widget to provide a
>  display of the SPICE protocol, which is available from:
>
>https://www.spice-space.org/download.html
> diff --git a/configure.ac b/configure.ac
> index e262e31..1b99066 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -24,7 +24,7 @@ LIBXML2_REQUIRED="2.6.0"
>  LIBVIRT_REQUIRED="0.10.0"
>  LIBVIRT_GLIB_REQUIRED="0.1.8"
>  GTK_VNC_REQUIRED="0.4.0"
> -SPICE_GTK_REQUIRED="0.33"
> +SPICE_GTK_REQUIRED="0.35"
>  SPICE_PROTOCOL_REQUIRED="0.12.7"
>  GOVIRT_REQUIRED="0.3.2"
>
> diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c
> index a604230..f9b383b 100644
> --- a/src/virt-viewer-display-spice.c
> +++ b/src/virt-viewer-display-spice.c
> @@ -103,7 +103,7 @@ static void update_enabled(VirtViewerDisplay *self, 
> gboolean enabled, gboolean s
>  return;
>
>  g_object_get(self, "nth-display", &nth, NULL);
> -spice_main_update_display_enabled(main_channel, nth, enabled, send);
> +spice_main_channel_update_display_enabled(main_channel, nth, enabled, 
> send);
>  }
>
>  static void
> diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
> index f43ed65..fdc7004 100644
> --- a/src/virt-viewer-session-spice.c
> +++ b/src/virt-viewer-session-spice.c
> @@ -38,7 +38,6 @@
>
>  G_DEFINE_TYPE (VirtViewerSessionSpice, virt_viewer_session_spice, 
> VIRT_VIEWER_TYPE_SESSION)
>
> -
>  struct _VirtViewerSessionSpicePrivate {
>  GtkWindow *main_window;
>  SpiceSession *session;
> @@ -921,9 +920,9 @@ virt_viewer_session_spice_display_monitors(SpiceChannel 
> *channel,
>  !display_is_in_fullscreen_mode(self, 
> VIRT_VIEWER_DISPLAY(display))) {
>  g_debug("display %d should not be enabled, disabling",
>  
> virt_viewer_display_get_nth(VIRT_VIEWER_DISPLAY(display)) + 1);
> -
> spice_main_set_display_enabled(virt_viewer_session_spice_get_main_channel(self),
> -   
> virt_viewer_display_get_nth(VIRT_VIEWER_DISPLAY(display)),
> -   FALSE);
> +
> spice_main_channel_update_display_enabled(virt_viewer_session_spice_get_main_channel(self),
> +  
> virt_viewer_display_get_nth(VIRT_VIEWER_DISPLAY(display)),
> +  FALSE, TRUE);
>  disabled = TRUE;
>  }
>
> @@ -1055,7 +1054,7 @@ 
> virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice *self)
>  return FALSE;
>  }
>
> -spice_main_set_display_enabled(cmain, -1, FALSE);
> +spice_main_channel_update_display_enabled(cmain, -1, FALSE, TRUE);
>
>  initial_displays = virt_viewer_app_get_initial_displays(app);
>  ndisplays = g_list_length(initial_displays);
> @@ -1079,15 +1078,15 @@ 
> virt_viewer_session_spice_fullscreen_auto_conf(VirtViewerSessionSpice *self)
>  GdkRectangle *rect = value;
>  gint j = GPOINTER_TO_INT(key);
>
> -spice_main_set_display(cmain, j, rect->x, rect->y, rect->width, 
> rect->height);
> -spice_main_set_display_enabled(cmain, j, TRUE);
> +spice_main_channel_update_display(cmain, j, rect->x, rect->y, 
> rect->width, rect->height, TRUE);
> +spice_main_channel_update_display_enabled(cmain, j, TRUE, TRUE);
>  g_debug("Set SPICE display %d to (%d,%d)-(%dx%d)",
>j, rect->x, rect->y, rect->width, rect->height);
>  }
>  g_list_free(initial_displays);
>  g_hash_table_unref(displays);
>
> -spice_main_send_monitor_config(cmain);
> +spice_main_channel_send_monitor_config(cmain);
>  self->priv->did_auto_conf = TRUE;
>  return TRUE;
>  }
> @@ -1180,8 +1179,8 @@ 
> virt_v

Re: [virt-tools-list] [PATCH] tpm: allow hotplug operation so error is reported by libvirt

2018-06-12 Thread Marc-André Lureau
On Tue, Jun 12, 2018 at 2:52 PM, Stefan Berger
 wrote:
> Perform a hotplug operation so that we get the error notification
> about unsupported TPM hotplug operation and we can alert the user
> that the change will only take effect upon domain shutdown.
>
> Signed-off-by: Stefan Berger 

Reviewed-by: Marc-André Lureau 

> ---
>  virtManager/domain.py | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/virtManager/domain.py b/virtManager/domain.py
> index 3eb860ec..8688f282 100644
> --- a/virtManager/domain.py
> +++ b/virtManager/domain.py
> @@ -991,7 +991,10 @@ class vmmDomain(vmmLibvirtObject):
>  if model != _SENTINEL:
>  editdev.model = model
>
> -self._redefine_xmlobj(xmlobj)
> +if do_hotplug:
> +self.hotplug(device=editdev)
> +else:
> +self._redefine_xmlobj(xmlobj)
>
>
>  
> --
> 2.14.4
>

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [virt-manager PATCH 0/5] WIP: Various TPM improvements

2018-05-24 Thread Marc-André Lureau
Hi

On Thu, May 24, 2018 at 6:01 PM, Stefan Berger
 wrote:
> On 05/24/2018 06:39 AM, marcandre.lur...@redhat.com wrote:
>>
>> From: Marc-André Lureau 
>>
>> Hi,
>>
>> The following series depend on the patches being reviewed for libvirt
>> "[PATCH 00/12] Add support for TPM emulator" (currently at v6).
>>
>> They allow to configure a CRB device (more TPM 2.0 compliant), and to
>> setup an emulated TPM.
>>
>> Feeback welcome
>
>
> The only thing that seems to be missing is to display the Model of an
> attached TPM. So far TPM Device shows 'Type' and 'Version'.

Right, that should be easy to add.
I will also update --help and man for virt-install.

I also wonder when or if emulated TPM should be added by default.

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [virt-manager PATCH] git: add a git publish configuration file

2018-04-24 Thread Marc-André Lureau
On Tue, Apr 24, 2018 at 8:11 PM, Daniel P. Berrangé  wrote:
> Provide a config file for git-publish that sets the right mailing list
> and patch subject prefix.
>
> Signed-off-by: Daniel P. Berrangé 

Reviewed-by: Marc-André Lureau 


> ---
>  .gitpublish | 4 
>  1 file changed, 4 insertions(+)
>  create mode 100644 .gitpublish
>
> diff --git a/.gitpublish b/.gitpublish
> new file mode 100644
> index ..ca733389
> --- /dev/null
> +++ b/.gitpublish
> @@ -0,0 +1,4 @@
> +[gitpublishprofile "default"]
> +base = master
> +to = virt-tools-list@redhat.com
> +prefix = virt-manager PATCH
> --
> 2.14.3
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH] virtinst: add feature support

2018-02-21 Thread Marc-André Lureau
Hi

On Wed, Feb 21, 2018 at 4:08 PM, Cole Robinson  wrote:
> On 02/20/2018 02:30 PM, marcandre.lur...@redhat.com wrote:
>> From: Marc-André Lureau 
>>
>> The  feature allows a guest to provide debug details when
>> producing dump. It's useful in particular for Linux guests with KASLR
>> enabled, as otherwise the dump are difficult to analyze.
>>
>
> Thanks for the patch, but, ugh I wish this didn't end up in libvirt as a
> boolean property, there's a reason things are generally tristate these
> days, since there's no way to distinguish between 'use hypervisor
> default' and 'explicitly disable this feature'. What if a future version
> of qemu or machine type defaults to vmcoreinfo=on, how does the user
> request libvirt disable that setting?
>

It translates to -device vmcoreinfo, so you have no other way but to
rely on -nodefaults at qemu level to disable it if some day it is
added by default.

So it will probably have to be specified explicitly all the time by
the domain XML.

Or I would like to know what else we could do..

> Maybe in this particular case it's minor but tristate is much preferred
> IMO. It's probably not too late to change at the libvirt level and
> convert  to , the only reason we
> never did that with preexisting boolean properties is that they were
> around long enough that apps were kinda dependent on it, for reading the
> XML at least.

I also think it can be changed to support the tristate later on, if it
makes sense.

>
>> This patch adds virt-install support for vmcoreinfo domain
>> feature. Whenever the host libvirt/qemu is recent enough, and the VM
>> is x86 or arm-virt, we can assume  is supported and
>> enable it safely by default (unless --feature vmcoreinfo=on/off is
>> given, or changed via API)
>>
>
> Better I think to split this patch in two parts, the xml/cli wiring
> which is straightforward, the 'adding it as default' which is always
> more interesting to discuss.
>
> My two questions are: 1) are there any downsides to enabling this, 2) if
> we should enable it by default why isn't it enabled by default in qemu,
> maybe tied to new machine types

I agree it would be nice to enable it by default on new machine types.
But since it's a -device, it should be removed anyway with
-nodefaults. Hence setting it should be higher up the stack, when
creating a domain XML.

>
>> Note: I am not quite sure if the tests update require
>> compare_check=support.SUPPORT_CONN_VMCOREINFO has was done for vmport
>> in commit 2d572e02bd619460f9db3bd671147600926d.
>>
>
> They do, so that there aren't test failures on non-latest libvirt. For
> example the test suite now shows failures with stock f27 packages.

ok

>
> The code itself looks fine though
>

thanks

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 1/3] remote-viewer: learn '-' as URI for standard input connection file

2017-11-16 Thread Marc-André Lureau
On Tue, Nov 14, 2017 at 5:46 PM, Victor Toso  wrote:
> Hi,
>
> On Tue, Nov 14, 2017 at 11:39:54AM -0500, Marc-André Lureau wrote:
>> Hi
>>
>> - Original Message -
>> > Hi,
>> >
>> > On Tue, Nov 14, 2017 at 04:56:01PM +0100, marcandre.lur...@redhat.com 
>> > wrote:
>> > > From: Marc-André Lureau 
>> > >
>> > > Some users want the ability to set connection details without writing
>> > > to a file or passing command line arguments.
>> > >
>> > > Learn to read the connection file from standard input for such use
>> > > case.
>> > >
>> > > This allows a parent process to set the connection details without
>> > > intermediary file.
>> > >
>> > > Signed-off-by: Marc-André Lureau 
>> > > Reviewed-by: Victor Toso 
>> > > ---
>> > >  man/remote-viewer.pod  |  3 +++
>> > >  src/remote-viewer.c| 46 
>> > > --
>> > >  src/virt-viewer-file.c | 31 +--
>> > >  src/virt-viewer-file.h |  2 ++
>> > >  4 files changed, 70 insertions(+), 12 deletions(-)
>> > >
>> > > diff --git a/man/remote-viewer.pod b/man/remote-viewer.pod
>> > > index 60ea3a6..8428c80 100644
>> > > --- a/man/remote-viewer.pod
>> > > +++ b/man/remote-viewer.pod
>> > > @@ -18,6 +18,9 @@ entry and a list of previously successfully accessed 
>> > > URI.
>> > >  The URI can also point to a connection settings file, see the CONNECTION
>> > >  FILE
>> > >  section for a description of the format.
>> > >
>> > > +If URI is '-', then remote-viewer will read the standard input as a
>> > > +connection settings file and attempt to connect using it.
>> > > +
>> > >  =head1 OPTIONS
>> > >
>> > >  The following options are accepted when running C:
>> > > diff --git a/src/remote-viewer.c b/src/remote-viewer.c
>> > > index fb5376c..e082178 100644
>> > > --- a/src/remote-viewer.c
>> > > +++ b/src/remote-viewer.c
>> > > @@ -1084,6 +1084,22 @@ remote_viewer_session_connected(VirtViewerSession
>> > > *session,
>> > >  g_free(uri);
>> > >  }
>> > >
>> > > +static gchar *
>> > > +read_all_stdin(gsize *len, GError **err)
>> > > +{
>> > > +GIOChannel *ioc = g_io_channel_unix_new(fileno(stdin));
>> > > +gchar *content = NULL;
>> > > +GIOStatus status;
>> > > +
>> > > +status = g_io_channel_read_to_end(ioc, &content, len, err);
>> > > +g_assert(status != G_IO_STATUS_AGAIN && status != G_IO_STATUS_EOF);
>> >
>> > "G_IO_STATUS_NORMAL on success. This function never returns 
>> > G_IO_STATUS_EOF"
>>
>> Yes, I also want to assert we don't get AGAIN (or should we loop?) I
>> don't think it's necessary, stdin should be blocking and this would be
>> a weird case, wouldn't it?
>
> It would. I just don't see the point on checking with G_IO_STATUS_EOF if
> documentation says it should never return it. IMHO, checking
> G_IO_STATUS_AGAIN should be fine.

ok

>
>> > > +
>> > > +g_io_channel_unref(ioc);
>> > > +g_assert((content && !*err) || (!content && *err));
>> >
>> > This seems that you are sanity checking g_io_channel_read_to_end() ?
>>
>> I want to make sure that either we get an error or we get content, not
>> both. It's not clear for the API (for ex with AGAIN).
>
> I agree
>
>> >
>> > If you want to assert here, I guess just use g_assert_no_error()
>> > instead ?
>>
>> That was basically the approach before, let the function return NULL,
>> and fail later when reading from NULL buffer with keyfile.
>>
>> Now if we want to produce a error message instead, we should propagate
>> GError.
>>
>> Other solution is to pring the GError immediately if any, and return
>> NULL in that case. Anything works for me.
>
> Feel free to keep it as is.
>

thanks

>> > > +
>> > > +return content;
>> > > +}
>> > > +
>> > >  static gboolean
>> > >  remote_viewer_initial_connect(RemoteViewer *self, const gchar *type,
>> > >VirtViewerFile *vvfile, GErro

Re: [virt-tools-list] [PATCH v2 1/3] remote-viewer: learn '-' as URI for standard input connection file

2017-11-14 Thread Marc-André Lureau
Hi

- Original Message -
> Hi,
> 
> On Tue, Nov 14, 2017 at 04:56:01PM +0100, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> > 
> > Some users want the ability to set connection details without writing
> > to a file or passing command line arguments.
> > 
> > Learn to read the connection file from standard input for such use
> > case.
> > 
> > This allows a parent process to set the connection details without
> > intermediary file.
> > 
> > Signed-off-by: Marc-André Lureau 
> > Reviewed-by: Victor Toso 
> > ---
> >  man/remote-viewer.pod  |  3 +++
> >  src/remote-viewer.c| 46 --
> >  src/virt-viewer-file.c | 31 +--
> >  src/virt-viewer-file.h |  2 ++
> >  4 files changed, 70 insertions(+), 12 deletions(-)
> > 
> > diff --git a/man/remote-viewer.pod b/man/remote-viewer.pod
> > index 60ea3a6..8428c80 100644
> > --- a/man/remote-viewer.pod
> > +++ b/man/remote-viewer.pod
> > @@ -18,6 +18,9 @@ entry and a list of previously successfully accessed URI.
> >  The URI can also point to a connection settings file, see the CONNECTION
> >  FILE
> >  section for a description of the format.
> >  
> > +If URI is '-', then remote-viewer will read the standard input as a
> > +connection settings file and attempt to connect using it.
> > +
> >  =head1 OPTIONS
> >  
> >  The following options are accepted when running C:
> > diff --git a/src/remote-viewer.c b/src/remote-viewer.c
> > index fb5376c..e082178 100644
> > --- a/src/remote-viewer.c
> > +++ b/src/remote-viewer.c
> > @@ -1084,6 +1084,22 @@ remote_viewer_session_connected(VirtViewerSession
> > *session,
> >  g_free(uri);
> >  }
> >  
> > +static gchar *
> > +read_all_stdin(gsize *len, GError **err)
> > +{
> > +GIOChannel *ioc = g_io_channel_unix_new(fileno(stdin));
> > +gchar *content = NULL;
> > +GIOStatus status;
> > +
> > +status = g_io_channel_read_to_end(ioc, &content, len, err);
> > +g_assert(status != G_IO_STATUS_AGAIN && status != G_IO_STATUS_EOF);
> 
> "G_IO_STATUS_NORMAL on success. This function never returns G_IO_STATUS_EOF"

Yes, I also want to assert we don't get AGAIN (or should we loop?) I don't 
think it's necessary, stdin should be blocking and this would be a weird case, 
wouldn't it?

> 
> > +
> > +g_io_channel_unref(ioc);
> > +g_assert((content && !*err) || (!content && *err));
> 
> This seems that you are sanity checking g_io_channel_read_to_end() ?

I want to make sure that either we get an error or we get content, not both. 
It's not clear for the API (for ex with AGAIN).

> 
> If you want to assert here, I guess just use g_assert_no_error()
> instead ?

That was basically the approach before, let the function return NULL, and fail 
later when reading from NULL buffer with keyfile.

Now if we want to produce a error message instead, we should propagate GError.

Other solution is to pring the GError immediately if any, and return NULL in 
that case. Anything works for me.

> 
> > +
> > +return content;
> > +}
> > +
> >  static gboolean
> >  remote_viewer_initial_connect(RemoteViewer *self, const gchar *type,
> >VirtViewerFile *vvfile, GError **error)
> > @@ -1174,16 +1190,34 @@ retry_dialog:
> >  
> >  g_debug("Opening display to %s", guri);
> >  
> > -file = g_file_new_for_commandline_arg(guri);
> > -if (g_file_query_exists(file, NULL)) {
> > -gchar *path = g_file_get_path(file);
> > -vvfile = virt_viewer_file_new(path, &error);
> > -g_free(path);
> > +if (!g_strcmp0(guri, "-")) {
> > +gsize len = 0;
> > +gchar *buf = read_all_stdin(&len, &error);
> > +
> >  if (error) {
> > -g_prefix_error(&error, _("Invalid file %s: "), guri);
> > +g_prefix_error(&error, _("Failed to read stdin: "));
> >  g_warning("%s", error->message);
> >  goto cleanup;
> >  }
> > +
> > +vvfile = virt_viewer_file_new_from_buffer(buf, len, &error);
> > +g_free(buf);
> > +} else {
> > +file = g_file_new_for_commandline_arg(guri);
> > +if (g_file_query_exists(file, NULL)) 

Re: [virt-tools-list] [PATCH 1/2] RFC: remote-viewer: learn '-' as URI for standard input connection file

2017-11-14 Thread Marc-André Lureau


- Original Message -
> Hi,
> 
> On Fri, Jul 28, 2017 at 08:43:44PM +0200, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> > 
> > Some users want the ability to set connection details without writing
> > to a file or passing command line arguments.
> > 
> > Learn to read the connection file from standard input for such use
> > case.
> > 
> > This allows a parent process to set the connection details without
> > intermediary file.
> > 
> > Signed-off-by: Marc-André Lureau 
> 
> Small comments below but okay with the idea
> 
> > ---
> >  man/remote-viewer.pod  |  3 +++
> >  src/remote-viewer.c| 32 +++-
> >  src/virt-viewer-file.c | 31 +--
> >  src/virt-viewer-file.h |  2 ++
> >  4 files changed, 57 insertions(+), 11 deletions(-)
> > 
> > diff --git a/man/remote-viewer.pod b/man/remote-viewer.pod
> > index 60ea3a6..8428c80 100644
> > --- a/man/remote-viewer.pod
> > +++ b/man/remote-viewer.pod
> > @@ -18,6 +18,9 @@ entry and a list of previously successfully accessed URI.
> >  The URI can also point to a connection settings file, see the CONNECTION
> >  FILE
> >  section for a description of the format.
> >  
> > +If URI is '-', then remote-viewer will read the standard input as a
> > +connection settings file and attempt to connect using it.
> > +
> >  =head1 OPTIONS
> >  
> >  The following options are accepted when running C:
> > diff --git a/src/remote-viewer.c b/src/remote-viewer.c
> > index b132214..39fe9c3 100644
> > --- a/src/remote-viewer.c
> > +++ b/src/remote-viewer.c
> > @@ -1080,6 +1080,18 @@ remote_viewer_session_connected(VirtViewerSession
> > *session,
> >  g_free(uri);
> >  }
> >  
> > +static gchar *
> > +read_all_stdin(gsize *len)
> 
> I would suggest to pass an GError ** as parameter...
> 
> > +{
> > +GIOChannel *ioc = g_io_channel_unix_new(fileno(stdin));
> 
> Docs says we should avoid using this function on Windows but I guess it
> should be fine with plain stdin.
> 
> > +gchar *content = NULL;
> > +
> > +g_io_channel_read_to_end(ioc, &content, len, NULL);
> 
> Pass the GError here and return NULL if return value is different then
> G_IO_STATUS_NORMAL

ok

> > +g_io_channel_unref(ioc);
> > +
> > +return content;
> > +}
> > +
> >  static gboolean
> >  remote_viewer_start(VirtViewerApp *app, GError **err)
> >  {
> > @@ -1134,11 +1146,21 @@ retry_dialog:
> >  
> >  g_debug("Opening display to %s", guri);
> >  
> > -file = g_file_new_for_commandline_arg(guri);
> > -if (g_file_query_exists(file, NULL)) {
> > -gchar *path = g_file_get_path(file);
> > -vvfile = virt_viewer_file_new(path, &error);
> > -g_free(path);
> > +if (!g_strcmp0(guri, "-")) {
> > +gsize len = 0;
> > +gchar *buf = read_all_stdin(&len);
> > +vvfile = virt_viewer_file_new_from_buffer(buf, len, &error);
> > +g_free(buf);
> 
> I guess that in case of errors reading stdin, we might want to
> goto cleanup that could happen below...
> 
> > +} else {
> > +file = g_file_new_for_commandline_arg(guri);
> > +if (g_file_query_exists(file, NULL)) {
> > +gchar *path = g_file_get_path(file);
> > +vvfile = virt_viewer_file_new(path, &error);
> > +g_free(path);
> > +}
> > +}
> > +
> > +if (vvfile) {
> 
> Before this patch, in case of error we would goto cleanup, maybe its
> better to keep it that way.

yes

> 
> if (error) {
> } else if (vvfile) {
> } else if (virt_viewer_util_extract_host(...) < 0 || type == NULL) {
> }
> 
> >  if (error) {
> >  g_prefix_error(&error, _("Invalid file %s: "), guri);
> >  g_warning("%s", error->message);
> > diff --git a/src/virt-viewer-file.c b/src/virt-viewer-file.c
> > index 9ff2a05..a511f21 100644
> > --- a/src/virt-viewer-file.c
> > +++ b/src/virt-viewer-file.c
> > @@ -139,16 +139,15 @@ enum  {
> >  };
> >  
> >  VirtViewerFile*
> > -virt_viewer_file_new(const gchar* location, GError** error)
> > +virt_viewer_file_new_from_buffer(const gchar* data, gsize len,
> > +

Re: [virt-tools-list] [PATCH 2/2] remote-viewer: remove --spice-controller

2017-07-31 Thread Marc-André Lureau
Hi

- Original Message -
> On Fri, Jul 28, 2017 at 08:43:45PM +0200, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> > 
> > spice controller interface is being removed from spice-gtk.
> 
> Is this fallout from napi browser plugins being killed by firefox/chrome/etc
> ?

Yes

> 
> Since i was planning on doing a release real soon, should we perhaps just
> add a deprecation message on startup right now, and then once I've done
> the release we merge this removal, so users have a little warning. Or has
> the code already been killed by spice-gtk ?
> 

The upcoming release should be the last with the spice-controller. Yes, it 
might be a good idea to add a warning message/dialog.

Thanks

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] Time for a new virt-viewer release ?

2017-07-31 Thread Marc-André Lureau
Hi

- Original Message -
> On Mon, Jul 10, 2017 at 10:34:27AM -0400, Marc-André Lureau wrote:
> > Hi
> > 
> > - Original Message -
> > > On 07/07/17 09:15, Daniel P. Berrange wrote:
> > > > Our last release was in Nov last year and there's a bunch of
> > > > accumulated
> > > > patches. It would also be desirable to include the fix for libvirt on
> > > > Windows which should make virt-viewer work properly again.
> > > > 
> > > 
> > > ACK with it, at least from my side, there is nothing left pending.
> > 
> > If you do a Windows build, please wait for spice-gtk release. I think
> > we can make it this week, as soon as fedora 26 is out might be the
> > earliest.
> 
> Is it ok to make a release now, and if so, which spice-gtk / mingw-spice-gtk
> versions should I make sure I have ?  Is F26 updates sufficient now ?
> 
> 

I was going to make a spice-gtk release (v0.34), I think we are good to go. 
Wait for the announcement & fedora updates.

thanks

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH virt-viewer 0/6] RFC: add dbus-controller, remove spice-controller

2017-07-28 Thread Marc-André Lureau
Hi

On Fri, Jun 23, 2017 at 5:34 PM  wrote:

> From: Marc-André Lureau 
>
> Hi,
>
> For the reasons explained in this spice-gtk patch series:
> https://patchwork.freedesktop.org/patch/161676/, spice-controller
> should eventually be removed. We developped the .vv file format as an
> alternative for browsers (and other users) to configure the viewer.
>
> But Jeremy White expressed some concerns about setting up connections
> with .vv file. I proposed such use case be covered with a new dbus
> interface. See --dbus-controller for more details.
>

I am not sure this patch makes so much sense.

I should start by saying it is lying, it doesn't allow you to write a
script with DEST=`remote-viewer --dbus-controller`, as the process will
keep running. So getting the dbus bus name isn't obvious. A solution to
that is to fork remote-viewer, waiting for the child to connect etc.. not
so trivial, not fun.

But I realize we don't really need a dbus interface for setting up the
connection details without using a writen file. We could just tell
remote-viewer to use stdin for the virt-viewer file.

So, I am going to send a patch for that instead.



>
> Comments welcome,
>
> Marc-André Lureau (6):
>   file: make constructor accept NULL location
>   session: remove virt_viewer_session_new() declaration
>   app: add dbus-ctrl property
>   remote-viewer: factor our remote_viewer_initial_connect()
>   remote-viewer: add a --dbus-controller
>   remote-viewer: remove --spice-controller
>
>  configure.ac|   3 +-
>  data/Makefile.am|   1 -
>  data/spice-xpi-client-remote-viewer |   6 -
>  data/virt-viewer.wxs.in |   3 -
>  man/remote-viewer.pod   |   6 -
>  src/remote-viewer.c | 698
> 
>  src/remote-viewer.h |   1 +
>  src/virt-viewer-app.c   |  12 +
>  src/virt-viewer-app.h   |   1 +
>  src/virt-viewer-file.c  |   8 +-
>  src/virt-viewer-session.h   |   1 -
>  11 files changed, 255 insertions(+), 485 deletions(-)
>  delete mode 100644 data/spice-xpi-client-remote-viewer
>
> --
> 2.13.1.395.gf7b71de06
>
> ___________
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

-- 
Marc-André Lureau
___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH virt-viewer] msi: Do not escape '$' for wixl-heat

2017-07-24 Thread Marc-André Lureau
Hi

- Original Message -
> wixl-heat does it itself since its commit 9273514c95e343340d18067b4f1
> 
> otherwise msi generation fails with:
> Couldn't find file
> $/tmp/tmp.1MYrxTLd1U/usr/x86_64-w64-mingw32/sys-root/mingw/bin/debug-helper.exe
> ---
>  data/Makefile.am | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/data/Makefile.am b/data/Makefile.am
> index 55718d9..d9c7049 100644
> --- a/data/Makefile.am
> +++ b/data/Makefile.am
> @@ -43,7 +43,7 @@ deps.txt:
>  virt-viewer-$(WIXL_ARCH)-$(VERSION).msi: virt-viewer.wxs deps.txt
>   $(AM_V_GEN)DESTDIR=`mktemp -d` &&   \
>   make -C $(top_builddir) install DESTDIR=$$DESTDIR >/dev/null && \
> - find $$DESTDIR | wixl-heat -p $$DESTDIR$(prefix)/   \
> + find $$DESTDIR | wixl-heat -p $DESTDIR$(prefix)/\

This doesn't look like the correct fix to me, since -p is only used to match 
and strip prefix-based filenames.

I think we shouldn't escape the sourcedir instead:

diff --git a/tools/wixl/wixl-heat.vala b/tools/wixl/wixl-heat.vala
index 47013c1..4c828f7 100644
--- a/tools/wixl/wixl-heat.vala
+++ b/tools/wixl/wixl-heat.vala
@@ -106,8 +106,8 @@ public int main (string[] args) {
 stdout.printf (indent + "\n".printf (id));
 else
 stdout.printf (indent + "\n".printf (id));
-file = sourcedir + Path.DIR_SEPARATOR_S + file;
-stdout.printf (indent + "  \n".printf (generate_id ("fil", 1, file), 
escape_filename(file)));
+file = sourcedir + Path.DIR_SEPARATOR_S + 
escape_filename(file);
+stdout.printf (indent + "  \n".printf (generate_id ("fil", 1, file), file));
 stdout.printf (indent + "\n");

Could you check before I commit in msitools?

Btw, it might be worth to consider a msitools release too, so virt-viewer msi 
can be build in fedora 26.


>   --component-group CG.virt-viewer --var var.DESTDIR  \
>   --directory-ref=INSTALLDIR > virt-viewer-files.wxs &&   \
>   MANUFACTURER="$(MANUFACTURER)" wixl -D SourceDir=$(prefix)  \
> --
> 2.13.3
> 
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] Time for a new virt-viewer release ?

2017-07-10 Thread Marc-André Lureau
Hi

- Original Message -
> On 07/07/17 09:15, Daniel P. Berrange wrote:
> > Our last release was in Nov last year and there's a bunch of accumulated
> > patches. It would also be desirable to include the fix for libvirt on
> > Windows which should make virt-viewer work properly again.
> > 
> 
> ACK with it, at least from my side, there is nothing left pending.

If you do a Windows build, please wait for spice-gtk release. I think we can 
make it this week, as soon as fedora 26 is out might be the earliest.

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] [PATCH virt-viewer 1/1] window: Allow to control zoom using keypad

2017-04-07 Thread Marc-André Lureau
),
> +self);
> +for (i = 0; i < G_N_ELEMENTS(keypad_action_entries); i++) {
> +gchar *detailed_name = g_strdup_printf("win.%s",
> keypad_action_entries[i].name);
> +gtk_application_set_accels_for_action(GTK_APPLICATION(priv->app),
> +  detailed_name,
> +  keypad_action_accels[i]);
> +g_free(detailed_name);
> +}
> +
>  priv->accel_enabled = TRUE;
>  }
>
> --
> 2.12.2
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
>
-- 
Marc-André Lureau
___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v4 2/2] gfxdetails: add listen type option

2017-02-20 Thread Marc-André Lureau
Hi

- Original Message -
> On Mon, Nov 28, 2016 at 02:47:46PM +0400, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> > 
> > Similarly to virt-install --listen=none, add a combobox to select
> > the listen type: "address" or "none" for now, as suggested by Pavel
> > Hrdina.
> 
> Hi, I'm sorry for the delay with review.  This looks promising but there are
> some implementation details that should be addressed.
> 
> > 
> > Signed-off-by: Marc-André Lureau 
> > ---
> >  ui/gfxdetails.ui   | 64
> >  ++
> >  virtManager/addhardware.py | 14 ++
> >  virtManager/details.py |  7 ++---
> >  virtManager/domain.py  | 11 +---
> >  virtManager/gfxdetails.py  | 38 ++-
> >  virtinst/devicegraphics.py | 16 +++-
> >  6 files changed, 115 insertions(+), 35 deletions(-)
> 
> [...]
> 
> > diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
> > index 7a3c8f2..3f868aa 100644
> > --- a/virtManager/addhardware.py
> > +++ b/virtManager/addhardware.py
> > @@ -1541,16 +1541,20 @@ class vmmAddHardware(vmmGObjectUI):
> >  
> >  def _validate_page_graphics(self):
> >  try:
> > -(gtype, port,
> > - tlsport, addr, passwd, keymap, gl) =
> > self._gfxdetails.get_values()
> > +(gtype, port, tlsport, listen,
> > + addr, passwd, keymap, gl) = self._gfxdetails.get_values()
> >  
> >  self._dev = virtinst.VirtualGraphics(self.conn.get_backend())
> >  self._dev.type = gtype
> > -self._dev.port = port
> >  self._dev.passwd = passwd
> > -self._dev.listen = addr
> > -self._dev.tlsPort = tlsport
> >  self._dev.gl = gl
> > +
> > +if not listen:
> > +self._dev.set_listen_none()
> > +else:
> > +self._dev.listen = addr
> > +self._dev.port = port
> > +self._dev.tlsPort = tlsport
> 
> This only validates the graphics device, but I would prefer to do it
> properly,
> something like this:
> 
>   if not listen or listen == "none":
>   self._dev.set_listen_none()
>   elif listen == "address":
>   self._dev.listen = addr
>   self._dev.port = port
>   self._dev.tlsPort = tlsport
>   else
>   raise ValueError(_("invalid listen type"))

Good catch

> 
> >  if keymap:
> >  self._dev.keymap = keymap
> >  except ValueError, e:
> > diff --git a/virtManager/details.py b/virtManager/details.py
> > index d803d52..d4e6629 100644
> > --- a/virtManager/details.py
> > +++ b/virtManager/details.py
> > @@ -2135,15 +2135,16 @@ class vmmDetails(vmmGObjectUI):
> >devobj=devobj)
> >  
> >  def config_graphics_apply(self, devobj):
> > -(gtype, port,
> > - tlsport, addr, passwd, keymap, gl) = self.gfxdetails.get_values()
> > +(gtype, port, tlsport, listen,
> > + addr, passwd, keymap, gl) = self.gfxdetails.get_values()
> >  
> >  kwargs = {}
> >  
> >  if self.edited(EDIT_GFX_PASSWD):
> >  kwargs["passwd"] = passwd
> >  if self.edited(EDIT_GFX_ADDRESS):
> > -kwargs["listen"] = addr
> > +kwargs["listen"] = listen
> > +kwargs["addr"] = addr
> 
> Now that we support to select listen type it would be probably better to
> separate the listen from address.  That would mean create all the bits as we
> already have for address.

I don't see much point in separating them, but ok

> 
> >  if self.edited(EDIT_GFX_KEYMAP):
> >  kwargs["keymap"] = keymap
> >  if self.edited(EDIT_GFX_PORT):
> > diff --git a/virtManager/domain.py b/virtManager/domain.py
> > index 6e742b9..f5159d6 100644
> > --- a/virtManager/domain.py
> > +++ b/virtManager/domain.py
> > @@ -824,7 +824,7 @@ class vmmDomain(vmmLibvirtObject):
> >  self._redefine_xmlobj(xmlobj)
> >  
> >  def define_graphics(self, devobj, do_hotplug,
> > -listen=_SENTINEL, port=_SENTINEL, tlsport=_SENTINEL,
> > +listen=_SENTINEL, addr=_SENTINEL, port=_SENTINEL,
> > tlsport=_SENTINEL,
> >  passwd=_SENTINEL, keymap=_SENTINEL, gtype=_S

Re: [virt-tools-list] [PATCH v4 1/2] virt-manager: add opengl graphics option

2016-12-19 Thread Marc-André Lureau
Hi

- Original Message -
> On 11/28/2016 05:47 AM, marcandre.lur...@redhat.com wrote:
> > From: Marc-André Lureau 
> > 
> > Add an OpenGL checkbox to the Spice graphics options (only available if
> > SUPPORT_CONN_SPICE_GL).
> > 
> 
> Sorry for the not reviewing these patches earlier...
> 
> This patch is fine but I'm still on the fence about exposing this in the UI
> at
> all:
> 
> 1) qemu:///system doesn't work out of the box, which is the common
> virt-manager usage

true, still waiting on libvirt to allow access to system qemu

> 2) the setting isn't really useful in isolation, needs to be combined with
> virtio-vga + accel3d setting at least, but the UI doesn't give any help here

we could disable the 3d checkbox if virtio isn't the video device?

> 3) I fear a trickle of bug reports like 'hey I clicked the GL option but 3D
> in
> my windows VM still sucks'

I am afraid that this will come inevitably :) Even if it worked, I can imagine 
people will complain that it isn't that much faster, doesn't work with Windows, 
is buggy with wayland etc.. We have to put pieces together and push people to 
do the required changes. Otherwise we are stuck, like for the past 6 months, 
and nobody even bother to test it..

> 
> I'd rather point people at virt-xml invocations until at least the
> qemu:///system issues are straightened out. And after that expose this with
> maybe some guest OS awareness, warnings/explaining tooltips, be explicit
> about
> errors like if a user tries to connect remotely, etc But I'm not 100%
> sold
> either way. Thoughts?

Either way works for me. It depends how "finished virt-manager wants to be :)

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 4/4] gfxdetails: add listen "None" option

2016-11-14 Thread Marc-André Lureau

Hi Pavel,

- Original Message -
> On Mon, Nov 14, 2016 at 09:49:33AM +0100, Pavel Hrdina wrote:
> > On Wed, Nov 09, 2016 at 11:21:35AM +0400, marcandre.lur...@redhat.com
> > wrote:
> > > From: Marc-André Lureau 
> > > 
> > > Similarly to virt-install --listen=none, add an option to disable all
> > > extra display server listening interface/ports.
> > > 
> > > Signed-off-by: Marc-André Lureau 
> > > ---
> > >  virtManager/addhardware.py | 10 +++---
> > >  virtManager/domain.py  |  4 
> > >  virtManager/gfxdetails.py  | 28 +---
> > >  virtinst/devicegraphics.py | 16 +++-
> > >  4 files changed, 47 insertions(+), 11 deletions(-)
> > 
> > The address box should be used only to specify address.  It would be better
> > to
> > add a new line named "Listen type" or something similar.
> > 
> > I'll push the previous patches.
> 
> I've tried the OpenGL option and it works only with listen type=none so we
> need

yes, it's spice limitation today, there is wip to address this

> to wait for this patch before pushing the 3/4 patch, so I'll push the first
> two
> patches now.
> 

Ok, I'll rework the remaining patches

> Pavel
> 
> > 
> > Pavel
> > 
> > > diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
> > > index 60b9157..87f397e 100644
> > > --- a/virtManager/addhardware.py
> > > +++ b/virtManager/addhardware.py
> > > @@ -1546,10 +1546,14 @@ class vmmAddHardware(vmmGObjectUI):
> > >  
> > >  self._dev =
> > >  virtinst.VirtualGraphics(self.conn.get_backend())
> > >  self._dev.type = gtype
> > > -self._dev.port = port
> > >  self._dev.passwd = passwd
> > > -self._dev.listen = addr
> > > -self._dev.tlsPort = tlsport
> > > +
> > > +if addr == "none":
> > > +self._dev.set_listen_none()
> > > +else:
> > > +self._dev.listen = addr
> > > +self._dev.port = port
> > > +self._dev.tlsPort = tlsport
> > >  if keymap:
> > >  self._dev.keymap = keymap
> > >  except ValueError, e:
> > > diff --git a/virtManager/domain.py b/virtManager/domain.py
> > > index 6e742b9..96bae64 100644
> > > --- a/virtManager/domain.py
> > > +++ b/virtManager/domain.py
> > > @@ -847,6 +847,10 @@ class vmmDomain(vmmLibvirtObject):
> > >  if gl != _SENTINEL:
> > >  editdev.gl = gl
> > >  
> > > +if listen == "none":
> > > +editdev.set_listen_none()
> > > +else:
> > > +editdev.remove_listen_none()
> > >  if do_hotplug:
> > >  self.hotplug(device=editdev)
> > >  else:
> > > diff --git a/virtManager/gfxdetails.py b/virtManager/gfxdetails.py
> > > index f3cd3a9..40e0cd8 100644
> > > --- a/virtManager/gfxdetails.py
> > > +++ b/virtManager/gfxdetails.py
> > > @@ -51,7 +51,7 @@ class vmmGraphicsDetails(vmmGObjectUI):
> > >  "on_graphics_use_password": self._change_password_chk,
> > >  
> > >  "on_graphics_password_changed": lambda ignore:
> > >  self.emit("changed-password"),
> > > -"on_graphics_address_changed": lambda ignore:
> > > self.emit("changed-address"),
> > > +"on_graphics_address_changed":
> > > self._change_graphics_address,
> > >  "on_graphics_tlsport_changed": lambda ignore:
> > >  self.emit("changed-tlsport"),
> > >  "on_graphics_port_changed": lambda ignore:
> > >  self.emit("changed-port"),
> > >  "on_graphics_keymap_changed": lambda ignore:
> > >  self.emit("changed-keymap"),
> > > @@ -86,6 +86,7 @@ class vmmGraphicsDetails(vmmGObjectUI):
> > >  model.append([None, _("Hypervisor default")])
> > >  model.append(["127.0.0.1", _("Localhost only")])
> > >  model.append(["0.0.0.0", _("All interfaces")])
> > > +model.append(["none", _(&quo

Re: [virt-tools-list] RFC: time for a 5.0 release ?

2016-10-10 Thread Marc-André Lureau
Hi

- Original Message -
> The 4.0 release was in June, and there have not been very many changes
> since then, but there are a couple of significant ones
> 
>  - Fix resizing of windows when using CSDs (relevant for Wayland)
>  - Fix virt-viewer not exiting on broken connection to guest
> 
> If we do a new release we can also pull in the nasty Win32 redraw
> bug that plagued 4.0. Of course we could do a new MSI build v4.1
> as an alternative.

Make sure to avoid glib 2.50 (in f25) which breaks non-console apps on windows 
(bgo#772511).

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] [PATCH 2/5] virtinst: check minimum qemu/libvirt for spice+gl

2016-10-06 Thread Marc-André Lureau
Hi Cole

On Sun, May 8, 2016 at 3:36 AM Cole Robinson  wrote:

> On 04/28/2016 08:22 AM, Marc-André Lureau wrote:
> > Signed-off-by: Marc-André Lureau 
> > ---
> >  virtinst/guest.py   | 5 +
> >  virtinst/support.py | 1 +
> >  2 files changed, 6 insertions(+)
> >
> > diff --git a/virtinst/guest.py b/virtinst/guest.py
> > index ab6dcba..5824e87 100644
> > --- a/virtinst/guest.py
> > +++ b/virtinst/guest.py
> > @@ -1141,6 +1141,11 @@ class Guest(XMLBuilder):
> >  if dev.image_compression is None:
> >  dev.image_compression = "off"
> >
> > +if (dev.type == "spice" and
> > + not self.conn.check_support(
> > + self.conn.SUPPORT_CONN_SPICE_GL)):
> > + raise ValueError(_("Host does not support spice GL"))
> > +
> >  def _add_spice_channels(self):
> >  if self.skip_default_channel:
> >  return
> > diff --git a/virtinst/support.py b/virtinst/support.py
> > index 1071750..1925986 100644
> > --- a/virtinst/support.py
> > +++ b/virtinst/support.py
> > @@ -311,6 +311,7 @@ SUPPORT_CONN_VCPU_PLACEMENT = _make(
> >  SUPPORT_CONN_MEM_STATS_PERIOD = _make(
> >  function="virDomain.setMemoryStatsPeriod",
> >  version="1.1.1", hv_version={"qemu": 0})
> > +SUPPORT_CONN_SPICE_GL = _make(version="1.3.3", hv_version={"qemu":
> "2.5.92"})
> >
>
> If we are going to wait for the libvirt listen type=none, maybe we can
> avoid
> this and use libvirt domcapabilities instead. It's on my todo list to use
> domcapabilities to advertise spice gl bits. We will see how this libvirt
> release cycle goes
>

Any news regarding domcapabilities? Should we go with that patch instead
for now?


>
> Thanks,
> Cole
>
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

-- 
Marc-André Lureau
___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH virt-install 2/2] Don't generate port and tlsport parameters in xml if spice gl is enabled

2016-05-04 Thread Marc-André Lureau
Hi

- Original Message -
> spice gl + tcp port is disallowed by qemu commit 569a93c, So in this
> case we don't generate port and tlsport parameters in domain xml.
> 
> Signed-off-by: Lin Ma 
> ---
>  tests/cli-test-xml/compare/virt-install-spice-gl.xml | 2 +-
>  virtinst/guest.py| 6 ++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/cli-test-xml/compare/virt-install-spice-gl.xml
> b/tests/cli-test-xml/compare/virt-install-spice-gl.xml
> index 44a6700..0407cd2 100644
> --- a/tests/cli-test-xml/compare/virt-install-spice-gl.xml
> +++ b/tests/cli-test-xml/compare/virt-install-spice-gl.xml
> @@ -46,7 +46,7 @@
>
>  
>  
> -
> +

nack, see also this thread: 
https://www.redhat.com/archives/virt-tools-list/2016-April/msg00120.html

>
>
>  
> diff --git a/virtinst/guest.py b/virtinst/guest.py
> index ab6dcba..e92c24a 100644
> --- a/virtinst/guest.py
> +++ b/virtinst/guest.py
> @@ -1132,6 +1132,12 @@ class Guest(XMLBuilder):
>  if dev.type == "default":
>  _set_type(dev)
>  
> +# spice gl + tcp port is disallowed by qemu commit 569a93c.
> +# So we dont generate port/tlsport parameters in domain xml.
> +if dev.type == "spice" and self.has_gl():
> +dev.port = None
> +dev.tlsPort = None
> +
>  if (dev.type == "spice" and
>  not self.conn.is_remote() and
>  self.conn.check_support(
> --
> 2.8.1
> 
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] [PATCH virt-install 1/2] Append '--attach' to virt-viewer for local display if spice gl enabled.

2016-05-04 Thread Marc-André Lureau
ack

- Original Message -
> Currently SPICE GL support is local-only, So it needs to attach to the
> local display.
> 
> Signed-off-by: Lin Ma 
> ---
>  virtinst/cli.py | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/virtinst/cli.py b/virtinst/cli.py
> index 8a3f6ae..cff1245 100644
> --- a/virtinst/cli.py
> +++ b/virtinst/cli.py
> @@ -423,6 +423,11 @@ def _gfx_console(guest):
>  "--connect", guest.conn.uri,
>  "--wait", guest.name]
>  
> +# Currently virt-viewer needs attaching to the local display while
> +# spice gl is enabled.
> +if guest.has_gl():
> +args.append("--attach")
> +
>  logging.debug("Launching virt-viewer for graphics type '%s'",
>  guest.get_devices("graphics")[0].type)
>  return _run_console(args)
> --
> 2.8.1
> 
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] [PATCH 3/5] virtinst: add listen=none graphics option

2016-04-28 Thread Marc-André Lureau
Hi

- Original Message -
> On Thu, Apr 28, 2016 at 10:14:27AM -0400, Marc-André Lureau wrote:
> > 
> > I like it, let me know how I can help. I hope we can have it in next
> > libvirt release, since it's not possible to setup a spice+virgl VM
> > anymore since qemu "Disallow use of gl + TCP port" now.
> 
> Do you mean it's not possible using virt-manager? Or something else?

Before this new qemu check, it was possible to setup a VM with 
virtmanager&libvirt with spice port listening on TCP (although it would result 
in black screen when connecting there). But virt-manager/vv would connect 
through libvirt, and thus virgl was working locally. Now it's no longer 
possible to start that VM anymore. Disabling all listening with 
libvirt/virt-manager is what this thread is about, so we can setup and start 
the VM again.


___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 3/5] virtinst: add listen=none graphics option

2016-04-28 Thread Marc-André Lureau
Hi

- Original Message -
> On Thu, Apr 28, 2016 at 09:39:40AM -0400, Marc-André Lureau wrote:
> > Hi
> > 
> > - Original Message -
> > > On Thu, Apr 28, 2016 at 02:22:09PM +0200, Marc-André Lureau wrote:
> > > > Add a special listen value to disable any extra display server
> > > > listening
> > > > socket. This is necessary now that qemu prevents starting a spice+virgl
> > > > VM with listening sockets (until spice allows remoting with virgl).
> > > > 
> > > > Signed-off-by: Marc-André Lureau 
> > > > ---
> > > >  man/virt-install.pod |  9
> > > >  +++--
> > > >  tests/cli-test-xml/compare/virt-install-many-devices.xml |  4 
> > > >  tests/clitest.py |  1 +
> > > >  virtinst/cli.py  | 11
> > > >  ++-
> > > >  4 files changed, 22 insertions(+), 3 deletions(-)
> > > > 
> > > > diff --git a/man/virt-install.pod b/man/virt-install.pod
> > > > index 0bc3d8c..0537693 100644
> > > > --- a/man/virt-install.pod
> > > > +++ b/man/virt-install.pod
> > > > @@ -964,8 +964,13 @@ Specify the spice tlsport.
> > > >  Address to listen on for VNC/Spice connections. Default is typically
> > > >  127.0.0.1
> > > >  (localhost only), but some hypervisors allow changing this globally
> > > >  (for
> > > >  example, the qemu driver default can be changed in
> > > >  /etc/libvirt/qemu.conf).
> > > > -Use 0.0.0.0 to allow access from other machines. This is use by 'vnc'
> > > > and
> > > > -'spice'
> > > > +Use 0.0.0.0 to allow access from other machines.
> > > > +
> > > > +Use 'none' to specify that the display server should not listen on any
> > > > +port. The display server can be accessed only locally through
> > > > +libvirt unix socket (virt-viewer with --attach for instance).
> > > > +
> > > > +This is used by 'vnc' and 'spice'
> > > >  
> > > >  =item B
> > > >  
> > > > diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml
> > > > b/tests/cli-test-xml/compare/virt-install-many-devices.xml
> > > > index e771cd3..d268cd9 100644
> > > > --- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
> > > > +++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
> > > > @@ -214,6 +214,10 @@
> > > >
> > > >
> > > >  
> > > > +
> > > > +  
> > > > +  
> > > > +
> > > 
> > > NACK, please don't do this ... it's not intuitive and it may confuse
> > > users.
> > > This wasn't designed in libvirt to start a domain with spice to not
> > > listen
> > > anywhere.  Even though it works, we shouldn't use it.  I'm working on
> > > patches,
> > > that will introduce new  which will tell qemu that
> > > spice
> > > shouldn't listen and that a client have to pass FD in order to connect.
> > > I'll
> > > also block this particular case in libvirt while starting a domain, that
> > > no
> > > port
> > > was specified.  It's not even documented anywhere.
> > 
> > Isn't it simply a documentation issue then? I don't think listen type='fd'
> > is more intuitive either. Also changing this now will break existing
> > configuration relying on this behaviour.
> 
> The 'fd' is a working name, I'll probably change it to 'none' or something
> else.
> Well one shouldn't rely on anything that isn't mentioned anywhere and is base
> on
> testing or reviewing code.  Instead of erroring out I'll probably convert
> this
> case to  but you should wait with those patches.  I

Ok, please keep me in CC. Are you working on this for the next release? if not, 
I can help.

> don't
> like similar configurations anywhere, where for some values it listens on
> address but with one exception that if you set port=0 and autoport=no that it
> won't listen anywhere (even if live XML has a listen=127.0.0.1).  It's
> ambiguous
> and like I said it may confuse users.
> 
> For that XML you are using in this patch live XML looks like this:
> 
> ...
> 
>   
>   
> 
> ...
> 
> which basically means that spice should listen on address 127.0.0.1 but no
> port
> was specified so does it really listen anywhere or what?

Isn't that a live XML "bug" instead?

> 
> I'm working on making this clear and to always represent a current state in
> the
> XML so everyone that uses libvirt knows exactly what's the configuration.

Sounds good

> 
> So in this case it should looks like this:
> 
> ...
> 
>   
>   
>   
> 
> ...

I like it, let me know how I can help. I hope we can have it in next libvirt 
release, since it's not possible to setup a spice+virgl VM anymore since qemu 
"Disallow use of gl + TCP port" now.

thanks

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 3/5] virtinst: add listen=none graphics option

2016-04-28 Thread Marc-André Lureau
Hi

- Original Message -
> On Thu, Apr 28, 2016 at 02:22:09PM +0200, Marc-André Lureau wrote:
> > Add a special listen value to disable any extra display server listening
> > socket. This is necessary now that qemu prevents starting a spice+virgl
> > VM with listening sockets (until spice allows remoting with virgl).
> > 
> > Signed-off-by: Marc-André Lureau 
> > ---
> >  man/virt-install.pod |  9 +++--
> >  tests/cli-test-xml/compare/virt-install-many-devices.xml |  4 
> >  tests/clitest.py |  1 +
> >  virtinst/cli.py  | 11 ++-
> >  4 files changed, 22 insertions(+), 3 deletions(-)
> > 
> > diff --git a/man/virt-install.pod b/man/virt-install.pod
> > index 0bc3d8c..0537693 100644
> > --- a/man/virt-install.pod
> > +++ b/man/virt-install.pod
> > @@ -964,8 +964,13 @@ Specify the spice tlsport.
> >  Address to listen on for VNC/Spice connections. Default is typically
> >  127.0.0.1
> >  (localhost only), but some hypervisors allow changing this globally (for
> >  example, the qemu driver default can be changed in
> >  /etc/libvirt/qemu.conf).
> > -Use 0.0.0.0 to allow access from other machines. This is use by 'vnc' and
> > -'spice'
> > +Use 0.0.0.0 to allow access from other machines.
> > +
> > +Use 'none' to specify that the display server should not listen on any
> > +port. The display server can be accessed only locally through
> > +libvirt unix socket (virt-viewer with --attach for instance).
> > +
> > +This is used by 'vnc' and 'spice'
> >  
> >  =item B
> >  
> > diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml
> > b/tests/cli-test-xml/compare/virt-install-many-devices.xml
> > index e771cd3..d268cd9 100644
> > --- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
> > +++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
> > @@ -214,6 +214,10 @@
> >
> >
> >  
> > +
> > +  
> > +  
> > +
> 
> NACK, please don't do this ... it's not intuitive and it may confuse users.
> This wasn't designed in libvirt to start a domain with spice to not listen
> anywhere.  Even though it works, we shouldn't use it.  I'm working on
> patches,
> that will introduce new  which will tell qemu that spice
> shouldn't listen and that a client have to pass FD in order to connect.  I'll
> also block this particular case in libvirt while starting a domain, that no
> port
> was specified.  It's not even documented anywhere.

Isn't it simply a documentation issue then? I don't think listen type='fd' is 
more intuitive either. Also changing this now will break existing configuration 
relying on this behaviour.

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH 3/5] virtinst: add listen=none graphics option

2016-04-28 Thread Marc-André Lureau
Add a special listen value to disable any extra display server listening
socket. This is necessary now that qemu prevents starting a spice+virgl
VM with listening sockets (until spice allows remoting with virgl).

Signed-off-by: Marc-André Lureau 
---
 man/virt-install.pod |  9 +++--
 tests/cli-test-xml/compare/virt-install-many-devices.xml |  4 
 tests/clitest.py |  1 +
 virtinst/cli.py  | 11 ++-
 4 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index 0bc3d8c..0537693 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -964,8 +964,13 @@ Specify the spice tlsport.
 Address to listen on for VNC/Spice connections. Default is typically 127.0.0.1
 (localhost only), but some hypervisors allow changing this globally (for
 example, the qemu driver default can be changed in /etc/libvirt/qemu.conf).
-Use 0.0.0.0 to allow access from other machines. This is use by 'vnc' and
-'spice'
+Use 0.0.0.0 to allow access from other machines.
+
+Use 'none' to specify that the display server should not listen on any
+port. The display server can be accessed only locally through
+libvirt unix socket (virt-viewer with --attach for instance).
+
+This is used by 'vnc' and 'spice'
 
 =item B
 
diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml 
b/tests/cli-test-xml/compare/virt-install-many-devices.xml
index e771cd3..d268cd9 100644
--- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -214,6 +214,10 @@
   
   
 
+
+  
+  
+
 
   
   
diff --git a/tests/clitest.py b/tests/clitest.py
index e67379a..ef96fe7 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -477,6 +477,7 @@ c.add_compare(""" \
 --graphics spice,port=5950,tlsport=5950,listen=1.2.3.4,keymap=ja \
 --graphics 
spice,image_compression=foo,streaming_mode=bar,clipboard_copypaste=yes,mouse_mode=client,filetransfer_enable=on
 \
 --graphics spice,gl=yes \
+--graphics spice,gl=yes,listen=none \
 \
 --controller usb,model=ich9-ehci1,address=0:0:4.7,index=0 \
 --controller usb,model=ich9-uhci1,address=0:0:4.0,index=0,master=0 \
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 8a3f6ae..d6d8c4f 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1875,10 +1875,19 @@ class ParserGraphics(VirtCLIParser):
 return
 inst.type = val
 
+def set_listen_cb(opts, inst, cliname, val):
+if val == "none":
+inst.port = None
+inst.tlsPort = None
+inst.listen = None
+inst.autoport = False
+else:
+inst.listen = val
+
 self.set_param(None, "type", setter_cb=set_type_cb)
 self.set_param("port", "port")
 self.set_param("tlsPort", "tlsport")
-self.set_param("listen", "listen")
+self.set_param("listen", "listen", setter_cb=set_listen_cb)
 self.set_param(None, "keymap", setter_cb=set_keymap_cb)
 self.set_param("passwd", "password")
 self.set_param("passwdValidTo", "passwordvalidto")
-- 
2.7.4

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH 0/5] virt-manager: more spice+virgl support

2016-04-28 Thread Marc-André Lureau
Hi

The following new series allows virt-manager to setup and use a
local-only spice & virgl-enabled VM. It depends on qemu 2.6 and
libvirt 1.3.3.

After this series, to configure a VM for virgl+spice, you can go to
Spice display details, select "Local only", and "GL" and switch the
video device to "virtio". To setup a new VM, you'll do similarly
during a customize installation. The Fedora 24 pre-release works out
of the box and allows easy testing.

(notes: a few patches are resent from older series. I didn't try to
manually "simplify" glade 3.20 modifications of ui file)

Marc-André Lureau (5):
  ConnectionInfo: console is active if fd can be provided
  virtinst: check minimum qemu/libvirt for spice+gl
  virtinst: add listen=none graphics option
  virt-manager: add opengl graphics option
  gfxdetails: add local-only option

 man/virt-install.pod   |   9 +-
 .../compare/virt-install-many-devices.xml  |   4 +
 tests/clitest.py   |   1 +
 ui/gfxdetails.ui   | 131 +++--
 virtManager/addhardware.py |   6 +-
 virtManager/details.py |  19 ++-
 virtManager/domain.py  |   7 +-
 virtManager/gfxdetails.py  |  49 ++--
 virtManager/sshtunnels.py  |   4 +
 virtinst/cli.py|  11 +-
 virtinst/guest.py  |   5 +
 virtinst/support.py|   1 +
 12 files changed, 194 insertions(+), 53 deletions(-)

-- 
2.7.4

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH 5/5] gfxdetails: add local-only option

2016-04-28 Thread Marc-André Lureau
Similarly to virt-install --listen=none, add a checkbox to disable all
extra display server listening interface/ports.

Signed-off-by: Marc-André Lureau 
---
 ui/gfxdetails.ui   | 106 +
 virtManager/addhardware.py |   4 +-
 virtManager/details.py |  12 -
 virtManager/domain.py  |   4 +-
 virtManager/gfxdetails.py  |  42 ++
 5 files changed, 118 insertions(+), 50 deletions(-)

diff --git a/ui/gfxdetails.ui b/ui/gfxdetails.ui
index 87c50f9..fe8d64f 100644
--- a/ui/gfxdetails.ui
+++ b/ui/gfxdetails.ui
@@ -67,63 +67,49 @@
   
   
 1
-4
+5
   
 
 
   
 True
 False
-1
 _Type:
 True
 graphics-type
-  
-  
-0
-0
-  
-
-
-  
-True
-False
 1
-Addr_ess:
-True
-graphics-address
   
   
 0
-1
+0
   
 
 
   
 True
 False
-1
 Pa_ssword:
 True
 graphics-password-chk
+1
   
   
 0
-4
+5
   
 
 
   
 True
 False
-1
 _Port:
 True
 graphics-port-auto
+1
   
   
 0
-2
+3
   
 
 
@@ -136,16 +122,16 @@
   
 True
 False
-1
 T_LS port:
 True
 graphics-tlsport-auto
+1
   
 
   
   
 0
-3
+4
   
 
 
@@ -193,21 +179,21 @@
   
   
 1
-3
+4
   
 
 
   
 True
 False
-1
 Ke_ymap:
 True
 graphics-keymap
+1
   
   
 0
-5
+6
   
 
 
@@ -228,7 +214,7 @@
   
   
 1
-5
+6
   
 
 
@@ -276,55 +262,55 @@
   
   
 1
-2
+3
   
 
 
   
 True
 False
-1
 Display:
+1
   
   
 0
-6
+7
   
 
 
   
 True
 False
-1
 XAuth:
+1
   
   
 0
-7
+8
   
 
 
   
 True
 False
-0
 label
+0
   
   
 1
-6
+7
   
 
 
   
 True
 False
-0
 label
+0
   
   
 1
-7
+8
   
 
 
@@ -342,7 +328,7 @@
   
   
 1
-1
+2
   
 
 
@@ -371,7 +357,7 @@
   
   
 0
-8
+9
   
 
 
@@ -389,7 +375,51 @@
   
   
 1
-8
+9
+  
+
+
+  
+True
+False
+Addr_ess:
+True
+graphics-address
+1
+  
+  
+0
+2
+  
+
+
+  
+True
+False
+Local only:
+True
+graphics-address
+1
+  
+  
+0
+1
+  
+
+
+  
+(through local libvirt 
only)
+True
+True
+False
+True
+0
+True
+
+  
+  
+1
+1
   
 
   
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index fbd4494..903cf63 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1560,7 +1560,7 @@ class vmmAddHardware(vmmGObjectUI):
 
 def _validate_page_graphics(self):
 try:
-(gtype, port,
+(gtype, autoport, port,
  tlsport, addr, passwd, keymap, gl) = self._gfxdetails.get_values()
 
 self._dev = virtinst.VirtualGraphics(self.conn.get_backend())
@@ -1569,6 +1569,8 @@ class vmmAddHardware(vmmGObjectUI):
 self._dev.passwd = passwd
 self._dev.listen = addr
 self._dev.tlsPort = tlsport
+if autoport is False:
+self._dev.autport = autoport
 if keymap:
 self._dev.keymap = keymap
 except ValueError, e:
diff --git a/virtManager/details.py b/virtManager/details.py
index 189a8d5..a52061f 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -91,6 +91,7 @@ EDIT_GFX_ADDRESS,
 EDIT_GFX_TLSPORT,
 EDIT_GFX_PORT,
 EDIT_GFX_OPENGL,
+EDIT_GFX_LOCAL_ONLY,
 
 EDIT_VIDEO_MODEL,
 
@@ -105,7 +106,7 @@ EDIT_FS,
 
 EDIT_HOSTDEV_ROMBAR,
 
-) = range(1, 46)
+) = range(1, 47)
 
 
 # Columns in hw list model
@@ -375,6 +376,8 @@ class vmmDetails(vmmGObjectUI):
 self.widget("graphics-align").add(self.gfxdetails.top_box)
 self.gfxdetails.connect("changed-type",
 lambda *x: self.enable_ap

[virt-tools-list] [PATCH 1/5] ConnectionInfo: console is active if fd can be provided

2016-04-28 Thread Marc-André Lureau
A domain doesn't need to have TCP socket listening, virt-manager can
now connect to it as long as libvirt can provide some fd (through
local unix sockets).

Signed-off-by: Marc-André Lureau 
---
 virtManager/sshtunnels.py | 4 
 1 file changed, 4 insertions(+)

diff --git a/virtManager/sshtunnels.py b/virtManager/sshtunnels.py
index 4fe8c3f..8749fa2 100644
--- a/virtManager/sshtunnels.py
+++ b/virtManager/sshtunnels.py
@@ -101,6 +101,10 @@ class ConnectionInfo(object):
 def console_active(self):
 if self.gsocket:
 return True
+connfd = self.get_conn_fd()
+if connfd != -1:
+os.close(connfd)
+return True
 if (self.gport in [None, -1] and self.gtlsport in [None, -1]):
 return False
 return True
-- 
2.7.4

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH 4/5] virt-manager: add opengl graphics option

2016-04-28 Thread Marc-André Lureau
From: Marc-André Lureau 

Add a OpenGl checkbox to the Spice graphics option (only available if
SUPPORT_CONN_SPICE_GL).

Signed-off-by: Marc-André Lureau 
---
 ui/gfxdetails.ui   | 29 +
 virtManager/addhardware.py |  2 +-
 virtManager/details.py |  9 +++--
 virtManager/domain.py  |  5 -
 virtManager/gfxdetails.py  | 13 ++---
 5 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/ui/gfxdetails.ui b/ui/gfxdetails.ui
index 85dbac6..87c50f9 100644
--- a/ui/gfxdetails.ui
+++ b/ui/gfxdetails.ui
@@ -363,5 +363,34 @@
 0
   
 
+
+  
+True
+False
+OpenGL
+  
+  
+0
+8
+  
+
+
+  
+True
+True
+False
+0.0500074505806
+0.5501192092896
+True
+
+
+  
+
+  
+  
+1
+8
+  
+
   
 
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 56c9235..fbd4494 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1561,7 +1561,7 @@ class vmmAddHardware(vmmGObjectUI):
 def _validate_page_graphics(self):
 try:
 (gtype, port,
- tlsport, addr, passwd, keymap) = self._gfxdetails.get_values()
+ tlsport, addr, passwd, keymap, gl) = self._gfxdetails.get_values()
 
 self._dev = virtinst.VirtualGraphics(self.conn.get_backend())
 self._dev.type = gtype
diff --git a/virtManager/details.py b/virtManager/details.py
index 0b8b145..189a8d5 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -90,6 +90,7 @@ EDIT_GFX_KEYMAP,
 EDIT_GFX_ADDRESS,
 EDIT_GFX_TLSPORT,
 EDIT_GFX_PORT,
+EDIT_GFX_OPENGL,
 
 EDIT_VIDEO_MODEL,
 
@@ -104,7 +105,7 @@ EDIT_FS,
 
 EDIT_HOSTDEV_ROMBAR,
 
-) = range(1, 45)
+) = range(1, 46)
 
 
 # Columns in hw list model
@@ -376,6 +377,8 @@ class vmmDetails(vmmGObjectUI):
 lambda *x: self.enable_apply(x, EDIT_GFX_TYPE))
 self.gfxdetails.connect("changed-port",
 lambda *x: self.enable_apply(x, EDIT_GFX_PORT))
+self.gfxdetails.connect("changed-opengl",
+lambda *x: self.enable_apply(x, EDIT_GFX_OPENGL))
 self.gfxdetails.connect("changed-tlsport",
 lambda *x: self.enable_apply(x, EDIT_GFX_TLSPORT))
 self.gfxdetails.connect("changed-address",
@@ -2131,7 +2134,7 @@ class vmmDetails(vmmGObjectUI):
 
 def config_graphics_apply(self, devobj):
 (gtype, port,
- tlsport, addr, passwd, keymap) = self.gfxdetails.get_values()
+ tlsport, addr, passwd, keymap, gl) = self.gfxdetails.get_values()
 
 kwargs = {}
 
@@ -2143,6 +2146,8 @@ class vmmDetails(vmmGObjectUI):
 kwargs["keymap"] = keymap
 if self.edited(EDIT_GFX_PORT):
 kwargs["port"] = port
+if self.edited(EDIT_GFX_OPENGL):
+kwargs["gl"] = gl
 if self.edited(EDIT_GFX_TLSPORT):
 kwargs["tlsport"] = tlsport
 if self.edited(EDIT_GFX_TYPE):
diff --git a/virtManager/domain.py b/virtManager/domain.py
index d79903f..66b7465 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -825,7 +825,8 @@ class vmmDomain(vmmLibvirtObject):
 
 def define_graphics(self, devobj, do_hotplug,
 listen=_SENTINEL, port=_SENTINEL, tlsport=_SENTINEL,
-passwd=_SENTINEL, keymap=_SENTINEL, gtype=_SENTINEL):
+passwd=_SENTINEL, keymap=_SENTINEL, gtype=_SENTINEL,
+gl=_SENTINEL):
 xmlobj = self._make_xmlobj_to_define()
 editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug)
 if not editdev:
@@ -843,6 +844,8 @@ class vmmDomain(vmmLibvirtObject):
 editdev.keymap = keymap
 if gtype != _SENTINEL:
 editdev.type = gtype
+if gl != _SENTINEL:
+editdev.gl = gl
 
 if do_hotplug:
 self.hotplug(device=editdev)
diff --git a/virtManager/gfxdetails.py b/virtManager/gfxdetails.py
index 0ae76c9..374eff8 100644
--- a/virtManager/gfxdetails.py
+++ b/virtManager/gfxdetails.py
@@ -35,6 +35,7 @@ class vmmGraphicsDetails(vmmGObjectUI):
 "changed-type": (GObject.SignalFlags.RUN_FIRST, None, []),
 "changed-address": (GObject.SignalFlags.RUN_FIRST, None, []),
 "changed-keymap": (GObject.SignalFlags.RUN_FIRST, None, []),
+"changed-opengl": (GObject.SignalFlags.RUN_FIRST, None, []),
 }
 
 def __init__(self, vm, builder, topwin):
@@ -54,6 +55,7 @@ class vmmGraphicsDetails(vmmGObjectUI):
 "on_graphics_tlsport_changed": lambda ignore: 
self.emit("changed-tlsport"),
 "on_graphics_port_changed": lambda ignore: 
self.emit("changed-port"),
 "on_graphics_keymap_changed":

[virt-tools-list] [PATCH 2/5] virtinst: check minimum qemu/libvirt for spice+gl

2016-04-28 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau 
---
 virtinst/guest.py   | 5 +
 virtinst/support.py | 1 +
 2 files changed, 6 insertions(+)

diff --git a/virtinst/guest.py b/virtinst/guest.py
index ab6dcba..5824e87 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -1141,6 +1141,11 @@ class Guest(XMLBuilder):
 if dev.image_compression is None:
 dev.image_compression = "off"
 
+if (dev.type == "spice" and
+ not self.conn.check_support(
+ self.conn.SUPPORT_CONN_SPICE_GL)):
+ raise ValueError(_("Host does not support spice GL"))
+
 def _add_spice_channels(self):
 if self.skip_default_channel:
 return
diff --git a/virtinst/support.py b/virtinst/support.py
index 1071750..1925986 100644
--- a/virtinst/support.py
+++ b/virtinst/support.py
@@ -311,6 +311,7 @@ SUPPORT_CONN_VCPU_PLACEMENT = _make(
 SUPPORT_CONN_MEM_STATS_PERIOD = _make(
 function="virDomain.setMemoryStatsPeriod",
 version="1.1.1", hv_version={"qemu": 0})
+SUPPORT_CONN_SPICE_GL = _make(version="1.3.3", hv_version={"qemu": "2.5.92"})
 
 
 # This is for disk . xen supports this, but it's
-- 
2.7.4

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH virt-manager] ConnectionInfo: console is active if fd can be provided

2016-04-26 Thread Marc-André Lureau
A domain doesn't need to have TCP socket listening, virt-manager can
now connect to it as long as libvirt can provide some fd (through
local unix sockets).

Signed-off-by: Marc-André Lureau 
---
 virtManager/sshtunnels.py | 4 
 1 file changed, 4 insertions(+)

diff --git a/virtManager/sshtunnels.py b/virtManager/sshtunnels.py
index 4fe8c3f..8749fa2 100644
--- a/virtManager/sshtunnels.py
+++ b/virtManager/sshtunnels.py
@@ -101,6 +101,10 @@ class ConnectionInfo(object):
 def console_active(self):
 if self.gsocket:
 return True
+connfd = self.get_conn_fd()
+if connfd != -1:
+os.close(connfd)
+return True
 if (self.gport in [None, -1] and self.gtlsport in [None, -1]):
 return False
 return True
-- 
2.7.4

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH v2 5/5] virt-manager: add opengl graphics option

2016-03-10 Thread Marc-André Lureau

Hi

- Original Message -
> 
> Okay, I'd like to hold off a bit on exposing in the UI until I play with it
> some... I don't want this ending up in Fedora and people start clicking the
> box then complain about nothing happening. So at least disabling it for older
> libvirt/qemu versions, and showing a warning box if we know it's not going to
> add anything, etc.
> 

Thanks, that makes sense, this patch is not complete enough itself, it should 
be part of a larger UI series.

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] [PATCH v2 5/5] virt-manager: add opengl graphics option

2016-03-10 Thread Marc-André Lureau
Hi Cole

- Original Message -
> On 03/04/2016 06:31 AM, Marc-André Lureau wrote:
> > From: Marc-André Lureau 
> > 
> > Add a OpenGl checkbox to the Spice graphics option.
> > 
> > Signed-off-by: Marc-André Lureau 
> > ---
> >  ui/gfxdetails.ui  | 29 +
> >  virtManager/details.py|  9 +++--
> >  virtManager/domain.py |  5 -
> >  virtManager/gfxdetails.py | 11 ---
> >  4 files changed, 48 insertions(+), 6 deletions(-)
> 
> I pushed 1-4, thanks!

thanks! 

> What does enabling just gl for spice give us, without virtio-gpu + 3daccel?
> Any error scenarios or weirdness?

No error, it will just not use it (but it may change in the future).

regards

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH v2 5/5] virt-manager: add opengl graphics option

2016-03-04 Thread Marc-André Lureau
From: Marc-André Lureau 

Add a OpenGl checkbox to the Spice graphics option.

Signed-off-by: Marc-André Lureau 
---
 ui/gfxdetails.ui  | 29 +
 virtManager/details.py|  9 +++--
 virtManager/domain.py |  5 -
 virtManager/gfxdetails.py | 11 ---
 4 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/ui/gfxdetails.ui b/ui/gfxdetails.ui
index 85dbac6..87c50f9 100644
--- a/ui/gfxdetails.ui
+++ b/ui/gfxdetails.ui
@@ -363,5 +363,34 @@
 0
   
 
+
+  
+True
+False
+OpenGL
+  
+  
+0
+8
+  
+
+
+  
+True
+True
+False
+0.0500074505806
+0.5501192092896
+True
+
+
+  
+
+  
+  
+1
+8
+  
+
   
 
diff --git a/virtManager/details.py b/virtManager/details.py
index 050ff26..99dcb6e 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -90,6 +90,7 @@ EDIT_GFX_KEYMAP,
 EDIT_GFX_ADDRESS,
 EDIT_GFX_TLSPORT,
 EDIT_GFX_PORT,
+EDIT_GFX_OPENGL,
 
 EDIT_VIDEO_MODEL,
 
@@ -104,7 +105,7 @@ EDIT_FS,
 
 EDIT_HOSTDEV_ROMBAR,
 
-) = range(1, 45)
+) = range(1, 46)
 
 
 # Columns in hw list model
@@ -376,6 +377,8 @@ class vmmDetails(vmmGObjectUI):
 lambda *x: self.enable_apply(x, EDIT_GFX_TYPE))
 self.gfxdetails.connect("changed-port",
 lambda *x: self.enable_apply(x, EDIT_GFX_PORT))
+self.gfxdetails.connect("changed-opengl",
+lambda *x: self.enable_apply(x, EDIT_GFX_OPENGL))
 self.gfxdetails.connect("changed-tlsport",
 lambda *x: self.enable_apply(x, EDIT_GFX_TLSPORT))
 self.gfxdetails.connect("changed-address",
@@ -2130,7 +2133,7 @@ class vmmDetails(vmmGObjectUI):
 
 def config_graphics_apply(self, devobj):
 (gtype, port,
- tlsport, addr, passwd, keymap) = self.gfxdetails.get_values()
+ tlsport, addr, passwd, keymap, gl) = self.gfxdetails.get_values()
 
 kwargs = {}
 
@@ -2142,6 +2145,8 @@ class vmmDetails(vmmGObjectUI):
 kwargs["keymap"] = keymap
 if self.edited(EDIT_GFX_PORT):
 kwargs["port"] = port
+if self.edited(EDIT_GFX_OPENGL):
+kwargs["gl"] = gl
 if self.edited(EDIT_GFX_TLSPORT):
 kwargs["tlsport"] = tlsport
 if self.edited(EDIT_GFX_TYPE):
diff --git a/virtManager/domain.py b/virtManager/domain.py
index 33535af..61311b7 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -826,7 +826,8 @@ class vmmDomain(vmmLibvirtObject):
 
 def define_graphics(self, devobj, do_hotplug,
 listen=_SENTINEL, port=_SENTINEL, tlsport=_SENTINEL,
-passwd=_SENTINEL, keymap=_SENTINEL, gtype=_SENTINEL):
+passwd=_SENTINEL, keymap=_SENTINEL, gtype=_SENTINEL,
+gl=_SENTINEL):
 xmlobj = self._make_xmlobj_to_define()
 editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug)
 if not editdev:
@@ -844,6 +845,8 @@ class vmmDomain(vmmLibvirtObject):
 editdev.keymap = keymap
 if gtype != _SENTINEL:
 editdev.type = gtype
+if gl != _SENTINEL:
+editdev.gl = gl
 
 if do_hotplug:
 self.hotplug(device=editdev)
diff --git a/virtManager/gfxdetails.py b/virtManager/gfxdetails.py
index 0ae76c9..9548065 100644
--- a/virtManager/gfxdetails.py
+++ b/virtManager/gfxdetails.py
@@ -35,6 +35,7 @@ class vmmGraphicsDetails(vmmGObjectUI):
 "changed-type": (GObject.SignalFlags.RUN_FIRST, None, []),
 "changed-address": (GObject.SignalFlags.RUN_FIRST, None, []),
 "changed-keymap": (GObject.SignalFlags.RUN_FIRST, None, []),
+"changed-opengl": (GObject.SignalFlags.RUN_FIRST, None, []),
 }
 
 def __init__(self, vm, builder, topwin):
@@ -54,6 +55,7 @@ class vmmGraphicsDetails(vmmGObjectUI):
 "on_graphics_tlsport_changed": lambda ignore: 
self.emit("changed-tlsport"),
 "on_graphics_port_changed": lambda ignore: 
self.emit("changed-port"),
 "on_graphics_keymap_changed": lambda ignore: 
self.emit("changed-keymap"),
+"on_graphics_opengl_toggled": lambda ignore: 
self.emit("changed-opengl"),
 })
 
 self._init_ui()
@@ -143,7 +145,9 @@ class vmmGraphicsDetails(vmmGObjectUI):
 if not self.widget("graphics-password-chk").get_active():
 passwd = None
 
-return gtype, port, tlsport, addr, passwd, keymap
+gl = self.widget("graphics-opengl").get_active()
+
+return gtype, port, tlsport, addr, passwd, keymap, gl
 
 def set_dev(self, gfx):
 self.reset_state()
@@ -188,6 +192,7 @@ class vmmGraphicsDetails

[virt-tools-list] [PATCH v2 0/5] virt-manager: add spice+virgl support

2016-03-04 Thread Marc-André Lureau
Hi

The following series allows to setup and use a local-only spice & virgl-enabled
VM. It depends qemu and libvirt from git.

It currently allows to setup a VM with virt-install, and I added minor details
tweaking to the virt-manager UI. I haven't checked setting up a VM from
virt-manager, this is left to do/check. To allow local framebuffer sharing, the
communication must happen through a UNIX socket. There is no need for a
listening socket on spice server, libvirt openGraphicsFD does the job just fine,
so I opted for that.

review and help welcome,

v1->v2:
- fix domain xml for spice gl parameter (changed during libvirt patches review)
- fix gfx.gl usage after Cole review

Marc-André Lureau (5):
  virtinst: add --graphics gl option
  virtinst: add virtio device model and accel3d attribute
  virtinst: use virtio if spice+gl
  virt-manager: connect with openGraphicsFD
  virt-manager: add opengl graphics option

 man/virt-install.pod   |  7 ++-
 .../compare/virt-install-many-devices.xml  |  4 ++
 .../cli-test-xml/compare/virt-install-spice-gl.xml | 70 ++
 tests/clitest.py   |  8 +++
 tests/xmlparse-xml/change-graphics-out.xml |  1 +
 tests/xmlparse-xml/change-videos-out.xml   |  4 +-
 tests/xmlparse.py  |  2 +
 ui/gfxdetails.ui   | 29 +
 virtManager/console.py |  2 +-
 virtManager/details.py |  9 ++-
 virtManager/domain.py  |  8 ++-
 virtManager/gfxdetails.py  | 11 +++-
 virtManager/sshtunnels.py  |  7 ++-
 virtManager/viewers.py |  9 +++
 virtinst/cli.py|  1 +
 virtinst/devicegraphics.py |  3 +-
 virtinst/devicevideo.py|  3 +-
 virtinst/guest.py  |  7 +++
 virtinst/osdict.py |  5 +-
 19 files changed, 177 insertions(+), 13 deletions(-)
 create mode 100644 tests/cli-test-xml/compare/virt-install-spice-gl.xml

-- 
2.5.0

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH v2 3/5] virtinst: use virtio if spice+gl

2016-03-04 Thread Marc-André Lureau
From: Marc-André Lureau 

Use virtio+accel3d by default whenever spice+gl is chosen. This allows
to easily set up accelerated gpu VM.

Signed-off-by: Marc-André Lureau 
---
 .../cli-test-xml/compare/virt-install-spice-gl.xml | 70 ++
 tests/clitest.py   |  7 +++
 virtinst/guest.py  |  7 +++
 virtinst/osdict.py |  5 +-
 4 files changed, 88 insertions(+), 1 deletion(-)
 create mode 100644 tests/cli-test-xml/compare/virt-install-spice-gl.xml

diff --git a/tests/cli-test-xml/compare/virt-install-spice-gl.xml 
b/tests/cli-test-xml/compare/virt-install-spice-gl.xml
new file mode 100644
index 000..44a6700
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-install-spice-gl.xml
@@ -0,0 +1,70 @@
+
+  foobar
+  ----
+  1048576
+  1048576
+  1
+  
+hvm
+
+  
+  
+
+
+
+  
+  
+Opteron_G4
+  
+  
+
+
+
+  
+  destroy
+  restart
+  restart
+  
+
+
+  
+  
+/usr/bin/qemu-kvm
+
+
+  
+
+
+  
+
+
+  
+
+
+  
+  
+  
+
+
+
+  
+  
+
+
+
+  
+  
+
+
+  
+
+
+
+  
+
+  
+
+
+
+  
+
diff --git a/tests/clitest.py b/tests/clitest.py
index 9d357c7..57934f3 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -529,6 +529,13 @@ c.add_compare(""" \
 """, "many-devices", compare_check=support.SUPPORT_CONN_RBD_FORMAT)
 
 
+c.add_compare(""" \
+--memory 1024 \
+--disk none \
+--graphics spice,gl=yes \
+""", "spice-gl", compare_check=support.SUPPORT_CONN_VMPORT)
+
+
 
 
 # CPU/RAM/numa and other singleton VM config tests #
diff --git a/virtinst/guest.py b/virtinst/guest.py
index f36a09d..da07410 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -1183,6 +1183,11 @@ class Guest(XMLBuilder):
 if gfx.type == gfx.TYPE_SPICE:
 return True
 
+def has_gl(self):
+for gfx in self.get_devices("graphics"):
+if gfx.gl:
+return True
+
 def _set_video_defaults(self):
 if self.has_spice():
 self._add_spice_channels()
@@ -1196,3 +1201,5 @@ class Guest(XMLBuilder):
 for video in self.get_devices("video"):
 if video.model == video.MODEL_DEFAULT:
 video.model = video_model
+if video.model == 'virtio' and self.has_gl():
+video.accel3d = True
diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index 704fbc6..9f9679c 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -522,7 +522,10 @@ class _OsVariant(object):
 return "vmvga"
 
 if guest.has_spice() and guest.os.is_x86():
-return "qxl"
+if guest.has_gl():
+return "virtio"
+else:
+return "qxl"
 
 if self.is_windows():
 return "vga"
-- 
2.5.0

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH v2 4/5] virt-manager: connect with openGraphicsFD

2016-03-04 Thread Marc-André Lureau
From: Marc-André Lureau 

This allows to connect to VM without any display listening socket, the
fd passing is done through libvirt connection.

Furthermore, since it uses unix socket, spice can use virgl locally
with texture sharing. This effectively enables spice-gtk to display
local virgl rendering.

Signed-off-by: Marc-André Lureau 
---
 virtManager/console.py| 2 +-
 virtManager/domain.py | 3 +++
 virtManager/sshtunnels.py | 7 ++-
 virtManager/viewers.py| 9 +
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/virtManager/console.py b/virtManager/console.py
index 3a1338e..1080f4a 100644
--- a/virtManager/console.py
+++ b/virtManager/console.py
@@ -621,7 +621,7 @@ class vmmConsolePages(vmmGObjectUI):
 gdevs = self.vm.get_graphics_devices()
 gdev = gdevs and gdevs[0] or None
 if gdev:
-ginfo = ConnectionInfo(self.vm.conn, gdev)
+ginfo = ConnectionInfo(self.vm, gdev)
 except Exception, e:
 # We can fail here if VM is destroyed: xen is a bit racy
 # and can't handle domain lookups that soon after
diff --git a/virtManager/domain.py b/virtManager/domain.py
index ab50d5c..33535af 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -1116,6 +1116,9 @@ class vmmDomain(vmmLibvirtObject):
 def open_console(self, devname, stream, flags=0):
 return self._backend.openConsole(devname, stream, flags)
 
+def open_graphics_fd(self):
+return self._backend.openGraphicsFD(0)
+
 def refresh_snapshots(self):
 self._snapshot_list = None
 
diff --git a/virtManager/sshtunnels.py b/virtManager/sshtunnels.py
index 03e1738..4fe8c3f 100644
--- a/virtManager/sshtunnels.py
+++ b/virtManager/sshtunnels.py
@@ -32,7 +32,9 @@ class ConnectionInfo(object):
 """
 Holds all the bits needed to make a connection to a graphical console
 """
-def __init__(self, conn, gdev):
+def __init__(self, vm, gdev):
+conn = vm.conn
+self.vm = vm
 self.gtype  = gdev.type
 self.gport  = gdev.port and str(gdev.port) or None
 self.gsocket= gdev.socket
@@ -47,6 +49,9 @@ class ConnectionInfo(object):
 if self._connhost == "localhost":
 self._connhost = "127.0.0.1"
 
+def get_conn_fd(self):
+return self.vm.open_graphics_fd()
+
 def _is_listen_localhost(self, host=None):
 try:
 return ipaddr.IPNetwork(host or self.gaddr).is_loopback
diff --git a/virtManager/viewers.py b/virtManager/viewers.py
index e285e44..e1b67b6 100644
--- a/virtManager/viewers.py
+++ b/virtManager/viewers.py
@@ -133,6 +133,10 @@ class Viewer(vmmGObject):
 def _open(self):
 if self._ginfo.need_tunnel():
 self._open_fd(self._tunnels.open_new())
+return
+connfd = self._ginfo.get_conn_fd()
+if connfd != -1:
+self._open_fd(connfd)
 else:
 self._open_host()
 
@@ -545,6 +549,11 @@ class SpiceViewer(Viewer):
 self._tunnels.unlock()
 
 def _channel_open_fd_request(self, channel, tls_ignore):
+if not self._ginfo.need_tunnel():
+connfd = self._ginfo.get_conn_fd()
+channel.open_fd(connfd)
+return
+
 if not self._tunnels:
 # Can happen if we close the details window and clear self._tunnels
 # while initially connecting to spice and channel FD requests
-- 
2.5.0

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH v2 2/5] virtinst: add virtio device model and accel3d attribute

2016-03-04 Thread Marc-André Lureau
From: Marc-André Lureau 

Signed-off-by: Marc-André Lureau 
---
 man/virt-install.pod | 2 +-
 tests/xmlparse-xml/change-videos-out.xml | 4 +++-
 tests/xmlparse.py| 1 +
 virtinst/devicevideo.py  | 3 ++-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index e2cd3a0..0bc3d8c 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -1339,7 +1339,7 @@ Use --console=? to see a list of all available sub 
options. Complete details at
 
 Specify what video device model will be attached to the guest. Valid values
 for VIDEO are hypervisor specific, but some options for recent kvm are
-cirrus, vga, qxl, or vmvga (vmware).
+cirrus, vga, qxl, virtio, or vmvga (vmware).
 
 Use --video=? to see a list of all available sub options. Complete details at 
L<http://libvirt.org/formatdomain.html#elementsVideo>
 
diff --git a/tests/xmlparse-xml/change-videos-out.xml 
b/tests/xmlparse-xml/change-videos-out.xml
index 15cb0b0..36780ad 100644
--- a/tests/xmlparse-xml/change-videos-out.xml
+++ b/tests/xmlparse-xml/change-videos-out.xml
@@ -30,7 +30,9 @@
   
 
 
-  
+  
+
+  
 
   
 
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index 2e41746..fa7eb5a 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -674,6 +674,7 @@ class XMLParseTest(unittest.TestCase):
 check("model", "cirrus", "cirrus", "qxl")
 check("ram", None, 100)
 check("vgamem", None, 8192)
+check("accel3d", None, True)
 
 self._alter_compare(guest.get_xml_config(), outfile)
 
diff --git a/virtinst/devicevideo.py b/virtinst/devicevideo.py
index 308bc2e..689c1cc 100644
--- a/virtinst/devicevideo.py
+++ b/virtinst/devicevideo.py
@@ -27,7 +27,7 @@ class VirtualVideoDevice(VirtualDevice):
 
 # Default models list
 MODEL_DEFAULT = "default"
-MODELS = ["cirrus", "vga", "vmvga", "xen", "qxl"]
+MODELS = ["cirrus", "vga", "vmvga", "xen", "qxl", "virtio"]
 
 @staticmethod
 def pretty_model(model):
@@ -43,6 +43,7 @@ class VirtualVideoDevice(VirtualDevice):
 ram = XMLProperty("./model/@ram", is_int=True)
 heads = XMLProperty("./model/@heads", is_int=True)
 vgamem = XMLProperty("./model/@vgamem", is_int=True)
+accel3d = XMLProperty("./model/acceleration/@accel3d", is_yesno=True)
 
 
 VirtualVideoDevice.register_type()
-- 
2.5.0

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH v2 1/5] virtinst: add --graphics gl option

2016-03-04 Thread Marc-André Lureau
From: Marc-André Lureau 

Add a --graphics option to enable accelarated rendering using
OpenGl. This is used only by Spice (and for local only guests atm).

Signed-off-by: Marc-André Lureau 
---
 man/virt-install.pod | 5 +
 tests/cli-test-xml/compare/virt-install-many-devices.xml | 4 
 tests/clitest.py | 1 +
 tests/xmlparse-xml/change-graphics-out.xml   | 1 +
 tests/xmlparse.py| 1 +
 virtinst/cli.py  | 1 +
 virtinst/devicegraphics.py   | 3 ++-
 7 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index 4efe391..e2cd3a0 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -982,6 +982,11 @@ Request a VNC password, required at connection time. 
Beware, this info may
 end up in virt-install log files, so don't use an important password. This
 is used by 'vnc' and 'spice'
 
+=item B
+
+Whether to use OpenGl accelerated rendering. Value is 'yes' or 'no'. This is
+used by 'spice'.
+
 =back
 
 Use --graphics=? to see a list of all available sub options. Complete details 
at L<http://libvirt.org/formatdomain.html#elementsGraphics>
diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml 
b/tests/cli-test-xml/compare/virt-install-many-devices.xml
index b444d75..e771cd3 100644
--- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -210,6 +210,10 @@
   
   
 
+
+  
+  
+
 
   
   
diff --git a/tests/clitest.py b/tests/clitest.py
index e68f81d..9d357c7 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -476,6 +476,7 @@ c.add_compare(""" \
 --graphics vnc,port=5950,listen=1.2.3.4,keymap=ja,password=foo \
 --graphics spice,port=5950,tlsport=5950,listen=1.2.3.4,keymap=ja \
 --graphics 
spice,image_compression=foo,streaming_mode=bar,clipboard_copypaste=yes,mouse_mode=client,filetransfer_enable=on
 \
+--graphics spice,gl=yes \
 \
 --controller usb,model=ich9-ehci1,address=0:0:4.7,index=0 \
 --controller usb,model=ich9-uhci1,address=0:0:4.0,index=0,master=0 \
diff --git a/tests/xmlparse-xml/change-graphics-out.xml 
b/tests/xmlparse-xml/change-graphics-out.xml
index 8a58f9a..0c08458 100644
--- a/tests/xmlparse-xml/change-graphics-out.xml
+++ b/tests/xmlparse-xml/change-graphics-out.xml
@@ -39,6 +39,7 @@
   
   
   
+  
   
   
   
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index b19f88c..2e41746 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -649,6 +649,7 @@ class XMLParseTest(unittest.TestCase):
 check("clipboard_copypaste", None, True)
 check("mouse_mode", None, "client")
 check("filetransfer_enable", None, False)
+check("gl", None, True)
 
 self._alter_compare(guest.get_xml_config(), outfile)
 
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 475bfb4..898f803 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1892,6 +1892,7 @@ class ParserGraphics(VirtCLIParser):
 self.set_param("mouse_mode", "mouse_mode")
 self.set_param("filetransfer_enable", "filetransfer_enable",
 is_onoff=True)
+self.set_param("gl", "gl", is_onoff=True)
 
 def _parse(self, opts, inst):
 if opts.fullopts == "none":
diff --git a/virtinst/devicegraphics.py b/virtinst/devicegraphics.py
index d8d54dd..c93a204 100644
--- a/virtinst/devicegraphics.py
+++ b/virtinst/devicegraphics.py
@@ -108,7 +108,7 @@ class VirtualGraphics(VirtualDevice):
 self._local_keymap = -1
 
 
-_XML_PROP_ORDER = ["type", "port", "tlsPort", "autoport",
+_XML_PROP_ORDER = ["type", "gl", "port", "tlsPort", "autoport",
"keymap", "listen",
"passwd", "display", "xauth"]
 
@@ -224,5 +224,6 @@ class VirtualGraphics(VirtualDevice):
 clipboard_copypaste = XMLProperty("./clipboard/@copypaste", is_yesno=True)
 mouse_mode = XMLProperty("./mouse/@mode")
 filetransfer_enable = XMLProperty("./filetransfer/@enable", is_yesno=True)
+gl = XMLProperty("./gl/@enable", is_yesno=True)
 
 VirtualGraphics.register_type()
-- 
2.5.0

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 4/5] virt-manager: connect with openGraphicsFD

2016-02-22 Thread Marc-André Lureau
Hi

- Original Message -
> On 02/22/2016 10:10 AM, Marc-André Lureau wrote:
> > Hi
> > 
> > On Thu, Feb 18, 2016 at 8:11 PM, Cole Robinson  wrote:
> >> Can you expand on this a bit more? Does this require  >> socket='XXX'
> >> ...  value to be specified by the user or something? Or will it enable gl
> >> even
> >> for listen=127.0.0.1 for example
> > 
> > It doesn't require any Spice listening socket, the fd passing is done
> > through libvirt.
> > 
> 
> Okay, I'll poke at this to understand it better, then we can push this patch
> separate from the spice bits since it's useful for vnc+unix socket as well
> 

agreed, thanks a lot

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH 4/5] virt-manager: connect with openGraphicsFD

2016-02-22 Thread Marc-André Lureau
Hi

On Thu, Feb 18, 2016 at 8:11 PM, Cole Robinson  wrote:
> Can you expand on this a bit more? Does this require  ...  value to be specified by the user or something? Or will it enable gl even
> for listen=127.0.0.1 for example

It doesn't require any Spice listening socket, the fd passing is done
through libvirt.

-- 
Marc-André Lureau

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH 1/5] virtinst: add --graphics gl option

2016-02-18 Thread Marc-André Lureau
From: Marc-André Lureau 

Add a --graphics option to enable accelarated rendering using
OpenGl. This is used only by Spice (and for local only guests atm).

Signed-off-by: Marc-André Lureau 
---
 man/virt-install.pod | 5 +
 tests/cli-test-xml/compare/virt-install-many-devices.xml | 3 +++
 tests/clitest.py | 1 +
 tests/xmlparse-xml/change-graphics-out.xml   | 2 +-
 tests/xmlparse.py| 1 +
 virtinst/cli.py  | 1 +
 virtinst/devicegraphics.py   | 3 ++-
 7 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index 1f3f535..c5359de 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -982,6 +982,11 @@ Request a VNC password, required at connection time. 
Beware, this info may
 end up in virt-install log files, so don't use an important password. This
 is used by 'vnc' and 'spice'
 
+=item B
+
+Whether to use OpenGl accelerated rendering. Value is 'yes' or 'no'. This is
+used by 'spice'.
+
 =back
 
 Use --graphics=? to see a list of all available sub options. Complete details 
at L<http://libvirt.org/formatdomain.html#elementsGraphics>
diff --git a/tests/cli-test-xml/compare/virt-install-many-devices.xml 
b/tests/cli-test-xml/compare/virt-install-many-devices.xml
index b444d75..e0902ef 100644
--- a/tests/cli-test-xml/compare/virt-install-many-devices.xml
+++ b/tests/cli-test-xml/compare/virt-install-many-devices.xml
@@ -210,6 +210,9 @@
   
   
 
+
+  
+
 
   
   
diff --git a/tests/clitest.py b/tests/clitest.py
index e68f81d..9d357c7 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -476,6 +476,7 @@ c.add_compare(""" \
 --graphics vnc,port=5950,listen=1.2.3.4,keymap=ja,password=foo \
 --graphics spice,port=5950,tlsport=5950,listen=1.2.3.4,keymap=ja \
 --graphics 
spice,image_compression=foo,streaming_mode=bar,clipboard_copypaste=yes,mouse_mode=client,filetransfer_enable=on
 \
+--graphics spice,gl=yes \
 \
 --controller usb,model=ich9-ehci1,address=0:0:4.7,index=0 \
 --controller usb,model=ich9-uhci1,address=0:0:4.0,index=0,master=0 \
diff --git a/tests/xmlparse-xml/change-graphics-out.xml 
b/tests/xmlparse-xml/change-graphics-out.xml
index 8a58f9a..f6130de 100644
--- a/tests/xmlparse-xml/change-graphics-out.xml
+++ b/tests/xmlparse-xml/change-graphics-out.xml
@@ -31,7 +31,7 @@
 
   
 
-
+
   
   
   
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index b19f88c..2e41746 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -649,6 +649,7 @@ class XMLParseTest(unittest.TestCase):
 check("clipboard_copypaste", None, True)
 check("mouse_mode", None, "client")
 check("filetransfer_enable", None, False)
+check("gl", None, True)
 
 self._alter_compare(guest.get_xml_config(), outfile)
 
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 475bfb4..898f803 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -1892,6 +1892,7 @@ class ParserGraphics(VirtCLIParser):
 self.set_param("mouse_mode", "mouse_mode")
 self.set_param("filetransfer_enable", "filetransfer_enable",
 is_onoff=True)
+self.set_param("gl", "gl", is_onoff=True)
 
 def _parse(self, opts, inst):
 if opts.fullopts == "none":
diff --git a/virtinst/devicegraphics.py b/virtinst/devicegraphics.py
index d8d54dd..d44eca7 100644
--- a/virtinst/devicegraphics.py
+++ b/virtinst/devicegraphics.py
@@ -108,7 +108,7 @@ class VirtualGraphics(VirtualDevice):
 self._local_keymap = -1
 
 
-_XML_PROP_ORDER = ["type", "port", "tlsPort", "autoport",
+_XML_PROP_ORDER = ["type", "gl", "port", "tlsPort", "autoport",
"keymap", "listen",
"passwd", "display", "xauth"]
 
@@ -208,6 +208,7 @@ class VirtualGraphics(VirtualDevice):
 type = XMLProperty("./@type",
default_cb=lambda s: "vnc",
default_name="default")
+gl = XMLProperty("./@gl", is_yesno=True)
 passwd = XMLProperty("./@passwd")
 passwdValidTo = XMLProperty("./@passwdValidTo")
 socket = XMLProperty("./@socket")
-- 
2.5.0

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH 3/5] virtinst: use virtio if spice+gl

2016-02-18 Thread Marc-André Lureau
From: Marc-André Lureau 

Use virtio+accel3d by default whenever spice+gl is chosen. This allows
to easily set up accelerated gpu VM.

Signed-off-by: Marc-André Lureau 
---
 .../cli-test-xml/compare/virt-install-spice-gl.xml | 69 ++
 tests/clitest.py   |  7 +++
 virtinst/guest.py  |  7 +++
 virtinst/osdict.py |  5 +-
 4 files changed, 87 insertions(+), 1 deletion(-)
 create mode 100644 tests/cli-test-xml/compare/virt-install-spice-gl.xml

diff --git a/tests/cli-test-xml/compare/virt-install-spice-gl.xml 
b/tests/cli-test-xml/compare/virt-install-spice-gl.xml
new file mode 100644
index 000..ef1e855
--- /dev/null
+++ b/tests/cli-test-xml/compare/virt-install-spice-gl.xml
@@ -0,0 +1,69 @@
+
+  foobar
+  ----
+  1048576
+  1048576
+  1
+  
+hvm
+
+  
+  
+
+
+
+  
+  
+Opteron_G4
+  
+  
+
+
+
+  
+  destroy
+  restart
+  restart
+  
+
+
+  
+  
+/usr/bin/qemu-kvm
+
+
+  
+
+
+  
+
+
+  
+
+
+  
+  
+  
+
+
+
+  
+
+
+
+  
+  
+
+
+  
+
+
+
+  
+
+  
+
+
+
+  
+
diff --git a/tests/clitest.py b/tests/clitest.py
index 9d357c7..57934f3 100644
--- a/tests/clitest.py
+++ b/tests/clitest.py
@@ -529,6 +529,13 @@ c.add_compare(""" \
 """, "many-devices", compare_check=support.SUPPORT_CONN_RBD_FORMAT)
 
 
+c.add_compare(""" \
+--memory 1024 \
+--disk none \
+--graphics spice,gl=yes \
+""", "spice-gl", compare_check=support.SUPPORT_CONN_VMPORT)
+
+
 
 
 # CPU/RAM/numa and other singleton VM config tests #
diff --git a/virtinst/guest.py b/virtinst/guest.py
index f36a09d..da07410 100644
--- a/virtinst/guest.py
+++ b/virtinst/guest.py
@@ -1183,6 +1183,11 @@ class Guest(XMLBuilder):
 if gfx.type == gfx.TYPE_SPICE:
 return True
 
+def has_gl(self):
+for gfx in self.get_devices("graphics"):
+if gfx.gl:
+return True
+
 def _set_video_defaults(self):
 if self.has_spice():
 self._add_spice_channels()
@@ -1196,3 +1201,5 @@ class Guest(XMLBuilder):
 for video in self.get_devices("video"):
 if video.model == video.MODEL_DEFAULT:
 video.model = video_model
+if video.model == 'virtio' and self.has_gl():
+video.accel3d = True
diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index 704fbc6..9f9679c 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -522,7 +522,10 @@ class _OsVariant(object):
 return "vmvga"
 
 if guest.has_spice() and guest.os.is_x86():
-return "qxl"
+if guest.has_gl():
+return "virtio"
+else:
+return "qxl"
 
 if self.is_windows():
 return "vga"
-- 
2.5.0

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH 0/5] RFC: virt-manager: add spice+virgl support

2016-02-18 Thread Marc-André Lureau
Hi

The following series allows to setup and use a local-only spice & virgl-enabled
VM. It depends on spice+virgl qemu series currently under review, and "qemu: add
spice opengl support" libvirt patch, as well as spice server/client from git
master.

It currently allows to setup a VM with virt-install, and I added minor details
tweaking to the virt-manager UI. I haven't checked setting up a VM from
virt-manager, this is left to do/check. To allow local framebuffer sharing, the
communication must happen through a UNIX socket. There is no need for a
listening socket on spice server, libvirt openGraphicsFD does the job just fine,
so I opted for that.

review and help welcome,

Marc-André Lureau (5):
  virtinst: add --graphics gl option
  virtinst: add virtio device model and accel3d attribute
  virtinst: use virtio if spice+gl
  virt-manager: connect with openGraphicsFD
  virt-manager: add opengl graphics option

 man/virt-install.pod   |  7 ++-
 .../compare/virt-install-many-devices.xml  |  3 +
 .../cli-test-xml/compare/virt-install-spice-gl.xml | 69 ++
 tests/clitest.py   |  8 +++
 tests/xmlparse-xml/change-graphics-out.xml |  2 +-
 tests/xmlparse-xml/change-videos-out.xml   |  4 +-
 tests/xmlparse.py  |  2 +
 ui/gfxdetails.ui   | 29 +
 virtManager/console.py |  2 +-
 virtManager/details.py |  9 ++-
 virtManager/domain.py  |  8 ++-
 virtManager/gfxdetails.py  | 11 +++-
 virtManager/sshtunnels.py  |  7 ++-
 virtManager/viewers.py |  9 +++
 virtinst/cli.py|  1 +
 virtinst/devicegraphics.py |  3 +-
 virtinst/devicevideo.py|  3 +-
 virtinst/guest.py  |  7 +++
 virtinst/osdict.py |  5 +-
 19 files changed, 175 insertions(+), 14 deletions(-)
 create mode 100644 tests/cli-test-xml/compare/virt-install-spice-gl.xml

-- 
2.5.0

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH 2/5] virtinst: add virtio device model and accel3d attribute

2016-02-18 Thread Marc-André Lureau
From: Marc-André Lureau 

Signed-off-by: Marc-André Lureau 
---
 man/virt-install.pod | 2 +-
 tests/xmlparse-xml/change-videos-out.xml | 4 +++-
 tests/xmlparse.py| 1 +
 virtinst/devicevideo.py  | 3 ++-
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/man/virt-install.pod b/man/virt-install.pod
index c5359de..9153cfe 100644
--- a/man/virt-install.pod
+++ b/man/virt-install.pod
@@ -1339,7 +1339,7 @@ Use --console=? to see a list of all available sub 
options. Complete details at
 
 Specify what video device model will be attached to the guest. Valid values
 for VIDEO are hypervisor specific, but some options for recent kvm are
-cirrus, vga, qxl, or vmvga (vmware).
+cirrus, vga, qxl, virtio, or vmvga (vmware).
 
 Use --video=? to see a list of all available sub options. Complete details at 
L<http://libvirt.org/formatdomain.html#elementsVideo>
 
diff --git a/tests/xmlparse-xml/change-videos-out.xml 
b/tests/xmlparse-xml/change-videos-out.xml
index 15cb0b0..36780ad 100644
--- a/tests/xmlparse-xml/change-videos-out.xml
+++ b/tests/xmlparse-xml/change-videos-out.xml
@@ -30,7 +30,9 @@
   
 
 
-  
+  
+
+  
 
   
 
diff --git a/tests/xmlparse.py b/tests/xmlparse.py
index 2e41746..fa7eb5a 100644
--- a/tests/xmlparse.py
+++ b/tests/xmlparse.py
@@ -674,6 +674,7 @@ class XMLParseTest(unittest.TestCase):
 check("model", "cirrus", "cirrus", "qxl")
 check("ram", None, 100)
 check("vgamem", None, 8192)
+check("accel3d", None, True)
 
 self._alter_compare(guest.get_xml_config(), outfile)
 
diff --git a/virtinst/devicevideo.py b/virtinst/devicevideo.py
index 308bc2e..689c1cc 100644
--- a/virtinst/devicevideo.py
+++ b/virtinst/devicevideo.py
@@ -27,7 +27,7 @@ class VirtualVideoDevice(VirtualDevice):
 
 # Default models list
 MODEL_DEFAULT = "default"
-MODELS = ["cirrus", "vga", "vmvga", "xen", "qxl"]
+MODELS = ["cirrus", "vga", "vmvga", "xen", "qxl", "virtio"]
 
 @staticmethod
 def pretty_model(model):
@@ -43,6 +43,7 @@ class VirtualVideoDevice(VirtualDevice):
 ram = XMLProperty("./model/@ram", is_int=True)
 heads = XMLProperty("./model/@heads", is_int=True)
 vgamem = XMLProperty("./model/@vgamem", is_int=True)
+accel3d = XMLProperty("./model/acceleration/@accel3d", is_yesno=True)
 
 
 VirtualVideoDevice.register_type()
-- 
2.5.0

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

[virt-tools-list] [PATCH 5/5] virt-manager: add opengl graphics option

2016-02-18 Thread Marc-André Lureau
From: Marc-André Lureau 

Add a OpenGl checkbox to the Spice graphics option.

Signed-off-by: Marc-André Lureau 
---
 ui/gfxdetails.ui  | 29 +
 virtManager/details.py|  9 +++--
 virtManager/domain.py |  5 -
 virtManager/gfxdetails.py | 11 ---
 4 files changed, 48 insertions(+), 6 deletions(-)

diff --git a/ui/gfxdetails.ui b/ui/gfxdetails.ui
index 85dbac6..87c50f9 100644
--- a/ui/gfxdetails.ui
+++ b/ui/gfxdetails.ui
@@ -363,5 +363,34 @@
 0
   
 
+
+  
+True
+False
+OpenGL
+  
+  
+0
+8
+  
+
+
+  
+True
+True
+False
+0.0500074505806
+0.5501192092896
+True
+
+
+  
+
+  
+  
+1
+8
+  
+
   
 
diff --git a/virtManager/details.py b/virtManager/details.py
index 8c46a60..1550320 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -90,6 +90,7 @@ EDIT_GFX_KEYMAP,
 EDIT_GFX_ADDRESS,
 EDIT_GFX_TLSPORT,
 EDIT_GFX_PORT,
+EDIT_GFX_OPENGL,
 
 EDIT_VIDEO_MODEL,
 
@@ -104,7 +105,7 @@ EDIT_FS,
 
 EDIT_HOSTDEV_ROMBAR,
 
-) = range(1, 45)
+) = range(1, 46)
 
 
 # Columns in hw list model
@@ -376,6 +377,8 @@ class vmmDetails(vmmGObjectUI):
 lambda *x: self.enable_apply(x, EDIT_GFX_TYPE))
 self.gfxdetails.connect("changed-port",
 lambda *x: self.enable_apply(x, EDIT_GFX_PORT))
+self.gfxdetails.connect("changed-opengl",
+lambda *x: self.enable_apply(x, EDIT_GFX_OPENGL))
 self.gfxdetails.connect("changed-tlsport",
 lambda *x: self.enable_apply(x, EDIT_GFX_TLSPORT))
 self.gfxdetails.connect("changed-address",
@@ -2128,7 +2131,7 @@ class vmmDetails(vmmGObjectUI):
 
 def config_graphics_apply(self, devobj):
 (gtype, port,
- tlsport, addr, passwd, keymap) = self.gfxdetails.get_values()
+ tlsport, addr, passwd, keymap, gl) = self.gfxdetails.get_values()
 
 kwargs = {}
 
@@ -2140,6 +2143,8 @@ class vmmDetails(vmmGObjectUI):
 kwargs["keymap"] = keymap
 if self.edited(EDIT_GFX_PORT):
 kwargs["port"] = port
+if self.edited(EDIT_GFX_OPENGL):
+kwargs["gl"] = gl
 if self.edited(EDIT_GFX_TLSPORT):
 kwargs["tlsport"] = tlsport
 if self.edited(EDIT_GFX_TYPE):
diff --git a/virtManager/domain.py b/virtManager/domain.py
index 33535af..61311b7 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -826,7 +826,8 @@ class vmmDomain(vmmLibvirtObject):
 
 def define_graphics(self, devobj, do_hotplug,
 listen=_SENTINEL, port=_SENTINEL, tlsport=_SENTINEL,
-passwd=_SENTINEL, keymap=_SENTINEL, gtype=_SENTINEL):
+passwd=_SENTINEL, keymap=_SENTINEL, gtype=_SENTINEL,
+gl=_SENTINEL):
 xmlobj = self._make_xmlobj_to_define()
 editdev = self._lookup_device_to_define(xmlobj, devobj, do_hotplug)
 if not editdev:
@@ -844,6 +845,8 @@ class vmmDomain(vmmLibvirtObject):
 editdev.keymap = keymap
 if gtype != _SENTINEL:
 editdev.type = gtype
+if gl != _SENTINEL:
+editdev.gl = gl
 
 if do_hotplug:
 self.hotplug(device=editdev)
diff --git a/virtManager/gfxdetails.py b/virtManager/gfxdetails.py
index 0ae76c9..df54bbf 100644
--- a/virtManager/gfxdetails.py
+++ b/virtManager/gfxdetails.py
@@ -35,6 +35,7 @@ class vmmGraphicsDetails(vmmGObjectUI):
 "changed-type": (GObject.SignalFlags.RUN_FIRST, None, []),
 "changed-address": (GObject.SignalFlags.RUN_FIRST, None, []),
 "changed-keymap": (GObject.SignalFlags.RUN_FIRST, None, []),
+"changed-opengl": (GObject.SignalFlags.RUN_FIRST, None, []),
 }
 
 def __init__(self, vm, builder, topwin):
@@ -54,6 +55,7 @@ class vmmGraphicsDetails(vmmGObjectUI):
 "on_graphics_tlsport_changed": lambda ignore: 
self.emit("changed-tlsport"),
 "on_graphics_port_changed": lambda ignore: 
self.emit("changed-port"),
 "on_graphics_keymap_changed": lambda ignore: 
self.emit("changed-keymap"),
+"on_graphics_opengl_toggled": lambda ignore: 
self.emit("changed-opengl"),
 })
 
 self._init_ui()
@@ -143,7 +145,9 @@ class vmmGraphicsDetails(vmmGObjectUI):
 if not self.widget("graphics-password-chk").get_active():
 passwd = None
 
-return gtype, port, tlsport, addr, passwd, keymap
+gl = self.widget("graphics-opengl").get_active()
+
+return gtype, port, tlsport, addr, passwd, keymap, gl
 
 def set_dev(self, gfx):
 self.reset_state()
@@ -188,6 +192,7 @@ class vmmGraphicsDetails(v

[virt-tools-list] [PATCH 4/5] virt-manager: connect with openGraphicsFD

2016-02-18 Thread Marc-André Lureau
From: Marc-André Lureau 

This allows to connect to VM without any listening socket.

Furthermore, since it uses unix socket, spice can use virgl locally
with texture sharing. This effectively enables spice-gtk to display
local virgl rendering.

Signed-off-by: Marc-André Lureau 
---
 virtManager/console.py| 2 +-
 virtManager/domain.py | 3 +++
 virtManager/sshtunnels.py | 7 ++-
 virtManager/viewers.py| 9 +
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/virtManager/console.py b/virtManager/console.py
index 3a1338e..1080f4a 100644
--- a/virtManager/console.py
+++ b/virtManager/console.py
@@ -621,7 +621,7 @@ class vmmConsolePages(vmmGObjectUI):
 gdevs = self.vm.get_graphics_devices()
 gdev = gdevs and gdevs[0] or None
 if gdev:
-ginfo = ConnectionInfo(self.vm.conn, gdev)
+ginfo = ConnectionInfo(self.vm, gdev)
 except Exception, e:
 # We can fail here if VM is destroyed: xen is a bit racy
 # and can't handle domain lookups that soon after
diff --git a/virtManager/domain.py b/virtManager/domain.py
index ab50d5c..33535af 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -1116,6 +1116,9 @@ class vmmDomain(vmmLibvirtObject):
 def open_console(self, devname, stream, flags=0):
 return self._backend.openConsole(devname, stream, flags)
 
+def open_graphics_fd(self):
+return self._backend.openGraphicsFD(0)
+
 def refresh_snapshots(self):
 self._snapshot_list = None
 
diff --git a/virtManager/sshtunnels.py b/virtManager/sshtunnels.py
index 03e1738..4fe8c3f 100644
--- a/virtManager/sshtunnels.py
+++ b/virtManager/sshtunnels.py
@@ -32,7 +32,9 @@ class ConnectionInfo(object):
 """
 Holds all the bits needed to make a connection to a graphical console
 """
-def __init__(self, conn, gdev):
+def __init__(self, vm, gdev):
+conn = vm.conn
+self.vm = vm
 self.gtype  = gdev.type
 self.gport  = gdev.port and str(gdev.port) or None
 self.gsocket= gdev.socket
@@ -47,6 +49,9 @@ class ConnectionInfo(object):
 if self._connhost == "localhost":
 self._connhost = "127.0.0.1"
 
+def get_conn_fd(self):
+return self.vm.open_graphics_fd()
+
 def _is_listen_localhost(self, host=None):
 try:
 return ipaddr.IPNetwork(host or self.gaddr).is_loopback
diff --git a/virtManager/viewers.py b/virtManager/viewers.py
index e285e44..e1b67b6 100644
--- a/virtManager/viewers.py
+++ b/virtManager/viewers.py
@@ -133,6 +133,10 @@ class Viewer(vmmGObject):
 def _open(self):
 if self._ginfo.need_tunnel():
 self._open_fd(self._tunnels.open_new())
+return
+connfd = self._ginfo.get_conn_fd()
+if connfd != -1:
+self._open_fd(connfd)
 else:
 self._open_host()
 
@@ -545,6 +549,11 @@ class SpiceViewer(Viewer):
 self._tunnels.unlock()
 
 def _channel_open_fd_request(self, channel, tls_ignore):
+if not self._ginfo.need_tunnel():
+connfd = self._ginfo.get_conn_fd()
+channel.open_fd(connfd)
+return
+
 if not self._tunnels:
 # Can happen if we close the details window and clear self._tunnels
 # while initially connecting to spice and channel FD requests
-- 
2.5.0

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [PATCH] msi: use the correct id for remote-viewer.exe

2015-10-08 Thread Marc-André Lureau


- Original Message -
> As, in theory, file ids are stables, seems that we have been using the
> wrong id for remote-viewer,exe since forever.

I don't think so, file association used to work.

More likely the path changed.

> That's what msidump shows:
> 
> ffidenci@cat ~/src/upstream/virt-viewer $ mkdir dump/
> ffidenci@cat ~/src/upstream/virt-viewer $ cd dump/
> ffidenci@cat ~/src/upstream/virt-viewer/dump $ msidump
> ../data/virt-viewer-x86-3.0.msi
> Exporting table _SummaryInformation...
> Exporting table _ForceCodepage...
> Exporting table AdminExecuteSequence...
> Exporting table AdvtExecuteSequence...
> Exporting table Component...
> Exporting table FeatureComponents...
> Exporting table CreateFolder...
> Exporting table AppSearch...
> Exporting table Property...
> Exporting table File...
> Exporting table ServiceInstall...
> Exporting table Error...
> Exporting table InstallExecuteSequence...
> Exporting table InstallUISequence...
> Exporting table RegLocator...
> Exporting table Feature...
> Exporting table CustomAction...
> Exporting table Icon...
> Exporting table Upgrade...
> Exporting table RemoveFile...
> Exporting table Shortcut...
> Exporting table Directory...
> Exporting table AdminUISequence...
> Exporting table Registry...
> Exporting table LaunchCondition...
> Exporting table Media...
> Exporting table Binary...
> Exporting table ServiceControl...
> Exporting table Signature...
> Exporting table MsiFileHash...

You could cut it "[...]"..

> ffidenci@cat ~/src/upstream/virt-viewer/dump $ grep
> "fil808B4A5BAB4ACD727D3823632E798743" File.idt
> ffidenci@cat ~/src/upstream/virt-viewer/dump $ grep
> "fil808B4A5BAB4ACD727D3823632E798743" Registry.idt
> reg29E29C5608128A0192FB9DC3C18562A6 0
> VirtViewer.vvfile\shell\open\command
> "[#fil808B4A5BAB4ACD727D3823632E798743]" "%1"   CProgIds
> ffidenci@cat ~/src/upstream/virt-viewer/dump $ grep "remote-viewer.exe"
> File.idt
> fil610DF9E49759B1DEC646290195F96F8A cmp7677A8696936707272DCA43B1BF26760
> remote-viewer.exe   855735  512 837
> 
> So, let's use the correct id (fil610DF9E49759B1DEC646290195F96F8A) from
> now on.
> 
> Related: rhbz#1146016
> ---
>  data/virt-viewer.wxs.in | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/data/virt-viewer.wxs.in b/data/virt-viewer.wxs.in
> index 2ed3b93..b7ea1e0 100644
> --- a/data/virt-viewer.wxs.in
> +++ b/data/virt-viewer.wxs.in
> @@ -67,7 +67,7 @@
>
>  
>
> - TargetFile='fil808B4A5BAB4ACD727D3823632E798743' Argument='"%1"' />
> + TargetFile='fil610DF9E49759B1DEC646290195F96F8A' Argument='"%1"' />
>  
>
>  
> --
> 2.4.3

If association works now, ack

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] [PATCH] msi: {virt, remote}-viewer depends on libxml2

2015-10-06 Thread Marc-André Lureau
ack

- Original Message -
> Currently libxml2 is pulled as an indirect dependency when virt-viewer
> is built with support to ovirt or libvirt (pulled by rest or libvirt,
> respectively). However, {virt,remote}-viewer itself depends on libxml2
> and not having it as an explicit dependency will cause errors on opening
> remote-viewer when it is built without support to ovirt/libvirt.
> ---
>  data/virt-viewer.wxs.in | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/data/virt-viewer.wxs.in b/data/virt-viewer.wxs.in
> index 48ef4ca..2ed3b93 100644
> --- a/data/virt-viewer.wxs.in
> +++ b/data/virt-viewer.wxs.in
> @@ -29,6 +29,7 @@
>
>  
>
> +  
>  
>
> @@ -135,6 +136,7 @@
>
>  
>
> +  
>
>
>
> --
> 2.4.3
> 
> ___
> virt-tools-list mailing list
> virt-tools-list@redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
> 

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


Re: [virt-tools-list] [virt-viewer PATCH V2] Add InstallScope="perMachine" to virt-viewer.wxs.in

2015-06-10 Thread Marc-André Lureau
Hi

On Tue, Jun 9, 2015 at 8:38 PM, Sandy Stutsman  wrote:

> Yeah, I remember looking at this last fall that dual mode
> perUser/perMachine wixl installers were a problem.
>
> And I think that a default perMachine installation conforms to most user
> expectations.
>


Agree, and the current wxs was designed and tested only perMachine, so
let's fix it to work properly that way.

ack

-- 
Marc-André Lureau
___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list

Re: [virt-tools-list] [virt-viewer PATCH V2] Add InstallScope="perMachine" to virt-viewer.wxs.in

2015-06-09 Thread Marc-André Lureau
Hi Sandy

- Original Message -
> The default installation (say double clicking the .msi file) results in an
> inconsistent installation state, part perMachine/part perUser. (The
> situation that raised the bug.)  The expected behavior is that the default
> installation be consistent. If other clients don't have admin privileges
> they can't install the client.

Did you identify what is mixed exactly?

I can see that per-user install switch to admin install in Windows Installer
log: "Elevation required to install product, will prompt for credentials"

The reason is that MSI prompts for elevation by default, unless msi summary
property Source have NO_PRIVILEGES. This is what InstallScope="perUser"
actually do.

The installation context changes installer behaviour according to msdn:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd765197%28v=vs.85%29.aspx

I can identify 2 sources of elevation requirements:

1) There are 2 ActiveX-related HKLM keys, and I thought I remember per-user 
install
would have some magic to make them per-user automatically. But I don't know 
where I got that from. But, ActiveX also support HKCU keys nowadays, so we
could solve that.

So we virt-viewer.msi today is a ALLUSERS= with elevated privileges required
so that HKLM key can be created. This is where it probably gets somehow mixed.

If we would simply replace HKLM keys by HKCU we should have per-user
installer, and we could set InstallScope="perUser" too to avoid elevation.
(because I am not convinced we need & want per-machine installer by default)

(Note: HKCU keys when installing with msiexec ALLUSERS=1 to override default
per-user behaviour, the key seems to be limited to the user running the 
installer,
it would be nice to have HKCU or HKLM depending on context)

2) However, if installed from unpriviledge user with elevation, should the 
install
location  still be per-user? I wish. But it doesn't even work in unpriviledge 
perUser.
ProgramFilesFolder always resolve to perMachine for me... I remember that used
to work, I have no idea what went wrong. Using LocalAppDataFolder according
to context would solve this, the same way as choosing HKCU vs HKLM.


All in all, dual perUser/perMachine is proven difficult to get working, so we 
could switch
to perMachine per default if nobody is able or willing to help here...

anybody? :)

___
virt-tools-list mailing list
virt-tools-list@redhat.com
https://www.redhat.com/mailman/listinfo/virt-tools-list


  1   2   3   4   5   6   7   8   9   10   >