From: Antti Kantee Date: Wed, 22 Apr 2015 10:51:09 +0000 (+0000) Subject: Use rumprun_config() instead of a homegrown interface. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a226e3db510a190b9f81e16244ae78cbf7a8c400;p=people%2Fliuw%2Frumprun.git Use rumprun_config() instead of a homegrown interface. We still do hackish configuration, but at least we do something. --- diff --git a/platform/baremetal/init.c b/platform/baremetal/init.c index fd3ba6c..bd92c6f 100644 --- a/platform/baremetal/init.c +++ b/platform/baremetal/init.c @@ -27,33 +27,10 @@ #include -#include -#include - #include #include -int bmk_havenet; - -/* - * boot and configure rump kernel - */ -static void -rumpkern_config(void) -{ - int rv = 1; - - /* le hack */ - if (rump_pub_netconfig_ifup("wm0") == 0) - rv = rump_pub_netconfig_dhcp_ipv4_oneshot("wm0"); - else if (rump_pub_netconfig_ifup("pcn0") == 0) - rv = rump_pub_netconfig_dhcp_ipv4_oneshot("pcn0"); - else if (rump_pub_netconfig_ifup("vioif0") == 0) - rv = rump_pub_netconfig_dhcp_ipv4_oneshot("vioif0"); - bmk_havenet = rv == 0; -} - void bmk_mainthread(void *notused) { @@ -61,7 +38,6 @@ bmk_mainthread(void *notused) int rv; _netbsd_init(); - rumpkern_config(); printf("=== calling main() ===\n\n"); rv = main(1, argv); diff --git a/platform/baremetal/rumpconfig.c b/platform/baremetal/rumpconfig.c index 6e32bac..4938cae 100644 --- a/platform/baremetal/rumpconfig.c +++ b/platform/baremetal/rumpconfig.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Martin Lucina. All Rights Reserved. + * Copyright (c) 2015 Antti Kantee. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,14 +23,29 @@ * SUCH DAMAGE. */ -/* placeholder/stubs (in case it was unguessable) */ +#include + +#include +#include #include +/* + * Does not exactly implement the config interface fully, but + * at least we might get network configuration ... + */ + void _rumprun_config(void) { + /* le hack */ + if (rump_pub_netconfig_ifup("wm0") == 0) + rump_pub_netconfig_dhcp_ipv4_oneshot("wm0"); + else if (rump_pub_netconfig_ifup("pcn0") == 0) + rump_pub_netconfig_dhcp_ipv4_oneshot("pcn0"); + else if (rump_pub_netconfig_ifup("vioif0") == 0) + rump_pub_netconfig_dhcp_ipv4_oneshot("vioif0"); } void