[libvirt] sysinfo: delete unnecessary white space of sysinfo.

Eric Blake eblake at redhat.com
Wed Jun 29 16:45:58 UTC 2011


On 06/28/2011 07:47 PM, Minoru Usui wrote:
>> Maybe we should use c_isspace() instead of open-coding this.  And how is
>> backslash a space?
> 
> I'll replace above block to c_isspace().
> 
> BTW, I copied its block from virSkipSpaces().

Ah, that explains your original design choices.

> It seems meaningful virSkipSpaces() treats backslash as space,
> but I think backslash is not space generally.
> 
> Is it OK that virSkipSpaces() treats backslash as space?

I would argue no - most clients of virSkipSpaces want to skip just
spaces, and only clients parsing xend output want to skip backslashes as
well.  I think it may be better to provide a new function for xend use,
and fix virSkipSpaces to only skip real spaces.

> Doesn't it need to rename something and define another virSkipSpaces()
> which doesn't treat backslash as space?

Exactly.  Maybe:

virSkipSpaces(const char **str) -> new behavior
virSkipSpaceAndBackslash(const char **str) -> existing behavior, but
used only by xen code

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110629/cf2a2726/attachment-0001.sig>


More information about the libvir-list mailing list