1. 04 10月, 2013 3 次提交
  2. 03 10月, 2013 8 次提交
    • L
      qemu: check actual netdev type rather than config netdev type during init · 9881bfed
      Laine Stump 提交于
      This resolves:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=1012824
         https://bugzilla.redhat.com/show_bug.cgi?id=1012834
      
      Note that a similar problem was reported in:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=827519
      
      but the fix only worked for <interface type='hostdev'>, *not* for
      <interface type='network'> where the network itself was a pool of
      hostdevs.
      
      The symptom in both cases was this error message:
      
         internal error: Unable to determine device index for network device
      
      In both cases the cause was lack of proper handling for netdevs
      (<interface>) of type='hostdev' when scanning the netdev list looking
      for alias names in qemuAssignDeviceNetAlias() - those that aren't
      type='hostdev' have an alias of the form "net%d", while those that are
      hostdev use "hostdev%d". This special handling was completely lacking
      prior to the fix for Bug 827519 which was:
      
      When searching for the highest alias index, libvirt looks at the alias
      for each netdev and if it is type='hostdev' it ignores the entry. If
      the type is not hostdev, then it expects the "net%d" form; if it
      doesn't find that, it fails and logs the above error message.
      
      That fix works except in the case of <interface type='network'> where
      the network uses hostdev (i.e. the network is a pool of VFs to be
      assigned to the guests via PCI passthrough). In this case, the check
      for type='hostdev' would fail because it was done as:
      
           def->net[i]->type == VIR_DOMAIN_NET_TYPE_HOSTDEV
      
      (which compares what was written in the config) when it actually
      should have been:
      
          virDomainNetGetActualType(def->net[i]) == VIR_DOMAIN_NET_TYPE_HOSTDEV
      
      (which compares the type of netdev that was actually allocated from
      the network at runtime).
      
      Of course the latter wouldn't be of any use if the netdevs of
      type='network' hadn't already acquired their actual network connection
      yet, but manual examination of the code showed that this is never the
      case.
      
      While looking through qemu_command.c, two other places were found to
      directly compare the net[i]->type field rather than getting actualType:
      
      * qemuAssignDeviceAliases() - in this case, the incorrect comparison
        would cause us to create a "net%d" alias for a netdev with
        type='network' but actualType='hostdev'. This alias would be
        subsequently overwritten by the proper "hostdev%d" form, so
        everything would operate properly, but a string would be
        leaked. This patch also fixes this problem.
      
      * qemuAssignDevicePCISlots() - would defer assigning a PCI address to
        a netdev if it was type='hostdev', but not for type='network +
        actualType='hostdev'. In this case, the actual device usually hasn't
        been acquired yet anyway, and even in the case that it has, there is
        no practical difference between assigning a PCI address while
        traversing the netdev list or while traversing the hostdev
        list. Because changing it would be an effective NOP (but potentially
        cause some unexpected regression), this usage was left unchanged.
      9881bfed
    • D
      Use 'vnet' as prefix for veth devices · fe3f108d
      Daniel P. Berrange 提交于
      The XML parser reserves 'vnet' as a prefix for automatically
      generated NIC device names. Switch the veth device creation
      to use this prefix, so it does not have to worry about clashes
      with user specified names in the XML.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      fe3f108d
    • D
      Retry veth device creation on failure · f2e53555
      Daniel P. Berrange 提交于
      The veth device creation code run in two steps, first it looks
      for two free veth device names, then it runs ip link to create
      the veth pair. There is an obvious race between finding free
      names and creating them, when guests are started in parallel.
      
      Rewrite the code to loop and re-try creation if it fails, to
      deal with the race condition.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f2e53555
    • D
      Avoid deleting NULL veth device name · 8766e9b5
      Daniel P. Berrange 提交于
      If veth device allocation has a fatal error, the veths
      array may contain NULL device names. Avoid calling the
      virNetDevVethDelete function on such names.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8766e9b5
    • D
      Avoid reporting an error if veth device is already deleted · 10caf94d
      Daniel P. Berrange 提交于
      The kernel automatically destroys veth devices when cleaning
      up the container network namespace. During normal shutdown, it
      is thus likely that the attempt to run 'ip link del vethN'
      will fail. If it fails, check if the device exists, and avoid
      reporting an error if it has gone. This switches to use the
      virCommand APIs instead of virRun too.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      10caf94d
    • D
      Don't set netdev offline in container cleanup · f5eae570
      Daniel P. Berrange 提交于
      During container cleanup there is a race where the kernel may
      have destroyed the veth device before we try to set it offline.
      This causes log error messages. Given that we're about to
      delete the device entirely, setting it offline is pointless.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f5eae570
    • M
      qemuMonitorJSONSendKey: Avoid double free · 3e8343e1
      Michal Privoznik 提交于
      After successful @cmd construction the memory where @keys points to is
      part of @cmd. Avoid double freeing it.
      3e8343e1
    • M
      qemuMonitorJSONGetVirtType: Fix error message · ec07a9e8
      Michal Privoznik 提交于
      When querying for kvm, we try to find 'enabled' field. Hence the error
      message should report we haven't found 'enabled' and not 'running'
      (which is not even in the reply). Probably a typo or copy-paste error.
      ec07a9e8
  3. 02 10月, 2013 2 次提交
  4. 01 10月, 2013 9 次提交
  5. 30 9月, 2013 5 次提交
  6. 29 9月, 2013 2 次提交
  7. 28 9月, 2013 6 次提交
  8. 27 9月, 2013 5 次提交