1. 06 8月, 2013 3 次提交
    • L
      qemu: add pcie-root controller · 48a3f48a
      Laine Stump 提交于
      This controller is implicit on q35 machinetypes. It provides 31 PCIe
      (*not* PCI) slots as controller 0.
      
      Currently there are no devices that can connect to pcie-root, and no
      implicit pci controller on a q35 machine, so q35 is still
      unusable. For a usable q35 system, we need to add a
      "dmi-to-pci-bridge" pci controller, which can connect to pcie-root,
      and provides standard pci slots that can be used to connect other
      devices.
      48a3f48a
    • L
      qemu: enable auto-allocate of all PCI addresses · c305783c
      Laine Stump 提交于
      Previous refactoring of the guest PCI address reservation/allocation
      code allowed for slot types other than basic PCI (e.g. PCI express,
      non-hotpluggable slots, etc) but would not auto-allocate a slot for a
      device that required any type other than a basic hot-pluggable
      PCI slot.
      
      This patch refactors the code to be aware of different slot types
      during auto-allocation of addresses as well - as long as there is an
      empty slot of the required type, it will be found and used.
      
      The piece that *wasn't* added is that we don't auto-create a new PCI
      bus when needed for anything except basic PCI devices. This is because
      there are multiple different types of controllers that can provide,
      for example, a PCI express slot (in addition to the pcie-root
      controller, these can also be found on a "root-port" or on a
      "downstream-switch-port"). Since we currently don't support any PCIe
      devices (except pending support for dmi-to-pci-bridge), we can defer
      any decision on what to do about this.
      c305783c
    • J
      xen: fix memory corruption in legacy driver · 0e671a16
      Jim Fehlig 提交于
      Commit 632180d1 introduced memory corruption in xenDaemonListDefinedDomains
      by starting to populate the names array at index -1, causing all sorts
      of havoc in libvirtd such as aborts like the following
      
      *** Error in `/usr/sbin/libvirtd': double free or corruption (out): 0x00007fffe00ccf20 ***
      ======= Backtrace: =========
      /lib64/libc.so.6(+0x7abf6)[0x7ffff3fa0bf6]
      /lib64/libc.so.6(+0x7b973)[0x7ffff3fa1973]
      /lib64/libc.so.6(xdr_array+0xde)[0x7ffff403cbae]
      /usr/sbin/libvirtd(+0x50251)[0x5555555a4251]
      /lib64/libc.so.6(xdr_free+0x15)[0x7ffff403ccd5]
      /usr/lib64/libvirt.so.0(+0x1fad34)[0x7ffff76b1d34]
      /usr/lib64/libvirt.so.0(virNetServerProgramDispatch+0x1fc)[0x7ffff76b16f1]
      /usr/lib64/libvirt.so.0(+0x1f214a)[0x7ffff76a914a]
      /usr/lib64/libvirt.so.0(+0x1f222d)[0x7ffff76a922d]
      /usr/lib64/libvirt.so.0(+0xbcc4f)[0x7ffff7573c4f]
      /usr/lib64/libvirt.so.0(+0xbc5e5)[0x7ffff75735e5]
      /lib64/libpthread.so.0(+0x7e0f)[0x7ffff48f7e0f]
      /lib64/libc.so.6(clone+0x6d)[0x7ffff400e7dd]
      
      Fix by initializing ret to 0 and only setting to error on failure path.
      0e671a16
  2. 05 8月, 2013 2 次提交
    • M
      Introduce max_queued_clients · 1199edb1
      Michal Privoznik 提交于
      This configuration knob lets user to set the length of queue of
      connection requests waiting to be accept()-ed by the daemon. IOW, it
      just controls the @backlog passed to listen:
      
        int listen(int sockfd, int backlog);
      1199edb1
    • M
      RPC: Don't accept client if it would overcommit max_clients · 2737aaaf
      Michal Privoznik 提交于
      Currently, even if max_client limit is hit, we accept() incoming
      connection request, but close it immediately. This has disadvantage of
      not using listen() queue. We should accept() only those clients we
      know we can serve and let all other wait in the (limited) queue.
      2737aaaf
  3. 04 8月, 2013 3 次提交
    • L
      qemu: eliminate almost-duplicate code in qemu_command.c · 3bb01257
      Laine Stump 提交于
      * The functions qemuDomainPCIAddressReserveAddr and
      qemuDomainPCIAddressReserveSlot were very similar (and should have
      been more similar) and were about to get more code added to them which
      would create even more duplicated code, so this patch gives
      qemuDomainPCIAddressReserveAddr a "reserveEntireSlot" arg, then
      replaces the body of qemuDomainPCIAddressReserveSlot with a call to
      qemuDomainPCIAddressReserveAddr.
      
      You will notice that addrs->lastaddr was previously set in
      qemuDomainPCIAddressReserveAddr (but *not* set in
      qemuDomainPCIAddressReserveSlot). For consistency and cleanliness of
      code, that bit was removed and put into the one caller of
      qemuDomainPCIAddressReserveAddr (there is a similar place where the
      caller of qemuDomainPCIAddressReserveSlot sets lastaddr). This does
      guarantee identical functionality to pre-patch code, but in practice
      isn't really critical, because lastaddr is just keeping track of where
      to start when looking for a free slot - if it isn't updated, we will
      just start looking on a slot that's already occupied, then skip up to
      one that isn't.
      
      * qemuCollectPCIAddress was essentially doing the same thing as
      qemuDomainPCIAddressReserveAddr, but with some extra special case
      checking at the beginning. The duplicate code has been replaced with
      a call to qemuDomainPCIAddressReserveAddr. This required adding a
      "fromConfig" boolean, which is only used to change the log error
      code from VIR_ERR_INTERNAL_ERROR (when the address was
      auto-generated by libvirt) to VIR_ERR_XML_ERROR (when the address is
      coming from the config); without this differentiation, it would be
      difficult to tell if an error was caused by something wrong in
      libvirt's auto-allocate code or just bad config.
      
      * the bit of code in qemuDomainPCIAddressValidate that checks the
      connect type flags is going to be used in a couple more places where
      we don't need to also check the slot limits (because we're generating
      the slot number ourselves), so that has been pulled out into a
      separate qemuDomainPCIAddressFlagsCompatible function.
      3bb01257
    • L
      qemu: rename some functions in qemu_command.c · 29e3a1df
      Laine Stump 提交于
      * qemuDomainPCIAddressSetNextAddr
      
      The name of this function was confusing because 1) other functions in
      the file that end in "Addr" are only operating on a single function of
      one PCI slot, not the entire slot, while functions that do something
      with the entire slot end in "Slot", and 2) it didn't contain a verb
      describing what it is doing (the "Set" refers to the set that contains
      all PCI buses in the system, used to keep track of which slots in
      which buses are already reserved for use).
      
      It is now renamed to qemuDomainPCIAddressReserveNextSlot, which more
      clearly describes what it is doing. Arguably, it could have been
      changed to qemuDomainPCIAddressSetReserveNextSlot, but 1) the word
      "set" is confusing in this context because it could be intended as a
      verb or as a noun, and 2) most other functions that operate on a
      single slot or address within this set are also named
      qemuDomainPCIAddress... rather than qemuDomainPCIAddressSet... Only
      the Create, Free, and Grow functions for an address set (which modify the
      entire set, not just one element) use "Set" in their name.
      
      * qemuPCIAddressAsString, qemuPCIAddressValidate
      
      All the other functions in this set are named
      qemuDomainPCIAddressxxxxx, so I renamed these to be consistent.
      29e3a1df
    • L
      conf: add default USB controller in qemu post-parse callback · c66da9d2
      Laine Stump 提交于
      The parser shouldn't be doing arch-specific things like adding in
      implicit controllers to the config. This should instead be done in the
      hypervisor's post-parse callback.
      
      This patch removes the auto-add of a usb controller from the domain
      parser, and puts it into the qemu driver's post-parse callback (just
      as is already done with the auto-add of the pci-root controller). In
      the future, any machine/arch that shouldn't have a default usb
      controller added should just set addDefaultUSB = false in this
      function.
      
      We've recently seen that q35 and ARMV7L domains shouldn't get a default USB
      controller, so I've set addDefaultUSB to false for both of those.
      c66da9d2
  4. 02 8月, 2013 4 次提交
  5. 01 8月, 2013 8 次提交
  6. 31 7月, 2013 8 次提交
  7. 30 7月, 2013 4 次提交
  8. 29 7月, 2013 8 次提交
    • E
      build: fix another virdbus issue on mingw · 9d62472f
      Eric Blake 提交于
      Depending on the set of mingw packages installed, it is possible
      that other .c files hit the mingw header pollution from the
      virdbus.h file.
      
      In file included from ../../src/rpc/virnetserver.c:39:0:
      ../../src/util/virdbus.h:41:35: error: expected ';', ',' or ')' before 'struct'
                             const char *interface,
                                         ^
      
      * src/util/virdbus.h (virDBusCallMethod): Match .c file change.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9d62472f
    • E
      build: fix virutil build on mingw · cd725c7a
      Eric Blake 提交于
      On platforms without decent group support, the build failed:
      
      Cannot export virGetGroupList: symbol not defined
      ./.libs/libvirt_security_manager.a(libvirt_security_manager_la-security_dac.o): In function `virSecurityDACPreFork':
      /home/eblake/libvirt-tmp/build/src/../../src/security/security_dac.c:248: undefined reference to `virGetGroupList'
      collect2: error: ld returned 1 exit status
      
      * src/util/virutil.c (virGetGroupList): Provide dummy implementation.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      cd725c7a
    • E
      build: fix virthread build on mingw · 4c1c336c
      Eric Blake 提交于
      Our recent conversion to make VIR_ALLOC report oom wasn't
      tested on mingw:
      
      In file included from ../../src/util/virthread.c:29:0:
      ../../src/util/virthreadwin32.c: In function 'virCondWait':
      ../../src/util/virthreadwin32.c:166:81: error: 'VIR_FROM_THIS' undeclared (first use in this function)
           if (VIR_REALLOC_N(c->waiters, c->nwaiters + 1) < 0) {
                                                                                       ^
      
      * src/util/virthreadwin32.c (VIR_FROM_THIS): Define.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4c1c336c
    • E
      build: fix virdbus build on mingw · 61fac39e
      Eric Blake 提交于
      Mingw headers pollute the namespace.
      
        CC       libvirt_util_la-virdbus.lo
      ../../src/util/virdbus.c:1102:35: error: expected ';', ',' or ')' before 'struct'
                             const char *interface,
                                         ^
      
      * src/util/virdbus.c (virDBusCallMethod): Avoid 'interface'.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      61fac39e
    • E
      build: fix vircgroup build on mingw · a2d0c3f5
      Eric Blake 提交于
      The previous patch was incomplete.
      
        CC       libvirt_util_la-vircgroup.lo
      ../../src/util/vircgroup.c:70:12: error: 'virCgroupPartitionEscape' declared 'static' but never defined [-Werror=unused-function]
       static int virCgroupPartitionEscape(char **path);
                  ^
      
      * src/util/vircgroup.c (virCgroupPartitionEscape): Move forward
      declaration inside conditional.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a2d0c3f5
    • D
      Conditionalize build of virCgroupValidateMachineGroup · 7cf81fa1
      Daniel P. Berrange 提交于
      The virCgroupValidateMachineGroup method calls some functions
      which are only conditionally compiled, thus it too must be
      made conditional. This fixes the build on non-Linux hosts.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      7cf81fa1
    • E
      build: fix VPATH 'make check' · 7df291a6
      Eric Blake 提交于
      A VPATH build 'make check' was failing with:
      
        GEN      check-driverimpls
      Can't open ../../src/../../src/lxc/lxc_monitor_protocol.h: No such file or directory at ../../src/check-driverimpls.pl line 29, <> line 27153.
      Can't open ../../src/../../src/lxc/lxc_monitor_protocol.c: No such file or directory at ../../src/check-driverimpls.pl line 29, <> line 27153.
      ...
        GEN      check-aclrules
      cannot read ../../src/../../src/remote/remote_protocol.x at ../../src/check-aclrules.pl line 128.
      
      because $(srcdir) was being prepended to file names that already
      included it.
      
      * src/Makefile.am (check-driverimpls): Don't add srcdir twice.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      7df291a6
    • D
      Fix probing of legacy Xen driver to not leave URI set · b7caae92
      Daniel P. Berrange 提交于
      When the legacy Xen driver probes with a NULL URI, and
      finds itself running on Xen, it will set conn->uri. A
      little bit later though it checks to see if libxl support
      exists, and if so declines the driver. This leaves the
      conn->uri set to 'xen:///', so if libxl also declines
      it, it prevents probing of the QEMU driver.
      
      Once a driver has set the conn->uri, it must *never*
      decline an open request. So we must move the libxl
      check earlier
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b7caae92