commit a3bf6c47a227303e3cd449a3ececf20aef24471d Author: W. David Ashley w.david.ashley@gmail.com Date: Fri Jul 10 10:28:00 2015 -0500
Domains chapter - corrected example 34
en-US/extras/Domains-Example-34.py | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) --- diff --git a/en-US/extras/Domains-Example-34.py b/en-US/extras/Domains-Example-34.py index 2fa4315..9a435c4 100644 --- a/en-US/extras/Domains-Example-34.py +++ b/en-US/extras/Domains-Example-34.py @@ -10,15 +10,15 @@ if conn == None: print('Failed to open connection to qemu:///system', file=sys.stderr) exit(1)
-dom = conn.lookupByID(6) +dom = conn.lookupByID(5) if dom == None: print('Failed to find the domain '+domName, file=sys.stderr) exit(1)
stats = dom.getCPUStats(True) -print('cpu_time: '+stats[0]) -print('system time: '+stats[1]) -print('user time: '+stats[2]) +print('cpu_time: '+str(stats[0]['cpu_time'])) +print('system_time: '+str(stats[0]['system_time'])) +print('user_time: '+str(stats[0]['user_time']))
conn.close() exit(0)