- 05 Feb, 2019 1 commit
-
-
Christophe Fergeau authored
The README still references QEMU < 0.14, and mentions Gerd and Hans which have not been active on spice-vdagent for a few years. Signed-off-by:
Christophe Fergeau <cfergeau@redhat.com> Acked-by:
Victor Toso <victortoso@redhat.com>
-
- 31 Jan, 2019 2 commits
-
-
Christophe Fergeau authored
vdagent.c has a 'file_test' function which tests for the existence of the /dev entry for the spicevmc channel. glib already provides such a g_file_test() function, so we can use it instead. Signed-off-by:
Christophe Fergeau <cfergeau@redhat.com> Acked-by:
Jakub Janků <jjanku@redhat.com>
-
Christophe Fergeau authored
On most distros, spice-vdagent will be autostarted as part of the startup of the desktop environment session. This is done by spice-vdagent.desktop, which has no way of checking if we are in a virt environment with the needed devices present. Currently, if /dev/virtio-ports/com.redhat.spice.0 is missing, we log an error in syslog, and exit with an error exit code. This is too noisy when autostarting it on a bare metal machine which have no use for spice-vdagent. This reverts 0159111b to get rid of these warnings in the session's logs spice/linux/vd_agent#12Signed-off-by:
Christophe Fergeau <cfergeau@redhat.com> Acked-by:
Frediano Ziglio <fziglio@redhat.com>
-
- 30 Jan, 2019 1 commit
-
-
Jonathon Jongsma authored
Use brackets everywhere. Acked-by:
Frediano Ziglio <fziglio@redhat.com>
-
- 29 Jan, 2019 8 commits
-
-
Jonathon Jongsma authored
Previously, the device info was only sent from the daemon to the session agent when we receive the device info message from the host. That means that if the session agent exits and reconnects, the session agent will not have the device info necessary to translate spice display IDs to guest device outputs. This patch saves the last device info message that was received from the host, and re-sends it to the session agent when it reconnects. NOTE: this may not be necessary if the server simply re-sends a device info message when it detects that the agent has connected... Acked-by:
Lukáš Hrázký <lhrazky@redhat.com> Signed-off-by:
Jonathon Jongsma <jjongsma@redhat.com>
-
Jonathon Jongsma authored
Add a display_id field to the structure that we use to send down the list of guest display resolutions to the vdagentd daemon. This allows us to map the spice display id to the proper X display for determining mouse locations, etc. In the case where we have an mjpeg plugin running in the streaming agent, we have two spice displays representing the same guest display. In that scenario, the session agent may maintain the following guest output mapping: spice channel 0 (QXL) => X output 0 spice channel 1 (streaming-agent) => X output 0 While this is not necessarily a supported scenario, it would be nice if the cursor input worked properly in this case. The root problem is that when the session agent sends down the guest xorg resolutions to the system daemon, it simply loops through the list of xorg displays, and for each X display it looks up the first spice display ID associated with it and sends that down to the daemon. In the scenario mentioned above, since there is only a single X display configured (albeit represented by two different spice displays), we would send down a single display resolution to the system daemon: - { width=1280, height=1024, x=0, y=0, display_id=0 } Notice that there is no entry for display_id=1. When the agent receives a cursor input message for display channel 1, that message will get passed to the systemn daemon, which will attempt to look up display_id 1 in order to convert the event coordinates to global coordinates. Finding no entry for display_id=1, the mouse events do not work. In this patch, when we want to send the guest resolutions down to the system daemon, we still loop through the list of X outputs, but for each output we also loop through the guest output mapping table and send a resolution structure down to the daemon for each registered output mapping. This means that in the previously mentioned scenario, we would send down the following information: - { width=1280, height=1024, x=0, y=0, display_id=0 } - { width=1280, height=1024, x=0, y=0, display_id=1 } This means that when the client sends a mouse event for display_id=1, the system daemon knows the coordinates of the guest display associated with that ID and can process the mouse event properly. Acked-by:
Lukáš Hrázký <lhrazky@redhat.com> Signed-off-by:
Jonathon Jongsma <jjongsma@redhat.com>
-
Jonathon Jongsma authored
Rather than getting the current guest resolution in a VDAgentMonitorsConfig struct and then translating it to a new struct type for sending down to the daemon, simply use the new function that was factored out in a previous commit and populate the message struct directly. Acked-by:
Lukáš Hrázký <lhrazky@redhat.com> Signed-off-by:
Jonathon Jongsma <jjongsma@redhat.com>
-
Jonathon Jongsma authored
When sending the guest xorg resolution to the vdagentd daemon, we get the current resolution with this function, which returns a VDAgentMonitorsConfig structure that must then be converted to the structure that we send to the daemon. Rather than re-using this function that returns the wrong type, factor out most of the functionality into a separate function. This function can be used by a new function to return a type appropriate for sending the xorg resolution to the daemon. This is necessary because in the next few commits I'll be changing the vdagentd protocol to send an additional display_id parameter to the daemon. Acked-by:
Lukáš Hrázký <lhrazky@redhat.com> Signed-off-by:
Jonathon Jongsma <jjongsma@redhat.com>
-
Jonathon Jongsma authored
instead of using the spice display id directly as the xrandr output, look it up using our new guest output map Acked-by:
Lukáš Hrázký <lhrazky@redhat.com> Signed-off-by:
Jonathon Jongsma <jjongsma@redhat.com>
-
Jonathon Jongsma authored
There are basically three ways to refer to an output within vdagent: - The index of the array of MonitorConfig message. This is essentially a "spice display id" - the index of the array of xrandr outputs. This is the "output index" - the xrandr output id. This is the "output ID" Previously, the "spice display id" and the "output index" were treated as synonymous. But in order to support more complciated setups with multiple display devices, etc, we need to differentiate these ideas more clearly. This patch simply renames some variables and a function so that we can tell more easily which one of these concepts we are dealing with. Acked-by:
Lukáš Hrázký <lhrazky@redhat.com> Signed-off-by:
Jonathon Jongsma <jjongsma@redhat.com>
-
Jonathon Jongsma authored
Instead of storing each device address and device display ID in the hash table, simply use the lookup_xrandr_output_for_device_info() function to look up the ID of the xrandr output and store that in the hash table. Acked-by:
Lukáš Hrázký <lhrazky@redhat.com> Signed-off-by:
Jonathon Jongsma <jjongsma@redhat.com>
-
Jonathon Jongsma authored
Add a function to look up an xrandr output for a given device display id. This uses sysfs and the drm subsystem to lookup information about a graphics device output. It then compares the drm output name to xrandr output names to try to match that device output to an xrandr output. This is necesary for guests that have multiple graphics devices. Acked-by:
Lukáš Hrázký <lhrazky@redhat.com> Signed-off-by:
Jonathon Jongsma <jjongsma@redhat.com>
-
- 28 Jan, 2019 1 commit
-
-
Lukáš Hrázký authored
The graphics_device_info message contains the device display ID information (device address and device display ID). Stores the data in a hash table in vdagent. Signed-off-by:
Lukáš Hrázký <lhrazky@redhat.com> Acked-by:
Jonathon Jongsma <jjongsma@redhat.com>
-
- 26 Jan, 2019 1 commit
-
-
Frediano Ziglio authored
If test is run with root (for instance on Gitlab CI) creating a file on a directory with no permission will succeed and test will fail. Instead create a link trying to create a file in /proc/1 directory (which fails also using root account). Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Victor Toso <victortoso@redhat.com>
-
- 17 Jan, 2019 1 commit
-
-
Christian Hesse authored
Commit 098268a3 (systemd: Update path in unit file) was a really incomplete change. Let's change every occurrence of /var/run to /run. Signed-off-by:
Christian Hesse <mail@eworm.de> Acked-by:
Frediano Ziglio <fziglio@redhat.com>
-
- 16 Jan, 2019 7 commits
-
-
Frediano Ziglio authored
Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Victor Toso <victortoso@redhat.com>
-
Frediano Ziglio authored
Avoid race condition creating file between checking file existence with stat() and opening with open(). Directly create the file passing the O_EXCL flag. Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Victor Toso <victortoso@redhat.com>
-
Frediano Ziglio authored
Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Victor Toso <victortoso@redhat.com>
-
Frediano Ziglio authored
Make easier to test file creation Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Victor Toso <victortoso@redhat.com>
-
Frediano Ziglio authored
Variable is not used. Keep code to create file together. Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Victor Toso <victortoso@redhat.com>
-
Frediano Ziglio authored
Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Victor Toso <victortoso@redhat.com>
-
Frediano Ziglio authored
Correct invalid value for a file descriptor is -1, not 0. Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Victor Toso <victortoso@redhat.com>
-
- 15 Jan, 2019 1 commit
-
-
Christian Hesse authored
When loading the unit file, systemd 240 logs: systemd[1]: /usr/lib/systemd/system/spice-vdagentd.service:9: PIDFile= references path below legacy directory /var/run/, updating /var/run/spice-vdagentd/spice-vdagentd.pid → /run/spice-vdagentd/spice-vdagentd.pid; please update the unit file accordingly. So update the path. Signed-off-by:
Christian Hesse <mail@eworm.de> Acked-by:
Frediano Ziglio <fziglio@redhat.com>
-
- 08 Jan, 2019 2 commits
-
-
Christophe Fergeau authored
.socket systemd units already automatically get a Before=sockets.service, and the udev rule we have will ensure that when the appropriate virtio device is there, the socket unit will be started, so this WantedBy dependency is not needed, and is in part responsible for these warnings: [ INFO ] dev-virtio\x2dports-com.redhat.spice.0.device is not active. [DEPEND] Dependency failed for Activation socket for spice guest agent daemon. https://bugzilla.redhat.com/show_bug.cgi?id=1545212Signed-off-by:
Christophe Fergeau <cfergeau@redhat.com>
-
Christophe Fergeau authored
The udev rule already adds SYSTEMD_WANTS=spice-vdagentd.socket to the relevant virtio devices, which automatically adds Wants=${device} to spice-vdagentd.socket (see 'systemctl show spice-vdagentd.socket'). Adding a Requisite/After for these ports is at best redundant, and most likely wrong as this is causing boot time warnings: [ INFO ] dev-virtio\x2dports-com.redhat.spice.0.device is not active. [DEPEND] Dependency failed for Activation socket for spice guest agent daemon. https://bugzilla.redhat.com/show_bug.cgi?id=1545212Signed-off-by:
Christophe Fergeau <cfergeau@redhat.com>
-
- 07 Jan, 2019 2 commits
-
-
Frediano Ziglio authored
Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Christophe Fergeau <cfergeau@redhat.com>
-
Frediano Ziglio authored
Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Christophe Fergeau <cfergeau@redhat.com>
-
- 04 Jan, 2019 5 commits
-
-
Frediano Ziglio authored
Make sure all module files include config.h Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Christophe Fergeau <cfergeau@redhat.com>
-
Frediano Ziglio authored
Remove HAVE_CONFIG_H check, it is always defined. Remove indentation of includes, now the include is not in a condition and also some were indented some not. Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Christophe Fergeau <cfergeau@redhat.com>
-
Frediano Ziglio authored
We need to pass the original argument list, however argv is modified by g_option_context_parse so save a copy of the array to make it possible to restart with the same arguments. Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Christophe Fergeau <cfergeau@redhat.com>
-
Frediano Ziglio authored
People can think that 32 means 32 bit while it is always a long. Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Christophe Fergeau <cfergeau@redhat.com>
-
Frediano Ziglio authored
Different tools (compilers or analysers) recognise missing break in switch as possible problems. Many recognise a "fall through" comment to tell it is wanted. Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Christophe Fergeau <cfergeau@redhat.com>
-
- 03 Jan, 2019 2 commits
-
-
Frediano Ziglio authored
Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Jonathon Jongsma <jjongsma@redhat.com>
-
Frediano Ziglio authored
Modify directly the new_wbuf->buf buffer instead of writing into a temporary buffer and then copy in the final one. This also fixes Coverity warning: | uninit_use_in_call: Using uninitialized value "message_header". Field | "message_header.data" is uninitialized when calling "memcpy". Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Jonathon Jongsma <jjongsma@redhat.com>
-
- 20 Dec, 2018 1 commit
-
-
Jonathon Jongsma authored
Get the CRTC ID from the output struct rather than using the output_index as an index into the array of crtcs Signed-off-by:
Jonathon Jongsma <jjongsma@redhat.com> Acked-by:
Lukáš Hrázký <lhrazky@redhat.com>
-
- 19 Dec, 2018 2 commits
-
-
Victor Toso authored
In the current code, output should never be negative but the check exists after we use the variable as index. Make the check earlier. This patch also breaks the check in two in order to provide more accurate error log. Found by coverity: | check_after_sink: You might be using variable "output" before | verifying that it is >= 0. Changes in v2: - Move overflow check before accessing the arrays (Frediano) Changes in v3: - Move the whole check before accessing the arrays. - Improve commit log. Signed-off-by:
Victor Toso <victortoso@redhat.com> Acked-by:
Frediano Ziglio <fziglio@redhat.com>
-
Victor Toso authored
And use well defined macros for standard file descriptors. Signed-off-by:
Victor Toso <victortoso@redhat.com> Acked-by:
Frediano Ziglio <fziglio@redhat.com>
-
- 15 Dec, 2018 1 commit
-
-
Jonathon Jongsma authored
Acked-by:
Frediano Ziglio <fziglio@redhat.com>
-
- 16 Nov, 2018 2 commits
-
-
Victor Toso authored
Easier to trigger on Wayland guest by running > xrandr --output XWAYLAND0 --rotate left In current master, this causes the spice-vdagentd to disconnect from the client. In 0.18 branch (latest release), mouse becomes unusable as mentioned in the referred bug below. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1641723Signed-off-by:
Victor Toso <victortoso@redhat.com> Acked-by:
Frediano Ziglio <fziglio@redhat.com>
-
Frediano Ziglio authored
The function name is XRRGetScreenSizeRange not RRGetScreenSizeRange. Signed-off-by:
Frediano Ziglio <fziglio@redhat.com> Acked-by:
Victor Toso <victortoso@redhat.com>
-