]> Git Repo - qemu.git/commit - qga/commands-posix.c
qga: removing switch statements, adding run_process_child
authorDaniel Henrique Barboza <[email protected]>
Thu, 21 Jun 2018 10:21:51 +0000 (07:21 -0300)
committerMichael Roth <[email protected]>
Tue, 3 Jul 2018 20:20:51 +0000 (15:20 -0500)
commit8b020b5eb708091e723518907184e609350f6d41
tree26cd953a71577bdaefb6ff85b3a7f0cd1d7e2973
parent246d76eba1944d7e59affb288ec27d7fcfb5d256
qga: removing switch statements, adding run_process_child

This is a cleanup of the resulting code after detaching
pmutils and Linux sys state file logic:

- remove the SUSPEND_MODE_* macros and use an enumeration
instead. At the same time, drop the switch statements
at the start of each function and use the enumeration
index to get the right binary/argument;

- create a new function called run_process_child(). This
function uses g_spawn_sync() to execute a shell command,
returning the exit code. This is a common operation in the
pmutils functions and will be used in the systemd implementation
as well, so this function will avoid code repetition.

There are more places inside commands-posix.c where this new
run_process_child function can also be used, but one step
at a time.

Signed-off-by: Daniel Henrique Barboza <[email protected]>
*check/propagate local_err before setting errp directly
Signed-off-by: Michael Roth <[email protected]>
qga/commands-posix.c
This page took 0.02396 seconds and 4 git commands to generate.