summaryrefslogtreecommitdiff
path: root/net/slirp.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2010-02-18 17:25:24 +0100
committerMarkus Armbruster <armbru@redhat.com>2010-03-16 16:58:32 +0100
commit1ecda02b24a13f501e747b8442934829d82698ae (patch)
tree8989913831ca3e48220b57f9104978015e39c5cb /net/slirp.c
parent6fdb03d58c614e0097d80ed130c19dcc393f7421 (diff)
error: Replace qemu_error() by error_report()
error_report() terminates the message with a newline. Strip it it from its arguments. This fixes a few error messages lacking a newline: net_handle_fd_param()'s "No file descriptor named %s found", and tap_open()'s "vnet_hdr=1 requested, but no kernel support for IFF_VNET_HDR available" (all three versions). There's one place that passes arguments without newlines intentionally: load_vmstate(). Fix it up.
Diffstat (limited to 'net/slirp.c')
-rw-r--r--net/slirp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/net/slirp.c b/net/slirp.c
index 7f846ec6f9..b41c60a39b 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -413,14 +413,14 @@ static int slirp_hostfwd(SlirpState *s, const char *redir_str,
if (slirp_add_hostfwd(s->slirp, is_udp, host_addr, host_port, guest_addr,
guest_port) < 0) {
- qemu_error("could not set up host forwarding rule '%s'\n",
- redir_str);
+ error_report("could not set up host forwarding rule '%s'",
+ redir_str);
return -1;
}
return 0;
fail_syntax:
- qemu_error("invalid host forwarding rule '%s'\n", redir_str);
+ error_report("invalid host forwarding rule '%s'", redir_str);
return -1;
}
@@ -473,10 +473,10 @@ static void slirp_smb_cleanup(SlirpState *s)
snprintf(cmd, sizeof(cmd), "rm -rf %s", s->smb_dir);
ret = system(cmd);
if (ret == -1 || !WIFEXITED(ret)) {
- qemu_error("'%s' failed.\n", cmd);
+ error_report("'%s' failed.", cmd);
} else if (WEXITSTATUS(ret)) {
- qemu_error("'%s' failed. Error code: %d\n",
- cmd, WEXITSTATUS(ret));
+ error_report("'%s' failed. Error code: %d",
+ cmd, WEXITSTATUS(ret));
}
s->smb_dir[0] = '\0';
}
@@ -493,7 +493,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
snprintf(s->smb_dir, sizeof(s->smb_dir), "/tmp/qemu-smb.%ld-%d",
(long)getpid(), instance++);
if (mkdir(s->smb_dir, 0700) < 0) {
- qemu_error("could not create samba server dir '%s'\n", s->smb_dir);
+ error_report("could not create samba server dir '%s'", s->smb_dir);
return -1;
}
snprintf(smb_conf, sizeof(smb_conf), "%s/%s", s->smb_dir, "smb.conf");
@@ -501,8 +501,8 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
f = fopen(smb_conf, "w");
if (!f) {
slirp_smb_cleanup(s);
- qemu_error("could not create samba server configuration file '%s'\n",
- smb_conf);
+ error_report("could not create samba server configuration file '%s'",
+ smb_conf);
return -1;
}
fprintf(f,
@@ -533,7 +533,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir,
if (slirp_add_exec(s->slirp, 0, smb_cmdline, &vserver_addr, 139) < 0) {
slirp_smb_cleanup(s);
- qemu_error("conflicting/invalid smbserver address\n");
+ error_report("conflicting/invalid smbserver address");
return -1;
}
return 0;
@@ -618,14 +618,14 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str,
snprintf(buf, sizeof(buf), "guestfwd.tcp:%d", port);
fwd->hd = qemu_chr_open(buf, p, NULL);
if (!fwd->hd) {
- qemu_error("could not open guest forwarding device '%s'\n", buf);
+ error_report("could not open guest forwarding device '%s'", buf);
qemu_free(fwd);
return -1;
}
if (slirp_add_exec(s->slirp, 3, fwd->hd, &server, port) < 0) {
- qemu_error("conflicting/invalid host:port in guest forwarding "
- "rule '%s'\n", config_str);
+ error_report("conflicting/invalid host:port in guest forwarding "
+ "rule '%s'", config_str);
qemu_free(fwd);
return -1;
}
@@ -638,7 +638,7 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str,
return 0;
fail_syntax:
- qemu_error("invalid guest forwarding rule '%s'\n", config_str);
+ error_report("invalid guest forwarding rule '%s'", config_str);
return -1;
}