This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 230702

Summary: Fails to boot raw tap image
Product: [Fedora] Fedora Reporter: Mark McLoughlin <markmc>
Component: xenAssignee: Daniel Berrange <berrange>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: bstein, katzj, xen-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: xen-3.0.4-7.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-03-20 12:01:04 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
xen-3.0.4-boot-raw-tap.patch none

Description Mark McLoughlin 2007-03-02 07:01:11 EST
With xen-3.0.4-6fc7, and a configuration like this:

disk = [ "tap:aio:/tmp/test.img,xvda,w" ]

I'm seeing this:

----
[2007-03-02 10:08:09 xend.XendDomainInfo 2900] DEBUG (XendDomainInfo:94)
XendDomainInfo.create(['vm', ['name', 'test'], ['memory', 512], ['maxmem', 512],
['on_poweroff', 'destroy'], ['on_reboot', 'restart'], ['on_crash', 'restart'],
['vcpus', 1], ['on_xend_start', 'ignore'], ['on_xend_stop', 'ignore'], ['uuid',
'9e68f448-1a66-87f3-c327-69ecc7187692'], ['bootloader', '/usr/bin/pygrub'],
['image', ['linux', ['kernel', '/var/run/xend/boot/boot_kernel.9ZEo8m'],
['ramdisk', '/var/run/xend/boot/boot_ramdisk.i29Kd6'], ['args', 'ro
root=/dev/VolGroup00/LogVol00']]], ['device', ['tap', ['uname',
'tap:aio:/tmp/test.img'], ['dev', 'xvda'], ['mode', 'w']]], ['device', ['vif',
['bridge', 'xenbr0'], ['mac', '00:16:3e:6c:05:00']]]])
[2007-03-02 10:08:09 xend.XendConfig 2900] WARNING (XendConfig:607) Unconverted
key: cpus
[2007-03-02 10:08:09 xend.XendDomainInfo 2900] DEBUG (XendDomainInfo:1284)
XendDomainInfo.constructDomain
[2007-03-02 10:08:09 xend.XendDomainInfo 2900] DEBUG (XendDomainInfo:1330)
XendDomainInfo.initDomain: 1 256
[2007-03-02 10:08:09 xend.XendDomainInfo 2900] INFO (XendDomainInfo:1572)
Mounting /tmp/test.img on /dev/xvdp.
[2007-03-02 10:08:09 xend.XendDomainInfo 2900] DEBUG (XendDomainInfo:2035)
create_vbd_with_vdi: {'device': '/dev/xvdp', 'image': '/tmp/test.img', 'mode': 'RO'}
[2007-03-02 10:08:09 xend 2900] DEBUG (DevController:115) DevController: writing
{'backend-id': '0', 'virtual-device': '51952', 'device-type': 'disk', 'state':
'1', 'backend': '/local/domain/0/backend/tap/0/51952'} to
local/domain/0/device/vbd/51952
.
[2007-03-02 10:08:09 xend 2900] DEBUG (DevController:117) DevController: writing
{'domain': 'Domain-0', 'frontend': '/local/domain/0/device/vbd/51952', 'uuid':
'cf6bf81e-bbb4-ec20-1e8a-9ce7d540fcdd', 'dev': '/dev/xvdp', 'state': '1',
'params': 'qcow:/tmp/test.img', 'mode': 'r', 'online': '1', 'frontend-id': '0',
'type': 'tap'} to /local/domain/0/backend/tap/0/51952.
[2007-03-02 10:08:09 xend 2900] DEBUG (DevController:153) Waiting for 51952.
[2007-03-02 10:08:09 xend 2900] DEBUG (DevController:522) hotplugStatusCallback
/local/domain/0/backend/tap/0/51952/hotplug-status.
[2007-03-02 10:08:09 xend 2900] DEBUG (DevController:522) hotplugStatusCallback
/local/domain/0/backend/tap/0/51952/hotplug-status.
[2007-03-02 10:08:09 xend 2900] DEBUG (DevController:536) hotplugStatusCallback 1.
[2007-03-02 10:08:09 xend 2900] ERROR (XendBootloader:39) Disk isn't accessible
[2007-03-02 10:08:09 xend.XendDomainInfo 2900] INFO (XendDomainInfo:1590)
Unmounting /dev/xvdp from /dev/xvdp.
----

Don't you just love when things go wrong with Xen? "Disk isn't accessible"?
Geez, thanks.

So, it turns out that the problem is this:

[2007-03-02 10:08:09 xend 2900] DEBUG (DevController:117) DevController: writing
{'domain': 'Domain-0', ..., 'dev': '/dev/xvdp', ..., 'params':
'qcow:/tmp/test.img', ..., 'type': 'tap'} to /local/domain/0/backend/tap/0/51952.

This is a raw image, not a QCOW image, so it's failing to mount the image.

However, we're only trying to mount the image for pygrub, since pygrub can't
handle e.g. QCOW files directly. But it can handle raw images just fine.

So, attaching a patch to not attempt to mount the image if it's raw, which fixes
the bug for me.

(It doesn't fix the case of e.g. using pygrub with a vmdk image, but *shrug*)
Comment 1 Mark McLoughlin 2007-03-02 07:01:11 EST
Created attachment 149104 [details]
xen-3.0.4-boot-raw-tap.patch
Comment 2 Stephen Tweedie 2007-03-02 07:21:12 EST
Same problem for me.  How does 3.0.5 fix this?
Comment 3 Mark McLoughlin 2007-03-02 07:48:51 EST
What makes you think it does?

From looking at xen-unstable, it looks like it has the same problem ... I'll be
sending the patch upstream.
Comment 4 Daniel Berrange 2007-03-02 07:52:36 EST
It doesn't AFAICT - 3.0.5 looks just as broken as 3.0.4 since the code in
question is basically identical. Mark's patch looks good and should be sent
upstream. I'll add the fix to rawhide.
Comment 5 Mark McLoughlin 2007-03-09 02:33:11 EST
Okay, I've made a couple of attempts to push it upstream. No response, and it
hasn't made it into the tree:

  http://lists.xensource.com/archives/html/xen-devel/2007-03/msg00156.html
  http://lists.xensource.com/archives/html/xen-devel/2007-03/msg00304.html
Comment 6 Mark McLoughlin 2007-03-20 12:01:04 EDT
It's upstream now:

  changeset:   14443:09f2e758a198
  parent:      14441:4e380c769774
  user:        Mark McLoughlin <markmc@redhat.com>
  date:        Tue Mar 20 11:10:52 2007 +0000
  summary:     Don't mount raw blktap disks for pygrub

So, it's in rawhide and upstream. Closing.