1. 06 1月, 2010 1 次提交
  2. 22 12月, 2009 1 次提交
    • D
      Fix detection of JSON when restarting libvirtd · c90e545f
      Daniel P. Berrange 提交于
      The XML XPath for detecting JSON in the running VM statefile was
      wrong causing all VMs to get JSON mode enabled at libvirtd restart.
      
      In addition if a VM was running a JSON enabled QEMU once, and then
      altered to point to a non-JSON enabled QEMU later the 'monJSON'
      flag would not get reset to 0.
      
      * src/qemu/qemu_driver.c: Fix setting/detection of JSON mode
      c90e545f
  3. 21 12月, 2009 1 次提交
  4. 20 12月, 2009 2 次提交
    • A
      Implements domainMemStats in the qemu driver · c7523b41
      Adam Litke 提交于
      Support for memory statistics reporting is accepted for qemu inclusion.
      Statistics are reported via the monitor command 'info balloon' as a comma
      seprated list:
      
      (qemu) info balloon
      balloon: actual=1024,mem_swapped_in=0,mem_swapped_out=0,major_page_faults=88,minor_page_faults=105535,free_mem=1017065472,total_mem=1045229568
      
      Libvirt, qemu, and the guest operating system may support a subset of the
      statistics defined by the virtio spec.  Thus, only statistics recognized by
      components will be reported.
      
      * src/qemu/qemu_driver.c src/qemu/qemu_monitor_text.[ch]: implement the
        new entry point by using info balloon monitor command
      c7523b41
    • A
      Add new API virDomainMemoryStats to header and drivers · 3a701313
      Adam Litke 提交于
      Set up the types for the domainMemoryStats function and insert it into the
      virDriver structure definition.  Because of static initializers, update
      every driver and set the new field to NULL.
      
      * include/libvirt/libvirt.h.in: new API
      * src/driver.h src/*/*_driver.c src/vbox/vbox_tmpl.c: add the new
        entry to the driver structure
      * python/generator.py: fix compiler errors, the actual python binding is
        implemented later
      3a701313
  5. 18 12月, 2009 2 次提交
    • J
      Implement CPU selection in QEMU driver · ffb13b11
      Jiri Denemark 提交于
      * src/qemu/qemu_conf.c src/qemu/qemu_conf.h src/qemu/qemu_driver.c:
        add the new entry point, extend capabilities and code to interract
        with qemu
      ffb13b11
    • J
      Adds the internal driver API · 16e4084a
      Jiri Denemark 提交于
      * src/driver.h: add an extra entry point in the structure
      * src/esx/esx_driver.c src/lxc/lxc_driver.c src/opennebula/one_driver.c
        src/openvz/openvz_driver.c src/phyp/phyp_driver.c src/qemu/qemu_driver.c
        src/remote/remote_driver.c src/test/test_driver.c src/uml/uml_driver.c
        src/vbox/vbox_tmpl.c src/xen/xen_driver.c: add NULL entry points for
        all drivers
      16e4084a
  6. 15 12月, 2009 3 次提交
  7. 14 12月, 2009 9 次提交
    • M
      Cleanup temporary #define after use · 057ad3a2
      Matthew Booth 提交于
      * src/qemu/qemu_driver.c: #undef LOOKUP_PTYS after use in
        qemudFindCharDevicePTYsMonitor()
      057ad3a2
    • P
      Fix possible NULL pointer dereference · 921d2225
      Paolo Bonzini 提交于
      If there are no references remaining to the object, vm is set to NULL
      and vm->persistent cannot be accessed.  Fixed by this trivial patch.
      
      * src/qemu/qemu_driver.c (qemudDomainCoreDump): Avoid possible
        NULL pointer dereference on --crash dump.
      921d2225
    • P
      add --live support to "virsh dump" · 1fb7af40
      Paolo Bonzini 提交于
      This is trivial for QEMU since you just have to not stop the vm before
      starting the dump.  And for Xen, you just pass the flag down to xend.
      
      * include/libvirt/libvirt.h.in (virDomainCoreDumpFlags): Add VIR_DUMP_LIVE.
      * src/qemu/qemu_driver.c (qemudDomainCoreDump): Support live dumping.
      * src/xen/xend_internal.c (xenDaemonDomainCoreDump): Support live dumping.
      * tools/virsh.c (opts_dump): Add --live. (cmdDump): Map it to VIR_DUMP_LIVE.
      1fb7af40
    • P
      add --crash support to "virsh dump" · b927aed8
      Paolo Bonzini 提交于
      This patch adds the --crash option (already present in "xm dump-core")
      to "virsh dump".  virDomainCoreDump already has a flags argument, so
      the API/ABI is untouched.
      
      * include/libvirt/libvirt.h.in (virDomainCoreDumpFlags): New flag for
        CoreDump
      * src/test/test_driver.c (testDomainCoreDump): Do not crash
        after dump unless VIR_DUMP_CRASH is given.
      * src/qemu/qemu_driver.c (qemudDomainCoreDump): Shutdown the domain
        instead of restarting it if --crash is passed.
      * src/xen/xend_internal.c (xenDaemonDomainCoreDump): Support --crash.
      * tools/virsh.c (opts_dump): Add --crash.
        (cmdDump): Map it to flags for virDomainCoreDump and pass them.
      b927aed8
    • P
      fix various breakages in qemu Dump command · f509e162
      Paolo Bonzini 提交于
      1) qemuMigrateToCommand uses ">>" so we have to truncate the file
      before starting the migration;
      
      2) the command wasn't updated to chown the driver and set/restore
      the security lavels;
      
      3) the VM does not have to be resumed if migration fails;
      
      4) the file is not removed when migration fails.
      
      * src/qemu/qemu_driver.c (qemuDomainCoreDump): Truncate file before
        dumping, set/restore ownership and security labels for the file.
      f509e162
    • D
      Fix a couple of problems in last patch · a7d1eb3c
      Daniel Veillard 提交于
      Those were pointed by DanB in his review but not yet fixed
      
      * src/qemu/qemu_driver.c: qemudWaitForMonitor() use EnterMonitorWithDriver()
        and ExitMonitorWithDriver() there
      * src/qemu/qemu_monitor_text.c: checking fro strdu failure and hash
        table add error in qemuMonitorTextGetPtyPaths()
      a7d1eb3c
    • M
      Get QEMU pty paths from the monitor · 60e8977f
      Matthew Booth 提交于
      This change makes the QEMU driver get pty paths from the output of the
      monitor 'info chardev' command. This output is structured, and contains
      both the name of the device and the path on the same line. This is
      considerably more reliable than parsing the startup log output, which
      requires the parsing code to know which order QEMU will print pty
      information in.
      
      Note that we still need to parse the log output as the monitor itself
      may be on a pty. This should be rare, however, and the new code will
      replace all pty paths parsed by the log output method once the monitor
      is available.
      
      * src/qemu/qemu_monitor.(c|h) src/qemu_monitor_text.(c|h): Implement
        qemuMonitorGetPtyPaths().
      * src/qemu/qemu_driver.c: Get pty path information using
        qemuMonitorGetPtyPaths().
      60e8977f
    • M
      Extract the assigned pty device for QEmu channels · 033eef43
      Matthew Booth 提交于
      * src/qemu/qemu_driver.c: Parse pty devices for channels
      033eef43
    • R
      Suppress cgroup error message on sucess startup · 2597f8ec
      Ryota Ozaki 提交于
      Even if qemudStartVMDaemon suceeds, an error was logged such as
      'qemuRemoveCgroup:1778 : internal error Unable to find cgroup for'.
      This is because qemudStartVMDaemon calls qemuRemoveCgroup to
      ensure that old cgroup does not remain. This workaround makes
      sense but leaving an error message may confuse users.
      * src/qemu/qemu_driver.c: a an option to the function to suppress the
        error being logged
      2597f8ec
  8. 11 12月, 2009 3 次提交
  9. 10 12月, 2009 1 次提交
    • M
      Add virBufferFreeAndReset() and replace free() · 1b9d0744
      Matthias Bolte 提交于
      Replace free(virBufferContentAndReset()) with virBufferFreeAndReset().
      Update documentation and replace all remaining calls to free() with
      calls to VIR_FREE(). Also add missing calls to virBufferFreeAndReset()
      and virReportOOMError() in OOM error cases.
      1b9d0744
  10. 09 12月, 2009 1 次提交
    • D
      Fix virDomainObj ref handling in QEMU driver · 8e7d1495
      Daniel P. Berrange 提交于
      Since the monitor I/O is processed out of band from the main
      thread(s) invoking monitor  commands, the virDomainObj may be
      deleted by the I/O thread. The qemuDomainObjBeginJob takes an
      extra reference to protect against final deletion, but this
      reference is released by the corresponding EndJob call. THus
      after the EndJob call it may not be valid to reference the
      virDomainObj any more. To allow callers to detect this, the
      EndJob call is changed to return the remaining reference count.
      
      * src/conf/domain_conf.c: Make virDomainObjUnref return the
        remaining reference count
      * src/qemu/qemu_driver.c: Avoid referencing virDomainObjPtr
        after qemuDomainObjEndJob if it has been deleted.
      8e7d1495
  11. 08 12月, 2009 6 次提交
    • D
      Switch over to passing a callback table to QEMU monitor · e9f4c943
      Daniel P. Berrange 提交于
      With addition of events there will be alot of callbacks.
      To avoid having to add many APIs to register callbacks,
      provide them all at once in a big table
      
      * src/qemu/qemu_driver.c: Pass in a callback table to QEMU
        monitor code
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h Replace
        the EOF and disk secret callbacks with a callback table
      e9f4c943
    • D
      Support for JSON mode monitor · 3a4f172f
      Daniel P. Berrange 提交于
      Initial support for the new QEMU monitor protocol  using JSON
      as the data encoding format instead of plain text
      
      * po/POTFILES.in: Add src/qemu/qemu_monitor_json.c
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Hack to turn on QMP
        mode. Replace with a version number check on >= 0.12 later
      * src/qemu/qemu_monitor.c: Delegate to json monitor if enabled
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
        impl of QMP protocol
      * src/Makefile.am: Add src/qemu/qemu_monitor_json.{c,h}
      3a4f172f
    • D
      Introduce callbacks for serializing domain object private data to XML · c5358c0e
      Daniel P. Berrange 提交于
      Now that drivers are using a private domain object state blob,
      the virDomainObjFormat/Parse methods are no longer able to
      directly serialize all neccessary state to/from XML. It is
      thus neccessary to introduce a pair of callbacks fo serializing
      private state.
      
      The code for serializing vCPU PIDs and the monitor device
      config can now move out of domain_conf.c and into the
      qemu_driver.c where they belong.
      
      * src/conf/capabilities.h: Add callbacks for serializing private
        state to/from XML
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Remove the
        monitor, monitor_chr, monitorWatch, nvcpupids and vcpupids
        fields from virDomainObjPtr. Remove code that serialized
        those fields
      * src/libvirt_private.syms: Export virXPathBoolean
      * src/qemu/qemu_driver.c: Add callbacks for serializing monitor
        and vcpupid data to/from XML
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Pass monitor
        char device config into qemuMonitorOpen directly.
      c5358c0e
    • D
      Pull code to start CPUs executing out of qemudInitCpuAffinity() · 5697aa84
      Daniel P. Berrange 提交于
      The code to start CPUs executing has nothing todo with CPU
      affinity masks, so pull it out of the qemudInitCpuAffinity()
      method and up into qemudStartVMDaemon()
      
      * src/qemu/qemu_driver.c: Pull code to start CPUs executing out
        of qemudInitCpuAffinity()
      5697aa84
    • D
      Add a 'format' arg to qemuMonitorChangeMedia() since JSON will support it · 8c12b20c
      Daniel P. Berrange 提交于
      The current QEMU disk media change does not support setting the
      disk format. The new JSON monitor will support this, so add an
      extra parameter to pass this info in
      
      * src/qemu/qemu_driver.c: Pass in disk format when changing media
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Add a 'format' arg to qemuMonitorChangeMedia()
      8c12b20c
    • D
      Fix crash when deleting monitor while a command is in progress · 79533da1
      Daniel P. Berrange 提交于
      If QEMU shuts down while we're in the middle of processing a
      monitor command, the monitor will be freed, and upon cleaning
      up we attempt to do  qemuMonitorUnlock(priv->mon) when priv->mon
      is NULL.
      
      To address this we introduce proper reference counting into
      the qemuMonitorPtr object, and hold an extra reference whenever
      executing a command.
      
      * src/qemu/qemu_driver.c: Hold a reference on the monitor while
        executing commands, and only NULL-ify the priv->mon field when
        the last reference is released
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c: Add reference
        counting to handle safe deletion of monitor objects
      79533da1
  12. 04 12月, 2009 1 次提交
    • M
      Fix some locking issues · 7a18fbee
      Matthias Bolte 提交于
      * src/conf/domain_conf.c: don't call virDomainObjUnlock twice
      * src/qemu/qemu_driver.c: relock driver lock if an error occurs in
        qemuDomainObjBeginJobWithDriver, enter/exit monitor with driver
        in qemudDomainSave
      7a18fbee
  13. 26 11月, 2009 1 次提交
  14. 24 11月, 2009 1 次提交
  15. 23 11月, 2009 1 次提交
    • D
      Pull schedular affinity code out into a separate module · 37f415da
      Daniel P. Berrange 提交于
      * src/Makefile.am: Add processinfo.h/processinfo.c
      * src/util/processinfo.c, src/util/processinfo.h: Module providing
        APIs for getting/setting process CPU affinity
      * src/qemu/qemu_driver.c: Switch over to new APIs for schedular
        affinity
      * src/libvirt_private.syms: Export virProcessInfoSetAffinity
        and virProcessInfoGetAffinity to internal drivers
      37f415da
  16. 19 11月, 2009 1 次提交
    • D
      Ensure driver lock is released when entering QEMU monitor · 278e9478
      Daniel P. Berrange 提交于
      The qemudStartVMDaemon() and several functions it calls use
      the QEMU monitor. The QEMU driver is locked while this function
      is executing, so it is rquired to release the driver lock and
      reacquire it either side of issuing a monitor command. It
      failed todo so, leading to deadlock
      
      * qemu/qemu_driver.c: Release driver when in qemudStartVMDaemon
        and things it calls
      278e9478
  17. 12 11月, 2009 1 次提交
    • C
      Add virConnectGetLibvirtVersion API · ce4c0bf5
      Cole Robinson 提交于
      There is currently no way to determine the libvirt version of a remote
      libvirtd we are connected to. This is a useful piece of data to enable
      feature detection.
      ce4c0bf5
  18. 11 11月, 2009 4 次提交
    • D
      Fix save and restore with non-privileged guests and SELinux · bc0010b3
      Daniel P. Berrange 提交于
      When running qemu:///system instance, libvirtd runs as root,
      but QEMU may optionally be configured to run non-root. When
      then saving a guest to a state file, the file is initially
      created as root, and thus QEMU cannot write to it. It is also
      missing labelling required to allow access via SELinux.
      
      * src/qemu/qemu_driver.c: Set ownership on save image before
        running migrate command in virDomainSave impl. Call out to
        security driver to set save image labelling
      * src/security/security_driver.h: Add driver APIs for setting
        and restoring saved state file labelling
      * src/security/security_selinux.c: Implement saved state file
        labelling for SELinux
      bc0010b3
    • D
      Implmentation of new APIs to checking state/persistence of objects · cabc2cc9
      Daniel P. Berrange 提交于
      This implements the virConnectIsSecure, virConnectIsEncrypted,
      virDomainIsPersistent, virDomainIsActive, virNetworkIsActive,
      virNetworkIsPersistent, virStoragePoolIsActive,
      virStoragePoolIsPersistent, virInterfaceIsActive APIs in
      (nearly) all drivers. Exceptions are:
      
       phyp: missing domainIsActive/Persistent
       esx: missing domainIsPersistent
       opennebula: missing domainIsActive/Persistent
      
      * src/remote/remote_protocol.x: Define remote wire ABI for newly
        added APIs.
      * daemon/remote_dispatch*.h: Re-generated from remote_protocol.x
      * src/esx/esx_driver.c, src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/opennebula/one_driver.c, src/openvz/openvz_conf.c,
        src/openvz/openvz_driver.c, src/phyp/phyp_driver.c,
        src/remote/remote_driver.c, src/storage/storage_driver.c,
        src/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/xen/xen_driver.c, src/xen/xen_driver.h, src/xen/xen_inotify.c,
        src/xen/xen_inotify.h: Implement all the new APIs where possible
      cabc2cc9
    • D
      New APIs for checking some object properties · c04498b3
      Daniel P. Berrange 提交于
      Introduce a number of new APIs to  expose some boolean properties
      of objects, which cannot otherwise reliably determined, nor are
      aspects of the XML configuration.
      
       * virDomainIsActive: Checking virDomainGetID is not reliable
         since it is not possible to distinguish between error condition
         and inactive domain for ID of -1.
       * virDomainIsPersistent: Check whether a persistent config exists
         for the domain
      
       * virNetworkIsActive: Check whether the network is active
       * virNetworkIsPersistent: Check whether a persistent config exists
         for the network
      
       * virStoragePoolIsActive: Check whether the storage pool is active
       * virStoragePoolIsPersistent: Check whether a persistent config exists
         for the storage pool
      
       * virInterfaceIsActive: Check whether the host interface is active
      
       * virConnectIsSecure: whether the communication channel to the
         hypervisor is secure
       * virConnectIsEncrypted: whether any network based commnunication
         channels are encrypted
      
      NB, a channel can be secure, even if not encrypted, eg if it does
      not involve the network, like a UNIX socket, or pipe.
      
       * include/libvirt/libvirt.h.in: Define public API
       * src/driver.h: Define internal driver API
       * src/libvirt.c: Implement public API entry point
       * src/libvirt_public.syms: Export API symbols
       * src/esx/esx_driver.c, src/lxc/lxc_driver.c,
         src/interface/netcf_driver.c, src/network/bridge_driver.c,
         src/opennebula/one_driver.c, src/openvz/openvz_driver.c,
         src/phyp/phyp_driver.c, src/qemu/qemu_driver.c,
         src/remote/remote_driver.c, src/test/test_driver.c,
         src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
         src/xen/xen_driver.c: Stub out driver tables
      c04498b3
    • D
      Various fixes following a code review · 52147a04
      Daniel Veillard 提交于
      * src/libvirt.c src/lxc/lxc_conf.c src/lxc/lxc_container.c
        src/lxc/lxc_controller.c src/node_device/node_device_hal.c
        src/openvz/openvz_conf.c src/qemu/qemu_driver.c
        src/qemu/qemu_monitor_text.c src/remote/remote_driver.c
        src/storage/storage_backend_disk.c src/storage/storage_driver.c
        src/util/logging.c src/xen/sexpr.c src/xen/xend_internal.c
        src/xen/xm_internal.c: Steve Grubb <sgrubb@redhat.com> sent a code
        review and those are the fixes correcting the problems
      52147a04