_() should not be used in conjunction with ngettext(),
otherwise it's impossible to properly translate the message into
languages that have multiple plural forms, such as Czech.
Fix ngettext usage in usb-device-widget.c and
update the PO files accordingly.
Signed-off-by: Jakub Janků
--
hin a wrong domain.
Fix ngettext usage in usb-device-widget.c and
update the PO files accordingly.
Signed-off-by: Jakub Janků
---
po/de.po| 9 +++--
po/fr.po| 11 ---
po/it.po| 12 +---
src/usb-device-widget.c | 7 ---
4
Translation strings for spice options are already present
in the respective PO files.
g_option_group_set_translation_domain() call needs to be made,
so that the strings marked with N_() actually get translated at runtime.
Signed-off-by: Jakub Janků
---
src/spice-option.c | 1 +
1 file changed
e_fds()
4) vdagentd
Replace the main_loop() with a GMainLoop.
Use g_unix_signal_add() to handle SIGINT, SIGHUP, SIGTERM.
SIGQUIT handling is not supported by GLib.
Integrate the session_info into the loop using
GIOChannel and g_io_add_watch().
Signed-off-by: Jakub Janků
---
M
Use G_DECLARE_FINAL_TYPE().
Rename
struct vdagent_virtio_port --> VirtioPort
Signed-off-by: Jakub Janků
---
src/vdagentd/vdagentd.c| 18 +-
src/vdagentd/virtio-port.c | 16
src/vdagentd/virtio-port.h | 31 ---
3 files changed,
: 2.56
RHEL 7.5: 2.54
RHEL 7.4: 2.50
Debian 10:2.58
Debian 9: 2.50
Debian 8: 2.42
Ubuntu 19.04: 2.60
Ubuntu 18.04: 2.56
Ubuntu 16.04: 2.48
Signed-off-by: Jakub Janků
---
Makefile.am | 12 ++--
configure.ac | 2 +-
2 files changed
ous (doesn't use the "hack" with GMainLoop)
Cheers,
Jakub Janků (5):
build: add GIO dependency
introduce VDAgentConnection
udscs: use GObject macro
virtio: use GObject macro
udscs-server: split initialization
Makefile.am| 14 +-
configure.ac |
the code a bit shorter and nicer.
Signed-off-by: Jakub Janků
---
src/udscs.c | 63 +++--
src/udscs.h | 28 +-
src/vdagentd/vdagentd.c | 24 ++--
3 files changed, 38 insertions(+), 77 deletions(-)
diff --git a
Use G_DECLARE_FINAL_TYPE().
Rename
struct udscs_connection --> UdscsConnection
Signed-off-by: Jakub Janků
---
src/udscs.c | 15 ++-
src/udscs.h | 28 +++-
src/vdagent/clipboard.c | 8
src/vdagent/clipboard.h |
drive_letter should be assigned only when the mapping was successful.
Signed-off-by: Jakub Janků
---
spice/spice-webdavd.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index 29058e7..f2c7f07 100644
--- a/spice
The pointer to loop must be set to NULL on unref.
Quit signal handler can be called at any time,
using g_main_loop_quit() on a freed loop could lead to segfault.
Signed-off-by: Jakub Janků
---
spice/spice-webdavd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/spice
Other symbols that were added after G_SOURCE_{REMOVE, CONTINUE}
are already being used in the rest of the file - e.g. g_task_new,
so there's no need to define these.
Signed-off-by: Jakub Janků
---
spice/spice-webdavd.c | 7 ---
1 file changed, 7 deletions(-)
diff --git a/spice/
The enum doesn't add much value, let's remove it.
Signed-off-by: Jakub Janků
---
spice/spice-webdavd.c | 19 +++
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index c77c870..29058e7 100644
--- a/spice/spice
Signed-off-by: Jakub Janků
---
spice/spice-webdavd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index 681e909..c77c870 100644
--- a/spice/spice-webdavd.c
+++ b/spice/spice-webdavd.c
@@ -31,6 +31,7 @@
#include
#include
The filename needs the proper extension for GitLab to handle
the file as a Markdown file.
Signed-off-by: Jakub Janků
---
NEWS => NEWS.md | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename NEWS => NEWS.md (100%)
diff --git a/NEWS b/NEWS.md
similarity index 100%
rename from NEWS
According to [0], g_debug should not be used in a signal handler.
So, to avoid reentrancy, do not print debug message when quit is
called with SIGINT.
[0]
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/signal?view=vs-2019
Signed-off-by: Jakub Janků
---
spice/spice-webdavd.c
No need to keep it around after calling
g_socket_listener_add_address().
Signed-off-by: Jakub Janků
---
spice/spice-webdavd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index d9b1fae..681e909 100644
--- a/spice/spice-webdavd.c
+++ b/spice
my_input_channel_* isn't saying much,
let's rename it to input_channel_*_thread,
which is more fitting.
Signed-off-by: Jakub Janků
---
spice/spice-webdavd.c | 48 +--
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/spice/spice-w
Don't fail silently when we cannot open the webdav virtio port.
Signed-off-by: Jakub Janků
---
spice/spice-webdavd.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index 3fac28b..d9b1fae 100644
--- a/spice/spice-webdavd.c
+++ b/spice/
OutputQueue is a self-contained unit and as such can be put in
a separate file to make the spice-webdavd.c less cluttered.
Also, as the current implementation defines output_queue_{ref, unref},
turn OutputQueue into a GObject which can handle these for us.
Signed-off-by: Jakub Janků
---
spice
We shouldn't wait for 1 second if the service is supposed to stop.
Signed-off-by: Jakub Janků
---
spice/spice-webdavd.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index cdfa73d..6ad63c5 100644
--- a/
Hi,
this series contains mostly fixes of some things
that I came across while reading the spice-webdavd.c code,
without any order.
Cheers,
Jakub Janků (13):
spice: remove G_SOURCE_{REMOVE,CONTINUE} definitions
spice: rename my_input_channel
spice: handle SIGINT properly
spice: quit
The filename needs the proper extension for GitLab to handle
the file as a Markdown file.
Fix some style issues so that the file renders correctly.
Signed-off-by: Jakub Janků
---
README => README.md | 21 ++---
1 file changed, 10 insertions(+), 11 deletions(-)
rename REA
The current implementation finishes it
only after new data arrives from the channel (or after it is cancelled).
Signed-off-by: Jakub Janků
---
src/vmcstream.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/vmcstream.c b/src/vmcstream.c
index 86c949a
Message with no data from spice-webdav daemon means
the client disconnected.
In this case, the client connection to phodav
should be closed as well.
This can happen e.g. when file transfer gets cancelled.
Signed-off-by: Jakub Janků
---
src/channel-webdav.c | 4 ++--
1 file changed, 2
The IO operation is cancelled on channel dispose
and it is not an error, so silence the warnings.
Signed-off-by: Jakub Janků
---
src/channel-webdav.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index 34d88a9..7bec2a0
p2);
g_output_stream_write_all_async(p1_out);
g_clear_object(p2);
g_pollable_output_stream_is_writable(p1_out);
Signed-off-by: Jakub Janků
---
src/giopipe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/giopipe.c b/src/giopipe.c
index de1adae..fcec844 100644
--- a/src/giopipe.c
+++ b/
case, ignore the message and start
demuxing again.
Signed-off-by: Jakub Janků
---
src/channel-webdav.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index 822fee0..ea287f1 100644
--- a/src/channel-webdav.c
+++ b/src/ch
The current implementation finishes it only after new data
arrives from the channel (or after it is cancelled).
Signed-off-by: Jakub Janků
---
src/vmcstream.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/src/vmcstream.c b/src/vmcstream.c
index 86c949a..b6f6d1a 100644
--- a/src
case, ignore the message and start
demuxing again.
Signed-off-by: Jakub Janků
---
src/channel-webdav.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index 822fee0..4e08efa 100644
--- a/src/channel-webdav.c
+++ b/src/ch
p2);
g_output_stream_write_all_async(p1_out);
g_clear_object(p2);
g_pollable_output_stream_is_writable(p1_out);
Signed-off-by: Jakub Janků
---
src/giopipe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/giopipe.c b/src/giopipe.c
index de1adae..fcec844 100644
--- a/src/giopipe.c
+++ b/
Message with no data from spice-webdav daemon means
the client disconnected.
In this case, the client connection to phodav
should be closed as well.
This can happen e.g. when file transfer gets cancelled.
Also, while we're at it, reorder the code a bit.
Signed-off-by: Jakub Janků
---
The IO operation is cancelled on channel dispose
and it is not an error, so silence the warnings.
Signed-off-by: Jakub Janků
---
src/channel-webdav.c | 12 +---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index a8cdcbc
Some parts of the internal file transfer task API
can be invoked in the coroutine context, so in these cases
use g_coroutine_signal_emit and g_coroutine_object_notify.
Signed-off-by: Jakub Janků
---
src/spice-file-transfer-task.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff
spice_main_channel_clipboard_selection_grab
from the coroutine context prints an error as we try to switch to a
coroutine we are already in.
Such issues are probably not likely, but the fix is easy.
Signed-off-by: Jakub Janků
---
src/spice-file-transfer-task.c | 6 +++---
1 file changed, 3 insertions(+), 3
ed
that can be seen if the channel gets disconnected
by the session while having non-empty write queue.
spice_session_channel_destroy() sets channel->priv->session to NULL,
but spice_channel_write_msg() subsequently attempts to call
spice_session_get_read_only() with NULL pointer.
Signe
annel are released asap. Otherwise,
spice session would be stuck waiting for the channel to finalize.
Signed-off-by: Jakub Janků
---
Note: I left the OutputQueue code still in place since I'm considering
using it for the drag&drop functionality.
src/channel
to be
disconnected, the write operations need to be cancelled so that
the references to the channel are released asap. Otherwise,
spice session would be stuck waiting for the channel to finalize.
Signed-off-by: Jakub Janků
---
Changes since v1:
* updated commit log and comment
---
src/channel-webdav.c
ff-by: Jakub Janků
---
spice/spice-webdavd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/spice/spice-webdavd.c b/spice/spice-webdavd.c
index 81b4d91..e1e0f5c 100644
--- a/spice/spice-webdavd.c
+++ b/spice/spice-webdavd.c
@@ -251,11 +251,13 @@ mux_data_read_cb (GO
We already check with each input_stream_read_thread_finish()
whether the count of the read bytes matches the requested one.
Also, this is the way GLib handles it.
Signed-off-by: Jakub Janků
---
https://gitlab.gnome.org/GNOME/phodav/merge_requests/4
I've opened the merge request on gitlab
When the construction properties are set, the objects are
referenced by g_value_dup_object(), so they should be unref
once the task is done.
If the main channel stays referenced, spice session fails
to disconnect and the viewer does not close.
Signed-off-by: Jakub Janků
---
Hi,
it seems a bit
ned-off-by: Jakub Janků
---
src/channel-webdav.c | 17 +++--
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/src/channel-webdav.c b/src/channel-webdav.c
index 14d4e05..09ef9f7 100644
--- a/src/channel-webdav.c
+++ b/src/channel-webdav.c
@@ -235,7 +235,7 @@ mux_msg_
t-CRITICAL **: 15:39:46.168: g_object_unref:
assertion 'G_IS_OBJECT (object)' failed
To fix this, call spice_vmc_write_finish() immediately in the
corresponding write_cb().
Signed-off-by: Jakub Janků
---
src/vmcstream.c | 23 ---
1 file changed, 12 insertions(+), 1
The client can be unrefed before the demux_to_client_cb() is called
which could lead to segfault. So ref it first before starting the
async write.
Signed-off-by: Jakub Janků
---
src/channel-webdav.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/channel-webdav.c b/src
Hi,
On Tue, 2018-01-09 at 15:35 +0100, Christophe Fergeau wrote:
> This is used to prevent unfocused guests from sniffing the clipboard
> content without the host or other guests noticing. This can be a
> security issue if any VM can track the clipboard activity in the
> session.
> This commit set
From: Jakub Janků
The code will be replaced by GTK+ in the following patch.
---
src/vdagent/vdagent.c |7 -
src/vdagent/x11-priv.h | 91
src/vdagent/x11.c | 1074 +---
src/vdagent/x11.h | 10 -
4 files changed, 1 insertion
called to force GTK+
to always use X11 backend.
The implementation is partially based on the code in spice-gtk
(spice-gtk-session.c).
Cheers,
Jakub Janků (2):
vdagent-x11: remove clipboard handling
vdagent: handle clipboard using GTK+
Makefile.am |2 +
src/vdagent/c
From: Jakub Janků
Place the code that handles clipboard
into a separate file - clipboard.c
---
Makefile.am | 2 +
src/vdagent/clipboard.c | 401
src/vdagent/clipboard.h | 42 +
src/vdagent/vdagent.c | 31 +++-
4 files
Hi Christophe,
On Wed, Feb 7, 2018 at 5:12 PM, Christophe de Dinechin
wrote:
> Hi Jakub,
>
>
> I have not looked at everything, but here are a few quick notes just from
> glancing…
>
>> On 21 Jan 2018, at 21:03, Jakub Janků wrote:
>>
>> From: Jakub Jank
--> AppRequest
- data_retrievals --> requests_from_apps
- data_requests --> requests_from_client
- sel_from_clip --> sel_id_from_clip
- minor style improvements
Jakub Janků (1):
vdagent: add GTK+ clipboard handling
Makefile.am | 6 +
configure.ac|
From: Jakub Janků
Add clipboard handling that uses GTK+ instead of Xlib.
Place the code into new files: clipboard.c, clipboard.h
Use the old Xlib implementation by default.
Add configure option --with-gtk-clipboard.
Guard the code by WITH_GTK_CLIPBOARD variable -
compile vdagent either with GTK
From: Jakub Janků
Add --with-gtk configure option.
If used, favor GTK+ over Xlib.
---
configure.ac | 13 -
src/vdagent/vdagent.c | 8 +++-
src/vdagent/x11.c | 6 ++
3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
From: Jakub Janků
This code using Xlib was removed by commit
"x11: retrieve _NET_WM_NAME using GDK"
a4f5c7dcb6579f61434a443e537641f91da6cb8c.
Bring it back to make GTK+ optional for now.
---
src/vdagent/vdagent.c | 6 ++--
src/vdagent/x11.
From: Jakub Janků
---
src/vdagent/clipboard.c | 416 +++-
src/vdagent/clipboard.h | 6 +-
src/vdagent/vdagent.c | 23 ++-
src/vdagent/x11-priv.h | 44 ++---
src/vdagent/x11.c | 25 ++-
src/vdagent/x11.h | 6 +
6 files changed
From: Jakub Janků
Introduce new functions to handle clipboard,
add new files clipboard.[ch]
This is only a preparatory patch for
following GTK+ clipboard implementation.
---
Makefile.am | 2 ++
src/vdagent/clipboard.c | 68 +
src
Hi,
these patches introduce support for transferring arbitrary type of clipboard
data between spice-gtk client and linux vdagent.
At the moment, VDAgentClipboard* messages are used to exchange data. These
messages use spice-defined identifiers to describe the type of data (such as
VD_AGENT_CLI
If guest agent has VD_AGENT_CAP_SELECTION_DATA,
use new VDAgentSelection* messages to transfer
clipboard data.
---
src/spice-gtk-session.c | 385 +++-
1 file changed, 305 insertions(+), 80 deletions(-)
diff --git a/src/spice-gtk-session.c b/src/spice-gtk-sessio
---
spice/vd_agent.h | 38 ++
1 file changed, 38 insertions(+)
diff --git a/spice/vd_agent.h b/spice/vd_agent.h
index 7109ede..0d81740 100644
--- a/spice/vd_agent.h
+++ b/spice/vd_agent.h
@@ -91,6 +91,10 @@ enum {
VD_AGENT_CLIENT_DISCONNECTED,
VD_AGEN
These enable transferring arbitrary type of data
unlike the VDAgentClipboard* messages that are
restricted to types defined in spice protocol
(and atom2agent[] in spice-gtk-session.c).
This will later be used for clipboard and DND data.
---
doc/reference/spice-gtk-sections.txt | 4 +
src/channe
---
src/vdagent/clipboard.c | 11 +++
src/vdagent/clipboard.h | 2 ++
src/vdagent/vdagent.c | 3 +++
3 files changed, 16 insertions(+)
diff --git a/src/vdagent/clipboard.c b/src/vdagent/clipboard.c
index 101e535..63f8527 100644
--- a/src/vdagent/clipboard.c
+++ b/src/vdagent/clipboard
Use GTK+ instead of Xlib where possible,
remove Xlib code that handles clipboard.
---
configure.ac| 13 +-
src/vdagent/clipboard.c | 49 +-
src/vdagent/clipboard.h |4 +-
src/vdagent/vdagent.c | 14 +-
src/vdagent/x11-priv.h | 94
src/vdagent/x11.c | 1177 +---
---
src/vdagentd-proto-strings.h | 10 ++
src/vdagentd-proto.h | 17 +
2 files changed, 27 insertions(+)
diff --git a/src/vdagentd-proto-strings.h b/src/vdagentd-proto-strings.h
index 6e7bcee..e76decc 100644
--- a/src/vdagentd-proto-strings.h
+++ b/src/vdagentd-pro
---
src/vdagent/clipboard.c | 162 ++--
1 file changed, 106 insertions(+), 56 deletions(-)
diff --git a/src/vdagent/clipboard.c b/src/vdagent/clipboard.c
index 63f8527..b8bb0ad 100644
--- a/src/vdagent/clipboard.c
+++ b/src/vdagent/clipboard.c
@@ -96,6 +96,83 @
---
src/vdagent/clipboard.c | 207
src/vdagent/clipboard.h | 11 +++
src/vdagent/vdagent.c | 15 +++
src/vdagentd/vdagentd.c | 178 +-
4 files changed, 393 insertions(+), 18 deletions(-)
diff --git a/src/vdagent/clipboar
364b6bba068bd694d7c4355b6275f88482d9f3f8 introduced
session_info_session_is_locked() in session-info.h, however
dummy-session-info.c implemented session_is_locked() instead,
causing builds with --with-session-info=none to fail.
This was fixed by d66fbb9d12ae2e5dbaf13d23b9abb4b6bf187d7f,
but it did
n quit it (this would also require adding destruction callbacks for
udscs_connection, udscs_server and virtio_port)
Is there any better solution?
Cheers,
Jakub
Jakub Janků (18):
vdagentd: parse argv using GLib
vport: add by_user param to vdagent_virtio_port_disconnect_callback
vdagentd
Rewrite udscs.c using VDAgentConnection to integrate it
into GMainLoop and simplify the code.
udscs_destroy_connection() does NOT close
the underlying FD immediately.
Apart from that, the behavior stays the same.
Drop support for select() in udscs_server, remove
udscs_server_fill_fds(), udscs_ser
If the virtio port is destroyed explicitly
by calling vdagent_virtio_port_destroy(),
by_user is set to TRUE, otherwise to FALSE.
This will be used later with GMainLoop.
---
src/vdagentd/virtio-port.c | 24 +++-
src/vdagentd/virtio-port.h | 10 +-
2 files changed, 20 in
All command line options now have long names
as they are required by GLib.
Change types of some global variables that hold the options:
- const char * --> gchar *
- int --> gboolean
Define DEFAULT_UINPUT_DEVICE as "/dev/uinput",
since there's already DEFAULT_VIRTIO_PORT_PATH, VDAGENTD_SO
This is purely a preparatory patch as it renders
the vdagentd non-functional.
Remove main while loop with FD polling.
udscs, virtio-port and session-info will be integrated
into the GMainLoop in the following commits.
Use g_unix_signal_add() to handle SIGINT, SIGHUP, SIGTERM.
SIGQUIT handling is
This is necessary for the following GDBus integration,
which drops session_info_get_fd(). The vdagentd therefore
won't be able to detect session changes using select().
---
src/vdagentd/console-kit.c| 2 +-
src/vdagentd/dummy-session-info.c | 2 +-
src/vdagentd/session-info.h | 4 +++
In console-kit.c, FD polling is handled internally by GDBus.
In systemd-login.c, FD is integrated into the GMainLoop
using GIOChannel.
Users of session-info.h are notified by ActiveSessionChangeCb
when the active session changes.
This renders the session_info_get_fd() obsolete.
---
src/vdagentd
Divide creation of udscs_server into 2 steps:
1) udscs_server_new()
- allocates new udscs_server struct and inits it
2) udscs_server_listen_to_fd(), udscs_server_listen_to_address()
- starts accepting new connections
udscs_server_listen_to_address() creates a new socket and
binds it to the giv
Require UNIX-specific GIO package to build spice-vdagent.
This includes
- GDBus which is going to be used instead of libdbus in
console-kit.c and systemd-login.c
- I/O stream classes and networking APIs that are going to
be used in udscs.c and virtio-port.c instead of low-level
POSIX I/O f
udscs_get_peer_cred() is currently used only in
vdagentd.c to obtain PID, so let's drop udscs_get_peer_cred()
and add udscs_get_peer_pid() instead.
---
src/udscs.c | 6 +++---
src/udscs.h | 4 ++--
src/vdagentd/vdagentd.c | 2 +-
3 files changed, 6 insertions(+), 6 deletion
Both console-kit.c and systemd-login.c
have been moved to GDBus.
---
Makefile.am | 2 --
configure.ac | 1 -
2 files changed, 3 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index b291b19..64ed406 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -47,7 +47,6 @@ src_spice_vdagent_SOURCES =
Rewrite virtio-port.c using VDAgentConnection to integrate it
into GMainLoop and simplify the code.
virtio_port_destroy() does NOT close the underlying FD immediately.
GSources attached to GMainContext can be processed during
vdagent_virtio_port_flush() call.
Apart from that, the behavior stays th
Add a set of helper functions built around GIO that can be used to
easily write messages to and read from the given FD.
Since VDAgentConnection uses GIO,
it integrates well with GMainLoop.
Read messages must begin with a header of a fixed size.
Message body size can vary.
User of VDAgentConnecti
Remove type_to_string, no_types arguments from
udscs_connect() and udscs_server_new().
udscs is used only in vdagent.c and vdagentd.c
and in both cases the args are the same
(vdagentd_messages, VDAGENTD_NO_MESSAGES).
Add debug_print_message_header().
---
src/udscs.c | 52 +
Rewrite systemd-login.c using GDBus instead of libdbus.
Use GDBusProxy. This is less efficient than the previous impl
as it caches all properties and listens to all signals of the
given DBus object. But it is just so much more convenient...
---
src/vdagentd/systemd-login.c | 254 +++--
Some older parts of the code currently use
memory functions defined in stdlib.h
and usually handle allocation errors.
On the other hand, newer parts of the code
and GLib/GTK+ functions themselves commonly use
wrappers provided by GLib that terminate
the program when there isn't enough memory.
So
Move code handling VDAGENTD_GUEST_XORG_RESOLUTION
from agent_read_complete() to a separate function
to make the switch statement less cluttered.
Remove unnecessary res variable.
---
src/vdagentd/vdagentd.c | 61 +
1 file changed, 31 insertions(+), 30 deleti
Rewrite console-kit.c using GDBus instead of libdbus.
GDBus provides a more convenient way to access DBus objects.
All DBus method calls share a fair amount of common code here,
so add a helper function dbus_call_method_for_string().
---
src/vdagentd/console-kit.c | 597 --
Move code handling VDAGENTD_FILE_XFER_STATUS
from agent_read_complete() to a separate function
to make the switch statement less cluttered.
Improve formatting a bit.
---
src/vdagentd/vdagentd.c | 61 +
1 file changed, 37 insertions(+), 24 deletions(-)
diff
-session
-X, --disable-session-integration
Change the types of some global variables that hold the options:
- const char * --> gchar *
- int --> gboolean
Define DEFAULT_UINPUT_DEVICE as "/dev/uinput",
since there's already DEFAULT_VIRTIO_PORT_PATH, VDAGENTD_SOCKET.
Required GLib version was bumped from 2.28 to 2.34 by
61fc548fe1a323dd2344c8ae267e3ce05e86da7d.
Signed-off-by: Jakub Janků
---
src/vdagent/file-xfers.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/src/vdagent/file-xfers.c b/src/vdagent/file-xfers.c
index 6461d05..0fabe7e 100644
--- a
y rewrite udscs, virtio-port, systemd-login
and console-kit.
Regards,
Jakub
Jakub Janků (6):
move to GLib memory functions
udscs: return void in udscs_write{,_all}()
vport: return void in vdagent_virtio_port_write{,_start}()
vdagentd: move code to do_agent_xorg_resolution()
vdagent
mplification.
Note: this commit only partially touches
src/vdagent/x11.c as the clipboard-handling
code here should be removed in the future.
Signed-off-by: Jakub Janků
---
src/udscs.c | 60 ++--
src/vdagent/x11-randr.c | 54 ++
The functions would return -1 only if malloc() failed, otherwise 0.
Since malloc() was replaced by g_malloc(), which terminates
the program if the allocation fails, return void instead.
Signed-off-by: Jakub Janků
---
src/vdagentd/virtio-port.c | 15 +--
src/vdagentd/virtio-port.h
The functions would return -1 only if malloc() failed, otherwise 0.
Since malloc() was replaced by g_malloc(), which terminates
the program if the allocation fails, return void instead.
Signed-off-by: Jakub Janků
---
src/udscs.c | 13 -
src/udscs.h | 5 ++---
2 files changed, 6
Move code handling VDAGENTD_GUEST_XORG_RESOLUTION messages
from agent_read_complete() to a separate function to make
the switch statement less cluttered.
Remove unnecessary res variable.
Signed-off-by: Jakub Janků
---
src/vdagentd/vdagentd.c | 62 +
1
Move code handling VDAGENTD_FILE_XFER_STATUS messages
from agent_read_complete() to a separate function
to make the switch statement less cluttered.
Improve formatting a bit.
Signed-off-by: Jakub Janků
---
src/vdagentd/vdagentd.c | 61 +
1 file changed
for simplification.
Replace subsequent alloc and memcpy calls
with single g_memdup where possible.
Note: this commit only partially touches
src/vdagent/x11.c as the clipboard-handling
code here should be removed in the future.
Signed-off-by: Jakub Janků
---
src/udscs.c
Move code handling VDAGENTD_GUEST_XORG_RESOLUTION messages
from agent_read_complete() to a separate function to make
the switch statement less cluttered.
Remove unnecessary res variable.
Signed-off-by: Jakub Janků
---
src/vdagentd/vdagentd.c | 62 ++---
1
Move code handling VDAGENTD_FILE_XFER_STATUS messages
from agent_read_complete() to a separate function
to make the switch statement less cluttered.
Simplify the code a bit.
Signed-off-by: Jakub Janků
---
src/vdagentd/vdagentd.c | 54 +++--
1 file changed
Remove @type_to_string, @no_types arguments from
udscs_connect(), udscs_create_server{,_for_fd}().
udscs is used only in vdagent.c and vdagentd.c
and in both cases the args are the same
(vdagentd_messages, VDAGENTD_NO_MESSAGES).
Add debug_print_message_header().
Signed-off-by: Jakub Janků
POSIX I/O functions dealing with file descriptors.
Version 2.44 is required because of the follwing definitions:
- g_input_stream_read_all_*
- g_output_stream_write_all_*
- GSimpleIOStream
Signed-off-by: Jakub Janků
---
Makefile.am | 2 ++
configure.ac | 1 +
2 files changed, 3 insertions
SIGINT, SIGHUP, SIGTERM.
SIGQUIT handling is not supported by GLib.
Integrate the session_info into the loop using
GIOChannel and g_io_add_watch().
Signed-off-by: Jakub Janků
---
Makefile.am| 2 +
src/udscs.c| 483 +++--
src
@err parameter
to the vdagent_virtio_port_disconnect_callback:
1) disconnect was initiated by vdagent_virtio_port_destroy()
--> @err is NULL
2) disconnect was caused by an IO error
--> @err is set accordingly
Signed-off-by: Jakub Janků
---
src/vdagentd/virtio-port.
the code a bit shorter and nicer.
Signed-off-by: Jakub Janků
---
src/udscs.c | 56 +
src/udscs.h | 27 +---
src/vdagentd/vdagentd.c | 24 +++---
3 files changed, 33 insertions(+), 74 deletions(-)
diff
1 - 100 of 223 matches
Mail list logo