arch: factor out parse_cmdline

Aside from the code that locates the string - in x64, the code that actually
parses the command line is always the same for both our architectures. Factor
it out.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
CC: Claudio Fontana <claudio.fontana@huawei.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
inspect the current command line

This patch adds a function that allow us to determine which is the current
command line in use. If parse_cmdline is called more than once, it has the duty
of updating that string.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
commands: add method to save a command line to disk

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
create an exception for code 500

The same way we handle 400 through a custom exception, handling error code 500
this way saves a lot of typing.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
os: add an api to modify the command line

When we add support for runtime instalation and provisioning, we would like to
have some way to edit the command line currently being executed. I'm exposing
this through the REST api.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>