~marcoceppi/charms/precise/qemu-cloud/tests

Viewing all changes in revision 12.

  • Committer: dann frazier
  • Date: 2012-11-14 22:09:20 UTC
  • Revision ID: dann.frazier@canonical.com-20121114220920-apgf1veu1zpswrpx
Avoid read-only issues by using nbd4 instead of nbd0

Once qemu-nbd has attached a file to a /dev/nbdX device read-only, the read-only
setting persists for any other block devices that are attached to it later.
Unfortunately there is no "read-write" flag for qemu-nbd - so that /dev/nbdX
device becomes unusable for anything but read-only devices from then on.
(I'm not sure this is a qemu-nbd bug; it might actually be rooted in the nbd
driver).

Since the upstart job uses /dev/nbd0 to extract boot files out of the disk
image, and it does this read-only, the install hook will fail when called
a second time:

  mount: block device /dev/nbd0p1 is write-protected, mounting read-only
  cp: cannot create regular file `/mnt/tmp/tmp.mnt/usr/bin/qemu-arm-static'
  Read-only file system

This breaks redeployments. To avoid this, let's use /dev/nbd4. I picked because
nbd0 is used by the upstart job, and nbd[1-3] are used by the image build.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: