summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-11-03 14:55:17 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-11-03 14:55:17 +0000
commit7135781f65f1267a72bf554ee2b7bd605f9e59aa (patch)
tree403f29f7852bf516c8df05fec487281a12b9834e /hw
parentf67d23b1ae32b97064fa8f05330efbb09e5d4b07 (diff)
parentf18a768efb990d9cd02911159de02e8ff5475239 (diff)
downloadhqemu-7135781f65f1267a72bf554ee2b7bd605f9e59aa.zip
hqemu-7135781f65f1267a72bf554ee2b7bd605f9e59aa.tar.gz
Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2014-11-02' into staging
trivial patches for 2014-11-02 # gpg: Signature made Sun 02 Nov 2014 11:54:43 GMT using RSA key ID A4C3D7DB # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" * remotes/mjt/tags/pull-trivial-patches-2014-11-02: (23 commits) vdi: wrapped uuid_unparse() in #ifdef tap: fix possible fd leak in net_init_tap tap: do not close(fd) in net_init_tap_one target-i386: Remove unused model_features_t struct tap_int.h: remove repeating NETWORK_SCRIPT defines os-posix: reorder parent notification for -daemonize pidfile: stop making pidfile error a special case os-posix: replace goto again with a proper loop os-posix: use global daemon_pipe instead of cryptic fds[1] dump: Fix dump-guest-memory termination and use-after-close virtio-9p-proxy: improve error messages in connect_namedsocket() virtio-9p-proxy: fix error return in proxy_init() virtio-9p-proxy: Fix sockfd leak target-tricore: check return value before using it net/slirp: specify logbase for smbd Revert "os-posix: report error message when lock file failed" util: Improve os_mem_prealloc error message sparse: fix build target-arm: A64: remove redundant store target-xtensa: mark XtensaConfig structs as unused ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/9pfs/virtio-9p-proxy.c11
-rw-r--r--hw/tricore/tricore_testboard.c2
2 files changed, 8 insertions, 5 deletions
diff --git a/hw/9pfs/virtio-9p-proxy.c b/hw/9pfs/virtio-9p-proxy.c
index b57966d..59c7445 100644
--- a/hw/9pfs/virtio-9p-proxy.c
+++ b/hw/9pfs/virtio-9p-proxy.c
@@ -1104,14 +1104,15 @@ static int connect_namedsocket(const char *path)
sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
if (sockfd < 0) {
- fprintf(stderr, "socket %s\n", strerror(errno));
+ fprintf(stderr, "failed to create socket: %s\n", strerror(errno));
return -1;
}
strcpy(helper.sun_path, path);
helper.sun_family = AF_UNIX;
size = strlen(helper.sun_path) + sizeof(helper.sun_family);
if (connect(sockfd, (struct sockaddr *)&helper, size) < 0) {
- fprintf(stderr, "socket error\n");
+ fprintf(stderr, "failed to connect to %s: %s\n", path, strerror(errno));
+ close(sockfd);
return -1;
}
@@ -1154,10 +1155,12 @@ static int proxy_init(FsContext *ctx)
sock_id = atoi(ctx->fs_root);
if (sock_id < 0) {
fprintf(stderr, "socket descriptor not initialized\n");
- g_free(proxy);
- return -1;
}
}
+ if (sock_id < 0) {
+ g_free(proxy);
+ return -1;
+ }
g_free(ctx->fs_root);
ctx->fs_root = NULL;
diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c
index eeb4922..a059a20 100644
--- a/hw/tricore/tricore_testboard.c
+++ b/hw/tricore/tricore_testboard.c
@@ -71,11 +71,11 @@ static void tricore_testboard_init(MachineState *machine, int board_id)
machine->cpu_model = "tc1796";
}
cpu = cpu_tricore_init(machine->cpu_model);
- env = &cpu->env;
if (!cpu) {
error_report("Unable to find CPU definition");
exit(1);
}
+ env = &cpu->env;
memory_region_init_ram(ext_cram, NULL, "powerlink_ext_c.ram", 2*1024*1024, &error_abort);
vmstate_register_ram_global(ext_cram);
memory_region_init_ram(ext_dram, NULL, "powerlink_ext_d.ram", 4*1024*1024, &error_abort);
OpenPOWER on IntegriCloud