Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1513431
| From | kys@exchange.microsoft.com |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH V2 06/14] Drivers: hv: vss: Improve log messages. |
| Date | 2016-11-01 19:20 +0100 |
| Message-ID | <syLPd-3J3-59@gated-at.bofh.it> (permalink) |
| References | <syLPb-3J3-1@gated-at.bofh.it> <syLPc-3J3-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Alex Ng <alexng@messages.microsoft.com>
Adding log messages to help troubleshoot error cases and transaction
handling.
Signed-off-by: Alex Ng <alexng@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
drivers/hv/hv_snapshot.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/hv/hv_snapshot.c b/drivers/hv/hv_snapshot.c
index a670713..5c95ba1 100644
--- a/drivers/hv/hv_snapshot.c
+++ b/drivers/hv/hv_snapshot.c
@@ -120,7 +120,7 @@ static int vss_handle_handshake(struct hv_vss_msg *vss_msg)
default:
return -EINVAL;
}
- pr_debug("VSS: userspace daemon ver. %d connected\n", dm_reg_value);
+ pr_info("VSS: userspace daemon ver. %d connected\n", dm_reg_value);
return 0;
}
@@ -128,8 +128,10 @@ static int vss_on_msg(void *msg, int len)
{
struct hv_vss_msg *vss_msg = (struct hv_vss_msg *)msg;
- if (len != sizeof(*vss_msg))
+ if (len != sizeof(*vss_msg)) {
+ pr_debug("VSS: Message size does not match length\n");
return -EINVAL;
+ }
if (vss_msg->vss_hdr.operation == VSS_OP_REGISTER ||
vss_msg->vss_hdr.operation == VSS_OP_REGISTER1) {
@@ -137,8 +139,11 @@ static int vss_on_msg(void *msg, int len)
* Don't process registration messages if we're in the middle
* of a transaction processing.
*/
- if (vss_transaction.state > HVUTIL_READY)
+ if (vss_transaction.state > HVUTIL_READY) {
+ pr_debug("VSS: Got unexpected registration request\n");
return -EINVAL;
+ }
+
return vss_handle_handshake(vss_msg);
} else if (vss_transaction.state == HVUTIL_USERSPACE_REQ) {
vss_transaction.state = HVUTIL_USERSPACE_RECV;
@@ -155,7 +160,7 @@ static int vss_on_msg(void *msg, int len)
}
} else {
/* This is a spurious call! */
- pr_warn("VSS: Transaction not active\n");
+ pr_debug("VSS: Transaction not active\n");
return -EINVAL;
}
return 0;
@@ -168,8 +173,10 @@ static void vss_send_op(void)
struct hv_vss_msg *vss_msg;
/* The transaction state is wrong. */
- if (vss_transaction.state != HVUTIL_HOSTMSG_RECEIVED)
+ if (vss_transaction.state != HVUTIL_HOSTMSG_RECEIVED) {
+ pr_debug("VSS: Unexpected attempt to send to daemon\n");
return;
+ }
vss_msg = kzalloc(sizeof(*vss_msg), GFP_KERNEL);
if (!vss_msg)
@@ -210,9 +217,13 @@ static void vss_handle_request(struct work_struct *dummy)
case VSS_OP_HOT_BACKUP:
if (vss_transaction.state < HVUTIL_READY) {
/* Userspace is not registered yet */
+ pr_debug("VSS: Not ready for request.\n");
vss_respond_to_host(HV_E_FAIL);
return;
}
+
+ pr_debug("VSS: Received request for op code: %d\n",
+ vss_transaction.msg->vss_hdr.operation);
vss_transaction.state = HVUTIL_HOSTMSG_RECEIVED;
vss_send_op();
return;
@@ -353,8 +364,10 @@ static void vss_on_reset(void)
hvt = hvutil_transport_init(vss_devname, CN_VSS_IDX, CN_VSS_VAL,
vss_on_msg, vss_on_reset);
- if (!hvt)
+ if (!hvt) {
+ pr_warn("VSS: Failed to initialize transport\n");
return -EFAULT;
+ }
return 0;
}
--
1.7.4.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH V2 00/14] Drivers: hv: Some miscellaneous fixes and enhancements kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 08/14] Drivers: hv: balloon: Fix info request to show max page count kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
Re: [PATCH V2 08/14] Drivers: hv: balloon: Fix info request to show max page count Dan Carpenter <dan.carpenter@oracle.com> - 2016-11-10 20:20 +0100
RE: [PATCH V2 08/14] Drivers: hv: balloon: Fix info request to show max page count "Alex Ng (LIS)" <alexng@microsoft.com> - 2016-11-11 00:20 +0100
[PATCH V2 04/14] Drivers: hv: balloon: Disable hot add when CONFIG_MEMORY_HOTPLUG is not set kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 02/14] Drivers: hv: utils: reduce HV_UTIL_NEGO_TIMEOUT timeout kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 12/14] Drivers: hv: vmbus: Base host signaling strictly on the ring state kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 03/14] Drivers: hv: utils: Fix the mapping between host version and protocol to use kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 11/14] tools: hv: remove unnecessary header files and netlink related code kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 14/14] Drivers: hv: vmbus: On the read path cleanup the logic to interrupt the host kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 07/14] Drivers: hv: vss: Operation timeouts should match host expectation kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 01/14] Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw() (v2) kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 10/14] tools: hv: fix a compile warning in snprintf kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 06/14] Drivers: hv: vss: Improve log messages. kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 09/14] tools: hv: remove unnecessary link flag kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 13/14] Drivers: hv: vmbus: On write cleanup the logic to interrupt the host kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
[PATCH V2 05/14] Drivers: hv: balloon: Add logging for dynamic memory operations kys@exchange.microsoft.com - 2016-11-01 19:20 +0100
csiph-web