Bug 2124446

Summary: Can not copy/paste from host to guest after restart spice-vdagentd.service
Product: Red Hat Enterprise Linux 9 Reporter: Hongzhou Liu <hongzliu>
Component: qemu-kvmAssignee: Marc-Andre Lureau <marcandre.lureau>
qemu-kvm sub component: Graphics QA Contact: Guo, Zhiyi <zhguo>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: coli, jinzhao, juzhang, juzhou, kraxel, mrezanin, virt-maint, zhetang, zhguo
Version: 9.1Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-7.2.0-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 07:20:04 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:
Bug Depends On: 2135806    
Bug Blocks:    

Description Hongzhou Liu 2022-09-06 07:47:07 UTC
Description of problem:
Can not copy/paste from host to guest after restart spice-vdagentd.service

Version-Release number of selected component (if applicable):
libvirt-8.5.0-5.el9.x86_64
qemu-kvm-7.0.0-12.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a vm with qemu-vdagent device
...
<channel type='qemu-vdagent'>
      <source>
        <clipboard copypaste='yes'/>
        <mouse mode='client'/>
      </source>
      <target type='virtio' name='com.redhat.spice.0' state='connected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
</channel>
...
2. Use tigervnc connect into guest, now the copy/paste function works well.

3: Log in to guest, stop the spice-vdagentd.service. spice-vdagentd.socket will active spice-vdagentd.service immediately. Check copy/paste again.

Actual results: On vnc client, I am only able to copy/paste form guest to host, can not copy/paste from host to guest.

Expected results: Can copy/paste for both way(From host to guest and guest to host)

Comment 1 Marc-Andre Lureau 2022-09-08 07:10:46 UTC
What's the guest OS & spice-vdagent version?

Could you check if spice-vdagent (the user daemon, not the vdagentd root daemon) is still running? If not, did it crash?

On fc36/fc36, spice-vdagent-0.22.1-1, I get a crash in vdagent_x11_do_read, because x11->display is NULL. I'll look into that.

thanks

Comment 2 Hongzhou Liu 2022-09-08 07:28:05 UTC
(In reply to Marc-Andre Lureau from comment #1)
> What's the guest OS & spice-vdagent version?
> 
> Could you check if spice-vdagent (the user daemon, not the vdagentd root
> daemon) is still running? If not, did it crash?
> 
> On fc36/fc36, spice-vdagent-0.22.1-1, I get a crash in vdagent_x11_do_read,
> because x11->display is NULL. I'll look into that.
> 
> thanks

I am running a RHEL9.1 guest on a RHEL-9.1 host with spice-vdagent-0.21.0-4.el9.x86_64, After I restart spice-vdagentd.service, is still running with no error occurs.

Comment 3 John Ferlan 2022-10-02 13:03:56 UTC
Upstream patches: https://lists.nongnu.org/archive/html/qemu-devel/2022-09/msg01627.html

Comment 4 Yanan Fu 2022-12-20 09:18:40 UTC
QE bot(pre verify): Set 'Verified:Tested,SanityOnly' as gating/tier1 test pass.

Comment 7 Guo, Zhiyi 2022-12-28 15:42:35 UTC
I'm able to reproduce this issue via the steps from the original report, buggy qemu used is qemu-kvm-7.1.0-6.el9.x86_64, vm used is rhel9.2

And I'm able to verify this issue against qemu-kvm-7.2.0-2.el9.x86_64.
With qemu-kvm-7.2.0-2.el9.x86_64, I can do bi-direction(client <-> VM) copy paste without problem

Comment 8 Guo, Zhiyi 2022-12-28 16:27:26 UTC
I also hit spice vdagent crash seems been noticed from https://bugzilla.redhat.com/show_bug.cgi?id=2124446#c1
And seems there is already a bug to track it: Bug 2145004 - On a RHEL 9 VM stopping and starting the spice-vdagentd results in a non-usable console
The spice vdagent crash can be reproduced on both qemu-kvm-7.1.0-6.el9.x86_64 and qemu-kvm-7.2.0-2.el9.x86_64, so this is not a regression of the patches here, so I mark this bug verified

Comment 10 errata-xmlrpc 2023-05-09 07:20:04 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: qemu-kvm 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-2023:2162