--- nono/vm/scsidev.cpp 2026/04/29 17:04:50 1.1.1.8 +++ nono/vm/scsidev.cpp 2026/04/29 17:04:56 1.1.1.10 @@ -15,7 +15,8 @@ // // コンストラクタ -SCSIDevice::SCSIDevice() +SCSIDevice::SCSIDevice(const std::string& objname_) + : inherited(objname_) { } @@ -29,7 +30,8 @@ SCSIDevice::~SCSIDevice() // // コンストラクタ -SCSIHostDevice::SCSIHostDevice() +SCSIHostDevice::SCSIHostDevice(const std::string& objname_) + : inherited(objname_) { devtype = SCSI::DevType::Initiator; @@ -701,11 +703,10 @@ class SCSICmdNotSupportedCommand : publi // // コンストラクタ -SCSITarget::SCSITarget(SCSIHostDevice *h, int id, std::vector& inq) +SCSITarget::SCSITarget(const std::string& objname_, + SCSIHostDevice *h, int id, std::vector& inq) + : inherited(objname_) { - logname = "scsitarget"; - devname = "SCSITarget"; - inquiry_data = inq; // ホストへのリンク (所有関係のないポインタ) host = h; @@ -717,6 +718,20 @@ SCSITarget::~SCSITarget() { } +// 電源オン +bool +SCSITarget::PowerOn() +{ + ClearSense(); + cmdseq.clear(); + cmdlen = 0; + cmd.reset(); + bytecount = 0; + lastbyte = false; + + return true; +} + // バスリセットされた (SCSIBus から呼ばれる) void SCSITarget::BusResetCB() @@ -1018,9 +1033,10 @@ SCSITarget::DispatchCmd() // コンストラクタ SCSIHD::SCSIHD(SCSIHostDevice *h, int id) - : inherited(h, id, inquiry_data) + : inherited(string_format("SCSIHD%d", id), h, id, inquiry_data) { - devname = "SCSIHD"; + AddAlias(string_format("HD%d", id)); + devtype = SCSI::DevType::HD; }