Re: [PATCH 1/6] Allow network model to contain "-"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/07/2011 11:41 PM, Michael Ellerman wrote:
> From: Michael Ellerman <michael@xxxxxxxxxxxxxx>
> 
> In QEMU PPC64 we have a network device called "spapr-vlan". We can specify
> this using the existing syntax for network devices, however libvirt
> currently rejects "spapr-vlan" in virDomainNetDefParseXML() because of
> the "-". Fix the code to accept "-".

Thanks for contributing!  I ran out of time to fully review this today,
but at least this one looks promising.

> 
> Signed-off-by: Michael Ellerman <michael@xxxxxxxxxxxxxx>
> ---
>  src/conf/domain_conf.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 75e51a0..5de33b9 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -3703,8 +3703,7 @@ virDomainNetDefParseXML(virCapsPtr caps,
>      if (model != NULL) {
>          int i;
>          for (i = 0 ; i < strlen(model) ; i++) {
> -            int char_ok = c_isalnum(model[i]) || model[i] == '_';
> -            if (!char_ok) {
> +            if (!c_isalnum(model[i]) && model[i] != '_' && model[i] != '-') {

I'm not sure if we need to tweak our RNG grammar to also allow this in
the XML validation.  I'll check that out tomorrow, when I get around to
applying this one and reviewing the rest of the series.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]