Skip to contentSkip to conversation

Fix for missing response to XS_UNWATCH request.

PATCH New Magnus Carlsson 1 participant 1 message Mar 21, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix for missing response to XS_UNWATCH request.

With this patch, Dom0 clients can do "unwatch" properly through the kernel's xenbus connection.

Cheers,
Magnus

# HG changeset patch
# User Magnus Carlsson <[email protected]> # Date 1174512701 25200
# Node ID 001a9729e8f7a6c0da128a7f9586f9a304e17cab # Parent 3fd9b0c71b8c687b108a8bf671c9c4fc47046a0a Fix for missing response to XS_UNWATCH request.

linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c +8 -8
diff -r 3fd9b0c71b8c -r 001a9729e8f7 linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_dev.c
@@ -246,9 +246,6 @@ static ssize_t xenbus_dev_write(struct f
 		token++;
 
 		if (msg_type == XS_WATCH) {
-			static const char * XS_WATCH_RESP = "OK";
-			struct xsd_sockmsg hdr;
-
 			watch = kmalloc(sizeof(*watch), GFP_KERNEL);
 			watch->watch.node = kmalloc(strlen(path)+1,
                                                     GFP_KERNEL);
@@ -266,11 +263,6 @@ static ssize_t xenbus_dev_write(struct f
 			}
 			
 			list_add(&watch->list, &u->watches);
-
-			hdr.type = XS_WATCH;
-			hdr.len = strlen(XS_WATCH_RESP) + 1;
-			queue_reply(u, (char *)&hdr, sizeof(hdr));
-			queue_reply(u, (char *)XS_WATCH_RESP, hdr.len);
 		} else {
 			list_for_each_entry_safe(watch, tmp_watch,
                                                  &u->watches, list) {
@@ -284,6 +276,14 @@ static ssize_t xenbus_dev_write(struct f
 				}
 			}
 		}
+		{
+			static const char * XS_RESP = "OK";
+			struct xsd_sockmsg hdr;
+			hdr.type = msg_type;
+			hdr.len = strlen(XS_RESP) + 1;
+			queue_reply(u, (char *)&hdr, sizeof(hdr));
+			queue_reply(u, (char *)XS_RESP, hdr.len);
+		}
 
 		break;
 

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