2011/5/27 Jean-Baptiste Rouault <jean-baptiste.rouault(a)diateam.net>:
On Friday 27 May 2011 16:01:32 Matthias Bolte wrote:
> Thanks, pushed then.
>
> There are other usages of getline in the OpenVZ driver, but they
> should all be safe because they don't distinguish between 0 and -1,
> except openvzGetProcessInfo.
>
> Jean-Baptiste could you test virsh dominfo of a running OpenVZ domain?
> I expect it to currently fail and will post a patch for it.
>
> Matthias
virsh dominfo on a running domain doesn't fail here :
> virsh # dominfo 100
> ID : 100
> Nom : 100
> UUID : 0a0cf7cb-efb4-4065-ac2d-e63ad51e72cf
> Type de SE : exe
> État : en cours d'exécution
> CPU : 1
> Temps CPU : 2,3s
> Mémoire Max : 262144 kB
> Mémoire utilisée : 262144 kB
> Persistent: yes
> Autostart: disable
I tried it on a stopped domain and it doesn't fail either.
Jean-Baptiste
Ah, makes sense, openvzGetProcessInfo doesn't normally run in the
situation where getline hits EOF because the loop will find the
appropriate line and exit the loop. Thanks for testing.
I'll post a patch to restore the original EOF handling even if it's
not critical.
Matthias