qemu/hw/xen/xen_devconfig.c
Dr. David Alan Gilbert abdfd6549d hw/xen: Remove deadcode
xen_be_copy_grant_refs is unused since 2019's
  19f87870ba ("xen: remove the legacy 'xen_disk' backend")

xen_config_dev_console is unused since 2018's
  6d7c06c213 ("Remove broken Xen PV domain builder")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <dave@treblig.org>
Acked-by: Anthony PERARD <anthony.perard@vates.tech>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
2024-10-03 15:24:42 +02:00

69 lines
1.9 KiB
C

#include "qemu/osdep.h"
#include "hw/xen/xen-legacy-backend.h"
#include "qemu/option.h"
#include "sysemu/blockdev.h"
#include "sysemu/sysemu.h"
/* ------------------------------------------------------------- */
static int xen_config_dev_dirs(const char *ftype, const char *btype, int vdev,
char *fe, char *be, int len)
{
char *dom;
dom = qemu_xen_xs_get_domain_path(xenstore, xen_domid);
snprintf(fe, len, "%s/device/%s/%d", dom, ftype, vdev);
free(dom);
dom = qemu_xen_xs_get_domain_path(xenstore, 0);
snprintf(be, len, "%s/backend/%s/%d/%d", dom, btype, xen_domid, vdev);
free(dom);
xenstore_mkdir(fe, XS_PERM_READ | XS_PERM_WRITE);
xenstore_mkdir(be, XS_PERM_READ);
return 0;
}
static int xen_config_dev_all(char *fe, char *be)
{
/* frontend */
if (xen_protocol)
xenstore_write_str(fe, "protocol", xen_protocol);
xenstore_write_int(fe, "state", XenbusStateInitialising);
xenstore_write_int(fe, "backend-id", 0);
xenstore_write_str(fe, "backend", be);
/* backend */
xenstore_write_str(be, "domain", qemu_name ? qemu_name : "no-name");
xenstore_write_int(be, "online", 1);
xenstore_write_int(be, "state", XenbusStateInitialising);
xenstore_write_int(be, "frontend-id", xen_domid);
xenstore_write_str(be, "frontend", fe);
return 0;
}
/* ------------------------------------------------------------- */
int xen_config_dev_vfb(int vdev, const char *type)
{
char fe[256], be[256];
xen_config_dev_dirs("vfb", "vfb", vdev, fe, be, sizeof(fe));
/* backend */
xenstore_write_str(be, "type", type);
/* common stuff */
return xen_config_dev_all(fe, be);
}
int xen_config_dev_vkbd(int vdev)
{
char fe[256], be[256];
xen_config_dev_dirs("vkbd", "vkbd", vdev, fe, be, sizeof(fe));
return xen_config_dev_all(fe, be);
}