[libvirt] [PATCH 8/8] Allow balloon driver collection to be adjusted dynamically

John Ferlan jferlan at redhat.com
Mon Jul 8 17:37:30 UTC 2013


On 07/03/2013 08:03 AM, Michal Privoznik wrote:
> On 02.07.2013 15:39, John Ferlan wrote:
>> Extend the virDomainSetMemeoryFlags() to accept a 'VIR_DOMAIN_MEM_PERIOD'
>> which will be used to dynamically set the collection period for the balloon
>> driver via a 'virsh dommemstat <domain> --period <value>' command.  Add
>> the --current, --live, & --config options to dommemstat.
>> ---
>>  docs/formatdomain.html.in    | 14 +++++++++
>>  include/libvirt/libvirt.h.in |  1 +
>>  src/libvirt.c                |  8 ++++-
>>  src/qemu/qemu_driver.c       | 44 +++++++++++++++++++++++++++-
>>  tools/virsh-domain-monitor.c | 70 ++++++++++++++++++++++++++++++++++++++++++--
>>  5 files changed, 132 insertions(+), 5 deletions(-)
> 
>> diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c

...snip...
>>  
>>      if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
>>          return false;
>>  
>> +    /* none of the options were specified - choose defaults based on state */
>> +    if (!current && !live && !config) {
>> +        if (virDomainIsActive(dom) == 1)
>> +            flags |= VIR_DOMAIN_AFFECT_LIVE;
>> +        else
>> +            flags |= VIR_DOMAIN_AFFECT_CONFIG;
> 
> This should not be needed as qemu driver will the proper option for
> VIR_DOMAIN_AFFECT_CURRENT. Client can't make such decision as domain is
> not locked and may translate into different state.
> 

I removed the 'else' condition and merely was following other examples
for the 'if' option.

John



> 
> Michal
> 




More information about the libvir-list mailing list