RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2030437 - Error using NULL monitor when querying launch security info for shutoff guest
Summary: Error using NULL monitor when querying launch security info for shutoff guest
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: libvirt
Version: 8.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Daniel Berrangé
QA Contact: Luyao Huang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-08 18:57 UTC by Daniel Berrangé
Modified: 2022-05-10 13:37 UTC (History)
5 users (show)

Fixed In Version: libvirt-8.0.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-10 13:24:21 UTC
Type: Bug
Target Upstream Version: 8.0.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-105186 0 None Closed API took 2 hours to recover after a revision install 2022-04-26 11:14:49 UTC
Red Hat Product Errata RHSA-2022:1759 0 None None None 2022-05-10 13:25:03 UTC

Description Daniel Berrangé 2021-12-08 18:57:08 UTC
Description of problem:
If you call the 'virDomainGetLaunchSecurityInfo' method on a guest with SEV config that is shutoff, libvirt tries to use a NULL monitor resulting in
an error:

 libvirt: QEMU Driver error : invalid argument: monitor must not be NULL

This can be demonstrated with:

$ cat sev.py 
#!/usr/bin/python3

import libvirt
import sys

c = libvirt.open(None)

d = c.lookupByName(sys.argv[1])

print (d.launchSecurityInfo())

# python3 sev.py fedora34
libvirt: QEMU Driver error : invalid argument: monitor must not be NULL
Traceback (most recent call last):
  File "sev.py", line 10, in <module>
    print (d.launchSecurityInfo())
  File "/usr/lib64/python3.6/site-packages/libvirt.py", line 1749, in launchSecurityInfo
    raise libvirtError('virDomainGetLaunchSecurityInfo() failed')
libvirt.libvirtError: invalid argument: monitor must not be NULL

Addressed in

https://listman.redhat.com/archives/libvir-list/2021-December/msg00233.html

Version-Release number of selected component (if applicable):
7.10.0-1.el8

How reproducible:
Always

Steps to Reproduce:
1. Configure a guest with SEV <launchSecurity>
2. Do NOT start the guest
3. Run the above python demo

Actual results:
Error about NULL monitor

Expected results:
Error that the guest is not running

Additional info:

Comment 1 Peter Krempa 2022-01-26 11:46:54 UTC
Fixed upstream by:

commit 5842163910e8b8d320a896d9485b321d553bad3f
Author: Daniel P. Berrangé <berrange>
Date:   Wed Dec 8 07:51:43 2021 -0500

    qemu: report error querying launch params for inactive guest
    
    Querying launch params on a inactive guest currently triggers
    a warning about the monitor being NULL.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=2030437
    
    Reviewed-by: Peter Krempa <pkrempa>
    Signed-off-by: Daniel P. Berrangé <berrange>

v7.10.0-299-g5842163910

Comment 4 Luyao Huang 2022-01-29 02:08:47 UTC
Verify this bug with libvirt-daemon-8.0.0-2.module+el8.6.0+14025+ca131e0a.x86_64:

1. prepare a inactive guest which enable SEV

# virsh list --all
 Id   Name   State
-----------------------
 -    vm1    shut off
 -    vm2    shut off

2. use python launchSecurityInfo api get guest SEV related information:

# cat tmp.py 
#!/usr/bin/python3

import libvirt
import sys

c = libvirt.open(None)

d = c.lookupByName(sys.argv[1])

print (d.launchSecurityInfo())


# python3 tmp.py vm1
libvirt: QEMU Driver error : Requested operation is not valid: domain is not running
Traceback (most recent call last):
  File "tmp.py", line 10, in <module>
    print (d.launchSecurityInfo())
  File "/usr/lib64/python3.6/site-packages/libvirt.py", line 1749, in launchSecurityInfo
    raise libvirtError('virDomainGetLaunchSecurityInfo() failed')
libvirt.libvirtError: Requested operation is not valid: domain is not running

Comment 6 errata-xmlrpc 2022-05-10 13:24:21 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 (Moderate: virt:rhel and virt-devel:rhel security, 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/RHSA-2022:1759


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