Bug 1816897

Summary: qemu fail get window 7 vm mem detail info
Product: Red Hat Enterprise Linux 7 Reporter: ks002278 <ks002278>
Component: virtio-winAssignee: Gal Hammer <ghammer>
virtio-win sub component: virtio-win-prewhql QA Contact: xiagao
Status: CLOSED NOTABUG Docs Contact:
Severity: low    
Priority: unspecified CC: jinzhao, juzhang, lijin
Version: 7.5Flags: ks002278: needinfo-
ks002278: needinfo-
ks002278: needinfo-
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-08 02:58:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
the is win7 vm domain define file none

Description ks002278@163.com 2020-03-25 03:12:39 UTC
Created attachment 1673260 [details]
the is win7 vm domain define file

Description of problem:


os:CentOS Linux release 7.5.1804 (Core)
virtio-win balloon driver :61.80.104.17300
QEMU emulator version 3.0.0
guest os win7 



Steps to Reproduce:
1.create a windows 7 vm cmd parameter :
/usr/local/bin/qemu-system-x86_64-nameguest=root-vsys_win7,debug-threads=on-S-objectsecret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-18-root-vsys_win7/master-key.aes-machinepc-i440fx-3.0,accel=kvm,usb=off,dump-guest-core=off-cpuIvyBridge-IBRS,ss=on,movbe=on,hypervisor=on,arat=on,tsc_adjust=on,mpx=on,rdseed=on,smap=on,clflushopt=on,sha-ni=on,xsaveopt=on,xsavec=on,xgetbv1=on,pdpe1gb=on,3dnowprefetch=on,topoext=on,avx=off,f16c=off-m2048-realtimemlock=off-smp1,sockets=1,cores=1,threads=1-objectmemory-backend-file,id=ram-node0,prealloc=yes,mem-path=/mnt/huge/libvirt/qemu/18-root-vsys_win7,share=yes,size=2147483648,host-nodes=0,policy=bind-numanode,nodeid=0,cpus=0,memdev=ram-node0-uuidb834fbc0-3c03-4350-acab-791f1a0e013f-no-user-config-nodefaults-chardevsocket,id=charmonitor,fd=32,server,nowait-monchardev=charmonitor,id=monitor,mode=control-rtcbase=utc,driftfix=slew-globalkvm-pit.lost_tick_policy=delay-no-hpet-no-shutdown-globalPIIX4_PM.disable_s3=1-globalPIIX4_PM.disable_s4=1-bootstrict=on-devicepiix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2-drivefile=/media/disk_image/root-vsys_win7.qcow2,format=qcow2,if=none,id=drive-virtio-disk0-devicevirtio-blk-pci,scsi=off,bus=pci.0,addr=0x9,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1-chardevsocket,id=charnet0,path=/secgate/var/run/vh-1-66-0-8-1-1,reconnect=60-netdevvhost-user,chardev=charnet0,id=hostnet0-devicevirtio-net-pci,netdev=hostnet0,id=net0,mac=00:04:00:42:08:11,bus=pci.0,addr=0x3-chardevsocket,id=charnet1,path=/secgate/var/run/vh-1-66-0-8-1-2,reconnect=60-netdevvhost-user,chardev=charnet1,id=hostnet1-devicevirtio-net-pci,netdev=hostnet1,id=net1,mac=00:04:00:42:08:12,bus=pci.0,addr=0x4-chardevsocket,id=charnet2,path=/secgate/var/run/vh-1-66-0-8-1-3,reconnect=60-netdevvhost-user,chardev=charnet2,id=hostnet2-devicevirtio-net-pci,netdev=hostnet2,id=net2,mac=00:04:00:42:08:13,bus=pci.0,addr=0x5-chardevsocket,id=charnet3,path=/secgate/var/run/vh-1-66-0-8-1-4,reconnect=60-netdevvhost-user,chardev=charnet3,id=hostnet3-devicevirtio-net-pci,netdev=hostnet3,id=net3,mac=00:04:00:42:08:14,bus=pci.0,addr=0x6-chardevsocket,id=charnet4,path=/secgate/var/run/vh-1-66-0-8-1-5,reconnect=60-netdevvhost-user,chardev=charnet4,id=hostnet4-devicevirtio-net-pci,netdev=hostnet4,id=net4,mac=00:04:00:42:08:15,bus=pci.0,addr=0x7-chardevsocket,id=charnet5,path=/secgate/var/run/vh-1-66-0-8-1-6,reconnect=60-netdevvhost-user,chardev=charnet5,id=hostnet5-devicevirtio-net-pci,netdev=hostnet5,id=net5,mac=00:04:00:42:08:16,bus=pci.0,addr=0x8-vnc0.0.0.0:5-devicecirrus-vga,id=video0,bus=pci.0,addr=0x2-devicevirtio-balloon-pci,id=balloon0,bus=pci.0,addr=0xa-msgtimestamp=on

win7 xml define :
    <memballoon model='virtio'>
      <stats period='30'/>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </memballoon>

2.login guest os win7 ,install virtio balloon driver ,and run blnsrv.exe -i

3.confirm blnsrv status is RUNNING

4.virsh qemu-monitor-command root-vsys_win7 '{"execute":"qom-get", "arguments":{"path":"//machine/peripheral/balloon0","property":"guest-stats"}}' --pretty

result is:
{
  "return": {
    "stats": {
      "stat-htlb-pgalloc": 18446744073709551615,
      "stat-swap-out": 18446744073709551615,
      "stat-available-memory": 18446744073709551615,
      "stat-htlb-pgfail": 18446744073709551615,
      "stat-free-memory": 18446744073709551615,
      "stat-minor-faults": 18446744073709551615,
      "stat-major-faults": 18446744073709551615,
      "stat-total-memory": 18446744073709551615,
      "stat-swap-in": 18446744073709551615,
      "stat-disk-caches": 18446744073709551615
    },
    "last-update": 1585044578
  },
  "id": "libvirt-1055"
}

5.I consult the bug ID:1238956 ,and do 
bash-4.1# virsh qemu-monitor-command root-vsys_win7 '{"execute":"qmp_capabilities"}'
{"id":"libvirt-1056","error":{"class":"CommandNotFound","desc":"Capabilities negotiation is already complete, command ignored"}}

virsh qemu-monitor-command root-vsys_win7 '{"execute": "qom-set","arguments": { "path": "/machine/peripheral/balloon0","property": "guest-stats-polling-interval", "value": 2 } }'  // this command no need ,because my xml define period value is 30

thought I try all the steps ,but still qemu can't get the win7 vm mem detail

Actual results:

bash-4.1# virsh dommemstat root-vsys_win7
actual 2097152
last_update 1585044578
rss 36632

Expected results:
bash-4.1# virsh dommemstat root-vsys_1 //root-vsys_1 is a centos vm
actual 8388608
swap_in 0
swap_out 0
major_fault 1603
minor_fault 200244829
unused 2120888
available 8176880
usable 6348004
last_update 1585105813
rss 31760


Additional info:

Comment 3 xiagao 2020-03-30 01:52:17 UTC
Could you provide the accurate pkg version?
#uname -a
#rpm -qa |grep qemu-kvm

Thanks.

Comment 4 xiagao 2020-03-30 08:00:56 UTC
Hi,
Now I has a rhel7.7 host, and I test on this host with 61.80.104.17300 driver, didn't hit your issue.

pkg:
kernel-3.10.0-1062.12.1.el7.x86_64
qemu-kvm-rhev-2.12.0-33.el7_7.10.x86_64

balloon device in win7.xml

    <memballoon model='virtio'>
      <stats period='30'/>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
    </memballoon>


result:
[root@dell-me02-pem610-02 home]# virsh qemu-monitor-command win7 '{"execute":"qom-get", "arguments":{"path":"//machine/peripheral/balloon0","property":"guest-stats"}}' --pretty
{
  "return": {
    "stats": {
      "stat-swap-out": 104493056,
      "stat-available-memory": 1586014208,
      "stat-free-memory": 1586012160,
      "stat-minor-faults": 12855099,
      "stat-major-faults": 39429,
      "stat-total-memory": 2146934784,
      "stat-swap-in": 813862912,
      "stat-disk-caches": 18446744073709551615
    },
    "last-update": 1585554550
  },
  "id": "libvirt-27"
}

[root@dell-me02-pem610-02 home]# virsh dommemstat win7actual 2097152
swap_in 794788
swap_out 102044
major_fault 39429
minor_fault 12855099
unused 1548840
available 2096616
usable 1548842
last_update 1585554550
rss 2241936

Comment 5 ks002278@163.com 2020-04-08 02:45:28 UTC
mybe my run env or uncorrect use cause fail to get mem-usage ,please close

Comment 6 lijin 2020-04-08 02:58:00 UTC
close according to comment#5