Bug 1919783 - Can not get filesystem info via qemu agent API domfsinfo
Summary: Can not get filesystem info via qemu agent API domfsinfo
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.4
Assignee: Michal Privoznik
QA Contact: Lili Zhu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-25 06:53 UTC by Lili Zhu
Modified: 2021-05-25 06:48 UTC (History)
6 users (show)

Fixed In Version: libvirt-7.0.0-4.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-25 06:47:24 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lili Zhu 2021-01-25 06:53:52 UTC
Description of problem:
Can not get filesystem info via qemu agent API domfsinfo for windows guest

Version-Release number of selected component (if applicable):
libvirt-7.0.0-2.module+el8.4.0+9520+ef609c5f.x86_64
virtio-win-1.9.15-0.el8.noarch

How reproducible:
100%

Steps to Reproduce:
1. prepare a windows guest with sata disk and qemu agent channel.
...
  <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/win2019-64.qcow2' index='2'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
...
   <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
...

2. start the guest
# virsh domtime win2k19 
Time: 1611510616 

3. try to get the filesystem info
# virsh domfsinfo win2k19 
error: Unable to get filesystem information
error: Unable to encode message payload

Actual results:
Unable to get filesystem information


Additional info:

Comment 1 Lili Zhu 2021-01-25 06:56:41 UTC
try to get the filesystem info via qemu-agent-command
# virsh qemu-agent-command win2k19 '{"execute":"guest-get-fsinfo"}' --pretty
{
  "return": [
    {
      "name": "\\\\?\\Volume{b7fc8170-5e69-11eb-8b4e-806e6f6e6963}\\",
      "total-bytes": 375109632,
      "mountpoint": "D:\\",
      "disk": [
        {
          "bus-type": "sata",
          "bus": 0,
          "unit": 0,
          "pci-controller": {
           *** "bus": -1, ***
           *** "slot": -1, ***
           *** "domain": -1, ***
           *** "function": -1 ***
          },
          "dev": "\\\\?\\Volume{b7fc8170-5e69-11eb-8b4e-806e6f6e6963}",
          "target": 0
        }
      ],
      "used-bytes": 375109632,
      "type": "CDFS"
    },
    {
      "name": "\\\\?\\Volume{1371a602-0000-0000-0000-d01200000000}\\",
      "total-bytes": 42632998912,
      "mountpoint": "C:\\",
      "disk": [
        {
          "serial": "QM00001",
          "bus-type": "sata",
          "bus": 0,
          "unit": 0,
          "pci-controller": {
            "bus": -1,
            "slot": -1,
            "domain": -1,
            "function": -1
          },
          "dev": "\\\\.\\PhysicalDrive0",
          "target": 0
        }
      ],
      "used-bytes": 15241457664,
      "type": "NTFS"
    },
    {
      "name": "\\\\?\\Volume{1371a602-0000-0000-0000-100000000000}\\",
      "total-bytes": 314568704,
      "mountpoint": "S:\\",
      "disk": [
        {
          "serial": "QM00001",
          "bus-type": "sata",
          "bus": 0,
          "unit": 0,
          "pci-controller": {
            "bus": -1,
            "slot": -1,
            "domain": -1,
            "function": -1
          },
          "dev": "\\\\.\\PhysicalDrive0",
          "target": 0
        }
      ],
      "used-bytes": 35090432,
      "type": "NTFS"
    }
  ]
}

I was trying to check the bug, it seems the pci address returned from qemu-agent-command it not correct.
But checked with Bug #1607841, it was marked as WONTFIX

Comment 2 Michal Privoznik 2021-02-15 16:32:17 UTC
Patches proposed upstream:

https://listman.redhat.com/archives/libvir-list/2021-February/msg00833.html

Comment 3 Michal Privoznik 2021-02-16 13:21:45 UTC
Merged upstream as:

2642cc0f66 qemu: Don't lie about @ndevAlias when translating FSInfo
9ad1e1d897 qemu: Bring if() outside from loop in virDomainFSInfoFormat()
59c80e9fd0 qemu: Move qemuAgentFSInfo array free into qemuDomainGetFSInfo()
5922b2b104 qemu: Drop needless check in virDomainFSInfoFormat()

v7.0.0-478-g2642cc0f66

Comment 8 Lili Zhu 2021-03-07 09:31:13 UTC
Verify this bug with:
libvirt-7.0.0-8.module+el8.4.0+10233+8b7fd9eb.x86_64

1. prepare a windows guest with sata disk and qemu agent channel.
...
  <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/win2019-64.qcow2' index='2'/>
      <backingStore/>
      <target dev='sda' bus='sata'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
...
   <channel type='unix'>
      <target type='virtio' name='org.qemu.guest_agent.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='2'/>
    </channel>
...

2. start the guest
# virsh domtime win2k19 
Time: 1611510616 

3. try to get the filesystem info
# virsh domfsinfo win2k19 
 Mountpoint        Name                                                Type   Target
--------------------------------------------------------------------------------------
 System Reserved   \\?\Volume{949c24e6-0000-0000-0000-100000000000}\   NTFS   
 C:\               \\?\Volume{949c24e6-0000-0000-0000-602200000000}\   NTFS

Comment 9 Lili Zhu 2021-03-07 09:34:50 UTC
As the testing result match with expected result, mark the bug as verified

Comment 11 errata-xmlrpc 2021-05-25 06:47:24 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:2098


Note You need to log in before you can comment on or make changes to this bug.