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 2000075 - [embed qemu] Failed to start vm by virt-qemu-run if vm has network interface
Summary: [embed qemu] Failed to start vm by virt-qemu-run if vm has network interface
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.0
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: rc
: ---
Assignee: Martin Kletzander
QA Contact: yafu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-09-01 10:30 UTC by Fangge Jin
Modified: 2023-05-09 08:07 UTC (History)
8 users (show)

Fixed In Version: libvirt-8.10.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 07:26:10 UTC
Type: Bug
Target Upstream Version: 8.10.0
Embargoed:


Attachments (Terms of Use)
vm xml (7.62 KB, text/plain)
2021-09-01 10:30 UTC, Fangge Jin
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-95859 0 None None None 2021-09-01 10:32:54 UTC
Red Hat Product Errata RHBA-2023:2171 0 None None None 2023-05-09 07:26:53 UTC

Description Fangge Jin 2021-09-01 10:30:38 UTC
Created attachment 1819631 [details]
vm xml

Description of problem:
Failed to start vm by virt-qemu-run

Version-Release number of selected component:
libvirt-7.6.0-2.module+el8.5.0+12219+a5ea13d2.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Set selinux to permissive mode(this is a temporary workaround)

2. Start service virtnetworkd

3. Try to start vm by virt-qemu-run, the vm xml includes network interface:
# virt-qemu-run -d -v vm1.xml
virt-qemu-run: 13: initializing libvirt 558442
virt-qemu-run: 1120: initializing signal handlers
virt-qemu-run: 1172: preparing event loop thread
virt-qemu-run: 1212: opening qemu:///embed?root=%2Ftmp%2Fvirt-qemu-run-5W5J80
virt-qemu-run: 30337: fetching guest config vm1.xml
virt-qemu-run: 30384: starting guest vm1.xml
2021-09-01 06:17:03.147+0000: 558442: info : libvirt version: 7.6.0, package: 2.module+el8.5.0+12219+a5ea13d2 (Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>, 2021-08-12-05:59:49, )
2021-09-01 06:17:03.147+0000: 558442: info : hostname: dell-per750-03.lab.eng.pek2.redhat.com
2021-09-01 06:17:03.147+0000: 558442: warning : qemuProcessStop:7965 : Unable to release network device '<null>'
virt-qemu-run: cannot start VM: An error occurred, but the cause is unknown
virt-qemu-run: 360759: cleaned up, exiting


4. Check syslog:
Sep 01 02:10:26 dell-per750-03.lab.eng.pek2.redhat.com virtlogd[84306]: Unable to open file: /tmp/virt-qemu-run-8S8N80/log/qemu/vm1.log: No such file or directory

5. Remove the network interface from vm xml, try again, vm can start successfully:
# virt-qemu-run vm1.xml   -d -v
virt-qemu-run: 27: initializing libvirt 106001
virt-qemu-run: 1987: initializing signal handlers
virt-qemu-run: 2310: preparing event loop thread
virt-qemu-run: 2403: opening qemu:///embed?root=%2Ftmp%2Fvirt-qemu-run-ZI4Y80
virt-qemu-run: 15547: fetching guest config vm1.xml
virt-qemu-run: 15636: starting guest vm1.xml
virt-qemu-run: 943151: guest running, Ctrl-C to stop now
virt-qemu-run: XML: <domain type='kvm' id='1'>
  <name>vm1</name>
  <uuid>f2d17ae3-dc8b-40f3-97e8-093faeca75ed</uuid>
......


Actual results:
Failed to start vm by virt-qemu-run when vm has network interface

Expected results:
It should succeed


Additional info:

Comment 1 Martin Kletzander 2022-11-11 13:34:42 UTC
Patch proposed upstream:

https://listman.redhat.com/archives/libvir-list/2022-November/235751.html

Comment 2 Martin Kletzander 2022-11-15 10:24:21 UTC
Fixed upstream with v8.9.0-238-g8e527dd65381:

commit 8e527dd653814fa0c6266228ae46f1aed0159608
Author: Martin Kletzander <mkletzan>
Date:   Fri Nov 11 14:19:50 2022 +0100

    virGetConnectGeneric: Only delegate existing identities

Comment 3 yafu 2022-12-07 08:42:24 UTC
Tested pass with libvirt-8.10.0-2.el9.x86_64.

Comment 7 yafu 2022-12-08 09:30:31 UTC
Verified with libvirt-8.10.0-2.el9.x86_64.

Test steps:
1.Set selinux to permissive mode:
#setenforce 0

2.Start a vm with network type interface by virt-qemu-run, the vm start successfully:
# virt-qemu-run -d -v vm.xml 
virt-qemu-run: 19: initializing libvirt 47541
virt-qemu-run: 856: initializing signal handlers
virt-qemu-run: 956: preparing event loop thread
virt-qemu-run: 1380: opening qemu:///embed?root=%2Ftmp%2Fvirt-qemu-run-59YXW1
virt-qemu-run: 20380: fetching guest config vm.xml
virt-qemu-run: 20523: starting guest vm.xml
virt-qemu-run: 1354073: guest running, Ctrl-C to stop now
virt-qemu-run: XML: <domain type='kvm' id='1'>
  <name>test</name>
  <uuid>50c64d95-c84a-4bed-a6d4-4426e2883a30</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://redhat.com/rhel/9.0"/>
    </libosinfo:libosinfo>
  </metadata>
...
<interface type='bridge'>
      <mac address='52:54:00:24:74:07'/>
      <source bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
...

Comment 9 errata-xmlrpc 2023-05-09 07:26:10 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 (libvirt 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-2023:2171


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