hw/xen: Use xs_node_read() from xenstore_read_str() instead of open-coding it
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Anthony PERARD <anthony.perard@vates.tech> Acked-by: Roger Pau Monné <roger.pau@citrix.com>
This commit is contained in:
parent
e4e113ecc2
commit
cd414c3f56
@ -22,6 +22,7 @@
|
|||||||
#include "qemu/main-loop.h"
|
#include "qemu/main-loop.h"
|
||||||
#include "hw/qdev-core.h"
|
#include "hw/qdev-core.h"
|
||||||
#include "hw/xen/xen-legacy-backend.h"
|
#include "hw/xen/xen-legacy-backend.h"
|
||||||
|
#include "hw/xen/xen-bus-helper.h"
|
||||||
#include "hw/xen/xen_pvdev.h"
|
#include "hw/xen/xen_pvdev.h"
|
||||||
|
|
||||||
/* private */
|
/* private */
|
||||||
@ -81,12 +82,9 @@ int xenstore_write_str(const char *base, const char *node, const char *val)
|
|||||||
|
|
||||||
char *xenstore_read_str(const char *base, const char *node)
|
char *xenstore_read_str(const char *base, const char *node)
|
||||||
{
|
{
|
||||||
char abspath[XEN_BUFSIZE];
|
|
||||||
unsigned int len;
|
|
||||||
char *str, *ret = NULL;
|
char *str, *ret = NULL;
|
||||||
|
|
||||||
snprintf(abspath, sizeof(abspath), "%s/%s", base, node);
|
str = xs_node_read(xenstore, 0, NULL, NULL, "%s/%s", base, node);
|
||||||
str = qemu_xen_xs_read(xenstore, 0, abspath, &len);
|
|
||||||
if (str != NULL) {
|
if (str != NULL) {
|
||||||
/* move to qemu-allocated memory to make sure
|
/* move to qemu-allocated memory to make sure
|
||||||
* callers can safely g_free() stuff. */
|
* callers can safely g_free() stuff. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user