i386: only parse the initrd_filename once for multiboot modules
commitf8da93a0ffa09268815c1942732cbc616a7db847
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 14 May 2018 17:19:12 +0000 (14 18:19 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 17 Jul 2018 14:24:50 +0000 (17 16:24 +0200)
tree3bdf84407d46ae8bf18c3dd17889415b31afa322
parent6e3ad3f0e31b8e31c6c0769d0f474bcd9673e0e5
i386: only parse the initrd_filename once for multiboot modules

The multiboot code parses the initrd_filename twice, first to count how
many entries there are, and second to process each entry. This changes
the first loop to store the parse module names in a list, and the second
loop can now use these names. This avoids having to pass NULL to the
get_opt_value() method which means it can safely assume a non-NULL param.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20180514171913.17664-3-berrange@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Tested-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/multiboot.c