[Spice-devel] [PATCH 0/4] Command line parsing with Glib

Victor Toso victortoso at redhat.com
Fri May 12 11:19:36 UTC 2017


From: Victor Toso <me at victortoso.com>

Hi,

As we already link the vdagent code with glib, I think we should try to let it
do most of the work whenever is possible. The second and third patch are
preparatory patches to have GOption for command line parsing. The first patch is
an extra.

If this seems good/acceptable I'll go on and change the vdagentd too.

Besides the code changes, the interface changed

-- before --
$ spice-vdagent --help
spice-vdagent: invalid option -- '-'

Usage: spice-vdagent [OPTIONS]

Spice guest agent X11 session agent, version 0.16.0.

Options:
  -h                                print this text
  -d                                log debug messages
  -s <port>                         set virtio serial port
  -S <filename>                     set udcs socket
  -x                                don't daemonize
  -f <dir|xdg-desktop|xdg-download> file xfer save dir
  -o <0|1>                          open dir on file xfer completion

-- now --
$ spice-vdagent --help
Usage:
  spice-vdagent [OPTION...]

        Spice session guest agent: X11
        Version: 0.17.0

Help Options:
  -h, --help                        Show help options

Application Options:
  -d, --debug                       Enable debug
  -x, --foreground                  Do not daemonize the agent
  -y, --x11-abort-on-error          Aborts on errors from X11
  -o, --file-xfer-open-dir          Open directory after completing file transfer
  -s, --virtio-serial-port-path     Set virtio-serial path (/dev/virtio-ports/com.redhat.spice.0)
  -f, --file-xfer-save-dir          Set directory to file transfers files
  -S, --vdagentd-socket             Set spice-vdagentd socket (/var/run/spice-vdagentd/spice-vdagent-sock)

Cheers,
    toso

Victor Toso (4):
  vdagentd-proto: define default virtio-port path
  vdagent: move file xfer initialization to a function
  vdagent: move file xfer finalize to a function
  vdagent: Use glib's commandline parser

 src/vdagent/vdagent.c   | 209 +++++++++++++++++++++++++++---------------------
 src/vdagentd-proto.h    |   2 +
 src/vdagentd/vdagentd.c |   2 +-
 3 files changed, 123 insertions(+), 90 deletions(-)

-- 
2.12.2



More information about the Spice-devel mailing list