You need to sign in or sign up before continuing.
  1. 29 1月, 2020 1 次提交
  2. 25 1月, 2020 3 次提交
  3. 17 1月, 2020 1 次提交
  4. 16 1月, 2020 2 次提交
  5. 08 1月, 2020 2 次提交
  6. 07 1月, 2020 1 次提交
  7. 03 1月, 2020 1 次提交
  8. 19 12月, 2019 6 次提交
  9. 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
  10. 17 12月, 2019 22 次提交