1. 15 12月, 2014 1 次提交
  2. 13 12月, 2014 2 次提交
    • M
      qemu: avoid rare race when undefining domain · c7d1c139
      Martin Kletzander 提交于
      When one domain is being undefined and at the same time started, for
      example, there is a possibility of a rare problem occuring.
      
       - Thread 1 does virDomainUndefine(), has the lock, checks that the
         domain is active and because it's not, calls
         virDomainObjListRemove().
      
       - Thread 2 does virDomainCreate() and tries to lock the domain.
      
       - Thread 1 needs to lock domain list in order to remove the domain from
         it, but must unlock domain first (proper order is to lock domain list
         first and the domain itself second).
      
       - Thread 2 grabs the lock, starts the domain and releases the lock.
      
       - Thread 1 grabs the lock and removes the domain from list.
      
      With this patch:
      
       - The undefining domain gets marked as "to undefine" before it is
          unlocked.
      
       - If domain is found in any of the search APIs, it's returned only if
         it is not marked as "to undefine".  The check is done while the
         domain is locked.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1150505Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      c7d1c139
    • L
      conf: Ignore device address for model=none usb controller and memballon · f6f4bd10
      Luyao Huang 提交于
      It make no sense at all to have it there.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      f6f4bd10
  3. 12 12月, 2014 1 次提交
  4. 10 12月, 2014 1 次提交
  5. 09 12月, 2014 3 次提交
    • L
      conf: forbid negative number in address(like controller, bus, slot...) · a23fefdf
      Luyao Huang 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1171582
      
      When we edit a negative controller address number to a device,
      some of them will auto generate a controller with invalid index
      number. This will make guest disappear after restart libvirtd.
      Instead of allowing negative number for controller index, we
      should forbid negative number in these place (we did this before,
      but after f18c02ec, virStrToLong_ui changed to allow negative
      number). Therefore switch to virStrToLong_uip in these places.
      Signed-off-by: NLuyao Huang <lhuang@redhat.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      a23fefdf
    • L
      network: store network macTableManager setting in NetDef actual object · 33f4a8bc
      Laine Stump 提交于
      At the time that the network driver allocates a connection to a
      network, the tap device that will be used hasn't yet been created -
      that will be done later by qemu (or lxc or whoever) - but if the
      network has macTableManager='libvirt', then when we do get around to
      creating the tap device, we will need to add an entry for it to the
      network bridge's fdb (forwarding database) *and* turn off learning and
      unicast_flood for that tap device in the bridge's sysfs settings. This
      means that qemu needs to know both the bridge name as well as the
      setting of macTableManager, so we either need to create a new API to
      retrieve that info, or just pass it back in the ActualNetDef that is
      created during networkAllocateActualDevice. We choose the latter
      method, since it's already done for the bridge device, and it has the
      side effect of making the information available in domain status.
      
      (NB: in the future, I think that the tap device should actually be
      created by networkAllocateActualDevice(), as that will solve several
      other problems, but that is a battle for another day, and this
      information will still be useful outside the network driver)
      33f4a8bc
    • L
      network: save bridge name in ActualNetDef when actualType==network too · a3609121
      Laine Stump 提交于
      When the actualType of a virDomainNetDef is "network", it means that
      we are connecting to a libvirt-managed network (routed, natted, or
      isolated) which does use a bridge device (created by libvirt). In the
      past we have required drivers such as qemu to call the public API to
      retrieve the bridge name in this case (even though it is available in
      the NetDef's ActualNetDef if the actualType is "bridge" (i.e., an
      externally-created bridge that isn't managed by libvirt). There is no
      real reason for this difference, and as a matter of fact it
      complicates things for qemu. Also, there is another bridge-related
      attribute (macTableManager) that will need to be available in both
      cases, so this makes things consistent.
      
      In order to avoid problems when restarting libvirtd after an update
      from an older version that *doesn't* store the network's bridgename in
      the ActualNetDef, we also need to put it in place during
      networkNotifyActualDevice() (this function is run for each interface
      of each domain whenever libvirtd is restarted).
      
      Along with making the bridge name available in the internal object, it
      is also now reported in the <source> element of the <interface> state
      XML (or the <actual> subelement in the internally-stored format).
      
      The one oddity about this change is that usually there is a separate
      union for every different "type" in a higher level object (e.g. in the
      case of a virDomainNetDef there are separate "network" and "bridge"
      members of the union that pivots on the type), but in this case
      network and bridge types both have exactly the same attributes, so the
      "bridge" member is used for both type==network and type==bridge.
      a3609121
  6. 02 12月, 2014 2 次提交
  7. 01 12月, 2014 2 次提交
  8. 25 11月, 2014 2 次提交
  9. 24 11月, 2014 1 次提交
  10. 21 11月, 2014 3 次提交
  11. 15 11月, 2014 1 次提交
  12. 11 11月, 2014 1 次提交
  13. 10 11月, 2014 2 次提交
  14. 08 11月, 2014 1 次提交
    • M
      domain_conf: Use virDomainParseMemory more widely · 01b4de2b
      Michal Privoznik 提交于
      As reviewing patches upstream it occurred to me, that we have two
      functions doing nearly the same: virDomainParseMemory which
      expects XML in the following format:
      
        <memory unit='MiB'>1337</memory>
      
      The other function being virDomainHugepagesParseXML expecting the
      following format:
      
        <someElement size='1337' unit='MiB'/>
      
      It wouldn't matter to have two functions handle two different
      scenarios like this if we could only not copy code that handles
      32bit arches around. So this code merges the common parts into
      one by inventing new @units_xpath argument to
      virDomainParseMemory which allows overriding the default location
      of @unit attribute in XML. With this change both scenarios above
      can be parsed with virDomainParseMemory.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      01b4de2b
  15. 07 11月, 2014 1 次提交
  16. 01 11月, 2014 1 次提交
    • E
      domain: fix parsing of memory tunables on 32-bit machines · 9998a657
      Eric Blake 提交于
      Commit 6c9a8a49 (Oct 2014) exposed a long-standing issue on 32-bit
      machines: code related to virDomainSetMemoryParameters has always
      been documented as using a 64-bit limit, but it was implemented by
      calling virDomainParseMemory which enforced an 'unsigned long'
      limit.  Since VIR_DOMAIN_MEMORY_PARAM_UNLIMITED capped to a
      long is -1, but virDomainParseScaledValue no longer accepts
      negative values, an attempt to use 2^53-1 as a hard memory limit
      started failing the testsuite.  However, the problem with capping
      things artificially low has existed for much longer - ever since
      commits 4888f0fb and 2e22f23b (Mar 2012) switched internal tracking
      from 'unsigned long' to 'unsigned long long' (prior to that time,
      the cap was a side-effect of the choice of types).  We _have_ to
      cap the balloon memory values, (no thanks to baked in 'unsigned long'
      of API such as virDomainSetMaxMemory or virDomainGetInfo with no
      counterpart API that guarantees 64-bit access to those numbers)
      but memory parameters have never needed the artificial limit.
      
      At any rate, the solution is to make the parser function gain a
      parameter, and only do the reduced 32-bit cap for the values that
      are constrained due to API.
      
      * src/conf/domain_conf.h (_virDomainMemtune): Add comments.
      * src/conf/domain_conf.c (virDomainParseMemory): Add parameter.
      (virDomainDefParseXML): Adjust callers.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9998a657
  17. 30 10月, 2014 1 次提交
  18. 25 10月, 2014 1 次提交
  19. 20 10月, 2014 1 次提交
  20. 15 10月, 2014 4 次提交
  21. 13 10月, 2014 1 次提交
  22. 11 10月, 2014 1 次提交
    • J
      Xen: Defer setting default vram value to Xen drivers · 9320c3ff
      Jim Fehlig 提交于
      Allow the Xen drivers to determine default vram values.  Sane
      default vaules depend on the device model being used, so the
      drivers are in the best position to determine the defaults.
      
      For the legacy xen driver, it is best to maintain the existing
      logic for setting default vram values to ensure there are no
      regressions.  The libxl driver currently does not support
      configuring a video device.  Support will be added in a
      subsequent patch, where the benefit of this change will be
      reaped.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      9320c3ff
  23. 06 10月, 2014 1 次提交
    • L
      conf: add trustGuestRxFilters attribute to network and domain interface · 07450cd4
      Laine Stump 提交于
      This new attribute will control whether or not libvirt will pay
      attention to guest notifications about changes to network device mac
      addresses and receive filters. The default for this is 'no' (for
      security reasons). If it is set to 'yes' *and* the specified device
      model and connection support it (currently only macvtap+virtio) then
      libvirt will watch for NIC_RX_FILTER_CHANGED events, and when it
      receives one, it will issue a query-rx-filter command, retrieve the
      result, and modify the host-side macvtap interface's mac address and
      unicast/multicast filters accordingly.
      
      The functionality behind this attribute will be in a later patch. This
      patch merely adds the attribute to the top-level of a domain's
      <interface> as well as to <network> and <portgroup>, and adds
      documentation and schema/xml2xml tests. Rather than adding even more
      test files, I've just added the net attribute in various applicable
      places of existing test files.
      07450cd4
  24. 04 10月, 2014 3 次提交
  25. 01 10月, 2014 1 次提交
  26. 24 9月, 2014 1 次提交
    • J
      conf: add options for disabling segment offloading · 5b3536ae
      Ján Tomko 提交于
      Add options for tuning segment offloading:
      <driver>
        <host csum='off' gso='off' tso4='off' tso6='off'
              ecn='off' ufo='off'/>
        <guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
      </driver>
      which control the respective host_ and guest_ properties
      of the virtio-net device.
      5b3536ae