Skip to content

Commit cd414c3

Browse files
committed
hw/xen: Use xs_node_read() from xenstore_read_str() instead of open-coding it
Signed-off-by: David Woodhouse <[email protected]> Reviewed-by: Anthony PERARD <[email protected]> Acked-by: Roger Pau Monné <[email protected]>
1 parent e4e113e commit cd414c3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

hw/xen/xen_pvdev.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "qemu/main-loop.h"
2323
#include "hw/qdev-core.h"
2424
#include "hw/xen/xen-legacy-backend.h"
25+
#include "hw/xen/xen-bus-helper.h"
2526
#include "hw/xen/xen_pvdev.h"
2627

2728
/* private */
@@ -81,12 +82,9 @@ int xenstore_write_str(const char *base, const char *node, const char *val)
8182

8283
char *xenstore_read_str(const char *base, const char *node)
8384
{
84-
char abspath[XEN_BUFSIZE];
85-
unsigned int len;
8685
char *str, *ret = NULL;
8786

88-
snprintf(abspath, sizeof(abspath), "%s/%s", base, node);
89-
str = qemu_xen_xs_read(xenstore, 0, abspath, &len);
87+
str = xs_node_read(xenstore, 0, NULL, NULL, "%s/%s", base, node);
9088
if (str != NULL) {
9189
/* move to qemu-allocated memory to make sure
9290
* callers can safely g_free() stuff. */

0 commit comments

Comments
 (0)