Re: [Qemu-devel] [PATCH 5/6] fw_cfg: insert fw_cfg file blobs via qemu cmdline

2015-03-19 Thread Laszlo Ersek
On 03/18/15 21:06, Gabriel L. Somlo wrote: > On Tue, Mar 17, 2015 at 12:49:50PM +0100, Gerd Hoffmann wrote: [snip] >> Which reminds me: Going for QemuOpts would be very useful (gives >> -readconfig support), and it would solve the init order issue too. >> Instead of having your custom storage yo

Re: [Qemu-devel] [PATCH 5/6] fw_cfg: insert fw_cfg file blobs via qemu cmdline

2015-03-19 Thread Gerd Hoffmann
Hi, > +case QEMU_OPTION_fwcfg: > +opts = qemu_opts_parse(qemu_find_opts("fw_cfg"), optarg, 0); > +if (opts == NULL) { > +exit(1); > +} That is fine here. > +fw_cfg_option_add(opts); That should be

Re: [Qemu-devel] [PATCH 5/6] fw_cfg: insert fw_cfg file blobs via qemu cmdline

2015-03-18 Thread Gabriel L. Somlo
On Tue, Mar 17, 2015 at 12:28:20PM +0100, Laszlo Ersek wrote: > > + > > +void fw_cfg_option_add(QemuOpts *opts) > > +{ > > +const char *name = qemu_opt_get(opts, "name"); > > +const char *file = qemu_opt_get(opts, "file"); > > + > > +if (name == NULL || *name == '\0' || file == NULL ||

Re: [Qemu-devel] [PATCH 5/6] fw_cfg: insert fw_cfg file blobs via qemu cmdline

2015-03-18 Thread Gabriel L. Somlo
On Tue, Mar 17, 2015 at 12:49:50PM +0100, Gerd Hoffmann wrote: > Hi, > > > Perhaps the suggestion to move the file loading from fw_cfg_init1() -- > > ie. device initialization -- to the earlier option parsing phase will > > appease Gerd too :) But, admittedly, I don't know what the "existing > >

Re: [Qemu-devel] [PATCH 5/6] fw_cfg: insert fw_cfg file blobs via qemu cmdline

2015-03-17 Thread Gabriel L. Somlo
Matt, On Tue, Mar 17, 2015 at 10:55:30AM +, Matt Fleming wrote: > > +void fw_cfg_option_add(QemuOpts *opts) > > +{ > > +const char *name = qemu_opt_get(opts, "name"); > > +const char *file = qemu_opt_get(opts, "file"); > > + > > +if (name == NULL || *name == '\0' || file == NULL ||

Re: [Qemu-devel] [PATCH 5/6] fw_cfg: insert fw_cfg file blobs via qemu cmdline

2015-03-17 Thread Gerd Hoffmann
Hi, > Perhaps the suggestion to move the file loading from fw_cfg_init1() -- > ie. device initialization -- to the earlier option parsing phase will > appease Gerd too :) But, admittedly, I don't know what the "existing > fw_cfg init order issues" that he referenced are. Basically fw_cfg init p

Re: [Qemu-devel] [PATCH 5/6] fw_cfg: insert fw_cfg file blobs via qemu cmdline

2015-03-17 Thread Laszlo Ersek
comments below On 03/16/15 15:15, Gabriel L. Somlo wrote: > Allow user supplied files to be inserted into the fw_cfg > device before starting the guest. Since fw_cfg_add_file() > already disallows duplicate fw_cfg file names, qemu will > exit with an error message if the user supplies multiple > b

Re: [Qemu-devel] [PATCH 5/6] fw_cfg: insert fw_cfg file blobs via qemu cmdline

2015-03-17 Thread Matt Fleming
On Mon, 2015-03-16 at 10:15 -0400, Gabriel L. Somlo wrote: > Allow user supplied files to be inserted into the fw_cfg > device before starting the guest. Since fw_cfg_add_file() > already disallows duplicate fw_cfg file names, qemu will > exit with an error message if the user supplies multiple > b

Re: [Qemu-devel] [PATCH 5/6] fw_cfg: insert fw_cfg file blobs via qemu cmdline

2015-03-17 Thread Gerd Hoffmann
Hi, > +static struct FWCfgOption { > +const char *name; > +const char *file; > +} *fw_cfg_options; > +static int fw_cfg_num_options; > +void fw_cfg_option_add(QemuOpts *opts) > +static void fw_cfg_options_insert(FWCfgState *s) Hmm, when looking at this (and the existing fw_cfg init or

[Qemu-devel] [PATCH 5/6] fw_cfg: insert fw_cfg file blobs via qemu cmdline

2015-03-16 Thread Gabriel L. Somlo
Allow user supplied files to be inserted into the fw_cfg device before starting the guest. Since fw_cfg_add_file() already disallows duplicate fw_cfg file names, qemu will exit with an error message if the user supplies multiple blobs with the same fw_cfg file name, or if a blob name collides with