Revision 3b698f52f9fabb4fb7844f57160c65cd6ce6513c authored by Peter Maydell on 09 October 2018, 17:24:59 UTC, committed by Kevin Wolf on 05 November 2018, 14:09:54 UTC
Taking the address of a field in a packed struct is a bad idea, because it might not be actually aligned enough for that pointer type (and thus cause a crash on dereference on some host architectures). Newer versions of clang warn about this. Avoid the bug by not using the "modify in place" byte swapping functions. There are a few places where the in-place swap function is used on something other than a packed struct field; we convert those anyway, for consistency. This patch was produced with the following spatch script (and hand-editing to fold a few resulting overlength lines): @@ expression E; @@ -be16_to_cpus(&E); +E = be16_to_cpu(E); @@ expression E; @@ -be32_to_cpus(&E); +E = be32_to_cpu(E); @@ expression E; @@ -be64_to_cpus(&E); +E = be64_to_cpu(E); @@ expression E; @@ -cpu_to_be16s(&E); +E = cpu_to_be16(E); @@ expression E; @@ -cpu_to_be32s(&E); +E = cpu_to_be32(E); @@ expression E; @@ -cpu_to_be64s(&E); +E = cpu_to_be64(E); Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: John Snow <jsnow@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
1 parent cf67b69
qemu-ga.texi
@example
@c man begin SYNOPSIS
@command{qemu-ga} [@var{OPTIONS}]
@c man end
@end example
@c man begin DESCRIPTION
The QEMU Guest Agent is a daemon intended to be run within virtual
machines. It allows the hypervisor host to perform various operations
in the guest, such as:
@itemize
@item
get information from the guest
@item
set the guest's system time
@item
read/write a file
@item
sync and freeze the filesystems
@item
suspend the guest
@item
reconfigure guest local processors
@item
set user's password
@item
...
@end itemize
qemu-ga will read a system configuration file on startup (located at
@file{/etc/qemu/qemu-ga.conf} by default), then parse remaining
configuration options on the command line. For the same key, the last
option wins, but the lists accumulate (see below for configuration
file format).
@c man end
@c man begin OPTIONS
@table @option
@item -m, --method=@var{method}
Transport method: one of @samp{unix-listen}, @samp{virtio-serial}, or
@samp{isa-serial} (@samp{virtio-serial} is the default).
@item -p, --path=@var{path}
Device/socket path (the default for virtio-serial is
@samp{/dev/virtio-ports/org.qemu.guest_agent.0},
the default for isa-serial is @samp{/dev/ttyS0})
@item -l, --logfile=@var{path}
Set log file path (default is stderr).
@item -f, --pidfile=@var{path}
Specify pid file (default is @samp{/var/run/qemu-ga.pid}).
@item -F, --fsfreeze-hook=@var{path}
Enable fsfreeze hook. Accepts an optional argument that specifies
script to run on freeze/thaw. Script will be called with
'freeze'/'thaw' arguments accordingly (default is
@samp{/etc/qemu/fsfreeze-hook}). If using -F with an argument, do
not follow -F with a space (for example:
@samp{-F/var/run/fsfreezehook.sh}).
@item -t, --statedir=@var{path}
Specify the directory to store state information (absolute paths only,
default is @samp{/var/run}).
@item -v, --verbose
Log extra debugging information.
@item -V, --version
Print version information and exit.
@item -d, --daemon
Daemonize after startup (detach from terminal).
@item -b, --blacklist=@var{list}
Comma-separated list of RPCs to disable (no spaces, @samp{?} to list
available RPCs).
@item -D, --dump-conf
Dump the configuration in a format compatible with @file{qemu-ga.conf}
and exit.
@item -h, --help
Display this help and exit.
@end table
@c man end
@c man begin FILES
The syntax of the @file{qemu-ga.conf} configuration file follows the
Desktop Entry Specification, here is a quick summary: it consists of
groups of key-value pairs, interspersed with comments.
@example
# qemu-ga configuration sample
[general]
daemonize = 0
pidfile = /var/run/qemu-ga.pid
verbose = 0
method = virtio-serial
path = /dev/virtio-ports/org.qemu.guest_agent.0
statedir = /var/run
@end example
The list of keys follows the command line options:
@table @option
@item daemon= boolean
@item method= string
@item path= string
@item logfile= string
@item pidfile= string
@item fsfreeze-hook= string
@item statedir= string
@item verbose= boolean
@item blacklist= string list
@end table
@c man end
@ignore
@setfilename qemu-ga
@settitle QEMU Guest Agent
@c man begin AUTHOR
Michael Roth <mdroth@linux.vnet.ibm.com>
@c man end
@c man begin SEEALSO
qemu(1)
@c man end
@end ignore
Computing file changes ...