read-only in domain 0, but still fails to be shared with a domU, because
it is mis-identified as being mounted writable. (On SUSE, CDs and DVDs
are auto-mounted not with merely permissions "ro", but
"ro,nosuid,nodev", hence the mis-identification.)
Signed-off-by: Charles Coffing <ccoffing@novell.com>
and the hotplug scripts checking whether that domain is still alive. This
triggers the "xenstore-read: couldn't read path /local/domain/107/vm" message
in /var/log/xen-hotplug.log, followed by "Device XYZ is mounted in a guest
domain and so cannot be mounted now".
Closes bug #514.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
I've changed this to only write "backend" (xenbus_backend.root) into
XENBUS_BASE_PATH. After appending XENBUS_TYPE (also exported) you can
construct the "base path" easily in the scripts. I've completely
removed writing XENBUS_FRONTEND_ID in favour of reading it from the
store at "$XENBUS_PATH/frontend-id".
Avoid re-reading the store over and over for the frontend domain's vm-path.
The patch also fixes a memory leak in backend_bus_id where we
leak the memory referenced by frontend if the function succeeds.
This work is by Christian Limpach.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
localhost migration.
return [ test ] is not valid, simply [ test ] at the end of the function is the
correct syntax.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
loop driver stores only the first 64 chars of the filename). In this case, we
need to read through the store until we find the domain using the device, and
read the configured filename from there instead.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
the check, reading from the store rather than /sys, and checking whether the
VM for apparently-conflicting uses is actually the same (i.e. this is a
migration or a reboot in progress).
This fixes recent failures in 12_block_attach_shared_domU and recloses bug #331.
This fix includes particularly skanky path slicing inside xenbus_probe, which
it would be nice to remove very soon.
The loopback device check still suffers from the problem that filenames over
64 characters long are truncated.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
configured. Both of the files pick the same free loop device in the for
loop, and then one fails to losetup. This patch will now retry if
losetup fails until it succeeds or no more devices are available.
Signed-off-by: Robert Read <robert@xensource.com>
check_sharing functions have been rejigged slightly so that the file-specific
stuff can share the code therein. This separates the actual test from the
generation of the error message, and introduces the canonicalise_mode function.
This also restores the broken teardown functionality for file: devices -- the
writing of XENBUS_PATH/node had been removed, but this is required for file
device teardown.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
a device from two guests, or from dom 0 and a guest, can destroy the filesystem,
and this check prevents that. This should ensure that the xm tests
11_block_attach_shared_dom0 and 12_block_attach_shared_domU should pass.
Closes bug #331.
Devices may be shared only if all uses are read-only. If anyone has read-write
access to a device, then no sharing is allowed.
The mode in the config file may now have an exclamation mark appended, to
indicate that devices may be shared (i.e. that this new check should be
bypassed). This supports some network block devices, but is clearly dangerous
and should only be used when you know what you are doing.
The mode specified in the config file is now written explicitly to the store,
To implement this, the blkback driver has been changed to create two entries
in /sys describing each device in use. This means that we can determine which
devices are in use without crawling through the store.
The physical-device node has been changed to give the major and minor of the
device, separated by a colon. This means that we do not need to pack these
numbers into one, removing the restriction to 8 bit minors that we had in place
before.
The mode specified in the config file is now written explicitly to the store,
rather than using the presence or absence of a read-only node. This supports
the write-sharing override above.
If the device is in use, a new hotplug status of "busy" is written to the
store, and a message is written to a new hotplug-error node. Xend uses these
things for diagnosis.
The block scripts do not need to handle online or offline events, so this
support has been removed. These scripts can be called twice, depending upon
the hotplug config, so they now identify the second run and do not attempt to
set up the device again.
The device directories in the store are cleaned out before new details are
written there. This prevents stale information from messing up block device
hotplugging. This will be one cause of "blkback: changing physical device
not supported" messages.
Signed-off-by: Ewan Mellor <ewan@xensource.com>
and udev. Pass all commands through from xen-backend.agent or
xen-backend.rules rather than second-guessing the individual scripts. This
should make it easier to tear down devices cleanly, especially the dangling
vifs we are seeing at the moment.
Cope with a missing type node inside the block script, as we don't want to
resurrect a removed node by writing a hotplug error message.
Log failure of iptables command.
Signed-off-by: Ewan Mellor <ewan@xensource.com>