]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Revert "qemu: allow passt to self-daemonize"
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 13 Feb 2023 09:25:51 +0000 (10:25 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Feb 2023 15:21:26 +0000 (16:21 +0100)
This reverts commit 0c4e716835eaf2a575bd063fde074c0fc7c4e4d4.

This patch was pushed by my mistake. Even though it got ACKed on
the list, I've raised couple of issues with it. They will be
fixed in next commits.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/qemu/qemu_passt.c

index f640a69c0049d59983e7922f9db3aa1ad697245c..0f09bf3db86a031390cd3699a697a7c4b4cfd702 100644 (file)
@@ -141,23 +141,24 @@ qemuPasstStart(virDomainObj *vm,
     g_autofree char *passtSocketName = qemuPasstCreateSocketPath(vm, net);
     g_autoptr(virCommand) cmd = NULL;
     g_autofree char *pidfile = qemuPasstCreatePidFilename(vm, net);
-    g_autofree char *errbuf = NULL;
     char macaddr[VIR_MAC_STRING_BUFLEN];
     size_t i;
     pid_t pid = (pid_t) -1;
     int exitstatus = 0;
     int cmdret = 0;
+    VIR_AUTOCLOSE errfd = -1;
 
     cmd = virCommandNew(PASST);
 
     virCommandClearCaps(cmd);
-    virCommandSetErrorBuffer(cmd, &errbuf);
+    virCommandSetPidFile(cmd, pidfile);
+    virCommandSetErrorFD(cmd, &errfd);
+    virCommandDaemonize(cmd);
 
     virCommandAddArgList(cmd,
                          "--one-off",
                          "--socket", passtSocketName,
                          "--mac-addr", virMacAddrFormat(&net->mac, macaddr),
-                         "--pid", pidfile,
                          NULL);
 
     if (net->mtu) {
@@ -263,7 +264,7 @@ qemuPasstStart(virDomainObj *vm,
 
     if (cmdret < 0 || exitstatus != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not start 'passt': %s"), errbuf);
+                       _("Could not start 'passt'. exitstatus: %d"), exitstatus);
         goto error;
     }