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"
Created attachment 467467 [details] patch to check file existence before doing other processing
This is upstream changeset 16539. We should look at upstream changeset 18084 and find a testcase for that as well.
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.
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.
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.
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.
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