From: Wen Congyang Date: Mon, 22 Sep 2014 05:59:16 +0000 (+0800) Subject: tools: libxl: read nictype from xenstore X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4390 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=498da5bf3d41e1155c98e9cff3090b114d837fc9;p=xen.git tools: libxl: read nictype from xenstore We need to use nictype to get default vifname. Signed-off-by: Wen Congyang Acked-by: Ian Campbell --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index f796da8e61..77672d06ba 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -3348,7 +3348,13 @@ static int libxl__device_nic_from_xs_be(libxl__gc *gc, nic->script = READ_BACKEND(NOGC, "script"); /* vif_ioemu nics use the same xenstore entries as vif interfaces */ - nic->nictype = LIBXL_NIC_TYPE_VIF; + tmp = READ_BACKEND(gc, "type"); + if (tmp) { + rc = libxl_nic_type_from_string(tmp, &nic->nictype); + if (rc) goto out; + } else { + nic->nictype = LIBXL_NIC_TYPE_VIF; + } nic->model = NULL; /* XXX Only for TYPE_IOEMU */ nic->ifname = NULL; /* XXX Only for TYPE_IOEMU */