]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
xen/netfront: Introduce xen_pv_nics_disabled
authorJulien Grall <julien.grall@citrix.com>
Fri, 16 Oct 2015 18:26:35 +0000 (19:26 +0100)
committerJulien Grall <julien.grall@citrix.com>
Mon, 2 Nov 2015 11:46:55 +0000 (11:46 +0000)
ARM guest is considered as HVM in Freebsd but they only support PV nics
(no emulation available).

sys/dev/xen/netfront/netfront.c
sys/x86/include/xen/xen-os.h
sys/xen/xen-os.h

index dd1015d72d82e6d24af275bf0e352e07061987d7..7588956210e6e4ba8285687c15560926101af518 100644 (file)
@@ -390,7 +390,7 @@ static int
 netfront_probe(device_t dev)
 {
 
-       if (xen_hvm_domain() && xen_disable_pv_nics != 0)
+       if (xen_pv_nics_disabled())
                return (ENXIO);
 
        if (!strcmp(xenbus_get_type(dev), "vif")) {
index f9c05572cf704cba39451c84103c6fd0696fa68e..51c8815a4226497150ac67311331432ebb67356c 100644 (file)
@@ -61,6 +61,15 @@ xen_pv_disks_disabled(void)
        return (xen_hvm_domain() && xen_disable_pv_disks != 0);
 }
 
+extern int xen_disable_pv_nics;
+
+static inline bool
+xen_pv_nics_disabled(void)
+{
+
+       return (xen_hvm_domain() && xen_disable_pv_nics != 0);
+}
+
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _MACHINE_X86_XEN_XEN_OS_H_ */
index 70e804a409f9870970e3ad23d8f3507f8cf003be..79604899b1c44bf2daf05b9ca1deb57fbcf31d54 100644 (file)
@@ -53,8 +53,6 @@ extern start_info_t *HYPERVISOR_start_info;
 /* XXX: we need to get rid of this and use HYPERVISOR_start_info directly */
 extern char *console_page;
 
-extern int xen_disable_pv_nics;
-
 enum xen_domain_type {
        XEN_NATIVE,             /* running on bare hardware    */
        XEN_PV_DOMAIN,          /* running in a PV domain      */