1. 25 2月, 2014 3 次提交
    • L
      conf: re-situate <bandwidth> element in <interface> · 65487c0f
      Laine Stump 提交于
      This moves the call to virNetDevBandwidthFormat() in
      virDomainNetDefFormat() to be called right after the call to
      virNetDevVPortProfileFormat(), so that a single chunk of that function
      can be placed inside an if that conditionally calls
      virDomainActualNetDefContentsFormat() instead (next patch). The
      re-ordering necessitates modifying a couple of test data files.
      65487c0f
    • L
      conf: make virDomainNetDefFormat a public function · 7c39214c
      Laine Stump 提交于
      We will need to call virDomainNetDefFormat() from the network hook (in
      the network driver).
      7c39214c
    • L
      conf: clarify what is returned for actual bandwidth and vlan · 6d4ffae4
      Laine Stump 提交于
      In practice, if a virDomainNetDef has a virDomainActualNetDef
      allocated, the ActualNetDef will *always* contain the bandwidth and
      vlan data from the NetDef (unless there was also a portgroup involved
      - see networkAllocateActualDevice()).
      
      However, virDomainNetGetActual(Bandwidth|Vlan)() were coded to make it
      appear as if it might be possible to have a valid bandwidth/vlan in
      the NetDef, but a NULL in the ActualNetDef. Believing this un-truth
      could lead to writing unnecessarily defensive code when dealing with
      the virDomainGetActual*() functions, so this patch makes it more
      obvious:
      
         If there is an ActualNetDef, it will always have a copy of the
         various appropriate bits from its parent NetDef, and the
         virDomainGetActual* function will *always* return the data from the
         ActualNetDef, not from the NetDef.
      
      The reason for this effective-NOP patch is that a subsequent patch to
      change virDomainNetDefFormat will rely on the above rule.
      6d4ffae4
  2. 20 2月, 2014 1 次提交
  3. 19 2月, 2014 4 次提交
  4. 17 2月, 2014 2 次提交
  5. 14 2月, 2014 1 次提交
  6. 11 2月, 2014 1 次提交
  7. 10 2月, 2014 3 次提交
    • P
      qemu: hyperv: Add support for timer enlightenments · 600bca59
      Peter Krempa 提交于
      Add a new <timer> for the HyperV reference time counter enlightenment
      and the iTSC reference page for Windows guests.
      
      This feature provides a paravirtual approach to track timer events for
      the guest (similar to kvmclock) with the option to use real hardware
      clock on systems with a iTSC with compensation across various hosts.
      600bca59
    • P
      conf: Enforce supported options for certain timers · 8ffaa42d
      Peter Krempa 提交于
      According to the documentation various timer options are only supported
      by certain timer types. Add a post parse check to verify that the user
      didn't specify invalid options.
      
      Also fix the qemu command line parsing function to set correct default
      values for the kvmclock timer so that it passes the new check.
      8ffaa42d
    • P
      schema: Fix guest timer specification schema according to the docs · bbd392ff
      Peter Krempa 提交于
      According to the documentation describing various tunables for domain
      timers not all the fields are supported by all the driver types. Express
      these in the RNG:
      
      - rtc, platform: Only these support the "track" attribute.
      - tsc: only one to support "frequency" and "mode" attributes
      - hpet, pit: tickpolicy/catchup attribute/element
      - kvmclock: no extra attributes are supported
      
      Additionally the attributes of the <catchup> element for
      tickpolicy='catchup' are optional according to the parsing code. Express
      this in the XML and fix a spurious space added while formatting the
      <catchup> element and add tests for it.
      bbd392ff
  8. 07 2月, 2014 2 次提交
  9. 21 1月, 2014 1 次提交
    • F
      spice: expose the QEMU disable file transfer option · 08d07e5f
      Francesco Romani 提交于
      spice-server offers an API to disable file transfer messages
      on the agent channel between the client and the guest.
      This is supported in qemu through the disable-agent-file-xfer option.
      
      This patch exposes this option to libvirt.
      Adds a new element 'filetransfer', with one property,
      'enable', which accepts a boolean.
      Default is enabled, for backward compatibility.
      
      Depends on the capability exported in the first patch of the series.
      Signed-off-by: NFrancesco Romani <fromani@redhat.com>
      08d07e5f
  10. 20 1月, 2014 1 次提交
  11. 16 1月, 2014 1 次提交
  12. 11 1月, 2014 1 次提交
  13. 08 1月, 2014 1 次提交
  14. 31 12月, 2013 1 次提交
    • L
      domain: don't try to interpret <driver> as virtio config for hostdev interfaces · 3337a98a
      Laine Stump 提交于
      This resolves:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=1046337
      
      The <driver> name attribute of an interface is interpreted in two
      different ways depending on the <interface> type - if the interface is
      type='hostdev', then the driver name describes which backend to use
      for the hostdev device assignment (vfio or kvm), but if the interface
      is any emulated type *and* the model type is "virtio", then the driver
      name can be "vhost" or "qemu", telling which backend qemu should use
      to communicate with the emulated device.
      
      The problem comes when someone has defined a an interface like this
      (which is accepted by the parser as long as no <driver name='xxx'/> is
      specified):
      
          <interface type='hostdev'>
             ...
             <model type='virtio'/>
             ...
          </interface>
      
      As libvirt storing this definition in the domain's status, the driver
      name is automatically filled in with the backend that was
      automatically decided by libvirt, so it stores this in the status:
      
          <interface type='hostdev'>
             ...
             <driver name='vfio'/>
             ...
             <model type='virtio'/>
             ...
          </interface>
      
      This isn't noticed until the next time libvirtd is restarted - as it
      is reading the status of all domains, it encounters the above
      interface definition, logs an error:
      
        internal error: Unknown interface <driver name='vfio'> has been specified
      
      and fails to reload the domain status, so the domain is marked as
      inactive.
      
      The solution is to stop the parser from interpreting <driver>
      attributes as if the device was an emulated virtio device, when it is
      actually a hostdev.
      
      (Although the bug has existed since vfio support was added, it has
      just recently become more apparent because libvirt previously didn't
      automatically set the driver name for hostdev interfaces in the domain
      status to vfio/kvm as it does since commit f094aa, first appearing in
      v1.1.4.)
      3337a98a
  15. 23 12月, 2013 1 次提交
    • L
      qemu: re-add hostdev interfaces to hostdev array on libvirtd restart · 8700b878
      Laine Stump 提交于
      This resolves:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=1045002
      
      If a domain has an <interface type='hostdev'> or an <interface
      type='network'> where the network itself is a pool of hostdev devices,
      then libvirt will internally keep that device on both the interface
      list *and* the hostdev list for the domain. One of the places this
      comes in handy is when a new device is being added and libvirt wants
      to find a unique "alias" name for it - it just scans through the
      hostdev array and makes sure it picks a name that doesn't match the
      alias of any device in that array.
      
      However, when libvirtd was restarted, if there was an <interface
      type='network'> with the network being a hostdev pool, the device
      would not be added to the reconstructed internal hostdev array, so its
      alias would not be found during a scan of the hostdev array, thus
      attempts to add a new hostdev (or <interface type='hostdev'> or
      <interface type='network'>) would result in a message like this:
      
      internal error: unable to execute QEMU command 'device_add':
                      Duplicate ID 'hostdev0' for device
      
      This patch simply fixes the existing code in the domain XML parser
      that fixes up the hostdev array in the case of <interface
      type='hostdev'> to do the same thing in the case of <interface
      type='network'> with a hostdev network.
      
      This bug has existed since the very first addition of hostdev networks
      to libvirt (0.10.0).
      8700b878
  16. 21 12月, 2013 1 次提交
    • J
      PanicCheckABIStability: Need to check for existence · d53c57b8
      John Ferlan 提交于
      Commit id '4313fead' added a call to virDomainPanicCheckABIStability()
      which did not check whether the panic device existed before making a call
      to virDomainDeviceInfoCheckABIStability() which ended up segfaulting:
      
      Thread 1 (Thread 0x7f5332837700 (LWP 10964)):
          (src=<optimized out>, dst=<optimized out>)
          at conf/domain_conf.c:13007
          (dst=<optimized out>, src=<optimized out>)
          at conf/domain_conf.c:13712
          (src=<optimized out>, dst=<optimized out>)
          at conf/domain_conf.c:14056
          (domain=domain@entry=0x7f53000057c0, vm=vm@entry=0x7f53000036d0,
           defptr=defptr@entry=0x7f5332836978, snap=snap@entry=0x7f5332836970,
           update_current=update_current@entry=0x7f5332836962, flags=flags@entry=1)
          at conf/snapshot_conf.c:1230
          (domain=0x7f53000057c0, xmlDesc=<optimized out>, flags=1)
          at qemu/qemu_driver.c:12719
          (domain=domain@entry=0x7f53000057c0, xmlDesc=0x7f53000081d0
           "<domainsnapshot>\n  <name>snap2</name>\n
           <description>new-desc</description>\n  <state>running</state>\n
           <parent>\n    <name>snap1</name>\n  </parent>\n
           <creationTime>1387487268</creationTime>\n  <memory s"..., flags=1)
          at libvirt.c:19695
      ...
      
      (gdb) up 3
      (gdb) print *other->def->dom
      $2 = {virtType = 2, id = -1, ..
      ...
        rng = 0x0, panic = 0x0, namespaceData = 0x0,...
      ...
      (gdb) print *def->dom
      $3 = {virtType = 2, id = -1, ...
      ...
        rng = 0x0, panic = 0x0, namespaceData = 0x0,...
      ...
      (gdb)
      
      Also seen using following sequence:
      
      virsh save $dom $file
      virsh save-image-edit $file
        add (or remove) a <panic/> line
        <devices>
        ...
          <panic>
            <address type='isa' iobase='0x505'/>
          </panic>
        ...
        </devices>
      d53c57b8
  17. 13 12月, 2013 2 次提交
  18. 12 12月, 2013 3 次提交
  19. 10 12月, 2013 1 次提交
  20. 06 12月, 2013 2 次提交
  21. 02 12月, 2013 7 次提交
    • P
      conf: Add helper do clear disk source authentication struct · 0018477f
      Peter Krempa 提交于
      Add virDomainDiskAuthClear to help cleaning out the struct in other
      places too.
      0018477f
    • P
      conf: Add functions to copy and free network disk source definitions · ae361674
      Peter Krempa 提交于
      To simplify operations on virDomainDiskHostDef arrays we will need deep
      copy and freeing functions. Add and properly export them.
      ae361674
    • P
      conf: Export disk source formatter and parser · 5f86d11e
      Peter Krempa 提交于
      This code will be reused in the snapshot disk definition parser.
      5f86d11e
    • P
      conf: Split out seclabel formating code for disk source · 30f7ca67
      Peter Krempa 提交于
      The code is common for all the various disk types. Split it out to a
      common function.
      30f7ca67
    • P
      conf: Clean up virDomainDiskSourceDefFormatInternal · 03ad83cb
      Peter Krempa 提交于
      Avoid if statements when used with virBufferEscapeString which
      automaticaly omits the whole string. Also add some line breaks to
      visualy separate the code.
      03ad83cb
    • P
      conf: Support disk source formatting without needing a virDomainDiskDefPtr · d6b4c2cc
      Peter Krempa 提交于
      The <source> element formatting function was expecting a
      virDomainDiskDefPtr to store the data. As snapshots are not using this
      data structure to hold the data, we need to add an internal function
      which splits out individual fields separately.
      d6b4c2cc
    • N
      Fix memory leak in virDomainDefParseXML() · 2cfcd2cc
      Nehal J Wani 提交于
      This patch fixes the memory leaks found while running qemuxml2argvtest
      
      ==8260== 3 bytes in 1 blocks are definitely lost in loss record 1 of
      129
      ==8260==    at 0x4A0887C: malloc (vg_replace_malloc.c:270)
      ==8260==    by 0x341F485E21: strdup (strdup.c:42)
      ==8260==    by 0x4CADCFF: virStrdup (virstring.c:554)
      ==8260==    by 0x4CBB839: virXPathString (virxml.c:90)
      ==8260==    by 0x4CE753A: virDomainDefParseXML (domain_conf.c:11478)
      ==8260==    by 0x4CEB4FE: virDomainDefParseNode (domain_conf.c:12742)
      ==8260==    by 0x4CEB675: virDomainDefParse (domain_conf.c:12684)
      ==8260==    by 0x425958: testCompareXMLToArgvHelper (qemuxml2argvtest.c:107)
      ==8260==    by 0x427111: virtTestRun (testutils.c:138)
      ==8260==    by 0x41D3FE: mymain (qemuxml2argvtest.c:452)
      ==8260==    by 0x4277B2: virtTestMain (testutils.c:593)
      ==8260==    by 0x341F421A04: (below main) (libc-start.c:225)
      ==8260==
      ==8260== 4 bytes in 1 blocks are definitely lost in loss record 5 of
      129
      ==8260==    at 0x4A0887C: malloc (vg_replace_malloc.c:270)
      ==8260==    by 0x341F485E21: strdup (strdup.c:42)
      ==8260==    by 0x4CADCFF: virStrdup (virstring.c:554)
      ==8260==    by 0x4CBB839: virXPathString (virxml.c:90)
      ==8260==    by 0x4CE753A: virDomainDefParseXML (domain_conf.c:11478)
      ==8260==    by 0x4CEB4FE: virDomainDefParseNode (domain_conf.c:12742)
      ==8260==    by 0x4CEB675: virDomainDefParse (domain_conf.c:12684)
      ==8260==    by 0x425958: testCompareXMLToArgvHelper (qemuxml2argvtest.c:107)
      ==8260==    by 0x427111: virtTestRun (testutils.c:138)
      ==8260==    by 0x41D39A: mymain (qemuxml2argvtest.c:451)
      ==8260==    by 0x4277B2: virtTestMain (testutils.c:593)
      ==8260==    by 0x341F421A04: (below main) (libc-start.c:225)
      ==8260==
      2cfcd2cc