1. 07 10月, 2013 11 次提交
    • G
    • E
      build: add configure --without-readline · e5f46105
      Eric Blake 提交于
      Make it much easier to test a configuration built without readline
      support, by reusing our existing library probe machinery.  It gets
      a bit tricky with readline, which does not provide a pkg-config
      snippet, and which on some platforms requires one of several
      terminal libraries as a prerequiste, but the end result should be
      the same default behavior but now with the option to disable things.
      
      * m4/virt-readline.m4 (LIBVIRT_CHECK_READLINE): Simplify by using
      LIBVIRT_CHECK_LIB.
      * tools/virsh.c: Convert USE_READLINE to WITH_READLINE.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      e5f46105
    • E
      build: move readline check into its own macro · d6eac3f3
      Eric Blake 提交于
      A future patch will allow disabling readline; doing this in an
      isolated file instead of configure.ac will make the task easier.
      
      * configure.ac: Move readline code...
      * m4/virt-readline.m4: ...here.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      d6eac3f3
    • E
      build: kill maintainer mode, always rebuild by default · 3fde7ad8
      Eric Blake 提交于
      The automake manual recommends against the use of disabling
      maintainer mode by default:
      
      https://www.gnu.org/software/automake/manual/automake.html#maintainer_002dmode
      
      because when it is disabled, the user gets no indication if they
      touch a file that would normally require a rebuild.  Automake
      1.11 changed things so that AM_MAINTAINER_MODE([enable]) will set
      the mode to enabled by default; but RHEL 5 still uses automake 1.9,
      where AM_MAINTAINER_MODE did not recognize an argument, and
      therefore disables maintainer mode by default.  Having the default
      be different according to which version of automake built the
      project is annoying, and I _have_ been bitten on RHEL 5 rebuilds
      where the default disabled mode led to silently incorrect builds.
      
      The automake manual admits that being able to disable maintainer
      mode still makes sense for projects that still store generated
      files from the autotools in version control; but we have dropped
      that for several years now.  As such, it's finally time to just
      ditch the whole idea of maintainer mode, and unconditionally
      rebuild autotools files if a dependency changes, without offering
      a configure option to disable that mode.
      
      * configure.ac (AM_MAINTAINER_MODE): Drop.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3fde7ad8
    • D
      Remove use of virConnectPtr from all remaining nwfilter code · 999d72fb
      Daniel P. Berrange 提交于
      The virConnectPtr is passed around loads of nwfilter code in
      order to provide it as a parameter to the callback registered
      by the virt drivers. None of the virt drivers use this param
      though, so it serves no purpose.
      
      Avoiding the need to pass a virConnectPtr means that the
      nwfilterStateReload method no longer needs to open a bogus
      QEMU driver connection. This addresses a race condition that
      can lead to a crash on startup.
      
      The nwfilter driver starts before the QEMU driver and registers
      some callbacks with DBus to detect firewalld reload. If the
      firewalld reload happens while the QEMU driver is still starting
      up though, the nwfilterStateReload method will open a connection
      to the partially initialized QEMU driver and cause a crash.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      999d72fb
    • D
      Don't pass virConnectPtr in nwfilter 'struct domUpdateCBStruct' · ebca369e
      Daniel P. Berrange 提交于
      The nwfilter driver only needs a reference to its private
      state object, not a full virConnectPtr. Update the domUpdateCBStruct
      struct to have a 'void *opaque' field instead of a virConnectPtr.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ebca369e
    • D
      Remove virConnectPtr arg from virNWFilterDefParse* · b77b16ce
      Daniel P. Berrange 提交于
      None of the virNWFilterDefParse* methods require a virConnectPtr
      arg, so just drop it
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b77b16ce
    • C
      Adjust legacy max payload size to account for header information · 609eb987
      Claudio Bley 提交于
      Commit 27e81517 set the payload size to 256 KB, which is
      actually the max packet size, including the size of the header.
      
      Reduce this by VIR_NET_MESSAGE_HEADER_MAX (24) and set
      VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX to 262120, which was the original
      value before increasing the limit in commit eb635de1.
      609eb987
    • R
      nodeinfo: make freebsdNodeGetCPUCount work on Mac OS X · 2d74822a
      Ryota Ozaki 提交于
      This fixes the following error:
        error : nodeGetInfo:933 : this function is not supported
        by the connection driver: node info not implemented on this platform
      
      The freebsdNodeGetCPUCount was renamed to appleFreebsdNodeGetCPUCount
      in order to make more visible the fact, that it works on Mac OS X too.
      
      Mac OS X can use sysctlbyname as same as FreeBSD to get the CPU
      frequency. However, the MIB style name is different from FreeBSD's.
      And the unit of the return frequency is also different.
      Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2d74822a
    • R
      rpc: fix getsockopt for LOCAL_PEERCRED on Mac OS X · 5a468b38
      Ryota Ozaki 提交于
      This fixes the following error:
        error : virGetUserEnt:703 : Failed to find user record for uid '32654'
      
      '32654' (it's random and varies) comes from getsockopt with
      LOCAL_PEERCRED option. getsockopt returns w/o error but seems
      to not set any value to the buffer for uid.
      
      For Mac OS X, LOCAL_PEERCRED has to be used with SOL_LOCAL level.
      With SOL_LOCAL, getsockopt returns a correct uid.
      
      Note that SOL_LOCAL can be found in
      /System/Library/Frameworks/Kernel.framework/Versions/A/Headers/sys/un.h.
      Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5a468b38
    • C
      doc: fix typo in HACKING · f7f469d0
      Chen Hanxiao 提交于
      s/installion/installation
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      f7f469d0
  2. 05 10月, 2013 4 次提交
    • E
      build: fix build on 32-bit platforms · 815e3098
      Eric Blake 提交于
      qemumonitorjsontest.c: In function 'testQemuMonitorJSONqemuMonitorJSONGetBalloonInfo':
      qemumonitorjsontest.c:1134: warning: integer constant is too large for 'long' type
      
      * tests/qemumonitorjsontest.c
      (testQemuMonitorJSONqemuMonitorJSONGetBalloonInfo)
      (testQemuMonitorJSONqemuMonitorJSONGetBlockStatsInfo): Use correct
      type.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      815e3098
    • E
      build: fix build on RHEL 5 · 51c82165
      Eric Blake 提交于
      On RHEL 5, compilation fails with:
      
      storage/storage_backend.c: In function 'createRawFile':
      storage/storage_backend.c:339: warning: implicit declaration of function 'fallocate'
      storage/storage_backend.c:339: warning: nested extern declaration of 'fallocate' [-Wnested-externs]
      
      But:
      
      $ grep HAVE_FALLOCATE config.h
      /* #undef HAVE_FALLOCATE */
      
      Huh? It turns out that in kernels that old, fallocate() is not
      implemented (config.h is correct), but <linux/fs.h> defines
      HAVE_FALLOCATE as an empty witness macro for a completely
      different purpose.  Since storage_backend.c is including
      <linux/fs.h> on RHEL 5, we are hosed by the kernel definition.
      Newer kernels no longer pollute the namespace, and it's fairly
      easy to convert to an expression that works with both the old
      kernel witness and the new-style config.h (undefined or 1).
      
      Problem introduced in commit 532fef36.
      
      * src/storage/storage_backend.c (createRawFile): Avoid namespace
      pollution from kernel, by checking HAVE_FALLOCATE for a value.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      51c82165
    • E
      build: fix build --without-remote · bdc55cc7
      Eric Blake 提交于
      I tried to test ./configure --without-lxc --without-remote.
      First, the build failed with some odd errors, such as an
      inability to build xen, or link failures for virNetTLSInit.
      But when you think about it, once there is no remote code,
      all of libvirtd is useless, any stateful driver that depends
      on libvirtd is also not worth compiling, and any libraries
      used only by RPC code are not needed.  So I patched
      configure.ac to make for some saner defaults when an
      explicit disable is attempted.  Similarly, since we have
      migrated virnetdevbridge into generic code, the workaround
      for Linux kernel stupidity must not depend on stateful
      drivers being in use.
      
      Then there's 'make check' that needs segregation.
      
      Wow - quite a bit of cleanup to make --without-remote useful :)
      
      * configure.ac: Let --without-remote toggle defaults on stateful
      drivers and other libraries.  Pick up Linux kernel workarounds
      even when qemu and lxc are not being compiled.
      * tests/Makefile.am (test_programs): Factor out programs that
      require remote.
      * src/libvirt_private.syms (rpc/virnet*.h): Move...
      * src/libvirt_remote.syms: ...into new file.
      * src/Makefile.am (SYM_FILES): Ship new syms file.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      bdc55cc7
    • C
      docs: aclpolkit: Fix a heading typo · 9dd4150a
      Cole Robinson 提交于
      9dd4150a
  3. 04 10月, 2013 13 次提交
  4. 03 10月, 2013 12 次提交
    • L
      qemu: check actual netdev type rather than config netdev type during init · 9881bfed
      Laine Stump 提交于
      This resolves:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=1012824
         https://bugzilla.redhat.com/show_bug.cgi?id=1012834
      
      Note that a similar problem was reported in:
      
         https://bugzilla.redhat.com/show_bug.cgi?id=827519
      
      but the fix only worked for <interface type='hostdev'>, *not* for
      <interface type='network'> where the network itself was a pool of
      hostdevs.
      
      The symptom in both cases was this error message:
      
         internal error: Unable to determine device index for network device
      
      In both cases the cause was lack of proper handling for netdevs
      (<interface>) of type='hostdev' when scanning the netdev list looking
      for alias names in qemuAssignDeviceNetAlias() - those that aren't
      type='hostdev' have an alias of the form "net%d", while those that are
      hostdev use "hostdev%d". This special handling was completely lacking
      prior to the fix for Bug 827519 which was:
      
      When searching for the highest alias index, libvirt looks at the alias
      for each netdev and if it is type='hostdev' it ignores the entry. If
      the type is not hostdev, then it expects the "net%d" form; if it
      doesn't find that, it fails and logs the above error message.
      
      That fix works except in the case of <interface type='network'> where
      the network uses hostdev (i.e. the network is a pool of VFs to be
      assigned to the guests via PCI passthrough). In this case, the check
      for type='hostdev' would fail because it was done as:
      
           def->net[i]->type == VIR_DOMAIN_NET_TYPE_HOSTDEV
      
      (which compares what was written in the config) when it actually
      should have been:
      
          virDomainNetGetActualType(def->net[i]) == VIR_DOMAIN_NET_TYPE_HOSTDEV
      
      (which compares the type of netdev that was actually allocated from
      the network at runtime).
      
      Of course the latter wouldn't be of any use if the netdevs of
      type='network' hadn't already acquired their actual network connection
      yet, but manual examination of the code showed that this is never the
      case.
      
      While looking through qemu_command.c, two other places were found to
      directly compare the net[i]->type field rather than getting actualType:
      
      * qemuAssignDeviceAliases() - in this case, the incorrect comparison
        would cause us to create a "net%d" alias for a netdev with
        type='network' but actualType='hostdev'. This alias would be
        subsequently overwritten by the proper "hostdev%d" form, so
        everything would operate properly, but a string would be
        leaked. This patch also fixes this problem.
      
      * qemuAssignDevicePCISlots() - would defer assigning a PCI address to
        a netdev if it was type='hostdev', but not for type='network +
        actualType='hostdev'. In this case, the actual device usually hasn't
        been acquired yet anyway, and even in the case that it has, there is
        no practical difference between assigning a PCI address while
        traversing the netdev list or while traversing the hostdev
        list. Because changing it would be an effective NOP (but potentially
        cause some unexpected regression), this usage was left unchanged.
      9881bfed
    • M
      qemucapabilitiesdata: Add qemu-1.6.50 data · 50c5818c
      Michal Privoznik 提交于
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      50c5818c
    • M
      qemucapabilitiesdata: Add qemu-1.6.0 data · 3e17d795
      Michal Privoznik 提交于
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      3e17d795
    • M
      qemucapabilitiesdata: Add qemu-1.4.2 data · 47674a22
      Michal Privoznik 提交于
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      47674a22
    • M
      qemucapabilitiesdata: Add qemu-1.3.1 data · 37819287
      Michal Privoznik 提交于
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      37819287
    • M
      qemucapabilitiesdata: Add qemu-1.2.2 data · f44cea73
      Michal Privoznik 提交于
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      f44cea73
    • M
      qemuMonitorTestFree: Join worker thread · 2d670cd4
      Michal Privoznik 提交于
      Join the worker thread no matter if it is running or zombie already.
      With current implementation the thread is joined iff @running is true.
      However, when worker executes the last line, @running is set to false.
      Hence qemuMonitorTestFree() won't join it (and free resources) even
      though we can clearly see worker has run (nobody else sets @running =
      false).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      2d670cd4
    • M
      qemumonitorjsontest: Test qemuMonitorJSONSystemPowerdown · 555b0420
      Michal Privoznik 提交于
      Right now, we are testing qemuMonitorSystemPowerdown instead of
      qemuMonitorJSONSystemPowerdown. It makes no harm, as both functions have
      the same header and the former is just a wrapper over the latter. But we
      should be consistent as we're testing the JSON functions only in here.
      555b0420
    • D
      Use 'vnet' as prefix for veth devices · fe3f108d
      Daniel P. Berrange 提交于
      The XML parser reserves 'vnet' as a prefix for automatically
      generated NIC device names. Switch the veth device creation
      to use this prefix, so it does not have to worry about clashes
      with user specified names in the XML.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      fe3f108d
    • D
      Retry veth device creation on failure · f2e53555
      Daniel P. Berrange 提交于
      The veth device creation code run in two steps, first it looks
      for two free veth device names, then it runs ip link to create
      the veth pair. There is an obvious race between finding free
      names and creating them, when guests are started in parallel.
      
      Rewrite the code to loop and re-try creation if it fails, to
      deal with the race condition.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f2e53555
    • D
      Avoid deleting NULL veth device name · 8766e9b5
      Daniel P. Berrange 提交于
      If veth device allocation has a fatal error, the veths
      array may contain NULL device names. Avoid calling the
      virNetDevVethDelete function on such names.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8766e9b5
    • D
      Avoid reporting an error if veth device is already deleted · 10caf94d
      Daniel P. Berrange 提交于
      The kernel automatically destroys veth devices when cleaning
      up the container network namespace. During normal shutdown, it
      is thus likely that the attempt to run 'ip link del vethN'
      will fail. If it fails, check if the device exists, and avoid
      reporting an error if it has gone. This switches to use the
      virCommand APIs instead of virRun too.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      10caf94d