Bug 438439

Summary: xenbus driver leaks sysfs device entries for PVFB
Product: Red Hat Enterprise Linux 5 Reporter: Daniel Berrangé <berrange>
Component: kernel-xenAssignee: Markus Armbruster <armbru>
Status: CLOSED DUPLICATE QA Contact: Martin Jenner <mjenner>
Severity: high Docs Contact:
Priority: high    
Version: 5.2CC: clalance, minovotn, syeghiay, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-10 09:44:53 UTC Type: ---
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:    
Bug Blocks: 448753, 492570    

Description Daniel Berrangé 2008-03-20 21:19:22 UTC
Description of problem:
Create a paravirt guest with the framebuffer configured, and then destroy it
again. The /sys/class/xen-backend/devices/ directory will contain 2 nods for the
VFB and VKBD devices. These nodes never appear to go away.

Version-Release number of selected component (if applicable):
kernel-2.6.18-84.el5

How reproducible:
Always

Steps to Reproduce:
1. Edit /etc/xen/GUEST and add 
2.vfb = [ "type=vnc,vncunused=1"]
3. virsh start GUEST
4. Let it boot
5. virsh destroy GUEST
6. ls /sys/bus/xen-backend/devices/

Actual results:
Two directories are still present:

vfb-DOMID-0
vkbd-DOMID-0

Expected results:
No directories are left behind

Additional info:

Comment 1 Daniel Berrangé 2008-03-20 21:22:22 UTC
The problem appears to be with the delegation of responsibility between the
xenbus module, and the backend specific modules.

The sysfs node is added when the xenbus_probe_node() method in the xenbus module
calls device_register().


The corresponding call for device_unregister() though is in th backend specific
modules. eg, the frontend_changed() method in  the blkback module.

There does not appear to be any generic fallback code in xenbus to call
device_unregister() for device's whose backend lives in userspace such as VFB.


Comment 3 RHEL Program Management 2008-07-24 16:11:04 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 6 Michal Novotny 2009-04-08 15:17:43 UTC
In fact, when you do `xenstore-rm /local/domain/0/backend/{deviceClass}/{domid}` it automatically deletes those files in sysfs. I am working investigating it now...

Comment 7 Michal Novotny 2009-04-09 10:26:39 UTC
I seems to be connected to BZ #439182. I've created and done workaround/patch and posted it to this BZ.

Comment 8 Chris Lalancette 2009-04-10 09:44:53 UTC
I'm going to close this as a dup of 439182, then.  If it turns out to be different, we can re-open.

Chris Lalancette

*** This bug has been marked as a duplicate of bug 439182 ***