On 08/13/2012 10:04 AM, Juan Quintela wrote: >>> +# @dirty-pages-rate: number of pages dirtied by second by the >>> +# guest. (since 1.2) >>
>> Since HMP only prints this stat when it is non-zero, should this field >> be marked optional? Then again, once you have dirty page tracking, I >> suspect this would never be zero (or even showing an explicit zero would >> help detect stalls). > > What is easier for libvirt to have here. > > At the beggining, this value is going to be wrong/cero. I can: > - not print it until it is != 0 > - print a big enough number ) > - make it optional? I guess this would alse be more difficult for > libvirt. > - put your good idea here? I see your point about querying early enough that there is not yet enough data to have a good estimate. In that case, either outputting 0 or omitting the field will do the trick. Libvirt already has to support older qemu that always omitted the field, and it is a one-liner code addition in libvirt to say that if the field is omitted, treat it like '0'. I'm not even quite sure what libvirt will be able to do with this number; libvirt made some unfortunate API decisions where migration statistics are exposed to the user in a hard-coded struct (virDomainJobInfo), and since we didn't allow for the struct to grow without breaking ABI, exposing additional information would require a new libvirt API. So don't let libvirt hold up the inclusion of this useful information on the qemu side of things. Maybe another option would be to return [U]INT_MAX when there is not enough data to yet provide a valid number, where having a non-zero value at least lets people know that the stat will be available in a later call. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature