Re: [PATCH] Split all QEMU process mangement code into separate file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jan 29, 2011 at 11:41:33AM -0700, Eric Blake wrote:
> On 01/28/2011 06:21 AM, Daniel P. Berrange wrote:
> > -static int qemudStartVMDaemon(virConnectPtr conn,
> > -                              struct qemud_driver *driver,
> ...
> 
> > -    if (!(cmd = qemuBuildCommandLine(conn, driver, vm->def, priv->monConfig,
> > -                                     priv->monJSON != 0, qemuCmdFlags,
> > -                                     migrateFrom, stdin_fd,
> > -                                     vm->current_snapshot, vmop)))
> > -        goto cleanup;
> > -
> > -    if (qemuDomainSnapshotSetCurrentInactive(vm, driver->snapshotDir) < 0)
> > -        goto cleanup;
> 
> Why was the SetCurrentInactive line commented out in the move?

It is already invoked in the caller, so it should be redundant
here, and it causes a circular dependency if we leave it in.

> > +static void
> > +qemuProcessReconnect(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaque)
> > +{
> 
> > +    if (virDomainObjUnref(obj) > 0) {
> > +        /* We can't get the monitor back, so must kill the VM
> > +         * to remove danger of it ending up running twice if
> > +         * user tries to start it again later */
> > +        qemudShutdownVMDaemon(driver, obj, 0);
> 
> Wouldn't this cause a compile error, since you renamed the function to
> qemuProcessStop?  Indeed:
> 
> cc1: warnings being treated as errors
> qemu/qemu_process.c: In function 'qemuProcessReconnect':
> qemu/qemu_process.c:1854:9: error: implicit declaration of function
> 'qemudShutdownVMDaemon' [-Wimplicit-function-declaration]
> qemu/qemu_process.c:1854:9: error: nested extern declaration of
> 'qemudShutdownVMDaemon' [-Wnested-externs]
> qemu/qemu_process.c: In function 'qemuProcessStart':
> qemu/qemu_process.c:1949:9: error: implicit declaration of function
> 'fstat' [-Wimplicit-function-declaration]
> qemu/qemu_process.c:1949:9: error: nested extern declaration of 'fstat'
> [-Wnested-externs]
> qemu/qemu_process.c:1954:9: error: implicit declaration of function
> 'S_ISFIFO' [-Wimplicit-function-declaration]
> qemu/qemu_process.c:1954:9: error: nested extern declaration of
> 'S_ISFIFO' [-Wnested-externs]

This is a result of rebasing just before posting it. The fixes
are trivial

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 1e3dea2..76c48dd 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -24,6 +24,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <signal.h>
+#include <sys/stat.h>
 
 #include "qemu_process.h"
 #include "qemu_domain.h"
@@ -1851,7 +1852,7 @@ error:
         /* We can't get the monitor back, so must kill the VM
          * to remove danger of it ending up running twice if
          * user tries to start it again later */
-        qemudShutdownVMDaemon(driver, obj, 0);
+        qemuProcessStop(driver, obj, 0);
         if (!obj->persistent)
             virDomainRemoveInactive(&driver->domains, obj);
         else

Daniel

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]