[libvirt] [PATCH] LXC fix virCgroupGetValueStr on handling a string terminated with '\n'

Daniel P. Berrange berrange at redhat.com
Fri Oct 16 12:45:25 UTC 2009


On Fri, Oct 16, 2009 at 05:05:27PM +0900, Ryota Ozaki wrote:
> Hi there,
> 
> A cgroup file returns integer value terminated with '\n' and remaining
> it has sometimes harmful effects, for example it leads virStrToLong_ull
> failed.
> 
> The fix just gets rid of '\n' if included. It first has been in
> virCgroupGetFreezerState, but now merged in virCgroupGetValueStr to cover
> every functions using virCgroupGetValueStr.
> 
> I'm not sure that that behavior is from the beginning or changed in a
> recent kernel, but the fix should work even though anyway.

ACK, looks good.

> BTW, by the defect I first got the following error and it made me confused.
> 
> # virsh -c lxc:/// dominfo 4930
> Id:             4930
> Name:           lxc
> UUID:           084369a0-956a-3010-fc37-ddeb4d627e69
> OS Type:        exe
> Autostart:      disable
> error: this function is not supported by the hypervisor: virNodeGetSecurityModel
> 
> The really error happens in lxcDomainGetInfo, so I guess something is wrong
> with internal error propagation. Anyone know this unexpected behavior?

This looks rather odd - I can't think of anything which could cause this
to happen - virsh is supposed to be filtering out that error message


Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list