1. 08 12月, 2009 14 次提交
    • 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
      Switch LXC driver to use a private data blob for virDomainObj state · e4b07fd6
      Daniel P. Berrange 提交于
      * src/lxc/lxc_driver.c: Introduce lxcDomainObjPrivate for storing
        monitor device state
      e4b07fd6
    • D
      Switch UML driver to use a private data blob for virDomainObj state · f248c965
      Daniel P. Berrange 提交于
      * src/uml/uml_driver.c: Introduce umlDomainObjPrivateData for storing
        monitor device state. Remove unneccessary VIR_FREE on vcpupids
      f248c965
    • 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 migration cancellation for QEMU · 3fa3cff7
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor_text.c: Add missing underscore in the
        migrate_cancel monitor command impl
      3fa3cff7
    • D
      Move qemuMonitorEscape + migrate status enum into shared monitor code · fa1e4759
      Daniel P. Berrange 提交于
      The qemuMonitorEscape() method, and the VIR_ENUM for migration
      status will be needed by the JSON monitor too, so move that code
      into the shared qemu_monitor.c file instead of qemu_monitor_text.c
      
      * src/qemu/qemu_monitor.h: Declare qemuMonitorMigrationStatus enum
        and qemuMonitorEscapeArg and qemuMonitorEscapeShell methods
      * src/qemu/qemu_monitor.c: Implement qemuMonitorMigrationStatus enum
        and qemuMonitorEscapeArg and qemuMonitorEscapeShell methods
      * src/qemu/qemu_monitor_text.c: Remove above methods/enum
      fa1e4759
    • 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
    • G
      udev_device_get_devpath might return NULL · 1f604116
      Guido Günther 提交于
      Fix crash on strdup in that case.
      1f604116
    • D
      Fix a compilation failure if yajl not avail · a4e09c1e
      Daniel Veillard 提交于
      configure:     yajl: no
      CC     libvirt_util_la-json.lo
      util/json.c:32:27: error: yajl/yajl_gen.h: No such file or directory
      util/json.c:33:29: error: yajl/yajl_parse.h: No such file or directory
      
      * src/util/json.c: remove the includes if yajl not configured in
      a4e09c1e
    • M
      Fix compilation for configure --disable-nls · 1449392d
      Matthias Bolte 提交于
      1449392d
    • M
      vbox: Update IIDs from version 3.1-beta2 to 3.1-final · 74c1c534
      Matthias Bolte 提交于
      This solves the 'nsIEventQueue object is null' error when trying
      to connect to a VirtualBox 3.1 hypervisor instance.
      74c1c534
    • D
      Fix ReprotError vs ReportError typo in JSON code · 0a4283cb
      Daniel P. Berrange 提交于
      * src/util/json.c: Fix ReprotError typo when YAJL is not available
      0a4283cb
    • D
      Fix inverted conditional test in configure.ac check for yajl · 6e547d54
      Daniel P. Berrange 提交于
      * configure.in: Fix inverted conditional test when yajl is not
        found
      6e547d54
  2. 07 12月, 2009 2 次提交
    • D
      Introduce a simple API for handling JSON data · 9428f2ce
      Daniel P. Berrange 提交于
      This introduces simple API for handling JSON data. There is
      an internal data structure 'virJSONValuePtr' which stores a
      arbitrary nested JSON value (number, string, array, object,
      nul, etc).  There are APIs for constructing/querying objects
      and APIs for parsing/formatting string formatted JSON data.
      
      This uses the YAJL library for parsing/formatting from
      
       http://lloyd.github.com/yajl/
      
      * src/util/json.h, src/util/json.c: Data structures and APIs
        for representing JSON data, and parsing/formatting it
      * configure.in: Add check for yajl library
      * libvirt.spec.in: Add build requires for yajl
      * src/Makefile.am: Add json.c/h
      * src/libvirt_private.syms: Export JSON symbols to drivers
      9428f2ce
    • D
      Add --system flag to autogen.sh to make it easy to build with right prefix · 563dc565
      Daniel P. Berrange 提交于
      Add a --system flag to autogen.sh which gets turned into the args
      --prefix=/usr --sysconfdir=/etc --localstatedir=/var to make it
      easy to build with settings that match an RPM build
      
      * autogen.sh: Add --system flag
      563dc565
  3. 05 12月, 2009 3 次提交
  4. 04 12月, 2009 4 次提交
    • J
      Support for interface model='netfront' · dddad4bc
      Jiri Denemark 提交于
      Xen HVM guests with PV drivers end up with two network interfaces for
      each configured interface. One of them being emulated by qemu and the
      other one paravirtual. As this might not be desirable, the attached
      patch provides a way for users to specify that only paravirtual network
      interface should be presented to the guest.
      
      The configuration was inspired by qemu/kvm driver, for which users can
      specify model='virtio' to use paravirtual network interface.
      
      The patch adds support for model='netfront' which results in
      type=netfront instead of type=ioemu (or nothing for newer xen versions)
      in guests native configuration. Xen's qemu ignores interfaces with
      type != ioemu and only paravirtual network device will be seen in the
      guest.
      
      Four possible configuration scenarios follow:
      
      - no model specified in domain's XML
          - libvirt will behave like before this change; it will set
            type=ioemu for HVM guests on xen host which is not newer than
            XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU
          - covered by existing tests
      
      - PV guest, any model
          - no functional change, model is passed as is (and ignored by the
            hypervisor)
          - covered by existing tests (e.g., *-net-e1000.*)
      - HVM guest, model=netfront
          - type is set to "netfront", model is not specified
          - covered by new *-net-netfront.* tests
      
      - HVM guest, model != netfront
          - type is set to "ioemu", model is passed as is
          - covered by new *-net-ioemu.* tests
      
      The fourth scenario feels like a regression for xen newer than
      XEND_CONFIG_MAX_VERS_NET_TYPE_IOEMU as users who had a model specified
      in their guest's configuration won't see a paravirtual interface in
      their guests any more. On the other hand, the reason for specifying a
      model is most likely the fact that they want to use such model which
      implies emulated interface. Users of older xen won't be affected at all
      as their xen provides paravirtual interface regardless of the type used.
      
      - src/xen/xend_internal.c: add netfront support for the xend backend
      - src/xen/xm_internal.c: add netfront support for the XM serialization too
      dddad4bc
    • P
      vbox: Add support for version 3.1 · 834d6547
      Pritesh Kothari 提交于
      Also fixed serial port configuration which was broken due to recent
      change in virDomainChrDef where targetType was newly added.
      
      * src/Makefile.am: add new files
      * src/vbox/vbox_driver.c: add case for version 3.1
      * src/vbox/vbox_tmpl.c: refactor common patterns into macros, support for
        version 3.1, serial port configuration fix
      * src/vbox/vbox_CAPI_v3_1.h, src/vbox/vbox_V3_1.c: generated code
      834d6547
    • M
      Add virIndexToDiskName and fix mapping gap · 63166a4e
      Matthias Bolte 提交于
      esxVMX_IndexToDiskName handles indices up to 701. This limit comes
      from a mapping gap in virDiskNameToIndex:
      
        sdzy -> 700
        sdzz -> 701
        sdaaa -> 728
        sdaab -> 729
      
      This line in virDiskNameToIndex causes this gap:
      
        idx = (idx + i) * 26;
      
      Fixing it by altering this line to:
      
        idx = (idx + (i < 1 ? 0 : 1)) * 26;
      
      Also add a new version of virIndexToDiskName that handles the inverse
      mapping for arbitrary indices.
      
      * src/esx/esx_vmx.[ch]: remove esxVMX_IndexToDiskName
      * src/util/util.[ch]: add virIndexToDiskName and fix mapping gap
      * tests/esxutilstest.c: update test to verify that the gap is fixed
      63166a4e
    • 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
  5. 03 12月, 2009 1 次提交
  6. 02 12月, 2009 1 次提交
    • D
      Fix event test timer checks on kernels with HZ=100 · 32f021f2
      Daniel P. Berrange 提交于
      On kernels with HZ=100, the resolution of sleeps in poll() is
      quite bad. Doing a precise check on the expiry time vs the
      current time will thus often thing the timer has not expired
      even though we're within 10ms of the expected expiry time. This
      then causes another pointless sleep in poll() for <10ms. Timers
      do not need to have such precise expiration, so we treat a timer
      as expired if it is within 20ms of the expected expiry time. This
      also fixes the eventtest.c test suite on kernels with HZ=100
      
      * daemon/event.c: Add 20ms fuzz when checking for timer expiry
      32f021f2
  7. 30 11月, 2009 2 次提交
  8. 27 11月, 2009 2 次提交
  9. 26 11月, 2009 5 次提交
  10. 24 11月, 2009 2 次提交
  11. 23 11月, 2009 4 次提交
    • D
      Support QEMU's virtual FAT block device driver · e7c78b0a
      Daniel P. Berrange 提交于
      Introduce a new type="dir"  mode for <disks> that allows use of
      QEMU's  virtual FAT block device driver. eg
      
          <disk type='dir' device='floppy'>
            <source dir='/tmp/test'/>
            <target dev='fda' bus='fdc'/>
            <readonly/>
          </disk>
      
      gets turned into
      
        -drive file=fat:floppy:/tmp/test,if=floppy,index=0
      
      Only read-only disks are supported with virtual FAT mode
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Add type="dir"
      * docs/schemas/domain.rng: Document new disk type
      * src/xen/xend_internal.c, src/xen/xm_internal.c: Raise error for
        unsupported disk types
      * tests/qemuxml2argvdata/qemuxml2argv-disk-cdrom-empty.args: Fix
        empty disk file handling
      * tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.args,
        tests/qemuxml2argvdata/qemuxml2argv-disk-drive-fat.xml,
        tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.args,
        tests/qemuxml2argvdata/qemuxml2argv-floppy-drive-fat.xml
        tests/qemuxml2argvtest.c: Test QEMU vitual FAT driver
      * src/qemu/qemu_conf.c: Support generating fat:/some/dir type
        disk args
      * src/security/security_selinux.c: Temporarily skip labelling
        of directory based disks
      e7c78b0a
    • D
      Alternate CPU affinity impl to cope with NR_CPUS > 1024 · a73cd93b
      Daniel P. Berrange 提交于
      The cpu_set_t type can only cope with NR_CPUS <= 1024, beyond this
      it is neccessary to use alternate CPU_SET maps with a dynamically
      allocated CPU map
      
      * src/util/processinfo.c: Support new unlimited size CPU set type
      a73cd93b
    • 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
    • D
      Ignore docs/ directory for strcmp() syntax check · af10d9ba
      Daniel P. Berrange 提交于
      * .x-sc_prohibit_strcmp_and_strncmp: Ignore docs/
      af10d9ba