Bug 661277

Summary: hotplug: check image file existence
Product: Red Hat Enterprise Linux 5 Reporter: Yufang Zhang <yuzhang>
Component: xenAssignee: Xen Maintainance List <xen-maint>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 5.6CC: pbonzini, pcao, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: xen-3.0.3-122.el5 Doc Type: Bug Fix
Doc Text:
Prior to this update, the hotplug scripts did not check if an image file existed before doing further processing. Consequently, when a non-existent image file was attached to a guest, the output error message was too vague to be helpful. This bug has been fixed, and the error message is sufficiently informative.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-07-21 09:18:23 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:
Attachments:
Description Flags
patch to check file existence before doing other processing none

Description Yufang Zhang 2010-12-08 11:57:22 UTC
Description of problem:
Currently, hotplug scripts doesn't check image file existence before doing other processing. Thus when attaching a non-existence image file to a guest, output error message is not as clear as upstream.  

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

How reproducible:
Always

Steps to Reproduce:
1. Create a PV guest.
2. Attach a non-existence image file to the PV guest

Actual results:
# xm block-attach vm1 file:/root/test.img1 xvdb:disk r
Error: Device 51728 (vbd) could not be connected. /etc/xen/scripts/block failed; error detected.
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode>

Create a new virtual block device.

Expected results:
# xm block-attach vm1 file:/root/test.img1 xvdb:disk r
Error: Device 51728 (vbd) could not be connected. /root/test.img1 does not exist
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode>

Create a new virtual block device.


Additional info:
Add a check for file existence before other processing in hotplug script would fix this problem. Such as:

test -f $file || fatal "$file does not exist"

Comment 1 Yufang Zhang 2010-12-08 12:17:56 UTC
Created attachment 467467 [details]
patch to check file existence before doing other processing

Comment 3 Paolo Bonzini 2010-12-14 11:47:54 UTC
This is upstream changeset 16539.

We should look at upstream changeset 18084 and find a testcase for that as well.

Comment 4 RHEL Program Management 2011-01-11 19:48:33 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 5 RHEL Program Management 2011-01-12 15:22:52 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 9 Yufang Zhang 2011-03-21 02:35:43 UTC
QA verified this bug with xen-3.0.3-126.el5:

Attach a non-existed block device to guest:

# xm block-attach vm1 file:/root/test.img1 xvdb:disk r
Error: Device 51728 (vbd) could not be connected. /root/test.img1 does not exist
Usage: xm block-attach <Domain> <BackDev> <FrontDev> <Mode>

Create a new virtual block device.


So change this bug to VERIFIED.

Comment 10 Tomas Capek 2011-07-13 13:28:18 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Prior to this update, the hotplug scripts did not check if an image file existed before doing further processing. Consequently, when a non-existent image file was attached to a guest, the output error message was too vague to be helpful. This bug has been fixed, and the error message is sufficiently informative.

Comment 11 errata-xmlrpc 2011-07-21 09:18:23 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1070.html

Comment 12 errata-xmlrpc 2011-07-21 11:59:46 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1070.html