* fix(installer): use 8 KiB HFS+ catalog B-tree nodes for REIMSTOOLS image * feat(guesttools): support Windows-to-macOS window drag-and-drop (Agent v13) --------- Co-authored-by: Shroap <184123002+YinLiaoCo@users.noreply.github.com>
522 lines
16 KiB
Go
522 lines
16 KiB
Go
package app
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"io"
|
|
"os"
|
|
"path/filepath"
|
|
"strings"
|
|
"time"
|
|
|
|
"github.com/Nwflower/reims-go/internal/driver"
|
|
"github.com/Nwflower/reims-go/internal/host"
|
|
"github.com/Nwflower/reims-go/internal/macos/guest"
|
|
"github.com/Nwflower/reims-go/internal/macos/macosdriver"
|
|
"github.com/Nwflower/reims-go/internal/macos/reims"
|
|
"github.com/Nwflower/reims-go/internal/plugin"
|
|
"github.com/Nwflower/reims-go/internal/plugin/builtin"
|
|
"github.com/Nwflower/reims-go/internal/qmp"
|
|
"github.com/Nwflower/reims-go/internal/vmstart"
|
|
wailsRuntime "github.com/wailsapp/wails/v2/pkg/runtime"
|
|
)
|
|
|
|
const (
|
|
vmExitWaitTimeout = 12 * time.Second
|
|
vmMemoryReclaimWaitTimeout = 15 * time.Second
|
|
)
|
|
|
|
func (a *App) cachedVMPID(name string) int {
|
|
a.mu.Lock()
|
|
defer a.mu.Unlock()
|
|
for _, vm := range a.lastVMs {
|
|
if vm.Name == name && vm.State == "running" && vm.PID != nil && *vm.PID > 0 {
|
|
return *vm.PID
|
|
}
|
|
}
|
|
return 0
|
|
}
|
|
|
|
func (a *App) waitForVMProcessExit(ctx context.Context, pid int, timeout time.Duration) {
|
|
if pid <= 0 || timeout <= 0 {
|
|
return
|
|
}
|
|
waitCtx, cancel := context.WithTimeout(ctx, timeout)
|
|
defer cancel()
|
|
_ = host.WaitProcessExit(waitCtx, uint32(pid), qemuImage)
|
|
}
|
|
|
|
func (a *App) waitForCommitMemoryReclaim(ctx context.Context, c *reims.Client, name, logPrefix string) {
|
|
if ctx.Err() != nil || c == nil {
|
|
return
|
|
}
|
|
detail, err := c.Show(ctx, name)
|
|
if err != nil || detail.Memory == "" {
|
|
return
|
|
}
|
|
vmstart.WaitForCommitMemory(ctx, detail.Memory, vmMemoryReclaimWaitTimeout, func(availGB, neededGB float64) {
|
|
a.emitVMLog(name, fmt.Sprintf("%s: waiting for Windows to release VM memory (available %.1f GB, need %.1f GB)...", logPrefix, availGB, neededGB))
|
|
})
|
|
}
|
|
|
|
func (a *App) cancelRebootWatcher(name string) { a.cancelRebootWatcherKey(vmKey(name)) }
|
|
|
|
func (a *App) cancelRebootWatcherKey(key string) {
|
|
a.mu.Lock()
|
|
if entry, ok := a.rebootWatchers[key]; ok {
|
|
entry.cancel()
|
|
delete(a.rebootWatchers, key)
|
|
}
|
|
a.mu.Unlock()
|
|
}
|
|
|
|
func (a *App) watchWin10ColdReboot(name, qmpAddr string) {
|
|
a.cancelRebootWatcher(name)
|
|
baseCtx := a.ctx
|
|
if baseCtx == nil {
|
|
baseCtx = context.Background()
|
|
}
|
|
watchCtx, cancel := context.WithCancel(baseCtx)
|
|
a.mu.Lock()
|
|
a.nextWatcherID++
|
|
myID := a.nextWatcherID
|
|
a.rebootWatchers[vmKey(name)] = rebootWatcherEntry{id: myID, cancel: cancel}
|
|
a.mu.Unlock()
|
|
|
|
go func() {
|
|
defer func() {
|
|
cancel()
|
|
a.mu.Lock()
|
|
if cur, ok := a.rebootWatchers[vmKey(name)]; ok && cur.id == myID {
|
|
delete(a.rebootWatchers, vmKey(name))
|
|
}
|
|
a.mu.Unlock()
|
|
}()
|
|
|
|
reason, err := qmp.WatchShutdownReason(watchCtx, qmpAddr)
|
|
if err != nil {
|
|
if watchCtx.Err() == nil {
|
|
a.emitVMLog(name, "Win10 WHPX cold-reboot monitor disconnected: "+err.Error())
|
|
}
|
|
return
|
|
}
|
|
if reason != "guest-reset" {
|
|
if reason != "" {
|
|
a.emitVMLog(name, "Win10 WHPX cold-reboot: VM exited ("+reason+"), not restarting")
|
|
}
|
|
return
|
|
}
|
|
a.mu.Lock()
|
|
tr := a.transitions[vmKey(name)]
|
|
a.mu.Unlock()
|
|
if tr == "stopping" || tr == "suspending" {
|
|
return
|
|
}
|
|
|
|
a.emitVMLog(name, "Win10 WHPX cold-reboot: guest requested reboot (guest-reset), restarting in a fresh Hyper-V partition...")
|
|
oldPID := a.cachedVMPID(name)
|
|
c, err := a.client()
|
|
if err != nil {
|
|
a.emitVMLog(name, "Win10 WHPX cold-reboot aborted: "+err.Error())
|
|
return
|
|
}
|
|
// Wait for QEMU to finish exiting cleanly under -no-reboot. Wait on the
|
|
// OS process handle when known so we don't race against QEMU teardown
|
|
// even if `reims-ctl list` reports stopped early.
|
|
deadline := time.Now().Add(vmExitWaitTimeout)
|
|
waitedPID := 0
|
|
if oldPID > 0 {
|
|
a.waitForVMProcessExit(watchCtx, oldPID, time.Until(deadline))
|
|
waitedPID = oldPID
|
|
}
|
|
for time.Now().Before(deadline) {
|
|
if watchCtx.Err() != nil {
|
|
return
|
|
}
|
|
vms, err := c.List(watchCtx)
|
|
if err == nil {
|
|
stopped := false
|
|
for _, vm := range vms {
|
|
if vm.Name != name {
|
|
continue
|
|
}
|
|
if vm.PID != nil && *vm.PID > 0 && oldPID == 0 {
|
|
oldPID = *vm.PID
|
|
}
|
|
if vm.State == "stopped" {
|
|
stopped = true
|
|
}
|
|
break
|
|
}
|
|
if stopped {
|
|
break
|
|
}
|
|
if oldPID > 0 && oldPID != waitedPID {
|
|
a.waitForVMProcessExit(watchCtx, oldPID, time.Until(deadline))
|
|
waitedPID = oldPID
|
|
continue
|
|
}
|
|
}
|
|
select {
|
|
case <-watchCtx.Done():
|
|
return
|
|
case <-time.After(300 * time.Millisecond):
|
|
}
|
|
}
|
|
if oldPID > 0 && oldPID != waitedPID {
|
|
a.waitForVMProcessExit(watchCtx, oldPID, time.Until(deadline))
|
|
}
|
|
if watchCtx.Err() != nil {
|
|
return
|
|
}
|
|
a.waitForCommitMemoryReclaim(watchCtx, c, name, "Win10 WHPX cold-reboot")
|
|
if watchCtx.Err() != nil {
|
|
return
|
|
}
|
|
if err := a.StartVMWithDriver(driver.BuiltinReimsMacOSDriverID, name); err != nil {
|
|
a.emitVMLog(name, "Win10 WHPX cold-reboot start failed: "+err.Error())
|
|
}
|
|
}()
|
|
}
|
|
|
|
// stripLegacyManagedExtraArgs removes reims-go internally managed QEMU arg
|
|
// fragments (reimstools, reimshelp, and legacy managed Win10 QMP targets)
|
|
// before ledger reconciliation so pre-plugin VMs and out-of-band helpers never
|
|
// produce duplicate QEMU device IDs on upgrade.
|
|
func stripLegacyManagedExtraArgs(extraArgs string) string {
|
|
s := reims.StripGuestToolsArgs(extraArgs)
|
|
s = reims.StripOfflineHelperArgs(s)
|
|
s = qmp.StripLegacyWin10RebootArgs(s)
|
|
s = reims.StripIncomingDeferArgs(s)
|
|
return strings.TrimSpace(s)
|
|
}
|
|
|
|
func (a *App) startVMLegacy(name string) error {
|
|
if err := a.requireWritableDataRoot(); err != nil {
|
|
return err
|
|
}
|
|
prep, err := a.prep(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
c := prep.Client
|
|
a.mu.Lock()
|
|
root := a.cfg.DataRoot
|
|
tmpDir := a.cfg.TempDir()
|
|
locale := a.cfg.Locale
|
|
a.mu.Unlock()
|
|
rep := host.Inspect(root)
|
|
if err := prep.CheckWHPX(rep); err != nil {
|
|
a.emitVMLog(name, "Start refused: "+err.Error())
|
|
return err
|
|
}
|
|
curDetail, _ := c.Show(context.Background(), name)
|
|
if err := prep.CheckMemory(curDetail.Memory, rep); err != nil {
|
|
a.emitVMLog(name, "Start refused: "+err.Error())
|
|
return err
|
|
}
|
|
a.cancelRebootWatcher(name)
|
|
|
|
a.mu.Lock()
|
|
mgr := a.pluginMgr
|
|
a.mu.Unlock()
|
|
var qmpAddr string
|
|
if mgr != nil {
|
|
// Unified plugin-kernel start pipeline (§4.4): collect all vm.beforeStart
|
|
// intents (builtin + L1 rule hooks + L3 code hooks) and write merged
|
|
// extra-args via AT MOST ONE `reims-ctl set --extra-args` call.
|
|
rtCaps := prep.Runtime.Manifest.EffectiveCapabilities()
|
|
intents, blockErr := mgr.Registry().Hooks().DispatchBeforeStart(context.Background(), plugin.BeforeStartPayload{
|
|
VMName: name,
|
|
VMDir: curDetail.Directory,
|
|
DriverID: builtin.IDDriverReimsMacOS,
|
|
ExtraArgs: curDetail.ExtraArgs,
|
|
HasInstaller: curDetail.HasInstaller,
|
|
InstallerPath: curDetail.InstallerPath,
|
|
RuntimeKind: prep.Runtime.Manifest.EffectiveKind(),
|
|
RuntimeCaps: rtCaps,
|
|
HostFacts: buildHostFacts(rep, rtCaps),
|
|
VMCaps: macosdriver.ReimsMacOSCapabilities,
|
|
State: curDetail.State,
|
|
})
|
|
if blockErr != nil {
|
|
a.emitVMLog(name, "Start blocked: "+blockErr.Error())
|
|
return blockErr
|
|
}
|
|
ledger, ledgerErr := plugin.LoadArgLedger(curDetail.Directory)
|
|
if ledgerErr != nil {
|
|
a.emitVMLog(name, "Warning: could not read arg ledger: "+ledgerErr.Error())
|
|
ledger = &plugin.ArgLedger{Version: 1, Owners: map[string][]plugin.ArgFragment{}}
|
|
}
|
|
// Reassign macOS-owned fragments from legacy builtin.core records to
|
|
// builtin.guest.macos before reconciling.
|
|
guest.MigrateLedger(ledger)
|
|
// Strip pre-ledger or out-of-band managed fragments so upgrading existing
|
|
// VMs never duplicates QEMU device IDs.
|
|
baseExtraArgs := stripLegacyManagedExtraArgs(curDetail.ExtraArgs)
|
|
nested := plugin.StartIntent{PluginID: builtin.IDDriverReimsMacOS}
|
|
macosdriver.AppendNestedVirtIntent(&nested, locale, curDetail.Directory, plugin.UserExtraArgs(baseExtraArgs, ledger), rep)
|
|
reconciled := plugin.ReconcileStartIntentsForDriver(baseExtraArgs, ledger, mgr.Registry().ActivePluginIDs(), nested.PluginID, append(intents, nested))
|
|
reconciled.Changed = strings.TrimSpace(curDetail.ExtraArgs) != reconciled.ExtraArgs
|
|
for _, warn := range reconciled.Warnings {
|
|
a.emitVMLog(name, "[plugin] "+warn)
|
|
}
|
|
if len(reconciled.Env) > 0 {
|
|
c.Env = append(c.Env, reconciled.Env...)
|
|
}
|
|
if reconciled.Changed {
|
|
if err := c.Set(context.Background(), reims.SetOpts{Name: name, ExtraArgs: &reconciled.ExtraArgs}, io.Discard, io.Discard); err != nil {
|
|
a.emitVMLog(name, "Warning: could not apply reconciled start extra-args: "+err.Error())
|
|
} else {
|
|
curDetail.ExtraArgs = reconciled.ExtraArgs
|
|
_ = plugin.SaveArgLedger(curDetail.Directory, ledger)
|
|
}
|
|
} else {
|
|
_ = plugin.SaveArgLedger(curDetail.Directory, ledger)
|
|
}
|
|
for _, act := range reconciled.PostStart {
|
|
if act.Kind == "qmp.watch_cold_reboot" {
|
|
if addr, ok := act.Params["qmp_addr"].(string); ok && addr != "" {
|
|
qmpAddr = addr
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
a.syncGuestTools(c, name, &curDetail, a.vmDeleteEpoch(name))
|
|
if prep.Runtime.Manifest.HasCapability("win32-unicode-input") {
|
|
if env := a.inputBridgeEnv(name, curDetail.Directory, a.vmDeleteEpoch(name)); len(env) > 0 {
|
|
c.Env = append(c.Env, env...)
|
|
}
|
|
}
|
|
if prep.Runtime.Manifest.HasCapability("window-file-drop") {
|
|
c.Env = append(c.Env, a.dropBridgeEnv(name, curDetail.Directory, a.vmDeleteEpoch(name))...)
|
|
}
|
|
prep.Prepare(context.Background(), name, rep, &curDetail)
|
|
if rep.NeedsColdRebootWorkaround {
|
|
sockPath := qmp.RebootSocketPath(curDetail.Directory, tmpDir, name)
|
|
_ = os.MkdirAll(filepath.Dir(sockPath), 0o755)
|
|
_ = os.Remove(sockPath)
|
|
merged := qmp.MergeWin10RebootUnixArgs(curDetail.ExtraArgs, sockPath)
|
|
if err := c.Set(context.Background(), reims.SetOpts{Name: name, ExtraArgs: &merged}, io.Discard, io.Discard); err != nil {
|
|
a.emitVMLog(name, "Win10 cold-reboot extra-args setup skipped: "+err.Error())
|
|
} else {
|
|
qmpAddr = "unix:" + sockPath
|
|
curDetail.ExtraArgs = merged
|
|
}
|
|
}
|
|
ledger, err := plugin.LoadArgLedger(curDetail.Directory)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
nested := plugin.StartIntent{PluginID: builtin.IDDriverReimsMacOS}
|
|
macosdriver.AppendNestedVirtIntent(&nested, locale, curDetail.Directory, plugin.UserExtraArgs(curDetail.ExtraArgs, ledger), rep)
|
|
reconciled := plugin.ReconcileStartIntentsForDriver(curDetail.ExtraArgs, ledger, nil, nested.PluginID, []plugin.StartIntent{nested})
|
|
for _, warning := range reconciled.Warnings {
|
|
a.emitVMLog(name, warning)
|
|
}
|
|
if reconciled.Changed {
|
|
if err := c.Set(context.Background(), reims.SetOpts{Name: name, ExtraArgs: &reconciled.ExtraArgs}, io.Discard, io.Discard); err != nil {
|
|
return err
|
|
}
|
|
if err := plugin.SaveArgLedger(curDetail.Directory, ledger); err != nil {
|
|
return err
|
|
}
|
|
curDetail.ExtraArgs = reconciled.ExtraArgs
|
|
}
|
|
}
|
|
|
|
if prep.Runtime.Manifest.HasCapability("display-fixed-mode") &&
|
|
vmstart.UsesFixedGuestMode(curDetail.Directory, rep.Displays, curDetail.Borderless, curDetail.Resolution) {
|
|
c.Env = append(c.Env, "REIMS_VGPU_WINDOW_FIXED_MODE=1")
|
|
}
|
|
if prep.Runtime.Manifest.HasCapability("client-window-close") {
|
|
c.Env = append(c.Env, vmstart.CloseRequestEnv(name)...)
|
|
}
|
|
|
|
a.mu.Lock()
|
|
a.transitions[vmKey(name)] = "starting"
|
|
delete(a.pendingChanges, vmKey(name))
|
|
a.mu.Unlock()
|
|
wailsRuntime.EventsEmit(a.ctx, "reims:state-changed", true)
|
|
|
|
startAt := time.Now()
|
|
a.emitStartSummary(name, vmInfoFromMacOSDetail(curDetail), rep, qmpAddr)
|
|
w := vmstart.LineWriter(func(line string) { a.emitVMLog(name, line) })
|
|
a.emitVMLog(name, "Starting "+name+"...")
|
|
if err := c.StartWithCompat(context.Background(), name, w, w, func(msg string) {
|
|
a.emitVMLog(name, msg)
|
|
}); err != nil {
|
|
a.mu.Lock()
|
|
delete(a.transitions, vmKey(name))
|
|
a.mu.Unlock()
|
|
a.emitVMLog(name, "Start error: "+err.Error())
|
|
wailsRuntime.EventsEmit(a.ctx, "reims:state-changed", true)
|
|
return err
|
|
}
|
|
if qmpAddr != "" && mgr == nil {
|
|
a.watchWin10ColdReboot(name, qmpAddr)
|
|
}
|
|
if mgr != nil {
|
|
mgr.Registry().Hooks().DispatchObserve(plugin.EventVMAfterStart, plugin.VMEventPayload{
|
|
VMName: name,
|
|
VMDir: curDetail.Directory,
|
|
DriverID: builtin.IDDriverReimsMacOS,
|
|
QMPAddr: qmpAddr,
|
|
})
|
|
}
|
|
a.startVMMonitor(name, vmInfoFromMacOSDetail(curDetail), startAt)
|
|
a.wakePoll()
|
|
wailsRuntime.EventsEmit(a.ctx, "reims:state-changed", true)
|
|
return nil
|
|
}
|
|
|
|
func (a *App) stopVMLegacy(name string, force bool) error {
|
|
return a.stopVMLegacyCtx(context.Background(), name, force)
|
|
}
|
|
|
|
func (a *App) stopVMLegacyCtx(ctx context.Context, name string, force bool) error {
|
|
c, err := a.client()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
a.cancelRebootWatcher(name)
|
|
stopVMMonitor(name)
|
|
a.mu.Lock()
|
|
mgr := a.pluginMgr
|
|
a.transitions[vmKey(name)] = "stopping"
|
|
a.mu.Unlock()
|
|
if mgr != nil {
|
|
mgr.Registry().Hooks().DispatchObserve(plugin.EventVMBeforeStop, plugin.VMEventPayload{
|
|
VMName: name,
|
|
DriverID: builtin.IDDriverReimsMacOS,
|
|
})
|
|
}
|
|
wailsRuntime.EventsEmit(a.ctx, "reims:state-changed", true)
|
|
|
|
w := vmstart.LineWriter(func(line string) { a.emitVMLog(name, line) })
|
|
a.emitVMLog(name, fmt.Sprintf("Stopping %s (force=%v)...", name, force))
|
|
if force {
|
|
err = c.StopForce(ctx, name, w, w)
|
|
} else {
|
|
err = c.Stop(ctx, name, w, w)
|
|
}
|
|
if err != nil {
|
|
a.mu.Lock()
|
|
delete(a.transitions, vmKey(name))
|
|
a.mu.Unlock()
|
|
a.emitVMLog(name, "Stop error: "+err.Error())
|
|
return err
|
|
}
|
|
a.mu.Lock()
|
|
delete(a.pendingChanges, vmKey(name))
|
|
a.mu.Unlock()
|
|
if mgr != nil {
|
|
mgr.Registry().Hooks().DispatchObserve(plugin.EventVMAfterStop, plugin.VMEventPayload{
|
|
VMName: name,
|
|
DriverID: builtin.IDDriverReimsMacOS,
|
|
})
|
|
}
|
|
a.wakePoll()
|
|
wailsRuntime.EventsEmit(a.ctx, "reims:state-changed", true)
|
|
return nil
|
|
}
|
|
|
|
func (a *App) RestartVM(name string) error { return a.RestartVMWithDriver("", name) }
|
|
|
|
// restartMacOSVM restarts a built-in macOS VM, waiting for the old QEMU
|
|
// process and its committed memory to go away before starting again.
|
|
func (a *App) restartMacOSVM(name string) (stopped bool, err error) {
|
|
oldPID := a.cachedVMPID(name)
|
|
if err := a.StopVMWithDriver(driver.BuiltinReimsMacOSDriverID, name, false); err != nil {
|
|
return false, err
|
|
}
|
|
ctx := a.baseCtx()
|
|
a.waitForVMProcessExit(ctx, oldPID, vmExitWaitTimeout)
|
|
if c, err := a.client(); err == nil {
|
|
a.waitForCommitMemoryReclaim(ctx, c, name, "Restart")
|
|
}
|
|
if err := ctx.Err(); err != nil {
|
|
return true, err
|
|
}
|
|
return true, a.StartVMWithDriver(driver.BuiltinReimsMacOSDriverID, name)
|
|
}
|
|
|
|
func (a *App) ejectInstallerLegacy(name string) error {
|
|
c, err := a.client()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
w := vmstart.LineWriter(func(line string) { a.emitVMLog(name, line) })
|
|
a.emitVMLog(name, "Ejecting installer from "+name+"...")
|
|
if err := c.Eject(context.Background(), name, w, w); err != nil {
|
|
a.emitVMLog(name, "Eject error: "+err.Error())
|
|
return err
|
|
}
|
|
a.emitVMLog(name, "Installer ejected.")
|
|
wailsRuntime.EventsEmit(a.ctx, "reims:state-changed", true)
|
|
return nil
|
|
}
|
|
|
|
func (a *App) deleteVMLegacy(name string, keepFiles bool) error {
|
|
c, err := a.client()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
a.cancelRebootWatcher(name)
|
|
stopVMMonitor(name)
|
|
w := vmstart.LineWriter(func(line string) { a.emitVMLog(name, line) })
|
|
a.emitVMLog(name, fmt.Sprintf("Deleting VM %s (keepFiles=%v)...", name, keepFiles))
|
|
if err := c.Delete(context.Background(), name, keepFiles, w, w); err != nil {
|
|
a.emitVMLog(name, "Delete error: "+err.Error())
|
|
return err
|
|
}
|
|
a.mu.Lock()
|
|
delete(a.pendingChanges, vmKey(name))
|
|
delete(a.transitions, vmKey(name))
|
|
delete(a.diskPaths, vmKey(name))
|
|
delete(a.procSamples, vmKey(name))
|
|
gt := a.guestTools
|
|
a.mu.Unlock()
|
|
releaseVMTyping(name)
|
|
releaseVMThumbnail(name)
|
|
if gt != nil {
|
|
gt.UnregisterVM(name)
|
|
}
|
|
a.mu.Lock()
|
|
delMgr := a.pluginMgr
|
|
a.mu.Unlock()
|
|
if delMgr != nil {
|
|
delMgr.Registry().Hooks().DispatchObserve(plugin.EventVMDeleted, plugin.VMEventPayload{
|
|
VMName: name,
|
|
DriverID: builtin.IDDriverReimsMacOS,
|
|
})
|
|
}
|
|
a.wakePoll()
|
|
wailsRuntime.EventsEmit(a.ctx, "reims:state-changed", true)
|
|
return nil
|
|
}
|
|
|
|
// OpenVMFolder shows the VM's directory in File Explorer.
|
|
func (a *App) OpenVMFolder(name string) error {
|
|
d, err := a.GetVMDetail(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if d.Directory == "" {
|
|
return fmt.Errorf("VM %s has no directory", name)
|
|
}
|
|
return host.OpenFolder(d.Directory)
|
|
}
|
|
|
|
func (a *App) ReadVMLogs(name string, serial bool) (string, error) {
|
|
return a.ReadVMLogsWithDriver("", name, serial)
|
|
}
|
|
|
|
func (a *App) readVMLogsLegacy(name string, serial bool) (string, error) {
|
|
c, err := a.client()
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
return c.ReadLogs(context.Background(), name, serial)
|
|
}
|