ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / in / incus / 1377-reverse.patch
blob860b8693271ce5fadfb1f785d7382c3592a1f1d1
1 --- b/internal/server/device/tpm.go
2 +++ a/internal/server/device/tpm.go
3 @@ -202,13 +202,11 @@
4 },
7 + proc, err := subprocess.NewProcess("swtpm", []string{"socket", "--tpm2", "--tpmstate", fmt.Sprintf("dir=%s", tpmDevPath), "--ctrl", fmt.Sprintf("type=unixio,path=%s", socketPath)}, "", "")
8 - proc, err := subprocess.NewProcess("swtpm", []string{"socket", "--tpm2", "--tpmstate", fmt.Sprintf("dir=%s", tpmDevPath), "--ctrl", fmt.Sprintf("type=unixio,path=swtpm-%s.sock", d.name)}, "", "")
9 if err != nil {
10 return nil, err
13 - proc.Cwd = tpmDevPath
15 // Start the TPM emulator.
16 err = proc.Start(context.Background())
17 if err != nil {
18 --- b/internal/server/instance/drivers/driver_qemu.go
19 +++ a/internal/server/instance/drivers/driver_qemu.go
20 @@ -3668,7 +3668,7 @@
22 // Add TPM device.
23 if len(runConf.TPMDevice) > 0 {
24 + err = d.addTPMDeviceConfig(&cfg, runConf.TPMDevice)
25 - err = d.addTPMDeviceConfig(&cfg, runConf.TPMDevice, fdFiles)
26 if err != nil {
27 return "", nil, err
29 @@ -4852,7 +4852,7 @@
30 return monHook, nil
33 +func (d *qemu) addTPMDeviceConfig(cfg *[]cfgSection, tpmConfig []deviceConfig.RunConfigItem) error {
34 -func (d *qemu) addTPMDeviceConfig(cfg *[]cfgSection, tpmConfig []deviceConfig.RunConfigItem, fdFiles *[]*os.File) error {
35 var devName, socketPath string
37 for _, tpmItem := range tpmConfig {
38 @@ -4863,16 +4863,9 @@
42 - fd, err := unix.Open(socketPath, unix.O_PATH, 0)
43 - if err != nil {
44 - return err
45 - }
47 - tpmFD := d.addFileDescriptor(fdFiles, os.NewFile(uintptr(fd), socketPath))
49 tpmOpts := qemuTPMOpts{
50 devName: devName,
51 + path: socketPath,
52 - path: fmt.Sprintf("/proc/self/fd/%d", tpmFD),
54 *cfg = append(*cfg, qemuTPM(&tpmOpts)...)
56 --- b/shared/subprocess/proc.go
57 +++ a/shared/subprocess/proc.go
58 @@ -27,7 +27,6 @@
59 Name string `yaml:"name"`
60 Args []string `yaml:"args,flow"`
61 Apparmor string `yaml:"apparmor"`
62 - Cwd string `yaml:"cwd"`
63 PID int64 `yaml:"pid"`
64 Stdin io.ReadCloser `yaml:"-"`
65 Stdout io.WriteCloser `yaml:"-"`
66 @@ -154,11 +153,6 @@
67 cmd.Stderr = p.Stderr
68 cmd.Stdin = p.Stdin
69 cmd.SysProcAttr = p.SysProcAttr
71 - if p.Cwd != "" {
72 - cmd.Dir = p.Cwd
73 - }
75 if cmd.SysProcAttr == nil {
76 cmd.SysProcAttr = &syscall.SysProcAttr{}