qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging

Fix memory leak in synth backend.

# gpg: Signature made Mon 19 Feb 2018 17:29:49 GMT
# gpg: using RSA key 71D4D5E5822F73D6
# gpg: Good signature from "Greg Kurz <groug@kaod.org>"
# gpg: aka "Gregory Kurz <gregory.kurz@free.fr>"
# gpg: aka "[jpeg image of size 3330]"
# Primary key fingerprint: B482 8BAF 9431 40CE F2A3 4910 71D4 D5E5 822F 73D6

* remotes/gkurz/tags/for-upstream:
9p: fix leak in synth_name_to_path()
9p: v9fs_path_copy() readability

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

+6 -6
+1
hw/9pfs/9p-synth.c
··· 495 495 } 496 496 out: 497 497 /* Copy the node pointer to fid */ 498 + g_free(target->data); 498 499 target->data = g_memdup(&node, sizeof(void *)); 499 500 target->size = sizeof(void *); 500 501 return 0;
+4 -5
hw/9pfs/9p.c
··· 190 190 va_end(ap); 191 191 } 192 192 193 - void v9fs_path_copy(V9fsPath *lhs, V9fsPath *rhs) 193 + void v9fs_path_copy(V9fsPath *dst, const V9fsPath *src) 194 194 { 195 - v9fs_path_free(lhs); 196 - lhs->data = g_malloc(rhs->size); 197 - memcpy(lhs->data, rhs->data, rhs->size); 198 - lhs->size = rhs->size; 195 + v9fs_path_free(dst); 196 + dst->size = src->size; 197 + dst->data = g_memdup(src->data, src->size); 199 198 } 200 199 201 200 int v9fs_name_to_path(V9fsState *s, V9fsPath *dirpath,
+1 -1
hw/9pfs/9p.h
··· 343 343 void v9fs_path_init(V9fsPath *path); 344 344 void v9fs_path_free(V9fsPath *path); 345 345 void v9fs_path_sprintf(V9fsPath *path, const char *fmt, ...); 346 - void v9fs_path_copy(V9fsPath *lhs, V9fsPath *rhs); 346 + void v9fs_path_copy(V9fsPath *dst, const V9fsPath *src); 347 347 int v9fs_name_to_path(V9fsState *s, V9fsPath *dirpath, 348 348 const char *name, V9fsPath *path); 349 349 int v9fs_device_realize_common(V9fsState *s, const V9fsTransport *t,