Skip to contentSkip to conversation

xenstore xenbus failure

DISCUSSION Adam Wendt 2 participants 4 messages Jan 20, 2009 – Jan 24, 2009 Xen hypervisor interface

lore
Share & tools
lore

Adam Wendt

author
#0 lore raw

Hi,

Still having problems getting xenstore working without the socket interface. Here is output running simple xenstore-ls:

Got message DIRECTORY len 2 from 0x1451b80 Writing msg DIRECTORY (tool) out to 0x1451b80
xenstore-ls: xs_directory (/): Invalid argument IN 0x1451b80 20090120 10:43:23 DIRECTORY (/ )
OUT 0x1451b80 20090120 10:43:23 DIRECTORY (tool vm local )

First 2 lines are verbose output of xenstored, middle line is output of the xenstore client and last 2 lines are trace log from xenstored.

'Invalid argument' seems to be coming from the write() call on line 98 of xs_lib.c.

Seems to happen the _second_ time that xs_write_all is called from xs_talkv (writing the parameters) in this case the "/" for the ls.

Quoted 1 line

From the output above we can see that xenstored is receiving the write, and

even the "/" parameter, so why would the write be failing with 'Invalid argument'?

Thanks,

Adam
Adam Wendt Consulting

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 10 lines · Adam Wendt

Hi,

Still having problems getting xenstore working without the socket interface. Here is output running simple xenstore-ls:

Got message DIRECTORY len 2 from 0x1451b80 Writing msg DIRECTORY (tool) out to 0x1451b80
xenstore-ls: xs_directory (/): Invalid argument IN 0x1451b80 20090120 10:43:23 DIRECTORY (/ )
OUT 0x1451b80 20090120 10:43:23 DIRECTORY (tool vm local )

I just noticed something very similar...

        root@bogga:~# xenstore-ls 
        xenstore-ls: xs_directory (/): Success
        root@bogga:~# strace xenstore-ls
        [...]
        open("/proc/xen/xenbus", O_RDWR|O_LARGEFILE) = 3
        [...]
        write(3, "\1\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0", 16) = 16
        write(3, "/\0", 2)                      = -168004416

I don't like the look of that return value and:
CC drivers/xen/xenfs/xenbus.o
/local/scratch/ianc/devel/kernels/paravirt/drivers/xen/xenfs/xenbus.c: In function 'xenbus_file_write':
/local/scratch/ianc/devel/kernels/paravirt/drivers/xen/xenfs/xenbus.c:294: warning: 'rc' may be used uninitialized in this function

Can you try this patch, it fixes things for me:

drivers/xen/xenfs/xenbus.c +5 -6
diff -r 8fed53a1d8d1 drivers/xen/xenfs/xenbus.c
@@ -291,7 +291,7 @@
 static int xenbus_write_transaction(unsigned msg_type,
 				    struct xenbus_file_priv *u)
 {
-	int rc, ret;
+	int rc;
 	void *reply;
 	struct xenbus_transaction_holder *trans = NULL;
 	LIST_HEAD(staging_q);
@@ -326,15 +326,14 @@
 	}
 
 	mutex_lock(&u->reply_mutex);
-	ret = queue_reply(&staging_q, &u->u.msg, sizeof(u->u.msg));
-	if (!ret)
-		ret = queue_reply(&staging_q, reply, u->u.msg.len);
-	if (!ret) {
+	rc = queue_reply(&staging_q, &u->u.msg, sizeof(u->u.msg));
+	if (!rc)
+		rc = queue_reply(&staging_q, reply, u->u.msg.len);
+	if (!rc) {
 		list_splice_tail(&staging_q, &u->read_buffers);
 		wake_up(&u->read_waitq);
 	} else {
 		queue_cleanup(&staging_q);
-		rc = ret;
 	}
 	mutex_unlock(&u->reply_mutex);
 

Ian.

author
#2 lore raw
Quoted 25 lines · Ian Campbell
Quoted 10 lines · Adam Wendt

Hi,

Still having problems getting xenstore working without the socket interface. Here is output running simple xenstore-ls:

Got message DIRECTORY len 2 from 0x1451b80 Writing msg DIRECTORY (tool) out to 0x1451b80
xenstore-ls: xs_directory (/): Invalid argument IN 0x1451b80 20090120 10:43:23 DIRECTORY (/ )
OUT 0x1451b80 20090120 10:43:23 DIRECTORY (tool vm local )

I just noticed something very similar...

       root@bogga:~# xenstore-ls
       xenstore-ls: xs_directory (/): Success
       root@bogga:~# strace xenstore-ls
       [...]
       open("/proc/xen/xenbus", O_RDWR|O_LARGEFILE) = 3
       [...]
       write(3, "\1\0\0\0\0\0\0\0\0\0\0\0\2\0\0\0", 16) = 16
       write(3, "/\0", 2)                      = -168004416

I don't like the look of that return value and:
CC drivers/xen/xenfs/xenbus.o

Quoted 8 lines

/local/scratch/ianc/devel/kernels/paravirt/drivers/xen/xenfs/xenbus.c: In
function 'xenbus_file_write':

/local/scratch/ianc/devel/kernels/paravirt/drivers/xen/xenfs/xenbus.c:294:
warning: 'rc' may be used uninitialized in this function

Can you try this patch, it fixes things for me:
<snip>

The patch fixed my issues with xenbus/xenstore. Now having other problems starting guest:

1. vif hotplug hangs and then errors out, haven't looked deeper into this due to the following issues.
2. Without a vif entry when I start guest it fails to find the disk partition names I have defined in my guest config file, disks only seem to be available on ca01 (for initial root) and then /dev/xvdaX, no hdaX entries like my guest config has.
3. I don't get a login prompt on the console, my entire init process is displayed up to starting local (this is gentoo) but then no login, I see a /dev/xvc0 device and I have a valid inittab entriy (along with securetty entry) but never get a login promt on the console

So without networking no way to get into my guest, guess I'll try to debug the vif hotplug issue next.

Adam
Adam Wendt Consulting

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
Quoted 2 lines · Adam Wendt

The patch fixed my issues with xenbus/xenstore.

Excellent, thanks. I've forwarded upstream.

Quoted 4 lines

Now having other problems starting guest:

1. vif hotplug hangs and then errors out, haven't looked deeper into this due to the following issues.

There is currently no netback in the pvops dom0 kernel so this isn't expected to work yet.

Quoted 4 lines

2. Without a vif entry when I start guest it fails to find the disk partition names I have defined in my guest config file, disks only seem to be available on ca01 (for initial root) and then /dev/xvdaX, no hdaX entries like my guest config has.

ca01? What sort of guest is it?

Blkback devices work OK for me with PV Linux guests so I think the dom0 side is broadly OK but it is possible a different guest might expose something different.

There is currently no blktap in pvops kernel so that wouldn't be expected to work.

Quoted 4 lines

3. I don't get a login prompt on the console, my entire init process is displayed up to starting local (this is gentoo) but then no login, I see a /dev/xvc0 device and I have a valid inittab entriy (along with securetty entry) but never get a login promt on the console

For a pvops kernel the console device is called hvc0 not xvc0.

Ian.