xen-bus.c (4f65e89f8cf0e079b4ec3ddfede314bbb4e35c76) | xen-bus.c (523b6b3abac928ff3574d8a45df58d29bd8ae454) |
---|---|
1/* 2 * Copyright (c) 2018 Citrix Systems Inc. 3 * 4 * This work is licensed under the terms of the GNU GPL, version 2 or later. 5 * See the COPYING file in the top-level directory. 6 */ 7 8#include "qemu/osdep.h" --- 697 unchanged lines hidden (view full) --- 706 707 return (xen_device_frontend_scanf(xendev, "state", "%u", &state) == 1); 708} 709 710static void xen_device_frontend_create(XenDevice *xendev, Error **errp) 711{ 712 ERRP_GUARD(); 713 XenBus *xenbus = XEN_BUS(qdev_get_parent_bus(DEVICE(xendev))); | 1/* 2 * Copyright (c) 2018 Citrix Systems Inc. 3 * 4 * This work is licensed under the terms of the GNU GPL, version 2 or later. 5 * See the COPYING file in the top-level directory. 6 */ 7 8#include "qemu/osdep.h" --- 697 unchanged lines hidden (view full) --- 706 707 return (xen_device_frontend_scanf(xendev, "state", "%u", &state) == 1); 708} 709 710static void xen_device_frontend_create(XenDevice *xendev, Error **errp) 711{ 712 ERRP_GUARD(); 713 XenBus *xenbus = XEN_BUS(qdev_get_parent_bus(DEVICE(xendev))); |
714 XenDeviceClass *xendev_class = XEN_DEVICE_GET_CLASS(xendev); |
|
714 | 715 |
715 xendev->frontend_path = xen_device_get_frontend_path(xendev); | 716 if (xendev_class->get_frontend_path) { 717 xendev->frontend_path = xendev_class->get_frontend_path(xendev, errp); 718 if (!xendev->frontend_path) { 719 error_prepend(errp, "failed to create frontend: "); 720 return; 721 } 722 } else { 723 xendev->frontend_path = xen_device_get_frontend_path(xendev); 724 } |
716 717 /* 718 * The frontend area may have already been created by a legacy 719 * toolstack. 720 */ 721 if (!xen_device_frontend_exists(xendev)) { 722 g_assert(xenbus->xsh); 723 --- 405 unchanged lines hidden --- | 725 726 /* 727 * The frontend area may have already been created by a legacy 728 * toolstack. 729 */ 730 if (!xen_device_frontend_exists(xendev)) { 731 g_assert(xenbus->xsh); 732 --- 405 unchanged lines hidden --- |