1. 15 1月, 2016 1 次提交
  2. 14 1月, 2016 5 次提交
  3. 13 1月, 2016 8 次提交
    • C
      build: fix distdir with wireshark disabled · e20dd2a4
      Cole Robinson 提交于
      Even though the Makefile has WITH_WIRESHARK guards, the _SOURCES
      variables are still processed when adding bits to the dist archive.
      
      plugin.c is a generated file that is only built when wireshark is
      enabled and it shouldn't be distributed, so use 'nodist'
      e20dd2a4
    • M
      qemuProcessCleanupChardevDevice: Don't unlink NULL paths · e988ba94
      Michal Privoznik 提交于
      So, you try to start a domain, but before we even get to the part
      where chardev part of qemu command line is generated (and
      possibly missing path to unix sockets is made up) an error occurs
      which results in calling qemuProcessStop. This will then try to
      clean up the mess and possibly ends up calling unlink(NULL).
      
      ==8085== Thread 3:
      ==8085== Syscall param unlink(pathname) points to unaddressable byte(s)
      ==8085==    at 0xA85EA57: unlink (in /lib64/libc-2.21.so)
      ==8085==    by 0x213D3C24: qemuProcessCleanupChardevDevice (qemu_process.c:2866)
      ==8085==    by 0x558D6B1: virDomainChrDefForeach (domain_conf.c:22924)
      ==8085==    by 0x213DA9AE: qemuProcessStop (qemu_process.c:5326)
      ==8085==    by 0x213DA2F2: qemuProcessStart (qemu_process.c:5190)
      ==8085==    by 0x2142957F: qemuDomainObjStart (qemu_driver.c:7396)
      ==8085==    by 0x214297DB: qemuDomainCreateWithFlags (qemu_driver.c:7450)
      ==8085==    by 0x21429842: qemuDomainCreate (qemu_driver.c:7468)
      ==8085==    by 0x5611B95: virDomainCreate (libvirt-domain.c:6753)
      ==8085==    by 0x125D9A: remoteDispatchDomainCreate (remote_dispatch.h:3613)
      ==8085==    by 0x125CB7: remoteDispatchDomainCreateHelper (remote_dispatch.h:3589)
      ==8085==    by 0x568BF41: virNetServerProgramDispatchCall (virnetserverprogram.c:437)
      ==8085==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
      ==8085==
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      e988ba94
    • J
      xenconfig: check return value of regcomp · 71daae96
      Jim Fehlig 提交于
      Commit ec63000a missed checking the return value of regcomp(),
      which coverity promptly identified.
      71daae96
    • M
      wireshark: Install into DESTDIR · 50078cfb
      Michal Privoznik 提交于
      Like everything we install, it should be prefixed with DESTDIR.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      50078cfb
    • J
      Xen: use correct domctl version in domaininfolist union · 6564de5e
      Jim Fehlig 提交于
      Commmit fd2e3c4c used the domctl version 8 structure for version 9
      in the xen_getdomaininfolist union, resulting in insufficient buffer
      size (and subsequent memory corruption) for the GETDOMAININFOLIST
      ioctl.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      6564de5e
    • C
      testutils: Fix coverity warning with REGENERATE_OUTPUT · ebfd6f45
      Cole Robinson 提交于
      - Don't double check for expectName
      - actual is always non-NULL by this point, so don't check it either
      ebfd6f45
    • C
      build: Kill tools/wireshark Makefiles · 3445acdb
      Cole Robinson 提交于
      Just handle it all in tools/Makefile.am. I verified the generated output
      looks similar to the pre patch output, but I didn't test it.
      3445acdb
    • M
      Expand $(wildcard) correctly · 8c67ab66
      Michal Privoznik 提交于
      So after da176bf6 and friend we have switched to $(wildcard
      some/path/*.xml) instead of enumerating the files explicitly.
      This is nice, however it makes distcheck build from VPATH fail.
      The reason is that it's is not obvious to what does the wildcard
      refer to: srcdir or builddir?
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      8c67ab66
  4. 12 1月, 2016 26 次提交
    • D
      qemu: add support of optional 'autodeflate' attribute · 981c01d4
      Dmitry Andreev 提交于
      Autodeflate can be enabled/disabled for memballon device
      of model 'virtio'.
      
      xml:
      <devices>
        <memballoon model='virtio' autodeflate='on'/>
      </devices>
      
      qemu:
      qemu -device virtio-balloon-pci,...,deflate-on-oom=on
      
      Autodeflate cannot be enabled/disabled for running domain.
      981c01d4
    • D
      qemu: add capability check for memballoon 'deflate-on-oom' feature · 3522a311
      Dmitry Andreev 提交于
      Add appropriate capability check and new virQEMUCaps flag for the new
      virtio balloon feature. QEMU commit with the complete feature description:
      http://git.qemu.org/?p=qemu.git;a=commit;h=e3816255bf4b6377bb405331e2ee0dc14d841b80
      3522a311
    • D
      conf: introduce 'autodeflate' attribute for memballoon device · 7bf3198d
      Dmitry Andreev 提交于
      Excessive memory balloon inflation can cause invocation of OOM-killer,
      when Linux is under severe memory pressure. QEMU memballoon device
      has a feature to release some memory at the last moment before some
      process will be get killed by OOM-killer.
      
      Introduce a new optional balloon device attribute 'autodeflate' to
      enable or disable this feature.
      7bf3198d
    • C
      rpc: socket: Don't repeatedly attempt to launch daemon · 2eb7a975
      Cole Robinson 提交于
      On every socket connect(2) attempt we were re-launching session
      libvirtd, up to 100 times in 5 seconds.
      
      This understandably caused some weird load races and intermittent
      qemu:///session startup failures
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1271183
      2eb7a975
    • C
      rpc: socket: Explicitly error if we exceed retry count · 8da02d52
      Cole Robinson 提交于
      When we autolaunch libvirtd for session URIs, we spin in a retry
      loop waiting for the daemon to start and the connect(2) to succeed.
      
      However if we exceed the retry count, we don't explicitly raise an
      error, which can yield a slew of different error messages elsewhere
      in the code.
      
      Explicitly raise the last connect(2) failure if we run out of retries.
      8da02d52
    • C
      rpc: socket: Minor cleanups · f102c714
      Cole Robinson 提交于
      - Add some debugging
      - Make the loop dependent only on retries
      - Make it explicit that connect(2) success exits the loop
      - Invert the error checking logic
      f102c714
    • R
      Add missing virxdrdefs.h include to log_protocol · bc451c49
      Roman Bogorodskiy 提交于
      Commit 2b6f6ad6 introduced the virxdrdefs.h header with
      common definitions to be included in the protocol files,
      but logging/log_protocol.x was missed, so add it there as well.
      
      Hopefully this fixes build on OS X.
      bc451c49
    • A
      46c551fd
    • B
      rpc: Don't rewrite msg->fds on every read dispatch · 133c511b
      Ben Gray 提交于
      When we are receiving data in smaller chunks it might happen that
      virNetServerClientDispatchRead() will be called multiple times.  And as
      that happens, if it is a message that also transfer headers, we decode
      the number of them every single time and, unfortunately, also allocate
      the memory for them.  That causes a leak, in the best scenario.
      
      Best viewed with '-w'.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      133c511b
    • J
      virsh: Create macro for common "interface" option · 545e5571
      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 = "interface",' entries are replaced, just those that have the
      common .help string of "interface name or MAC address".
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      545e5571
    • J
      virsh: Create macro for common "network" option · 21655228
      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 = "network",' entries are replaced, just those that have the
      common .help string of "network name or uuid".
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      21655228
    • J
      virsh: Create macros for common "vol" options · 5b436359
      John Ferlan 提交于
      Rather than continually cut-n-paste the strings into each command,
      create common macros to be used generically.  Replace the more commonly
      used "vol" option with a macro. This also adjusts 2 commands that
      didn't have the correct helpstr - 'vol-create-from' and 'vol-clone'.
      Both are described in the man page as taking vol, path, or key and
      the code uses the virshCommandOptVol instead of virshCommandOptVolBy.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      5b436359
    • J
      virsh: Create macro for common "file" option · febf69b5
      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 for the less common help string for each
      command option.  Note that only file options using "OT_DATA" and
      "OFLAG_REQ" will be replace - others are left as is.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      febf69b5
    • J
      virsh: Create macro for common "current" option · 5b42dbed
      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 for many options in virsh-domain.c
      is simply "affect current domain". So, create a second macro within that
      file in order to define the more common use as a revector to the
      common macro with the common _helpstr.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      5b42dbed
    • J
      virsh: Create macro for common "live" option · 8e4108f0
      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 for many options in virsh-domain.c
      is simply "affect running domain". So, create a second macro within that
      file in order to define the more common use as a revector to the
      common macro with the common _helpstr.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      8e4108f0
    • J
      virsh: Create macro for common "config" option · 0dbac60b
      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 for many options in virsh-domain.c
      is simply "affect next boot". So, create a second macro within that
      file in order to define the more common use as a revector to the
      common macro with the common _helpstr.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      0dbac60b
    • 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