core: make sure we expose the empty string when we detect no virtualization

On the bus, stick to exposing the empty string as "no virtualization",
instead of none.

Fixes #1423
This commit is contained in:
Lennart Poettering 2015-09-30 22:22:03 +02:00
parent e53fc357a9
commit 5c22925a57

View file

@ -81,10 +81,21 @@ static int property_get_virtualization(
void *userdata,
sd_bus_error *error) {
int v;
assert(bus);
assert(reply);
return sd_bus_message_append(reply, "s", virtualization_to_string(detect_virtualization()));
v = detect_virtualization();
/* Make sure to return the empty string when we detect no virtualization, as that is the API.
*
* https://github.com/systemd/systemd/issues/1423
*/
return sd_bus_message_append(
reply, "s",
v == VIRTUALIZATION_NONE ? "" : virtualization_to_string(v));
}
static int property_get_architecture(