Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jul 2014 04:10:25 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r268283 - head/sys/cam/ctl
Message-ID:  <201407050410.s654AP4D087788@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sat Jul  5 04:10:24 2014
New Revision: 268283
URL: http://svnweb.freebsd.org/changeset/base/268283

Log:
  Improve readability of XML generated by CTL_LUN_LIST.

Modified:
  head/sys/cam/ctl/ctl.c
  head/sys/cam/ctl/ctl_backend_block.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Sat Jul  5 03:49:20 2014	(r268282)
+++ head/sys/cam/ctl/ctl.c	Sat Jul  5 04:10:24 2014	(r268283)
@@ -3007,7 +3007,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			if (retval != 0)
 				break;
 
-			retval = sbuf_printf(sb, "<backend_type>%s"
+			retval = sbuf_printf(sb, "\t<backend_type>%s"
 					     "</backend_type>\n",
 					     (lun->backend == NULL) ?  "none" :
 					     lun->backend->name);
@@ -3015,7 +3015,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			if (retval != 0)
 				break;
 
-			retval = sbuf_printf(sb, "<lun_type>%d</lun_type>\n",
+			retval = sbuf_printf(sb, "\t<lun_type>%d</lun_type>\n",
 					     lun->be_lun->lun_type);
 
 			if (retval != 0)
@@ -3028,20 +3028,20 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 				continue;
 			}
 
-			retval = sbuf_printf(sb, "<size>%ju</size>\n",
+			retval = sbuf_printf(sb, "\t<size>%ju</size>\n",
 					     (lun->be_lun->maxlba > 0) ?
 					     lun->be_lun->maxlba + 1 : 0);
 
 			if (retval != 0)
 				break;
 
-			retval = sbuf_printf(sb, "<blocksize>%u</blocksize>\n",
+			retval = sbuf_printf(sb, "\t<blocksize>%u</blocksize>\n",
 					     lun->be_lun->blocksize);
 
 			if (retval != 0)
 				break;
 
-			retval = sbuf_printf(sb, "<serial_number>");
+			retval = sbuf_printf(sb, "\t<serial_number>");
 
 			if (retval != 0)
 				break;
@@ -3057,7 +3057,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 			if (retval != 0)
 				break;
 
-			retval = sbuf_printf(sb, "<device_id>");
+			retval = sbuf_printf(sb, "\t<device_id>");
 
 			if (retval != 0)
 				break;
@@ -3078,7 +3078,8 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 					break;
 			}
 			STAILQ_FOREACH(opt, &lun->be_lun->options, links) {
-				retval = sbuf_printf(sb, "<%s>%s</%s>", opt->name, opt->value, opt->name);
+				retval = sbuf_printf(sb, "\t<%s>%s</%s>\n",
+				    opt->name, opt->value, opt->name);
 				if (retval != 0)
 					break;
 			}

Modified: head/sys/cam/ctl/ctl_backend_block.c
==============================================================================
--- head/sys/cam/ctl/ctl_backend_block.c	Sat Jul  5 03:49:20 2014	(r268282)
+++ head/sys/cam/ctl/ctl_backend_block.c	Sat Jul  5 04:10:24 2014	(r268283)
@@ -2509,7 +2509,7 @@ ctl_be_block_lun_info(void *be_lun, stru
 	lun = (struct ctl_be_block_lun *)be_lun;
 	retval = 0;
 
-	retval = sbuf_printf(sb, "<num_threads>");
+	retval = sbuf_printf(sb, "\t<num_threads>");
 
 	if (retval != 0)
 		goto bailout;
@@ -2519,7 +2519,7 @@ ctl_be_block_lun_info(void *be_lun, stru
 	if (retval != 0)
 		goto bailout;
 
-	retval = sbuf_printf(sb, "</num_threads>");
+	retval = sbuf_printf(sb, "</num_threads>\n");
 
 bailout:
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407050410.s654AP4D087788>