diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2013-09-18 11:44:41 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2013-09-18 11:44:41 +0800 |
commit | bad9baa8794ed0c31b7f93b110815d98db7b2d7a (patch) | |
tree | 97bf348fcbfc56634873ce4613948a2369c9067e /ui/test | |
parent | 7b793150f96a6fe6033ac1390a663b1b62be2df6 (diff) | |
download | talos-petitboot-bad9baa8794ed0c31b7f93b110815d98db7b2d7a.tar.gz talos-petitboot-bad9baa8794ed0c31b7f93b110815d98db7b2d7a.zip |
discover: populate udev device types
Now that we have device types, populate from the udev info.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/test')
-rw-r--r-- | ui/test/discover-test.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/test/discover-test.c b/ui/test/discover-test.c index 45a4c74..faf1d89 100644 --- a/ui/test/discover-test.c +++ b/ui/test/discover-test.c @@ -3,6 +3,21 @@ #include "ui/common/discover-client.h" +static const char *device_type_string(enum device_type type) +{ + switch (type) { + case DEVICE_TYPE_DISK: + return "disk"; + case DEVICE_TYPE_NETWORK: + return "network"; + case DEVICE_TYPE_OPTICAL: + return "optical"; + case DEVICE_TYPE_UNKNOWN: + return "unknown"; + } + return "invalid"; +} + static int print_device_add(struct device *device, void __attribute__((unused)) *arg) { @@ -10,6 +25,7 @@ static int print_device_add(struct device *device, printf("new device:\n"); printf("\tid: %s\n", device->id); + printf("\ttype: %s\n", device_type_string(device->type)); printf("\tname: %s\n", device->name); printf("\tdesc: %s\n", device->description); printf("\ticon: %s\n", device->icon_file); |