Bug 1942315

Summary: improve error message when try to managedsave a domain with hostdev type interface
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: yalzhang <yalzhang>
Component: libvirtAssignee: khanicov
Status: CLOSED ERRATA QA Contact: yalzhang <yalzhang>
Severity: low Docs Contact:
Priority: low    
Version: 8.3CC: jdenemar, jsuchane, laine, lmen, mprivozn, pkrempa, virt-maint, xuzhang
Target Milestone: rcKeywords: Triaged, Upstream
Target Release: 8.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-7.6.0-2.module+el8.5.0+12219+a5ea13d2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-16 07:52:17 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:

Description yalzhang@redhat.com 2021-03-24 06:58:42 UTC
Description of problem:
The error message can be improved when try to managedsave a domain with hostdev type interface

Version-Release number of selected component (if applicable):
libvirt-7.0.0-10.module+el8.4.0+10417+37f6984d.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Start a vm with hostdev type interface as below# virsh dumpxml test | grep /interface -B12
<interface type='hostdev' managed='yes'>
<mac address='52:54:00:bc:37:1b'/>
<driver name='vfio'/>
<source>
<address type='pci' domain='0x0000' bus='0x04' slot='0x10' function='0x7'/>
</source>
<alias name='hostdev0'/>
<address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
</interface>
2. Tried to do managedsave which is not supported:
# virsh managedsave test
error: Failed to save domain 'test' state
error: Operation not supported: cannot migrate a domain with <hostdev mode='subsystem' type='pci'>

Actual results:
The error message reported "cannot migrate a domain with <hostdev mode='subsystem' type='pci'>", but in fact, it is a hostdev interface "<interface type='hostdev' managed='yes'>"

Expected results:
The error message can be improved to be like "cannot do mangedsave for a domain with hostdev interface or device"

Additional info:

Comment 3 khanicov 2021-08-05 10:50:18 UTC
Merged upstream as:

814a8aaeeb qemu_migration: check for interface type 'hostdev'

v7.6.0-11-g814a8aaeeb

Comment 5 yalzhang@redhat.com 2021-08-16 10:35:56 UTC
Test on libvirt-libs-7.6.0-2.module+el8.5.0+12219+a5ea13d2.x86_64 with hostdev interface, the result is as expected

# virsh managedsave rhel 
error: Failed to save domain 'rhel' state
error: Operation not supported: cannot migrate a domain with <interface type='hostdev'>

With hostdev device, it is also expected:
# virsh managedsave rhel 
error: Failed to save domain 'rhel' state
error: Operation not supported: cannot migrate a domain with <hostdev mode='subsystem' type='pci'>

Comment 8 yalzhang@redhat.com 2021-08-30 01:43:52 UTC
Test on libvirt-7.6.0-2.module+el8.5.0+12219+a5ea13d2.x86_64, the result is as expected.

Comment 10 errata-xmlrpc 2021-11-16 07:52:17 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:4684