[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • 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=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.