Bug 661277 - hotplug: check image file existence
Summary: hotplug: check image file existence
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: xen
Version: 5.6
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Xen Maintainance List
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-12-08 11:57 UTC by Yufang Zhang
Modified: 2011-07-21 11:59 UTC (History)
3 users (show)

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.
Clone Of:
Environment:
Last Closed: 2011-07-21 09:18:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch to check file existence before doing other processing (1.18 KB, patch)
2010-12-08 12:17 UTC, Yufang Zhang
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1070 0 normal SHIPPED_LIVE xen bug fix and enhancement update 2011-07-21 09:12:56 UTC

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


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