The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/8099
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From db04ac666b7ecef2ef0a2d8b3bccded8004f4fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com> Date: Thu, 29 Oct 2020 21:47:57 -0400 Subject: [PATCH] lxd/instances: Fix virtiofsd for config drive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber <stgra...@ubuntu.com> --- lxd/instance/drivers/driver_qemu.go | 46 +++++++++++++++-------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go index 1de732a6d2..8b59e1ea5b 100644 --- a/lxd/instance/drivers/driver_qemu.go +++ b/lxd/instance/drivers/driver_qemu.go @@ -884,35 +884,37 @@ func (vm *qemu) Start(stateful bool) error { } } - // Start the virtiofsd process in non-daemon mode. - if cmd != "" { - proc, err := subprocess.NewProcess("/usr/lib/qemu/virtiofsd", []string{fmt.Sprintf("--socket-path=%s", sockPath), "-o", fmt.Sprintf("source=%s", filepath.Join(vm.Path(), "config"))}, "", "") - if err != nil { - return err - } + if cmd == "" { + return fmt.Errorf("Required binary 'virtiofsd' couldn't be found") + } - err = proc.Start() - if err != nil { - return err - } + // Start the virtiofsd process in non-daemon mode. + proc, err := subprocess.NewProcess(cmd, []string{fmt.Sprintf("--socket-path=%s", sockPath), "-o", fmt.Sprintf("source=%s", filepath.Join(vm.Path(), "config"))}, "", "") + if err != nil { + return err + } - revert.Add(func() { proc.Stop() }) + err = proc.Start() + if err != nil { + return err + } - pidPath := filepath.Join(vm.LogPath(), "virtiofsd.pid") + revert.Add(func() { proc.Stop() }) - err = proc.Save(pidPath) - if err != nil { - return err - } + pidPath := filepath.Join(vm.LogPath(), "virtiofsd.pid") - // Wait for socket file to exist - for i := 0; i < 10; i++ { - if shared.PathExists(sockPath) { - break - } + err = proc.Save(pidPath) + if err != nil { + return err + } - time.Sleep(50 * time.Millisecond) + // Wait for socket file to exist + for i := 0; i < 10; i++ { + if shared.PathExists(sockPath) { + break } + + time.Sleep(50 * time.Millisecond) } // Setup background process.
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel