--- nono/vm/virtio_block.cpp 2026/04/29 17:05:50 1.1.1.5 +++ nono/vm/virtio_block.cpp 2026/04/29 17:05:59 1.1.1.6 @@ -52,21 +52,24 @@ VirtIOBlockDevice::VirtIOBlockDevice(uin { id = id_; - // 短縮形 - AddAlias(string_format("vblk%u", id)); + // 割り込み名(とログ名) + snprintf(intrname, sizeof(intrname), "VIOBlk%u", id); + SetName(intrname); + ClearAlias(); + AddAlias(intrname); + + image.SetName(intrname); device_id = VirtIO::DEVICE_ID_BLOCK; int num_max = 32; vqueues.emplace_back(this, 0, "RequestQ", num_max); blocksize = 512; - // 割り込み名 - snprintf(intrname, sizeof(intrname), "VIOBlk%u", id); // 完了通知メッセージ msgid = MessageID::VIRTIO_BLOCK_DONE(id); monitor = gMonitorManager->Regist(ID_MONITOR_VIRTIO_BLOCK(id), this); - monitor->func = ToMonitorCallback(&VirtIOBlockDevice::MonitorUpdate); + monitor->SetCallback(&VirtIOBlockDevice::MonitorScreen); monitor->SetSize(MONITOR_WIDTH, 2 + 4 * 1 + num_max + 3); } @@ -87,13 +90,14 @@ VirtIOBlockDevice::Init() const std::string wikey = string_format("virtio-block%u-writeignore", id); // オープン前に writeignore をチェック。see scsidev.cpp - write_ignore = gConfig->Find(wikey).AsInt(); + write_ignore = gConfig->Find(wikey).AsBool(); // オープン (値が空ならここには来ない) const ConfigItem& itemimg = gConfig->Find(imgkey); assert(itemimg.AsString().empty() == false); std::string path = gMainApp.NormalizePath(itemimg.AsString()); if (LoadDisk(path) == false) { + itemimg.Err("Could not open %s", path.c_str()); return false; } @@ -167,17 +171,17 @@ VirtIOBlockDevice::LoadDisk(const std::s } void -VirtIOBlockDevice::MonitorUpdate(Monitor *, TextScreen& screen) +VirtIOBlockDevice::MonitorScreen(Monitor *, TextScreen& screen) { int y = 0; screen.Clear(); - y = MonitorUpdateDev(screen, y); + y = MonitorScreenDev(screen, y); y++; - y = MonitorUpdateVirtQueue(screen, y, vqueues[0]); + y = MonitorScreenVirtQueue(screen, y, vqueues[0]); y++; - y = MonitorUpdateVirtQDesc(screen, y, vqueues[0]); + y = MonitorScreenVirtQDesc(screen, y, vqueues[0]); } // ディスクリプタを一つ処理する。