1. 19 12月, 2019 2 次提交
  2. 18 12月, 2019 1 次提交
    • D
      qemu_command: tidy up qemuBuildHostdevCommandLine loop · aed9bcd1
      Daniel Henrique Barboza 提交于
      The current 'for' loop with 5 consecutive 'ifs' inside
      qemuBuildHostdevCommandLine can be a bit smarter:
      
      - all 5 'ifs' fails if hostdev->mode is not equal to
      VIR_DOMAIN_HOSTDEV_MODE_SUBSYS. This check can be moved to the
      start of the loop, failing to the next element immediately
      in case it fails;
      
      - all 5 'ifs' checks for a specific subsys->type to build the proper
      command line argument (virHostdevIsSCSIDevice and virHostdevIsMdevDevice
      do that but within a helper). Problem is that the code will keep
      checking for matches even if one was already found, and there is
      no way a hostdev will fit more than one 'if' (i.e. a hostdev can't
      have 2+ different types). This means that a SUBSYS_TYPE_USB will
      create its command line argument in the first 'if', then all other
      conditionals will surely fail but will end up being checked anyway.
      
      All of this can be avoided by moving the hostdev->mode comparing
      to the start of the loop and using a switch statement with
      subsys->type to execute the proper code for a given hostdev
      type.
      Suggested-by: NJán Tomko <jtomko@redhat.com>
      Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      aed9bcd1
  3. 17 12月, 2019 26 次提交
  4. 09 12月, 2019 1 次提交
  5. 26 11月, 2019 1 次提交
  6. 22 11月, 2019 4 次提交
  7. 15 11月, 2019 1 次提交
  8. 12 11月, 2019 2 次提交
  9. 07 11月, 2019 1 次提交
  10. 25 10月, 2019 1 次提交