This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] Block device helper script and qemu-dm

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Block device helper script and qemu-dm
From: Radu Rendec <radu.rendec@xxxxxxxxxx>
Date: Fri, 26 Feb 2010 14:50:12 +0200
Delivery-date: Fri, 26 Feb 2010 07:53:15 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

I'm trying to implement a block device helper script for Xen to
automatically connect to iSCSI targets on guest domain setup. Disk
declaration is supposed to look like this:

disk = [ 

The path under /dev/disk is a symlink that udevd automatically creates
upon iscsi target login. The symlink points to the real block
device, /dev/sdX (where X is the first unused letter it finds).

The first issue was that I couldn't get qemu-dm to setup the disk
properly because it failed to figure out what driver to use. The easiest
way to fix this that occured to me is this:

--- xen-3.4.2/tools/ioemu-qemu-xen/xenstore.c.orig      2010-02-25 
14:11:43.000000000 +0200
+++ xen-3.4.2/tools/ioemu-qemu-xen/xenstore.c   2010-02-25 14:12:06.000000000 
@@ -491,6 +491,8 @@
                    format = &bdrv_raw;
                } else if (!strcmp(drv,"phy")) {
                    format = &bdrv_raw;
+               } else if (!strcmp(drv,"iscsi")) {
+                   format = &bdrv_raw;
                } else {
                    format = bdrv_find_format(drv);
                    if (!format) {

Although this solves the problem, I don't like patching things unless
it's absolutely necessary. Perhaps there is a better approach to this -
so I'm kindly asking you for some clues.

But the biggest issue seems to be the sequence of events: I guess that
first qemu-dm is started (on domU creation) and then the xen hotplug
scripts run.

This certainly makes sense for network devices (since the tap interface
is setup by qemu-dm and needs to be configured by hotplug afterwards),
but apparenly leaves no choice for setting up block devices *before*
qemu-dm starts.

Is there any way I could hook into domU setup before qemu-dm starts? I'd
also like to make this work with live migration: when domU migrates, the
iscsi target needs to be setup on the destination dom0.

I'm not subscribed to the list, so I'm kindly asking you to cc my
address if replying.


Radu Rendec

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] Block device helper script and qemu-dm, Radu Rendec <=