1. 28 8月, 2014 2 次提交
    • J
      domain_conf: Resolve Coverity REVERSE_INULL · 0c5ca985
      John Ferlan 提交于
      Coverity complains that checking for domain->def being non NULL in the
      if (live) path of virDomainObjAssignDef() would be unnecessary or a
      NULL deref since the call to virDomainObjIsActive() would already
      dereference domain->def when checking if the def->id field was != -1.
      
      Checked all callers to virDomainObjAssignDef() and each at some point
      dereferences (vm)->def->{field} prior to calling when live is true.
      0c5ca985
    • J
      domain_conf: Resolve Coverity REVERSE_INULL · 9ba04dec
      John Ferlan 提交于
      In virDomainActualNetDefFormat() a call to virDomainNetGetActualType(def)
      was made before a check for (!def) a few lines later. This triggered
      Coverity to note the possible NULL deref.  Just moving the initialization
      to after the !def checks resolves the issue
      9ba04dec
  2. 27 8月, 2014 2 次提交
  3. 26 8月, 2014 1 次提交
  4. 25 8月, 2014 2 次提交
  5. 20 8月, 2014 3 次提交
  6. 18 8月, 2014 2 次提交
    • P
      conf: Refactor virDomainVcpuPinDefParseXML · 64bbf4c3
      Peter Krempa 提交于
      Tidy up control flow, change boolean argument to use 'bool', improve
      error message in case the function is used to parse emulator pinning
      info and avoid a few temp variables that made no sense.
      
      Also when the function is called to parse emulator pinning info, there's
      no need to check the processor ID in that case.
      64bbf4c3
    • P
      conf: cpupin: Remove useless checking of vcpupin element count · cb8a94bf
      Peter Krempa 提交于
      The check doesn't make much sense as right below it the entries are
      either checked for duplicity or ignored in some cases. Having this check
      doesn't actually forbid passing invalid values.
      cb8a94bf
  7. 14 8月, 2014 1 次提交
  8. 12 8月, 2014 1 次提交
  9. 08 8月, 2014 3 次提交
    • P
      e260a0e6
    • J
      hostdev: Add iSCSI hostdev XML · 54ac483e
      John Ferlan 提交于
      Introduce a new structure to handle an iSCSI host device based on the
      existing virDomainHostdevSubsysSCSI by adding a "protocol='iscsi'" to
      the <source/> element. The existing scsi_host subsystem RNG was modified
      to read an optional "protocol='adapter'", although it won't be written
      out nor is it documented as an option (by choice).
      
      The new hostdev structure mimics the existing <disk/> element for an
      iSCSI device (network) device. New XML is:
      
        <hostdev mode='subsystem' type='scsi' managed='yes'>
          <source protocol='iscsi' name='iqn.1992-01.com.example'>
            <host name='example.org' port='3260'/>
            <auth username='myname'>
              <secret type='iscsi' usage='mycluster_myname'/>
            </auth>
          </source>
          <address type='drive' controller='0' bus='0' target='2' unit='5'/>
        </hostdev>
      
      The controller element will mimic the existing scsi_host code insomuch
      as when 'lsi' and 'virtio-scsi' are used.
      54ac483e
    • J
      domain_conf: Common routine to handle network storage host xml def · c3f49429
      John Ferlan 提交于
      In preparation for hostdev support for iSCSI and a virStorageNetHostDefPtr,
      split out the network disk storage parsing of the 'host' element into a
      separate routine.
      c3f49429
  10. 30 7月, 2014 3 次提交
    • E
      blockcommit: track job type in xml · 232a31be
      Eric Blake 提交于
      A future patch is going to wire up qemu active block commit jobs;
      but as they have similar events and are canceled/pivoted in the
      same way as block copy jobs, it is easiest to track all bookkeeping
      for the commit job by reusing the <mirror> element.  This patch
      adds domain XML to track which job was responsible for creating a
      mirroring situation, and adds a job='copy' attribute to all
      existing uses of <mirror>.  Along the way, it also massages the
      qemu monitor backend to read the new field in order to generate
      the correct type of libvirt job (even though it requires a
      future patch to actually cause a qemu event that can be reported
      as an active commit).  It also prepares to update persistent XML
      to match changes made to live XML when a copy completes.
      
      * docs/schemas/domaincommon.rng: Enhance schema.
      * docs/formatdomain.html.in: Document it.
      * src/conf/domain_conf.h (_virDomainDiskDef): Add a field.
      * src/conf/domain_conf.c (virDomainBlockJobType): String conversion.
      (virDomainDiskDefParseXML): Parse job type.
      (virDomainDiskDefFormat): Output job type.
      * src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Distinguish
      active from regular commit.
      * src/qemu/qemu_driver.c (qemuDomainBlockCopy): Set job type.
      (qemuDomainBlockPivot, qemuDomainBlockJobImpl): Clean up job type
      on completion.
      * tests/qemuxml2xmloutdata/qemuxml2xmlout-disk-mirror-old.xml:
      Update tests.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-active-commit.xml: New
      file.
      * tests/qemuxml2xmltest.c (mymain): Drive new test.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      232a31be
    • C
      Domain config: write <features/> if some capabilities are set. · 251d75a8
      Cédric Bosdonnat 提交于
      If all features are set to default (including the capabilities policy),
      but some capabilities are toggled, we need to output the <features>
      element when formatting the config.
      251d75a8
    • E
      blockcopy: add more XML for state tracking · 9a212d67
      Eric Blake 提交于
      Doing a blockcopy operation across a libvirtd restart is not very
      robust at the moment.  In particular, we are clearing the <mirror>
      element prior to telling qemu to finish the job.  Also, thanks to the
      ability to request async completion, the user can easily regain
      control prior to qemu actually finishing the effort, and they should
      be able to poll the domain XML to see if the job is still going.
      
      A future patch will fix things to actually wait until qemu is done
      before modifying the XML to reflect the job completion.  But since
      qemu issues identical BLOCK_JOB_COMPLETE events regardless of whether
      the job was cancelled (kept the original disk) or completed (pivoted
      to the new disk), we have to track which of the two operations were
      used to end the job.  Furthermore, we'd like to avoid attempts to
      end a job where we are already waiting on an earlier request to qemu
      to end the job.  Likewise, if we miss the qemu event (perhaps because
      it arrived during a libvirtd restart), we still need enough state
      recorded to be able to determine how to modify the domain XML once
      we reconnect to qemu and manually learn whether the job still exists.
      
      Although this patch doesn't actually fix the problem, it is a
      preliminary step that makes it possible to track whether a job
      has already begun steps towards completion.
      
      * src/conf/domain_conf.h (virDomainDiskMirrorState): New enum.
      (_virDomainDiskDef): Convert bool mirroring to new enum.
      * src/conf/domain_conf.c (virDomainDiskDefParseXML)
      (virDomainDiskDefFormat): Handle new values.
      * src/qemu/qemu_process.c (qemuProcessHandleBlockJob): Adjust
      client.
      * src/qemu/qemu_driver.c (qemuDomainBlockPivot)
      (qemuDomainBlockJobImpl): Likewise.
      * docs/schemas/domaincommon.rng (diskMirror): Expose new values.
      * docs/formatdomain.html.in (elementsDisks): Document it.
      * tests/qemuxml2argvdata/qemuxml2argv-disk-mirror.xml: Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9a212d67
  11. 29 7月, 2014 1 次提交
  12. 28 7月, 2014 1 次提交
  13. 25 7月, 2014 1 次提交
  14. 24 7月, 2014 8 次提交
    • J
      hostdev: Introduce virDomainHostdevSubsysSCSIiSCSI · 17bddc46
      John Ferlan 提交于
      Create the structures and API's to hold and manage the iSCSI host device.
      This extends the 'scsi_host' definitions added in commit id '5c811dce'.
      A future patch will add the XML parsing, but that code requires some
      infrastructure to be in place first in order to handle the differences
      between a 'scsi_host' and an 'iSCSI host' device.
      17bddc46
    • J
      hostdev: Introduce virDomainHostdevSubsysSCSIHost · 42957661
      John Ferlan 提交于
      Split virDomainHostdevSubsysSCSI further. In preparation for having
      either SCSI or iSCSI data, create a union in virDomainHostdevSubsysSCSI
      to contain just a virDomainHostdevSubsysSCSIHost to describe the
      'scsi_host' host device
      42957661
    • J
      hostdev: Introduce virDomainHostdevSubsysSCSI · 5805621c
      John Ferlan 提交于
      Create a separate typedef for the hostdev union data describing SCSI
      Then adjust the code to use the new pointer
      5805621c
    • J
      hostdev: Introduce virDomainHostdevSubsysPCI · 1c8da0d4
      John Ferlan 提交于
      Create a separate typedef for the hostdev union data describing PCI.
      Then adjust the code to use the new pointer
      1c8da0d4
    • J
      hostdev: Introduce virDomainHostdevSubsysUSB · 7540d07f
      John Ferlan 提交于
      Create a separate typedef for the hostdev union data describing USB.
      Then adjust the code to use the new pointer
      7540d07f
    • M
      numatune: finish the split from domain_conf and remove all dependencies · dc8b7ce7
      Martin Kletzander 提交于
      This patch adds back the virDomainDef typedef into domain_conf and
      makes all the numatune_conf functions independent of any virDomainDef
      definitions.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      dc8b7ce7
    • E
      conf: avoid memory leaks while parsing seclabel · 55d54dd9
      Eric Blake 提交于
      Our seclabel parsing was repeatedly assigning malloc'd data into a
      temporary variable, without first freeing the previous use.  Among
      other leaks flagged by valgrind:
      
      ==9312== 8 bytes in 1 blocks are definitely lost in loss record 88 of 821
      ==9312==    at 0x4A0645D: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==9312==    by 0x8C40369: strdup (strdup.c:42)
      ==9312==    by 0x50EA799: virStrdup (virstring.c:676)
      ==9312==    by 0x50FAEB9: virXPathString (virxml.c:90)
      ==9312==    by 0x50FAF1E: virXPathStringLimit (virxml.c:112)
      ==9312==    by 0x510F516: virSecurityLabelDefParseXML (domain_conf.c:4571)
      ==9312==    by 0x510FB20: virSecurityLabelDefsParseXML (domain_conf.c:4720)
      
      While it was multiple problems, it looks like commit da78351b (thankfully
      unreleased) was to blame for all of them.
      
      * src/conf/domain_conf.c (virSecurityLabelDefParseXML): Plug leaks
      detected by valgrind.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      55d54dd9
    • E
      metadata: track title edits across libvirtd restart · 60e49440
      Eric Blake 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1122205
      
      Although the edits were changing in-memory XML, it was not flushed
      to disk; so unless some other action changes XML, a libvirtd restart
      would lose the changed information.
      
      * src/conf/domain_conf.c (virDomainObjSetMetadata): Add parameter,
      to save live status across restarts.
      (virDomainSaveXML): Allow for test driver.
      * src/conf/domain_conf.h (virDomainObjSetMetadata): Adjust
      signature.
      * src/bhyve/bhyve_driver.c (bhyveDomainSetMetadata): Adjust caller.
      * src/lxc/lxc_driver.c (lxcDomainSetMetadata): Likewise.
      * src/qemu/qemu_driver.c (qemuDomainSetMetadata): Likewise.
      * src/test/test_driver.c (testDomainSetMetadata): Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      60e49440
  15. 23 7月, 2014 3 次提交
    • J
      Introduce virTristateSwitch enum · 3227e17d
      Ján Tomko 提交于
      For the values "default", "on", "off"
      
      Replaces
      virDeviceAddressPCIMulti
      virDomainFeatureState
      virDomainIoEventFd
      virDomainVirtioEventIdx
      virDomainDiskCopyOnRead
      virDomainMemDump
      virDomainPCIRombarMode
      virDomainGraphicsSpicePlaybackCompression
      3227e17d
    • J
      Introduce virTristateBool enum type · bb018ce6
      Ján Tomko 提交于
      Replace all three-state (default/yes/no) enums with it:
      virDomainBIOSUseserial
      virDomainBootMenu
      virDomainPMState
      virDomainGraphicsSpiceClipboardCopypaste
      virDomainGraphicsSpiceAgentFileTransfer
      virNetworkDNSForwardPlainNames
      bb018ce6
    • C
      lxc: allow to keep or drop capabilities · 47e5b5ae
      Cédric Bosdonnat 提交于
      Added <capabilities> in the <features> section of LXC domains
      configuration. This section can contain elements named after the
      capabilities like:
      
        <mknod state="on"/>, keep CAP_MKNOD capability
        <sys_chroot state="off"/> drop CAP_SYS_CHROOT capability
      
      Users can restrict or give more capabilities than the default using
      this mechanism.
      47e5b5ae
  16. 18 7月, 2014 1 次提交
  17. 17 7月, 2014 4 次提交
    • M
      numatune: Encapsulate numatune configuration in order to unify results · 93e82727
      Martin Kletzander 提交于
      There were numerous places where numatune configuration (and thus
      domain config as well) was changed in different ways.  On some
      places this even resulted in persistent domain definition not to be
      stable (it would change with daemon's restart).
      
      In order to uniformly change how numatune config is dealt with, all
      the internals are now accessible directly only in numatune_conf.c and
      outside this file accessors must be used.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      93e82727
    • M
      numatune: unify numatune struct and enum names · e764ec7a
      Martin Kletzander 提交于
      Since there was already public virDomainNumatune*, I changed the
      private virNumaTune to match the same, so all the uses are unified and
      public API is kept:
      
      s/vir\(Domain\)\?Numa[tT]une/virDomainNumatune/g
      
      then shrunk long lines, and mainly functions, that were created after
      that:
      
      sed -i 's/virDomainNumatuneMemPlacementMode/virDomainNumatunePlacement/g'
      
      And to cope with the enum name, I haad to change the constants as
      well:
      
      s/VIR_NUMA_TUNE_MEM_PLACEMENT_MODE/VIR_DOMAIN_NUMATUNE_PLACEMENT/g
      
      Last thing I did was at least a little shortening of already long
      name:
      
      s/virDomainNumatuneDef/virDomainNumatune/g
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      e764ec7a
    • M
      conf: purely a code movement · 775c4695
      Martin Kletzander 提交于
      to ease the review of commits to follow.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      775c4695
    • M
      support for QEMU vhost-user · a14abd46
      Michele Paolino 提交于
      This patch adds support for the QEMU vhost-user feature to libvirt.
      vhost-user enables the communication between a QEMU virtual machine
      and other userspace process using the Virtio transport protocol.
      It uses a char dev (e.g. Unix socket) for the control plane,
      while the data plane based on shared memory.
      
      The XML looks like:
      
      <interface type='vhostuser'>
          <mac address='52:54:00:3b:83:1a'/>
          <source type='unix' path='/tmp/vhost.sock' mode='server'/>
          <model type='virtio'/>
      </interface>
      Signed-off-by: NMichele Paolino <m.paolino@virtualopensystems.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      a14abd46
  18. 14 7月, 2014 1 次提交