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 2178553 - Should show complete error info if hotplugging passt backend interface failed
Summary: Should show complete error info if hotplugging passt backend interface failed
Keywords:
Status: CLOSED DUPLICATE of bug 2169244
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.2
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: yalzhang@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-15 09:08 UTC by yafu
Modified: 2023-04-25 10:02 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-03-23 13:57:46 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-151887 0 None None None 2023-03-15 09:09:55 UTC

Description yafu 2023-03-15 09:08:39 UTC
Description of problem:
Should show complete error info if hotplugging passt backend interface failed

Version-Release number of selected component (if applicable):
libvirt-9.0.0-8.el9_2.x86_64
qemu-kvm-7.2.0-12.el9_2.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Prepare a passt backend interface xml with non-existing logFile dir:
#cat passt-0.xml
$ cat passt-0.xml 
<interface type="user">
  <mac address="52:54:00:bc:fa:5e"/>
  <source dev="br0"/>
  <model type="virtio"/>
  <backend type="passt" logFile="/home/test2/passt.log"/>
  <alias name="net0"/>
</interface>

$ ll /home/test2
ls: cannot access '/home/test2': No such file or directory

2.Hotplug the passt backend interface to a running guest:
$ virsh attach-device test passt-0.xml 
error: Failed to attach device from passt-0.xml
error: internal error: Failed to start passt

3.

Actual results:
The error info does not show the reason of starting passt failed.

Expected results:
Show complete error info if hotplugging passt backend interface failed, such as:
$ virsh attach-device test passt-0.xml 
error: Failed to attach device from passt-0.xml
error: internal error: Failed to start passt: Couldn't open log file /home/test2/passt.log: No such file or directory


Additional info:
1.Could show complete error info if starting guest with passt backend interface failed:
$ virsh start test
error: Failed to start domain 'test'
error: internal error: Could not start 'passt': Couldn't open log file /home/test2/passt.log: No such file or directory

Comment 1 Michal Privoznik 2023-03-23 13:54:06 UTC
Fixed by the following commit:

commit 02355840ced2af18df1aa9ba387a6137a515eede
Author:     Michal Prívozník <mprivozn>
AuthorDate: Thu Feb 16 12:19:26 2023 +0100
Commit:     Michal Prívozník <mprivozn>
CommitDate: Mon Feb 20 09:43:14 2023 +0100

    qemu_passt: Report passt's error on failed start
    
    When starting passt, it may write something onto its stderr
    (convincing it to print even more is addressed later). Pass this
    string we read to user.
    
    Since we're not daemonizing passt anymore (see previous commit),
    we can let virCommand module do all the heavy lifting and switch
    to virCommandSetErrorBuffer() instead of reading error from an
    FD.
    
    Signed-off-by: Michal Privoznik <mprivozn>
    Reviewed-by: Stefano Brivio <sbrivio>
    Reviewed-by: Laine Stump <laine>

which is part of libvirt-9.1.0 release.

Comment 4 yalzhang@redhat.com 2023-04-25 10:02:32 UTC
Test on libvirt-9.2.0-1.el9.x86_64 with the same scenarios in comment 0, the bug is fixed:

1) no permission to create the log file:
$ cat interface.xml
<interface type="user">
  <mac address="52:54:00:bc:fa:5e"/>
  <source dev="eno1"/>
  <model type="virtio"/>
  <backend type="passt" logFile='/var/log/test.log'/>
  <alias name="net0"/>
</interface>

$ virsh attach-device vm1 interface.xml 
error: Failed to attach device from interface.xml
error: internal error: Child process (/usr/bin/passt --one-off --socket /run/user/1000/libvirt/qemu/run/passt/1-vm1-net0.socket --mac-addr 52:54:00:bc:fa:5e --pid /run/user/1000/libvirt/qemu/run/passt/1-vm1-net0-passt.pid --interface eno1 --log-file /var/log/test.log) unexpected exit status 1: Couldn't open log file /var/log/test.log: Permission denied

2) no log dir:
$ cat interface1.xml 
<interface type="user">
  <mac address="52:54:00:bc:fa:5e"/>
  <source dev="eno1"/>
  <model type="virtio"/>
  <backend type="passt" logFile='/var/no_dir/test.log'/>
  <alias name="net0"/>
</interface>

$ virsh attach-device vm1 interface1.xml 
error: Failed to attach device from interface1.xml
error: internal error: Child process (/usr/bin/passt --one-off --socket /run/user/1000/libvirt/qemu/run/passt/1-vm1-net0.socket --mac-addr 52:54:00:bc:fa:5e --pid /run/user/1000/libvirt/qemu/run/passt/1-vm1-net0-passt.pid --interface eno1 --log-file /var/no_dir/test.log) unexpected exit status 1: Couldn't open log file /var/no_dir/test.log: No such file or directory


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