Bug 654756

Summary: "xm block-detach 0" does not work for extended-ID devices
Product: Red Hat Enterprise Linux 5 Reporter: Paolo Bonzini <pbonzini>
Component: xenAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED WONTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: minovotn, mrezanin, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-12 08:47:17 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: 514500    

Description Paolo Bonzini 2010-11-18 18:32:19 UTC
Description of problem:
Simply taking stat()'s st_rdev doesn't work here, as the minor is
split into two parts, the major is present, and the "extended" bit
isn't set.

Version-Release number of selected component (if applicable):
3.0.3-115.el5

How reproducible:
100%

Steps to Reproduce:
1. Create a PV guest with an xvdaa disk
2. Try to unplug it
  
Actual results:
Doesn't work.

Expected results:
Should work.

Additional info:
Patch at http://permalink.gmane.org/gmane.comp.emulators.xen.devel/93790

Comment 2 Paolo Bonzini 2010-12-02 20:02:20 UTC
Aha, got it.  This is for devices that are hotplugged/hotunplugged to dom0.  A bit weird, but I think you can do it even in RHEL5 (if it works it can be useful as a quick way to mount a device as loopback and see its partitions.

Comment 3 Michal Novotny 2010-12-06 07:50:35 UTC
(In reply to comment #2)
> Aha, got it.  This is for devices that are hotplugged/hotunplugged to dom0.  A
> bit weird, but I think you can do it even in RHEL5 (if it works it can be
> useful as a quick way to mount a device as loopback and see its partitions.

Ok, do you mean something like `xm block-attach 0 /path/to/image xvdaa w` and `xm block-detach 0 xvdaa` or something else? If my procedure is correct those are the test results:

# xm block-attach 0 /home2/test.img xvdaa w
# ls /dev/xvdaa
ls: /dev/xvdaa: No such file or directory
# xm block-list 0
Vdev  BE handle state evt-ch ring-ref BE-path
268442112    0    0     1      -1     -1    /local/domain/0/backend/vbd/0/268442112
# xm block-detach 0 xvdaa
# ls /dev/xvdaa
ls: /dev/xvdaa: No such file or directory
# xm block-list 0
Vdev  BE handle state evt-ch ring-ref BE-path
268442112    0    0     1      -1     -1    /local/domain/0/backend/vbd/0/268442112

So I guess this is not working in RHEL-5 guest or my procedure is not correct and you meant something else.

Could you please give me more information about this?

Thanks,
Michal

Comment 4 Paolo Bonzini 2010-12-06 12:49:47 UTC
Assigning to myself for triaging.

Comment 5 RHEL Program Management 2011-01-11 20:13:32 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 6 RHEL Program Management 2011-01-12 15:22:22 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.

Comment 8 Paolo Bonzini 2011-01-17 10:51:21 UTC
The bug is there from inspecting the code, but I couldn't make the testcase work in general (i.e. I could not even attach, see comment #2).