]> git.ozlabs.org Git - petitboot/commitdiff
types: Remove detail and progress from struct status
authorJeremy Kerr <jk@ozlabs.org>
Wed, 7 Dec 2016 00:30:27 +0000 (11:30 +1100)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 20 Dec 2016 04:04:18 +0000 (15:04 +1100)
Nothing used these, and the serialisation was buggy anyway.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/boot.c
discover/device-handler.c
lib/pb-protocol/pb-protocol.c
lib/types/types.h
ui/test/discover-test.c

index 70e9d41de993803ae082e34d838d0ea5d947e84c..056d02de6869c681aa1d000edad0a8e9e9ef6b5c 100644 (file)
@@ -154,8 +154,6 @@ static void __attribute__((format(__printf__, 4, 5))) update_status(
        va_end(ap);
 
        status.type = type;
-       status.progress = -1;
-       status.detail = NULL;
 
        pb_debug("boot status: [%d] %s\n", type, status.message);
 
index 20df8d11b5d9ea95c960409e90a4adec51de06b2..2e96c2b4b7e35e026bfb0c1772bfff9fd319f3c8 100644 (file)
@@ -423,8 +423,6 @@ static void countdown_status(struct device_handler *handler,
        struct status status;
 
        status.type = STATUS_INFO;
-       status.progress = -1;
-       status.detail = NULL;
        status.message = talloc_asprintf(handler,
                        _("Booting in %d sec: %s"), sec, opt->option->name);
 
@@ -986,8 +984,6 @@ void device_handler_cancel_default(struct device_handler *handler)
        handler->default_boot_option = NULL;
 
        status.type = STATUS_INFO;
-       status.progress = -1;
-       status.detail = NULL;
        status.message = _("Default boot cancelled");
 
        discover_server_notify_boot_status(handler->server, &status);
@@ -1088,11 +1084,7 @@ void device_handler_process_url(struct device_handler *handler,
        struct param *param;
 
        status = talloc(handler, struct status);
-
        status->type = STATUS_ERROR;
-       status->progress = 0;
-       status->detail = talloc_asprintf(status,
-                       _("Received config URL %s"), url);
 
        if (!handler->network) {
                status->message = talloc_asprintf(handler,
index 1e72d19338eba3405f95ee842b6e1ee23d1739e0..8bc8820d8f5833274a6f80322d2d476ccaf7d97d 100644 (file)
@@ -219,7 +219,6 @@ int pb_protocol_boot_status_len(const struct status *status)
 {
        return  4 +
                4 + optional_strlen(status->message) +
-               4 + optional_strlen(status->detail) +
                4;
 }
 
@@ -410,10 +409,6 @@ int pb_protocol_serialise_boot_status(const struct status *status,
        pos += sizeof(uint32_t);
 
        pos += pb_protocol_serialise_string(pos, status->message);
-       pos += pb_protocol_serialise_string(pos, status->detail);
-
-       *(uint32_t *)pos = __cpu_to_be32(status->type);
-       pos += sizeof(uint32_t);
 
        assert(pos <= buf + buf_len);
        (void)buf_len;
@@ -848,23 +843,10 @@ int pb_protocol_deserialise_boot_status(struct status *status,
        pos += sizeof(uint32_t);
        len -= sizeof(uint32_t);
 
-       /* message and detail strings */
+       /* message string */
        if (read_string(status, &pos, &len, &status->message))
                goto out;
 
-       if (read_string(status, &pos, &len, &status->detail))
-               goto out;
-
-       /* and finally, progress */
-       if (len < sizeof(uint32_t))
-               goto out;
-
-       status->progress = __be32_to_cpu(*(uint32_t *)(pos));
-
-       /* clamp to 100% */
-       if (status->progress > 100)
-               status->progress = 100;
-
        rc = 0;
 
 out:
index b22c0b01374e69d233446170ada0dca59291bec8..506510b1fbbfc0775a3999e701a0158f5da3ebc4 100644 (file)
@@ -76,8 +76,6 @@ struct status {
                STATUS_ERROR,
        } type;
        char    *message;
-       char    *detail;
-       int     progress;
 };
 
 struct interface_info {
index ea767640e89a3f7ce6ff725a7ff1cf21b231dc1a..f3e7dd8cfc5b177595fedfd9a1ff9815c1dea3b2 100644 (file)
@@ -81,8 +81,6 @@ static void print_status(struct status *status,
        printf("status:\n");
        printf("\ttype:     %d\n", status->type);
        printf("\tmessage:  %s\n", status->message);
-       printf("\tdetail:   %s\n", status->detail);
-       printf("\tprogress: %d\n", status->progress);
 
 }