WARNING - OLD ARCHIVES

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/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Getting VBD working with xenstore, again

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] Getting VBD working with xenstore, again
From: Jacob Gorm Hansen <jacobg@xxxxxxx>
Date: Thu, 12 Jan 2006 12:42:16 +0100
Delivery-date: Thu, 12 Jan 2006 11:48:49 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=eJh9Y6L6BSSw4w+8RDiX1EBghwywY7eaDeXyMQ0oS9ZDoNLNS3a77K9TdOSWGaApLpi7NpwB7Ie10szW40sp1yLSdauEN0V48w8FaqKJpRT3QzSSQxLDrGUnPVrjT9oW43l7GUoqB8SO5+PNib/d6KQSqSwl/HTQIcoJCc//Lg8=
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
hi,

I have the code below, a version of which used to (just before xen3
release) work fine for giving my domain access to a block device. I
have tried to adjust this based on the python source, but my block
device no longer registers in domU :-(

For domU I am using the linux-2.6.12 from xen-unstable (about one week
old) and for dom0 linux-2.6-xen.hg of about the same age.

void setup_vbd(int domid, int uuid, char* vdev, char* pdev)
{
    struct xs_transaction_handle* t;

    struct xs_permissions xsperms[2];
    xsperms[0].id = domid;
    xsperms[0].perms = XS_PERM_READ | XS_PERM_WRITE;

    char s[256];
    char s2[256];

    char* home = xs_get_domain_path(xs,domid);
    char* dom0_home = xs_get_domain_path(xs,0);
    printf("dom0_home is %s\n",dom0_home);


    char backend[256];
    char frontend[256];
    sprintf(backend,"%s/backend/vbd/%d/%d",dom0_home,uuid,domid);
    sprintf(frontend, "%s/device/vbd/%d",home,uuid);

    xs_begin();

    sprintf(s,"%s/domain",backend);
    sprintf(s2,"%d",domid);
    xs_w(s, s2);

    sprintf(s,"%s/frontend",backend);
    xs_w(s, frontend );

    sprintf(s,"%s/frontend-id",backend);
    sprintf(s2,"%d",domid);
    xs_w(s, s2 );

    sprintf(s, "%s/state", backend);
    xs_w(s, "1");


    xs_end();

    xs_begin();
    xs_mkdir(xs,t,backend);
    int result = xs_set_permissions(xs, t, backend, xsperms, 1);

    sprintf(s,"%s/backend",frontend);
    xs_w(s, backend );

    sprintf(s, "%s/backend-id", frontend);
    xs_w(s, "0");

    sprintf(s, "%s/state", frontend);
    xs_w(s, "1");


    sprintf(s, "%s/virtual-device", frontend);
    xs_w(s, vdev );

    xs_end();
}

I hope someone can point out the obvious mistake in the code above.

Thanks in advance,
Jacob

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>