--- nono/host/hostnet.cpp 2026/04/29 17:05:51 1.1.1.10 +++ nono/host/hostnet.cpp 2026/04/29 17:05:55 1.1.1.11 @@ -77,6 +77,7 @@ #endif #if defined(HAVE_HOSTNET_SLIRP) #include "netdriver_slirp.h" +#include #endif #if defined(HAVE_HOSTNET_TAP) #include "netdriver_tap.h" @@ -109,6 +110,18 @@ HostNetDevice::GetDrivers() return list; } +// libslirp のバージョン文字列を返す。 +// libslirp が有効でなければ NULL を返す。 +/*static*/ const char * +HostNetDevice::GetSlirpVersion() +{ +#if defined(SLIRP_VERSION_STRING) + return SLIRP_VERSION_STRING; +#else + return NULL; +#endif +} + // コンストラクタ HostNetDevice::HostNetDevice(Device *parent_, uint n, @@ -159,16 +172,6 @@ HostNetDevice::Create2() return false; } - // hostnet*-fallback は使わなくなったので、 - // 初期値から変更されていれば警告だけ出す。 - std::string key = GetConfigKey(); - const std::string fallback_key = key + "-fallback"; - const ConfigItem& fallback_item = gConfig->Find(fallback_key); - if (fallback_item.GetFrom() != ConfigItem::FromInitial) { - warnx("Warning: option '%s' has been obsoleted.", - fallback_key.c_str()); - } - if (SelectDriver(true) == false) { return false; } @@ -622,7 +625,7 @@ HostNetDevice::Write() } // ドライバ名を返す -const std::string +const std::string& HostNetDevice::GetDriverName() { RWLockGuard_Read guard(driverlock); @@ -649,7 +652,8 @@ HostNetDevice::MonitorUpdate(Monitor *, screen.Print(0, 0, "Device(Port) : %s", GetPortName().c_str()); { RWLockGuard_Read guard(driverlock); - screen.Print(0, 1, "HostNet Driver: %s", driver->GetDriverName()); + screen.Print(0, 1, "HostNet Driver: %s", + driver->GetDriverName().c_str()); // 次の2行はドライバ依存情報 driver->MonitorUpdateMD(screen, 2); }