|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 2/7] libxl: introduce an OS-specific function to get the physical-device
On Thu, Feb 25, 2016 at 08:25:13PM +0100, Roger Pau Monne wrote:
> Linux and NetBSD will return the device major and minor numbers encoded in
> hex and separated by a ":". FreeBSD on the other hand returns the path to
> the block device or image file.
>
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
The code looks sensible.
Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
The acceptance of the patch depends on whether we come to agreement to
use the node as proposed in patch #1.
> ---
> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
> Cc: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
> tools/libxl/libxl.c | 9 +++++----
> tools/libxl/libxl_freebsd.c | 6 ++++++
> tools/libxl/libxl_internal.h | 6 ++++++
> tools/libxl/libxl_linux.c | 10 ++++++++++
> tools/libxl/libxl_netbsd.c | 10 ++++++++++
> 5 files changed, 37 insertions(+), 4 deletions(-)
>
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 2d18b8d..6d719d7 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -2515,10 +2515,11 @@ static void device_disk_add(libxl__egc *egc, uint32_t
> domid,
> */
> if (!disk->script &&
> disk->backend_domid == LIBXL_TOOLSTACK_DOMID) {
> - int major, minor;
> - if (!libxl__device_physdisk_major_minor(dev, &major,
> &minor))
> - flexarray_append_pair(back, "physical-device",
> - GCSPRINTF("%x:%x", major,
> minor));
> + char *physdev;
> +
> + physdev = libxl__get_physical_device(dev);
> + if (physdev != NULL)
> + flexarray_append_pair(back, "physical-device",
> physdev);
> }
>
> assert(device->backend_kind == LIBXL__DEVICE_KIND_VBD);
> diff --git a/tools/libxl/libxl_freebsd.c b/tools/libxl/libxl_freebsd.c
> index 47c3391..483f36e 100644
> --- a/tools/libxl/libxl_freebsd.c
> +++ b/tools/libxl/libxl_freebsd.c
> @@ -143,3 +143,9 @@ int libxl__pci_topology_init(libxl__gc *gc,
> {
> return ERROR_NI;
> }
> +
> +char *libxl__get_physical_device(char *dev)
> +{
> +
No need to have this extra blank line.
Wei.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |