|
| 1 | +From db8c3370d9813a664b096a66e86601b1ffb9236e Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= |
| 3 | + |
| 4 | +Date: Mon, 27 Oct 2025 19:42:00 +0100 |
| 5 | +Subject: [PATCH 2/2] DEBUG |
| 6 | + |
| 7 | +--- |
| 8 | + drivers/net/xen-netfront.c | 2 ++ |
| 9 | + drivers/xen/xenbus/xenbus_client.c | 9 +++++++++ |
| 10 | + 2 files changed, 11 insertions(+) |
| 11 | + |
| 12 | +diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c |
| 13 | +index a11a0e9494005..e6a2d72764fce 100644 |
| 14 | +--- a/drivers/net/xen-netfront.c |
| 15 | ++++ b/drivers/net/xen-netfront.c |
| 16 | +@@ -1817,6 +1817,7 @@ static void xennet_disconnect_backend(struct netfront_info *info) |
| 17 | + unsigned int i = 0; |
| 18 | + unsigned int num_queues = info->netdev->real_num_tx_queues; |
| 19 | + |
| 20 | ++ printk(KERN_CRIT "xennet_disconnect_backend info %p\n", info); |
| 21 | + netif_carrier_off(info->netdev); |
| 22 | + |
| 23 | + for (i = 0; i < num_queues && info->queues; ++i) { |
| 24 | +@@ -2659,6 +2660,7 @@ static void xennet_remove(struct xenbus_device *dev) |
| 25 | + { |
| 26 | + struct netfront_info *info = dev_get_drvdata(&dev->dev); |
| 27 | + |
| 28 | ++ printk(KERN_CRIT "xennet_remove %p\n", dev); |
| 29 | + xennet_bus_close(dev); |
| 30 | + xennet_disconnect_backend(info); |
| 31 | + |
| 32 | +diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c |
| 33 | +index ce2f49d9aa4ad..ac7fe6b1433fd 100644 |
| 34 | +--- a/drivers/xen/xenbus/xenbus_client.c |
| 35 | ++++ b/drivers/xen/xenbus/xenbus_client.c |
| 36 | +@@ -275,6 +275,15 @@ __xenbus_switch_state(struct xenbus_device *dev, |
| 37 | + */ |
| 38 | + int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state state) |
| 39 | + { |
| 40 | ++ if (WARN(state == XenbusStateClosed || state == XenbusStateClosing, |
| 41 | ++ "switching %s (%p) to state %d, otherend: %s, vanished: %d\n", |
| 42 | ++ dev->nodename, dev, state, dev->otherend, dev->vanished)) { |
| 43 | ++ char *otherend = NULL; |
| 44 | ++ int err = xenbus_gather(XBT_NIL, dev->nodename, "backend", "%s", &otherend, NULL); |
| 45 | ++ printk(KERN_CRIT "xs (%d): backend: %s\n", err, otherend); |
| 46 | ++ if (otherend) |
| 47 | ++ kfree(otherend); |
| 48 | ++ } |
| 49 | + if (dev->vanished) |
| 50 | + return 0; |
| 51 | + return __xenbus_switch_state(dev, state, 0); |
| 52 | +-- |
| 53 | +2.51.0 |
| 54 | + |
0 commit comments