diff --git a/src/exec/QemuSystem.go b/src/exec/QemuSystem.go index cab58522388a2389f1d1525560ee99659a76a06d..13901637f8288036f964136114c2f5eb224a2904 100644 --- a/src/exec/QemuSystem.go +++ b/src/exec/QemuSystem.go @@ -78,16 +78,6 @@ func NewQemuSystem(qgaSock string, cpus, ram int, nic string, usbDevs []string, } } - // Remarks: - // 1) This device is to allow copy/paste between guest & client - // -device virtserialport,chardev=spicechannel0,name=com.redhat.spice.0 - // 2) For sound support: "-soundhw hda" - // 3) For shared folder with the host: - // - QEMU: virtfs local,path=/tmp/pipo,mount_tag=sharedfs,security_model=none - // - In the guest: mkdir shared && sudo mount -t 9p sharedfs shared - // 4) For QEMU Guest Agent support: - // -device virtio-serial -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 -chardev socket,path=path_to_sock_file,server=on,wait=off,id=qga0 - // Enable KVM args := []string{"-enable-kvm"} // CPU @@ -100,8 +90,10 @@ func NewQemuSystem(qgaSock string, cpus, ram int, nic string, usbDevs []string, args = append(args, "-vga", "virtio") // Virtio serial args = append(args, "-device", "virtio-serial-pci") - // Spice - args = append(args, "-object", "secret,id=sec,file="+secretPwdFile+",format=base64", "-spice", "tls-port="+strconv.Itoa(spicePort)+",password-secret=sec,x509-dir="+certDir, "-device", "virtserialport,chardev=spicechannel0,name=com.redhat.spice.0", "-chardev", "spicevmc,id=spicechannel0,name=vdagent") + // SPICE + args = append(args, "-object", "secret,id=sec,file="+secretPwdFile+",format=base64", "-spice", "tls-port="+strconv.Itoa(spicePort)+",password-secret=sec,x509-dir="+certDir, "-chardev", "spicevmc,id=spicechannel0,name=vdagent") + // SPICE: allows copy/paste between guest & client + args = append(args, "-device", "virtserialport,chardev=spicechannel0,name=com.redhat.spice.0") // Network args = append(args, "-nic", nicArgs) // QEMU Guest Agent @@ -110,8 +102,12 @@ func NewQemuSystem(qgaSock string, cpus, ram int, nic string, usbDevs []string, for _, u := range usb { args = append(args, u) } + // Sound support + // args = append(args, "-soundhw", "hda") - //cmd := exec.Command(qemusystemBinary, "-enable-kvm", "-cpu", "host", "-smp", "cpus="+strconv.Itoa(cpus), "-m", strconv.Itoa(ram), "-drive", "file="+diskFile+",index=0,media=disk,format=qcow2,discard=unmap,detect-zeroes=unmap,if=virtio", "-vga", "virtio", "-device", "virtio-serial-pci", "-object", "secret,id=sec,file="+secretPwdFile+",format=base64", "-spice", "tls-port="+strconv.Itoa(spicePort)+",password-secret=sec,x509-dir="+certDir, "-device", "virtserialport,chardev=spicechannel0,name=com.redhat.spice.0", "-chardev", "spicevmc,id=spicechannel0,name=vdagent", "-nic", nicArgs, "-device", "virtio-serial", "-device", "virtserialport,chardev=qga0,name=org.qemu.guest_agent.0", "-chardev", "socket,path="+qgaSock+",server=on,wait=off,id=qga0", usb) + // To share a folder with the host: + // - Add QEMU args: virtfs local,path=/tmp/pipo,mount_tag=sharedfs,security_model=none + // - In the guest: mkdir shared && sudo mount -t 9p sharedfs shared cmd := exec.Command(qemusystemBinary, args...) return cmd, nil diff --git a/src/router/routerVMs.go b/src/router/routerVMs.go index dfb38f58454463a2091280d315d01b42f1c40acb..909325c7eeb7549a87ac65ba31966ca505694bec 100644 --- a/src/router/routerVMs.go +++ b/src/router/routerVMs.go @@ -511,7 +511,7 @@ func (r *RouterVMs)performVMsList(c echo.Context, userCapabilityAny, vmAccessCap return c.JSONPretty(http.StatusOK, r.vms.GetNetworkSerializedVMs( func(vm vms.VM) bool { if vm.IsOwner(user.Email) { - return true + return cond(vm) } else { capabilities, exists := vm.Access[user.Email] if exists {