summaryrefslogtreecommitdiffstats
path: root/discover/device-handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'discover/device-handler.c')
-rw-r--r--discover/device-handler.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/discover/device-handler.c b/discover/device-handler.c
index 281a3c4..87a46c7 100644
--- a/discover/device-handler.c
+++ b/discover/device-handler.c
@@ -429,6 +429,38 @@ static void _device_handler_vstatus(struct device_handler *handler,
talloc_free(status.message);
}
+static void _device_handler_vdevstatus(struct device_handler *handler,
+ struct discover_device *device, enum status_type type,
+ const char *fmt, va_list ap)
+{
+ char *msg;
+
+ msg = talloc_asprintf(handler, "[%s] %s",
+ device ? device->device->id : "unknown", fmt);
+ _device_handler_vstatus(handler, type, msg, ap);
+ talloc_free(msg);
+}
+
+void device_handler_status_dev_info(struct device_handler *handler,
+ struct discover_device *dev, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ _device_handler_vdevstatus(handler, dev, STATUS_INFO, fmt, ap);
+ va_end(ap);
+}
+
+void device_handler_status_dev_err(struct device_handler *handler,
+ struct discover_device *dev, const char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ _device_handler_vdevstatus(handler, dev, STATUS_ERROR, fmt, ap);
+ va_end(ap);
+}
+
void device_handler_status_info(struct device_handler *handler,
const char *fmt, ...)
{
OpenPOWER on IntegriCloud