aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-02-24 09:51:24 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-02-24 09:51:24 -0600
commit85f38553031b1a6e07f786c9ab0d403af7252b4f (patch)
tree4d9c0efac9343b2073732b368860f894e672a9b5
parent18ac5499584319ef828c7da4c6223f818dde0234 (diff)
parentf293d8b1f26953ccaef794785cea0619d4f8c268 (diff)
downloadqemu-85f38553031b1a6e07f786c9ab0d403af7252b4f.zip
qemu-85f38553031b1a6e07f786c9ab0d403af7252b4f.tar.gz
qemu-85f38553031b1a6e07f786c9ab0d403af7252b4f.tar.bz2
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
* stefanha/trivial-patches: slirp/misc: fix gcc __warn_memset_zero_len warnings vl.c: Increase width of machine name column in "-M ?" output tcg: Remove unneeded include statements
-rw-r--r--slirp/misc.c21
-rw-r--r--tcg/tcg.c12
-rw-r--r--vl.c4
3 files changed, 9 insertions, 28 deletions
diff --git a/slirp/misc.c b/slirp/misc.c
index 3432fbf..0308a62 100644
--- a/slirp/misc.c
+++ b/slirp/misc.c
@@ -333,7 +333,6 @@ void slirp_connection_info(Slirp *slirp, Monitor *mon)
struct socket *so;
const char *state;
char buf[20];
- int n;
monitor_printf(mon, " Protocol[State] FD Source Address Port "
"Dest. Address Port RecvQ SendQ\n");
@@ -357,10 +356,8 @@ void slirp_connection_info(Slirp *slirp, Monitor *mon)
dst_addr = so->so_faddr;
dst_port = so->so_fport;
}
- n = snprintf(buf, sizeof(buf), " TCP[%s]", state);
- memset(&buf[n], ' ', 19 - n);
- buf[19] = 0;
- monitor_printf(mon, "%s %3d %15s %5d ", buf, so->s,
+ snprintf(buf, sizeof(buf), " TCP[%s]", state);
+ monitor_printf(mon, "%-19s %3d %15s %5d ", buf, so->s,
src.sin_addr.s_addr ? inet_ntoa(src.sin_addr) : "*",
ntohs(src.sin_port));
monitor_printf(mon, "%15s %5d %5d %5d\n",
@@ -370,22 +367,20 @@ void slirp_connection_info(Slirp *slirp, Monitor *mon)
for (so = slirp->udb.so_next; so != &slirp->udb; so = so->so_next) {
if (so->so_state & SS_HOSTFWD) {
- n = snprintf(buf, sizeof(buf), " UDP[HOST_FORWARD]");
+ snprintf(buf, sizeof(buf), " UDP[HOST_FORWARD]");
src_len = sizeof(src);
getsockname(so->s, (struct sockaddr *)&src, &src_len);
dst_addr = so->so_laddr;
dst_port = so->so_lport;
} else {
- n = snprintf(buf, sizeof(buf), " UDP[%d sec]",
+ snprintf(buf, sizeof(buf), " UDP[%d sec]",
(so->so_expire - curtime) / 1000);
src.sin_addr = so->so_laddr;
src.sin_port = so->so_lport;
dst_addr = so->so_faddr;
dst_port = so->so_fport;
}
- memset(&buf[n], ' ', 19 - n);
- buf[19] = 0;
- monitor_printf(mon, "%s %3d %15s %5d ", buf, so->s,
+ monitor_printf(mon, "%-19s %3d %15s %5d ", buf, so->s,
src.sin_addr.s_addr ? inet_ntoa(src.sin_addr) : "*",
ntohs(src.sin_port));
monitor_printf(mon, "%15s %5d %5d %5d\n",
@@ -394,13 +389,11 @@ void slirp_connection_info(Slirp *slirp, Monitor *mon)
}
for (so = slirp->icmp.so_next; so != &slirp->icmp; so = so->so_next) {
- n = snprintf(buf, sizeof(buf), " ICMP[%d sec]",
+ snprintf(buf, sizeof(buf), " ICMP[%d sec]",
(so->so_expire - curtime) / 1000);
src.sin_addr = so->so_laddr;
dst_addr = so->so_faddr;
- memset(&buf[n], ' ', 19 - n);
- buf[19] = 0;
- monitor_printf(mon, "%s %3d %15s - ", buf, so->s,
+ monitor_printf(mon, "%-19s %3d %15s - ", buf, so->s,
src.sin_addr.s_addr ? inet_ntoa(src.sin_addr) : "*");
monitor_printf(mon, "%15s - %5d %5d\n", inet_ntoa(dst_addr),
so->so_rcv.sb_cc, so->so_snd.sb_cc);
diff --git a/tcg/tcg.c b/tcg/tcg.c
index d43fa4a..351a0a3 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -33,18 +33,6 @@
#define NDEBUG
#endif
-#include <stdarg.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <inttypes.h>
-#ifdef _WIN32
-#include <malloc.h>
-#endif
-#ifdef _AIX
-#include <alloca.h>
-#endif
-
#include "qemu-common.h"
#include "cache-utils.h"
#include "host-utils.h"
diff --git a/vl.c b/vl.c
index 641df59..cd77852 100644
--- a/vl.c
+++ b/vl.c
@@ -2004,9 +2004,9 @@ static QEMUMachine *machine_parse(const char *name)
printf("Supported machines are:\n");
for (m = first_machine; m != NULL; m = m->next) {
if (m->alias) {
- printf("%-10s %s (alias of %s)\n", m->alias, m->desc, m->name);
+ printf("%-20s %s (alias of %s)\n", m->alias, m->desc, m->name);
}
- printf("%-10s %s%s\n", m->name, m->desc,
+ printf("%-20s %s%s\n", m->name, m->desc,
m->is_default ? " (default)" : "");
}
exit(!name || *name != '?');