1. 12 1月, 2016 24 次提交
    • J
      virsh: Create macro for common "persistent" option · c7ccd8b2
      John Ferlan 提交于
      Rather than continually cut-n-paste the strings into each command,
      create a common macro to be used generically.  Note that not all
      '{.name = "persistent",' entries are replaced, just those that have the
      common .help string of "make live change persistent".
      
      Non replaced instances are unique to the command.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      c7ccd8b2
    • J
      virsh: Create macro for common "domain" option · b6fb1e24
      John Ferlan 提交于
      Rather than continually cut-n-paste the strings into each command,
      create a common macro to be used generically. The macro will take a
      single argument _helpstr which will be used to pass the translatable
      helpstr since not all domain options can take the same string.
      
      The majority of the options take 'N_("domain name, id or uuid")', so
      create a separate macro with a _FULL suffix while those that do not
      take the same string will use the VIRSH_COMMON_OPT_DOMAIN macro.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      b6fb1e24
    • J
      virsh: Adjustments for the VIRSH_COMMON_OPT_POOL · 70c6e677
      John Ferlan 提交于
      The macro is slightly adjusted to add an argument "_helpstr". This
      will be passed as a translation macro string since other uses of the
      option may not have the same exact help string (such as is the case
      when the uuid is not suppliable for create commands).
      
      In virsh-pool.c - we'll create a singular VIRSH_COMMON_OPT_POOL_FULL
      in order to pass along the 'N_("pool name or uuid")'
      
      In virsh-volume.c there will be a VIRSH_COMMON_OPT_POOL_FULL and a
      VIRSH_COMMON_OPT_POOL_NAME, which passes 'N_("pool name")' for
      the commands that can only pass a name. There will also be a
      VIRSH_COMMON_OPT_POOL_OPTIONAL which is used for the command
      options which use OT_STRING and don't require the --pool argument.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      70c6e677
    • J
      virsh: Convert VSH_POOL_ macro to VIRSH_COMMON_OPT_ · f688b808
      John Ferlan 提交于
      Commit id's 'cf793b00', 'e178688f', 'f9a6110f', '5372d49b', and 'e1937354'
      added new VSH_POOL_ macros; however, it was pointed out after push that
      commit id '834c5720' preferred use of VIRSH_ for the prefix over VSH_.
      
      So this patch just changes the VSH_ to VIRSH_ and it changes the naming
      format from VIRSH_<opt>_OPT_COMMON to VIRSH_COMMON_OPT_<opt>.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      f688b808
    • L
      util: eliminate bogus error log in virNetDevVPortProfileGetStatus · 21e63916
      Laine Stump 提交于
       if instanceId is NULL
      
      When virNetDevVPortProfileGetStatus() was called with instanceId =
      NULL (which is the case for all DISASSOCIATE requests in 802.1Qbh) it
      would log the following error:
      
         Could not find netlink response with expected parameters
      
      even though the disassociate had been successfully completely. Then,
      due to the fortunate coincidence of status having been initialized to
      0 and then not changed when the "failure" was encountered, it would
      still return a status of 0 (PORT_VDP_RESPONSE_SUCCESS), so the caller
      would assume a successful operation.
      
      This would result in a spurious log message though, and would fill in
      LastErrorMessage, so that the API would return that error if it
      happened during cleanup from some other error. That, in turn, would
      lead to an incorrect supposition that the response to the port profile
      disassociate was the cause of the failure.
      
      During debugging, I noticed that the VF in question usually had *no
      uuid* associated with it (big surprise)by the time the disassociate
      completed, so the solution is *not* to send the previous instanceId
      down.
      
      This patch fixes virNetDevVPortProfileGetStatus() to only check the
      VF's uuid in the status if it was given an instanceId to check against
      when originally called. Otherwise it only checks that the particular
      VF is present (it will be).
      
      This does cause a slight difference in behavior - rather than
      returning with status unchanged (and thus always 0) it will actually
      get the IFLA_PORT_RESPONSE. This could lead to revelation of error
      conditions we were previously ignoring. Or not. So far "not".
      21e63916
    • L
      qemu: use enum when setting PCI "multi" value, not 0 or 1 · 47b83037
      Laine Stump 提交于
      Use the VIR_TRISTATE_SWITCH_* enums appropriately.
      
      No functional change.
      47b83037
    • L
      qemu: auto-add a USB2 controller set for Q35 machines · bd04ad42
      Laine Stump 提交于
      Use virDomainDefAddUSBController() to add an EHCI1+UHCI1+UHCI2+UHCI3
      controller set to newly defined Q35 domains that don't have any USB
      controllers defined.
      bd04ad42
    • L
      qemu: define virDomainDevAddUSBController() · 8ebca27b
      Laine Stump 提交于
      This new function will add a single controller of the given model,
      except the case of ich9-usb-ehci1 (the master controller for a USB2
      controller set) in which case a set of related controllers will be
      added (EHCI1, UHCI1, UHCI2, UHCI3). These controllers will not be
      given PCI addresses, but should be otherwise ready to use.
      
      "-1" is allowed for controller model, and means "default for this
      machinetype". This matches the existing practice in
      qemuDomainDefPostParse(), which always adds the default controller
      with model = -1, and relies on the commandline builder to set a model
      (that is wrong, but will be fixed later).
      8ebca27b
    • L
      conf: add virDomainDefAddController() · ed64d92b
      Laine Stump 提交于
      We need a virDomainDefAddController() that doesn't check for an
      existing controller at the same index (since USB2 controllers must be
      added in sets of 4 that are all at the same index), so rather than
      duplicating the code in virDomainDefMaybeAddController(), split it
      into two functions, in the process eliminating existing duplicated
      code that loops through the controller list by calling
      virDomainControllerFind(), which does the same thing).
      ed64d92b
    • L
      qemu: prefer 00:1D.x and 00:1A.x for USB2 controllers on Q35 · 163338ec
      Laine Stump 提交于
      The real Q35 machine puts the first USB controller set (EHCI+(UHCIx4))
      on bus 0 slot 0x1D, and the 2nd USB controller set on bus 0 slot 0x1A,
      so let's attempt to make the virtual machine match that for
      controllers with auto-assigned addresses when possible.
      
      Three test cases were added to assure that the proper addresses are
      assigned - one with a single set of unaddressed USB controllers, one
      with 3 (to grab both preferred slots plus one more), and one with the
      order of the controller definitions reordered, to assure that the
      auto-assignment isn't mixed up by order.
      163338ec
    • L
      qemu: don't assume slot 0 is unused/reserved. · 7dbb5fce
      Laine Stump 提交于
      When qemuAssignDevicePCISlots() is looking for companion controllers
      for a USB controller that has no PCI address specified, it initializes
      a virDevicePCIAddress to 0000:00:00.0, fills it in with the
      companion's address if one is found, then checks whether or not there
      was a find based on slot == 0. On a system with a single PCI bus, that
      is a valid way to check, because slot 0 is reserved, but on most other
      PCI buses, slot 0 is not reserved, and is open for use by any
      device. This patch adds a separate bool that is set when a companion
      is found rather than relying on the faulty information provided with
      "slot == 0".
      7dbb5fce
    • J
      Unify int types handling in protocol files · 2b6f6ad6
      Jasper Lievisse Adriaanse 提交于
      Some of the protocol files already include handing of the missing int
      types such as xdr_uint64_t, some don't. To fix it everywhere, move out
      of the appropriate defines to the utils/virxdrdefs.h file and include
      it where needed.
      Signed-off-by: NRoman Bogorodskiy <bogorodskiy@gmail.com>
      2b6f6ad6
    • J
      Use struct sockpeercred when available · 91b423be
      Jasper Lievisse Adriaanse 提交于
      OpenBSD uses 'struct sockpeercred' instead of 'struct ucred'. Add a
      configure check that detects its presence and use if in the code that
      could be compiled on OpenBSD.
      Signed-off-by: NRoman Bogorodskiy <bogorodskiy@gmail.com>
      91b423be
    • J
      cgroup: don't include sys/mount.h if not needed · 1b60f1b4
      Jasper Lievisse Adriaanse 提交于
      As cgroup implementation only works on Linux, it does not
      make much sense to include sys/mount.h if other requirements are
      not met, such as HAVE_MNTENT_H and HAVE_GETMNTENT_R.
      
      Also, it fixes build on OpenBSD that requires to include sys/param.h
      along with sys/mount.h.
      Signed-off-by: NRoman Bogorodskiy <bogorodskiy@gmail.com>
      1b60f1b4
    • C
      build: Kill docs/schemas/Makefile.am · f7d0f124
      Cole Robinson 提交于
      Move the logic to docs/Makefile.am, and simplify it with a wildcard
      expression.
      f7d0f124
    • C
      build: Kill include/libvirt/Makefile.am · 48b6ca83
      Cole Robinson 提交于
      Move all the logic to include/Makefile.am, simplify it with a wildcard,
      then kill include/libvirt/Makefile.am
      48b6ca83
    • M
      wireshark: Fix header of get_message_len() · 4f477785
      Michal Privoznik 提交于
      In wireshark commit ceb8d954 (v1.99.2) they have changed the
      signature of a function that determines how long a libvirt packet
      is. Now it accepts a void pointer for passing data into the
      function. Well, this is nice, but we don't need it right now.
      Anyway, we have to change our code.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      4f477785
    • M
      wireshark: Replace WIRESHARK_COMPAT with actual version comparison · 7bcbcd1d
      Michal Privoznik 提交于
      In the upcoming patch we will need yet another #ifdef code block
      depending on wireshark version. Instead of defining
      WIRESHARK_COMPAT2 or something lets just compare the version
      right at the place so that we can clearly see what version broke
      API.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      7bcbcd1d
    • M
      wireshark: s/tvb_length/tvb_captured_length/ · fcbae101
      Michal Privoznik 提交于
      In wireshak commit 22149c55 (v.1.11.3) the API was renamed.
      Follow the change in our code too. Since the wireshark change was
      made in the very same version that we require at least we are
      good to go.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      fcbae101
    • M
      wireshark: s/ep_alloc/wmem_alloc/ · 0bfdb9cb
      Michal Privoznik 提交于
      In wireshark, they have introduced their own memory allocator
      wmem. This means that we need to adapt our code to that change
      too. Notably 0ad15f88ccf434e8210ca is the wireshark commit you
      want to look at. It's the one where they dropped the old API. The
      new allocator has been introduced in 84cc3daa (v1.10.0), however,
      was not exposed until 5c05c9e0 (v1.10.0). Since we already are
      requiring 1.11.3 or higher no other change is needed.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0bfdb9cb
    • M
      wireshark: s/proto_tree_add_text/proto_tree_add_item/ · d3ede96d
      Michal Privoznik 提交于
      In the wireshark commit e2735ecfdd7a96c they dropped
      proto_tree_add_text in favor of proto_tree_add_item. Adapt to
      this change.
      
      Moreover, the proto_tree_add_item API is around for ages and we
      are already using it anyway. Therefore we don't need to change
      required version of wireshark.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      d3ede96d
    • M
      qemu: Introduce QEMU_CAPS_VSERPORT_CHANGE · 0a84286d
      Michal Privoznik 提交于
      This capability tells if qemu is capable of vserport_change
      events.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      0a84286d
    • M
      qemu: change qemuFindAgentConfig return type · d5762cc0
      Michal Privoznik 提交于
      While this is no functional change, whole channel definition is
      going to be needed very soon. Moreover, while touching this obey
      const correctness rule in qemuAgentOpen() - so far it was passed
      regular pointer to channel config even though the function is
      expected to not change pointee at all. Pass const pointer
      instead.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      d5762cc0
    • M
      qemu: Set virtio channel state sooner · 2f504455
      Michal Privoznik 提交于
      In qemu driver we listen to virtio channel events like an agent
      connected to or disconnected from the guest part of socket.
      However, with a little exception - when we find out that the
      socket in question is the guest agent one, we connect or
      disconnect guest agent which is done prior setting new state in
      internal structure. Due to a bug in our code it may happen that
      we got the event but failed to set it in internal structure
      representing the channel.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2f504455
  2. 11 1月, 2016 12 次提交
  3. 10 1月, 2016 4 次提交
    • C
      examples: Use one top level makefile · da176bf6
      Cole Robinson 提交于
      Using one Makefile per example subdirectory essentially serializes 'make'
      calls. Convert to one example/Makefile that builds and distributes
      all the subdir files. This reduces example/ rebuild time from about 5.8
      seconds to 1.5 seconds on my machine.
      
      One slight difference is that we no longer ship Makefile.am with the
      examples in the rpm. This was virtually useless anyways since the Makefile
      was very specific to libvirt infrastructure, so wasn't generically
      reusable anyways.
      
      Tested with 'make distcheck' and 'make rpm'
      da176bf6
    • C
      cfg.mk: Drop period after filename for indent failures · 03569fda
      Cole Robinson 提交于
      The period makes it more difficult to copy/paste the errant filename
      for manual fixup
      03569fda
    • M
      virt-host-validate-common: Print warning on missing IOMMU · 6e277017
      Michal Privoznik 提交于
      No only coverity warns about this, but it kind of makes sense
      too. We have a test whether host supports IOMMU. Some platforms
      don't have it, I know. But in that case we should print a message
      that it's unknown whether platform has it or not.
      
      Before:
        (no output)
      
      After:
        QEMU: Checking for device assignment IOMMU support                         : WARN (Unknown if this platform has IOMMU support)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      6e277017
    • M
      virDomainMigrateUnmanagedParams: Don't blindly dereference @dconnuri · b7fac9f7
      Michal Privoznik 提交于
      This function may be called with @dconnuri == NULL, e.g. from
      virDomainMigrateToURI3() if the flags are missing
      VIR_MIGRATE_PEER2PEER flag. Moreover, all later functions called
      from here do wrap it into NULLSTR() so why not do the same here?
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      b7fac9f7