Message ID | 1542765966-20244-5-git-send-email-lizhijian@cn.fujitsu.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v2,1/5] unify len and addr type for memory/address APIs | expand |
On Wed, 21 Nov 2018 at 02:11, Li Zhijian <lizhijian@cn.fujitsu.com> wrote: > > CC: Paolo Bonzini <pbonzini@redhat.com> > CC: Richard Henderson <rth@twiddle.net> > CC: Eduardo Habkost <ehabkost@redhat.com> > CC: "Michael S. Tsirkin" <mst@redhat.com> > CC: Marcel Apfelbaum <marcel.apfelbaum@gmail.com> > Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> > --- > hw/i386/pc.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > index f095725..2ffe6fb 100644 > --- a/hw/i386/pc.c > +++ b/hw/i386/pc.c > @@ -984,7 +984,10 @@ static void load_linux(PCMachineState *pcms, > initrd_addr = (initrd_max-initrd_size) & ~4095; > > initrd_data = g_malloc(initrd_size); > - load_image(initrd_filename, initrd_data); > + if (load_image(initrd_filename, initrd_data) < 0) { > + fprintf(stderr, "failed to load initrd\n"); > + exit(1); > + } Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
diff --git a/hw/i386/pc.c b/hw/i386/pc.c index f095725..2ffe6fb 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -984,7 +984,10 @@ static void load_linux(PCMachineState *pcms, initrd_addr = (initrd_max-initrd_size) & ~4095; initrd_data = g_malloc(initrd_size); - load_image(initrd_filename, initrd_data); + if (load_image(initrd_filename, initrd_data) < 0) { + fprintf(stderr, "failed to load initrd\n"); + exit(1); + } fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_ADDR, initrd_addr); fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size);
CC: Paolo Bonzini <pbonzini@redhat.com> CC: Richard Henderson <rth@twiddle.net> CC: Eduardo Habkost <ehabkost@redhat.com> CC: "Michael S. Tsirkin" <mst@redhat.com> CC: Marcel Apfelbaum <marcel.apfelbaum@gmail.com> Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com> --- hw/i386/pc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)