Re: [Qemu-devel] [PATCH] block: Validate node-name

2014-09-19 Thread Stefan Hajnoczi
On Wed, Sep 17, 2014 at 01:31:06PM +0200, Kevin Wolf wrote: > The device_name of a BlockDriverState is currently checked because it is > always used as a QemuOpts ID and qemu_opts_create() checks whether such > IDs are wellformed. > > node-name is supposed to share the same namespace, but it isn't

Re: [Qemu-devel] [PATCH] block: Validate node-name

2014-09-19 Thread Stefan Hajnoczi
On Wed, Sep 17, 2014 at 01:31:06PM +0200, Kevin Wolf wrote: > The device_name of a BlockDriverState is currently checked because it is > always used as a QemuOpts ID and qemu_opts_create() checks whether such > IDs are wellformed. > > node-name is supposed to share the same namespace, but it isn't

Re: [Qemu-devel] [PATCH] block: Validate node-name

2014-09-18 Thread Markus Armbruster
Kevin Wolf writes: > Am 17.09.2014 um 13:49 hat Benoît Canet geschrieben: >> >> >> > +int qemu_opts_id_wellformed(const char *id) >> >> This return 0 and 1 as a bool. >> Could we make the function return bool in the same series ? > > I considered the change (as you probably saw, the new block.

Re: [Qemu-devel] [PATCH] block: Validate node-name

2014-09-17 Thread Benoît Canet
The Wednesday 17 Sep 2014 à 13:31:06 (+0200), Kevin Wolf wrote : > The device_name of a BlockDriverState is currently checked because it is > always used as a QemuOpts ID and qemu_opts_create() checks whether such > IDs are wellformed. > > node-name is supposed to share the same namespace, but it

Re: [Qemu-devel] [PATCH] block: Validate node-name

2014-09-17 Thread Kevin Wolf
Am 17.09.2014 um 13:49 hat Benoît Canet geschrieben: > > > > +int qemu_opts_id_wellformed(const char *id) > > This return 0 and 1 as a bool. > Could we make the function return bool in the same series ? I considered the change (as you probably saw, the new block.c function returns a bool), but

Re: [Qemu-devel] [PATCH] block: Validate node-name

2014-09-17 Thread Benoît Canet
> +int qemu_opts_id_wellformed(const char *id) This return 0 and 1 as a bool. Could we make the function return bool in the same series ? I wonder what are the possible interferences between !strchr("-._", id[i]) and Jeff's node name auto naming series.

[Qemu-devel] [PATCH] block: Validate node-name

2014-09-17 Thread Kevin Wolf
The device_name of a BlockDriverState is currently checked because it is always used as a QemuOpts ID and qemu_opts_create() checks whether such IDs are wellformed. node-name is supposed to share the same namespace, but it isn't checked currently. This patch adds explicit checks both for device_na