--- nono/vm/v68kio.cpp 2026/04/29 17:05:29 1.1.1.2 +++ nono/vm/v68kio.cpp 2026/04/29 17:05:51 1.1.1.5 @@ -43,6 +43,7 @@ // $ff07'fe00-$ff07'ffff VirtIO (slot $7f) #include "v68kio.h" +#include "buserr.h" #include "busio.h" #include "config.h" #include "goldfish_pic.h" @@ -55,6 +56,7 @@ #include "virtio_block.h" #include "virtio_entropy.h" #include "virtio_net.h" +#include "virtio_scsi.h" #include "vm.h" // コンストラクタ @@ -126,8 +128,11 @@ V68kIODevice::Create() // Net if (true) { - pVirtIO[slot].reset(new BusIO_L(slot)); + try { + pVirtIO[slot].reset(new BusIO_L(slot)); + } catch (...) { } if ((bool)pVirtIO[slot] == false) { + warnx("Failed to initialize VirtIONetDevice at %s", __method__); return false; } viotable[slot] = pVirtIO[slot].get(); @@ -136,8 +141,11 @@ V68kIODevice::Create() // Entropy if (true) { - pVirtIO[slot].reset(new BusIO_L(slot)); + try { + pVirtIO[slot].reset(new BusIO_L(slot)); + } catch (...) { } if ((bool)pVirtIO[slot] == false) { + warnx("Failed to initialize VirtIOEntropyDevice at %s", __method__); return false; } viotable[slot] = pVirtIO[slot].get(); @@ -158,23 +166,27 @@ V68kIODevice::Create() continue; } - pVirtIO[slot].reset(new BusIO_L(slot, id)); + try { + pVirtIO[slot].reset(new BusIO_L(slot, id)); + } catch (...) { } if ((bool)pVirtIO[slot] == false) { - item.Err(); // ? + warnx("Failed to initialize VirtIOBlockDevice(%u) at %s", + id, __method__); return false; } viotable[slot] = pVirtIO[slot].get(); slot++; } - return true; -} - -bool -V68kIODevice::Init() -{ - if (inherited::Init() == false) { - return false; + // SCSI + if (true) { + pVirtIO[slot].reset(new BusIO_L(slot)); + if ((bool)pVirtIO[slot] == false) { + warnx("Failed to initialize VirtIOSCSIDevice at %s", __method__); + return false; + } + viotable[slot] = pVirtIO[slot].get(); + slot++; } return true;