discover: Send options to client in order
authorGeoff Levand <geoff@infradead.org>
Tue, 21 May 2013 13:27:24 +0000 (21:27 +0800)
committerGeoff Levand <geoff@infradead.org>
Tue, 21 May 2013 14:00:14 +0000 (22:00 +0800)
Send the boot options to the client in the order discovered.  This
change  is in follow up to inverting the order that the server
saves the options internally.

Signed-off-by: Geoff Levand <geoff@infradead.org>
discover/device-handler.c

index 3a687675c3bde9c0af445634dbf25a3ff91fcab0..9b2ef3df4d94209c92166dadf1f07ca7d295ec81 100644 (file)
@@ -448,7 +448,7 @@ static void process_boot_option_queue(struct device_handler *handler)
                pb_log("\tresolved!\n");
 
                list_remove(&opt->list);
                pb_log("\tresolved!\n");
 
                list_remove(&opt->list);
-               list_add(&opt->device->boot_options, &opt->list);
+               list_add_tail(&opt->device->boot_options, &opt->list);
                talloc_steal(opt->device, opt);
                boot_option_finalise(opt);
                discover_server_notify_boot_option_add(handler->server,
                talloc_steal(opt->device, opt);
                boot_option_finalise(opt);
                discover_server_notify_boot_option_add(handler->server,
@@ -500,7 +500,7 @@ static void context_commit(struct device_handler *handler,
                        pb_log("boot option %s is resolved, "
                                        "sending to clients\n",
                                        opt->option->id);
                        pb_log("boot option %s is resolved, "
                                        "sending to clients\n",
                                        opt->option->id);
-                       list_add(&dev->boot_options, &opt->list);
+                       list_add_tail(&dev->boot_options, &opt->list);
                        talloc_steal(dev, opt);
                        boot_option_finalise(opt);
                        discover_server_notify_boot_option_add(handler->server,
                        talloc_steal(dev, opt);
                        boot_option_finalise(opt);
                        discover_server_notify_boot_option_add(handler->server,