All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@entel.upc.edu>
To: Christoph Egger <Christoph.Egger@amd.com>
Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
	Stefano@mx1.upc.es, Stabellini <Stefano.Stabellini@eu.citrix.com>
Subject: Re: libxl: problem with devices in PV
Date: Thu, 21 Jul 2011 10:39:09 +0200	[thread overview]
Message-ID: <CAPLaKK6EMG13iLt3ceWjwMj10ung4x5D8XQ+c45wzNW_Z13sKg@mail.gmail.com> (raw)
In-Reply-To: <4E26E5BB.1020902@amd.com>

[-- Attachment #1: Type: text/plain, Size: 2455 bytes --]

Hello,

Thanks for the help, I have a preliminary patch that allows booting PV
machines with xl on NetBSD, but there seems to be some issues with PCI
devices, the guest takes a very long time to start, and I think it's
because it's waiting for PCI devices to initialize.

[    5.280068] XENBUS: Waiting for devices to initialise:
295s...290s...285s...280s...275s...270s...265s...260s...255s...250s...245s...240s...235s...230s...225s...220s...215s...210s...205s...200s...195s...190s...185s...180s...175s...170s...165s...160s...155s...150s...145s...140s...135s...130s...125s...120s...115s...110s...105s...100s...95s...90s...85s...80s...75s...70s...65s...60s...55s...50s...45s...40s...35s...30s...25s...20s...15s...10s...5s...0s...
[  300.280078] XENBUS: Device with no driver: device/vbd/51714
[  300.280086] XENBUS: Device with no driver: device/vbd/51713
[  300.280495] XENBUS: Timeout connecting to device: device/pci/0
(local state 3, remote state 1)

xm didn't add pci entries to xenstore, and I don't know what should be
the status of those entries, or if it's best to disable the adding of
pci entries to xenstore in libxl if no devices are configured?

I've looked at http://wiki.xensource.com/xenwiki/XenStoreReference,
but the wiki doesn't have any information regarding PCI xenstore
entries.

The status of those entries in xenstore is the following:

/local/domain/0/backend/pci = ""   (n0)
/local/domain/0/backend/pci/1 = ""   (n0)
/local/domain/0/backend/pci/1/0 = ""   (n0,r1)
/local/domain/0/backend/pci/1/0/frontend =
"/local/domain/1/device/pci/0"   (n0,r1)
/local/domain/0/backend/pci/1/0/frontend-id = "1"   (n0,r1)
/local/domain/0/backend/pci/1/0/online = "1"   (n0,r1)
/local/domain/0/backend/pci/1/0/state = "1"   (n0,r1)
/local/domain/0/backend/pci/1/0/domain = "debian"   (n0,r1)
/local/domain/0/backend/pci/1/0/num_devs = "0"   (n0,r1)
/local/domain/1/device/pci = ""   (n0,r1)
/local/domain/1/device/pci/0 = ""   (n1,r0)
/local/domain/1/device/pci/0/backend =
"/local/domain/0/backend/pci/1/0"   (n1,r0)
/local/domain/1/device/pci/0/backend-id = "0"   (n1,r0)
/local/domain/1/device/pci/0/state = "3"   (n1,r0)
/local/domain/1/device/pci/0/pci-op-ref = "8"   (n1,r0)
/local/domain/1/device/pci/0/event-channel = "8"   (n1,r0)
/local/domain/1/device/pci/0/magic = "7"   (n1,r0)

The patch attached breaks linux support, it is only attached for
informative purposes.

Regards, Roger.

[-- Attachment #2: patch-libxl --]
[-- Type: application/octet-stream, Size: 2533 bytes --]

diff -r e298ce67777e tools/hotplug/NetBSD/block
--- a/tools/hotplug/NetBSD/block	Mon Jul 18 14:38:31 2011 +0100
+++ b/tools/hotplug/NetBSD/block	Thu Jul 21 12:36:05 2011 +0200
@@ -19,7 +19,8 @@
 
 xpath=$1
 xstatus=$2
-xtype=$(xenstore-read "$xpath/type")
+xtype=$3
+#xtype=$(xenstore-read "$xpath/type")
 xparams=$(xenstore-read "$xpath/params")
 
 case $xstatus in
diff -r e298ce67777e tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c	Mon Jul 18 14:38:31 2011 +0100
+++ b/tools/libxl/libxl_device.c	Thu Jul 21 12:36:05 2011 +0200
@@ -136,13 +136,13 @@
               a->disk->format == LIBXL_DISK_FORMAT_EMPTY)) {
             goto bad_format;
         }
-        if (a->disk->format != LIBXL_DISK_FORMAT_EMPTY &&
+        /*if (a->disk->format != LIBXL_DISK_FORMAT_EMPTY &&
             !S_ISBLK(a->stab.st_mode)) {
             LIBXL__LOG(ctx, LIBXL__LOG_DEBUG, "Disk vdev=%s, backend phy"
                        " unsuitable as phys path not a block device",
                        a->disk->vdev);
             return 0;
-        }
+        }*/
 
         return backend;
 
diff -r e298ce67777e tools/xenbackendd/xenbackendd.c
--- a/tools/xenbackendd/xenbackendd.c	Mon Jul 18 14:38:31 2011 +0100
+++ b/tools/xenbackendd/xenbackendd.c	Thu Jul 21 12:36:05 2011 +0200
@@ -89,15 +89,15 @@
 }
 
 static void
-doexec(const char *cmd, const char *arg1, const char *arg2)
+doexec(const char *cmd, const char *arg1, const char *arg2, const char *arg3)
 {
-	dodebug("exec %s %s %s", cmd, arg1, arg2);
+	dodebug("exec %s %s %s %s", cmd, arg1, arg2, arg3);
 	switch(vfork()) {
 	case -1:
 		dolog(LOG_ERR, "can't vfork: %s", strerror(errno));
 		break;
 	case 0:
-		execl(cmd, cmd, arg1, arg2, NULL);
+		execl(cmd, cmd, arg1, arg2, arg3, NULL);
 		dolog(LOG_ERR, "can't exec %s: %s", cmd, strerror(errno));
 		exit(EXIT_FAILURE);
 		/* NOTREACHED */
@@ -150,6 +150,8 @@
 	char *s;
 	int state;
 	char *sstate;
+	char *params;
+	char *stype;
 	char *p;
 	char buf[80];
 	int type;
@@ -297,11 +299,18 @@
 				    strerror(errno));
 				goto next2;
 			}
-			doexec(s, vec[XS_WATCH_PATH], sstate);
+			doexec(s, vec[XS_WATCH_PATH], sstate, NULL);
 			break;
 
 		case DEVTYPE_VBD:
-			doexec(vbd_script, vec[XS_WATCH_PATH], sstate);
+			snprintf(buf, sizeof(buf), "%s/params", vec[XS_WATCH_PATH]);
+			params = xs_read(xs, XBT_NULL, buf, 0);
+			if (strncmp(params,
+				"/dev",
+				strlen(params)) == 0)
+				stype = "phy";
+			stype = "file";
+			doexec(vbd_script, vec[XS_WATCH_PATH], sstate, stype);
 			break;
 
 		default:

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

  reply	other threads:[~2011-07-21  8:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-20 11:01 libxl: problem with devices in PV Roger Pau Monné
2011-07-20 11:37 ` Stefano Stabellini
2011-07-20 12:54   ` Ian Campbell
2011-07-20 13:10     ` Roger Pau Monné
2011-07-20 13:30       ` Ian Campbell
2011-07-20 14:27         ` Christoph Egger
2011-07-21  8:39           ` Roger Pau Monné [this message]
2011-07-21  9:03             ` Ian Campbell
2011-07-21  9:19               ` Roger Pau Monné
2011-07-21  9:39                 ` Roger Pau Monné
2011-07-21 10:36                   ` Ian Campbell
2011-07-21  9:42                 ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPLaKK6EMG13iLt3ceWjwMj10ung4x5D8XQ+c45wzNW_Z13sKg@mail.gmail.com \
    --to=roger.pau@entel.upc.edu \
    --cc=Christoph.Egger@amd.com \
    --cc=Ian.Campbell@eu.citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=Stefano@mx1.upc.es \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.