1. 12 7月, 2011 1 次提交
    • D
      Implement code to attach to external QEMU instances. · 109efd79
      Daniel P. Berrange 提交于
      Given a PID, the QEMU driver reads /proc/$PID/cmdline and
      /proc/$PID/environ to get the configuration. This is fed
      into the ARGV->XML convertor to build an XML configuration
      for the process.
      
      /proc/$PID/exe is resolved to identify the full command
      binary path
      
      After checking for name/uuid uniqueness, an attempt is
      made to connect to the monitor socket. If successful
      then 'info status' and 'info kvm' are issued to determine
      whether the CPUs are running and if KVM is enabled.
      
      * src/qemu/qemu_driver.c: Implement virDomainQemuAttach
      * src/qemu/qemu_process.h, src/qemu/qemu_process.c: Add
        qemuProcessAttach to connect to the monitor of an
        existing QEMU process
      109efd79
  2. 24 6月, 2011 2 次提交
    • D
      Allow automatic kill of guests when a connection is closed · 3ba937da
      Daniel P. Berrange 提交于
      If an application is using libvirt + KVM as a piece of its
      internal infrastructure to perform a specific task, it can
      be desirable to guarentee the VM dies when the virConnectPtr
      disconnects from libvirtd. This ensures the app can't leak
      any VMs it was using. Adding VIR_DOMAIN_START_AUTOKILL as
      a flag when starting guests enables this to be done.
      
      * include/libvirt/libvirt.h.in: All VIR_DOMAIN_START_AUTOKILL
      * src/qemu/qemu_driver.c: Support automatic killing of guests
        upon connection close
      * tools/virsh.c: Add --autokill flag to 'start' and 'create'
        commands
      3ba937da
    • D
      Add infrastructure to automatically destroy guests when a connection closes · 558b7fd0
      Daniel P. Berrange 提交于
      Sometimes it is useful to be able to automatically destroy a guest when
      a connection is closed. For example, kill an incoming migration if
      the client managing the migration dies. This introduces a map between
      guest 'uuid' strings and virConnectPtr objects. When a connection is
      closed, any associated guests are killed off.
      
      * src/qemu/qemu_conf.h: Add autokill hash table to qemu driver
      * src/qemu/qemu_process.c, src/qemu/qemu_process.h: Add APIs
        for performing autokill of guests associated with a connection
      * src/qemu/qemu_driver.c: Initialize autodestroy map
      558b7fd0
  3. 16 5月, 2011 1 次提交
    • J
      Implement domain state reason · b046c55d
      Jiri Denemark 提交于
      Only in drivers which use virDomainObj, drivers that query hypervisor
      for domain status need to be updated separately in case their hypervisor
      supports this functionality.
      
      The reason is also saved into domain state XML so if a domain is not
      running (i.e., no state XML exists) the reason will be lost by libvirtd
      restart. I think this is an acceptable limitation.
      b046c55d
  4. 11 5月, 2011 1 次提交
    • D
      Allow destroying QEMU VM even if a job is active · cbf9f2f2
      Daniel P. Berrange 提交于
      Introduce a virProcessKill function that can be safely called
      even when the job mutex is held. This allows virDomainDestroy
      to kill any VM even if it is asleep in a monitor job. The PID
      will die and the thread asleep on the monitor will then wake
      up releasing the job mutex.
      
      * src/qemu/qemu_driver.c: Kill process before using qemuProcessStop
        to ensure job is released
      * src/qemu/qemu_process.c: Add virProcessKill for killing off
        QEMU processes
      cbf9f2f2
  5. 17 2月, 2011 1 次提交
    • D
      Split all QEMU process mangement code into separate file · 48c2d6c6
      Daniel P. Berrange 提交于
      Move the qemudStartVMDaemon and qemudShutdownVMDaemon
      methods into a separate file, renaming them to
      qemuProcessStart, qemuProcessStop. All helper methods
      called by these are also moved & renamed to match
      
      * src/Makefile.am: Add qemu_process.c/.h
      * src/qemu/qemu_command.c: Add qemuDomainAssignPCIAddresses
      * src/qemu/qemu_command.h: Add VNC port min/max
      * src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: Add
        domain event queue helpers
      * src/qemu/qemu_driver.c, src/qemu/qemu_driver.h: Remove
        all QEMU process startup/shutdown functions
      * src/qemu/qemu_process.c, src/qemu/qemu_process.h: Add
        all QEMU process startup/shutdown functions
      48c2d6c6