[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 01/12] block/nfs: add support for setting debug level
From: |
Jeff Cody |
Subject: |
[Qemu-block] [PULL 01/12] block/nfs: add support for setting debug level |
Date: |
Mon, 29 Feb 2016 15:08:41 -0500 |
From: Peter Lieven <address@hidden>
recent libnfs versions support logging debug messages. Add
support for it in qemu through an URL parameter.
Example:
qemu -cdrom nfs://127.0.0.1/iso/my.iso?debug=2
Signed-off-by: Peter Lieven <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Message-id: address@hidden
Signed-off-by: Jeff Cody <address@hidden>
---
block/nfs.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/block/nfs.c b/block/nfs.c
index 5eb8c13..7220e89 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -36,6 +36,7 @@
#include <nfsc/libnfs.h>
#define QEMU_NFS_MAX_READAHEAD_SIZE 1048576
+#define QEMU_NFS_MAX_DEBUG_LEVEL 2
typedef struct NFSClient {
struct nfs_context *context;
@@ -334,6 +335,17 @@ static int64_t nfs_client_open(NFSClient *client, const
char *filename,
}
nfs_set_readahead(client->context, val);
#endif
+#ifdef LIBNFS_FEATURE_DEBUG
+ } else if (!strcmp(qp->p[i].name, "debug")) {
+ /* limit the maximum debug level to avoid potential flooding
+ * of our log files. */
+ if (val > QEMU_NFS_MAX_DEBUG_LEVEL) {
+ error_report("NFS Warning: Limiting NFS debug level"
+ " to %d", QEMU_NFS_MAX_DEBUG_LEVEL);
+ val = QEMU_NFS_MAX_DEBUG_LEVEL;
+ }
+ nfs_set_debug(client->context, val);
+#endif
} else {
error_setg(errp, "Unknown NFS parameter name: %s",
qp->p[i].name);
--
1.9.3
- [Qemu-block] [PULL 00/12] Block patches, Jeff Cody, 2016/02/29
- [Qemu-block] [PULL 01/12] block/nfs: add support for setting debug level,
Jeff Cody <=
- [Qemu-block] [PULL 02/12] sheepdog: allow to delete snapshot, Jeff Cody, 2016/02/29
- [Qemu-block] [PULL 04/12] curl: add support for HTTP authentication parameters, Jeff Cody, 2016/02/29
- [Qemu-block] [PULL 03/12] rbd: add support for getting password from QCryptoSecret object, Jeff Cody, 2016/02/29
- [Qemu-block] [PULL 05/12] iscsi: add support for getting CHAP password via QCryptoSecret API, Jeff Cody, 2016/02/29
- [Qemu-block] [PULL 06/12] vhdx: DIV_ROUND_UP() in vhdx_calc_bat_entries(), Jeff Cody, 2016/02/29
- [Qemu-block] [PULL 07/12] vhdx: Simplify vhdx_set_shift_bits(), Jeff Cody, 2016/02/29
- [Qemu-block] [PULL 09/12] mirror: Add mirror_wait_for_io, Jeff Cody, 2016/02/29
- [Qemu-block] [PULL 08/12] mirror: Rewrite mirror_iteration, Jeff Cody, 2016/02/29
- [Qemu-block] [PULL 10/12] block/backup: make backup cluster size configurable, Jeff Cody, 2016/02/29
- [Qemu-block] [PULL 12/12] iotests/124: Add cluster_size mismatch test, Jeff Cody, 2016/02/29