1. 04 12月, 2011 1 次提交
    • E
      build: fix build on Cygwin · c74a2a03
      Eric Blake 提交于
      The RPC fixups needed on Linux are also needed on cygwin, and
      worked without further tweaking to the list of fixups.  Also,
      unlike BSD, Cygwin exports 'struct ifreq', but unlike Linux,
      Cygwin lacks the ioctls that we were using 'struct ifreq' to
      access.  This patch allows compilation under cygwin.
      
      * src/rpc/genprotocol.pl: Also perform fixups on cygwin.
      * src/util/virnetdev.c (HAVE_STRUCT_IFREQ): Also require AF_PACKET
      definition.
      * src/util/virnetdevbridge.c (virNetDevSetupControlFull): Only
      compile if SIOCBRADDBR works.
      c74a2a03
  2. 03 12月, 2011 2 次提交
    • E
      build: fix build at -O2 on rawhide · 75da3200
      Eric Blake 提交于
      I had previously tested commit 059d746d with -O intentionally omitted
      from my CFLAGS; but that means that I missed out on this warning
      from gcc 4.6.2 when optimizations are enabled:
      
      util/buf.c: In function 'virBufferGetIndent':
      util/buf.c:86:1: error: function might be candidate for attribute 'pure' [-Werror=suggest-attribute=pure]
      
      While it is probably a good idea to add the attributes and silence
      this warning, it's also invasive; 'make -k' found more than 75 such
      complaints.  And it doesn't help that gcc 4.6.2 is still buggy
      (coreutils reported a case where gcc 4.6.2 incorrectly suggested
      marking a function pure that incremented a global variable; fixed
      in gcc 4.7).  So the best fix for now is to disable the warning.
      
      It also doesn't help that I stumbled across another problem - gcc
      documents that -Wsuggest-attribute=pure only warns if you use -O,
      or if you use -fipa-pure-const.  But in practice, when I omitted -O
      but added -fipa-pure-const, the warnings are fickle - I got warnings
      for simple compilation that disappeared when I also added -fPIC.
      And the way libtool compiles things is with -fPIC first, then without
      -fPIC but with errors sent to /dev/null - which meant that without
      disabling -Wsuggest-attribute=pure, I got a compile error with no
      message.  :(  See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10197
      
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): Silence
      -Wsuggest-attribute warnings for now.
      75da3200
    • S
      apparmor: allow tunnelled migrations. · 4cfdbfc4
      Serge Hallyn 提交于
      The pathname for the pipe for tunnelled migration is unresolvable.  The
      libvirt apparmor driver therefore refuses access, causing migration to
      fail.  If we can't resolve the path, the worst that can happen is that
      we should have given permission to the file but didn't.  Otherwise
      (especially since this is a /proc/$$/fd/N file) the file is already open
      and libvirt won't be refused access by apparmor anyway.
      
      Also adjust virt-aa-helper to allow access to the
      *.tunnelmigrate.dest.name files.
      
      For more information, see https://launchpad.net/bugs/869553.
      Signed-off-by: NSerge Hallyn <serge.hallyn@canonical.com>
      4cfdbfc4
  3. 02 12月, 2011 9 次提交
    • P
      client: Check if other thread claims it has the buck before claiming it. · fd066925
      Peter Krempa 提交于
      Originaly, the code checked if another client is the queue and infered
      ownership of the buck from that. Commit fa959500
      added a separate variable to track the buck. That caused, that a new
      call might enter claiming it has the buck, while another thread was
      signalled to take the buck. This ends in two threads claiming they hold
      the buck and entering poll(). This happens due to a race on waking up
      threads on the client lock mutex.
      
      This caused multi-threaded clients to hang, most prominently visible and
      reproducible on python based clients, like virt-manager.
      
      This patch causes threads, that have been signalled to take the buck to
      re-check if buck is held by another thread.
      fd066925
    • S
      Update of filters to handle multiple IP addresses · 8c309caf
      Stefan Berger 提交于
      With fragments borrowed from David Steven's previous submission and some
      further modifications:
      
      A set of modifications to filters to handle multiple IP addresses
      (and MAC addresses) per interface.
      
      Also:
      - enable DHCP traffic from VM to any DHCP server
      - will require an update to a libvirt-tck data file
      Signed-off-by: NDavid L Stevens <dlstevens@us.ibm.com>
      Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
      8c309caf
    • E
      virsh: translate net-info help · 77e62f13
      Eric Blake 提交于
      Reported by kato.tomoyuki@jp.fujitsu.com at
      https://bugzilla.redhat.com/show_bug.cgi?id=749564
      
      * tools/virsh.c (info_network_info): Mark string for translation.
      77e62f13
    • E
      maint: typo fixes · a6997934
      Eric Blake 提交于
      Many of these were mentioned by Yuri Chornoivan in:
      https://bugzilla.redhat.com/show_bug.cgi?id=669506
      
      * src/esx/esx_vi.c (esxVI_WaitForTaskCompletion): Fix spelling.
      * src/conf/netdev_vport_profile_conf.c
      (virNetDevVPortProfileParse): Likewise.
      * src/xen/xend_internal.c (xenDaemonDomainSetVcpusFlags):
      Likewise.
      * src/xen/xm_internal.c (xenXMDomainSetVcpusFlags): Likewise.
      * src/esx/esx_util.c (esxUtil_ResolveHostname): Likewise.
      * src/storage/storage_backend_fs.c
      (virStorageBackendFileSystemBuild): Likewise.
      * daemon/libvirtd.conf: Likewise.
      * src/util/logging.c (virLogMessage): Likewise.
      * src/uml/uml_conf.c (umlBuildCommandLineNet): Likewise.
      * src/vmx/vmx.c (virVMXFormatEthernet): Likewise.
      a6997934
    • E
      build: update to latest gnulib · 059d746d
      Eric Blake 提交于
      * .gnulib: Update to latest, for improved 'make syntax-check' and
      compiler warnings.
      * m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS):
      Re-silence -Wformat-nonliteral.
      * cfg.mk (_test_script_regex): Recognize our test scripts.
      * gnulib/local/lib/*.diff: Drop, now that gnulib has this.
      * tests/virsh-optparse: Fix use of compare.
      * tests/virsh-schedinfo: Likewise.
      059d746d
    • E
      build: properly skip tests · da8061ee
      Eric Blake 提交于
      I got this failure on FreeBSD:
      
      shunloadtest.c: In function 'main':
      shunloadtest.c:150: error: 'EXIT_AM_SKIP' undeclared (first use in this function)
      
      but inspection showed several other problems, all fixed here.
      
      * tests/domainsnapshotxml2xmltest.c [!WITH_QEMU]: Ensure
      EXIT_AM_SKIP is defined.
      * tests/esxutilstest.c [!WITH_ESX]: Likewise.
      * tests/openvzutilstest.c [!WITH_OPENVZ]: Likewise.
      * tests/qemuargv2xmltest.c [!WITH_QEMU]: Likewise.
      * tests/qemuhelptest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxml2argvtest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxml2xmltest.c [!WITH_QEMU]: Likewise.
      * tests/qemuxmlnstest.c [!WITH_QEMU]: Likewise.
      * tests/shunloadtest.c [!linux]: Likewise.
      * tests/vmx2xmltest.c [!WITH_VMX]: Likewise.
      * tests/xml2vmxtest.c [!WITH_VMX]: Likewise.
      da8061ee
    • D
      Avoid crash in shunloadtest · 24d97928
      Daniel P. Berrange 提交于
      For unknown reasons, the shunloadtest will crash on Fedora 16
      inside dlopen()
      
       (gdb) bt
       #0  0x00000000000050e6 in ?? ()
       #1  0x00007ff61a77b9d5 in floor () from /lib64/libm.so.6
       #2  0x00007ff61e522963 in _dl_relocate_object () from /lib64/ld-linux-x86-64.so.2
       #3  0x00007ff61e5297e6 in dl_open_worker () from /lib64/ld-linux-x86-64.so.2
       #4  0x00007ff61e525006 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
       #5  0x00007ff61e52917a in _dl_open () from /lib64/ld-linux-x86-64.so.2
       #6  0x00007ff61e0f6f26 in dlopen_doit () from /lib64/libdl.so.2
       #7  0x00007ff61e525006 in _dl_catch_error () from /lib64/ld-linux-x86-64.so.2
       #8  0x00007ff61e0f752f in _dlerror_run () from /lib64/libdl.so.2
       #9  0x00007ff61e0f6fc1 in dlopen@@GLIBC_2.2.5 () from /lib64/libdl.so.2
       #10 0x0000000000400a15 in main (argc=<optimized out>, argv=<optimized out>) at shunloadtest.c:105
      
      Changing from RTLD_NOW to RTLD_LAZY avoids this problem,
      but quite possibly does not fix the root cause.
      
      * shunloadtest.c: s/NOW/LAZY/
      24d97928
    • D
      Fix build for platforms lacking struct ifreq · 949e1091
      Daniel P. Berrange 提交于
      This ought to fix the build if you have net/if.h but do
      not have struct ifreq
      
      * configure.ac: Check for struct ifreq in net/if.h
      * src/util/virnetdev.c: Conditionalize to avoid use of
        struct ifreq if it does not exist
      949e1091
    • E
      build: fix 'make dist' without dtrace · 55d76a72
      Eric Blake 提交于
      probes.h can only be generated on Linux, and then only with dtrace
      installed.  If it is part of the tarball, then either 'make dist'
      will fail if you don't have that setup, or we would have to start
      keeping probes.h in libvirt.git.  Since we only need it to be
      generated when dtrace is in use, it's better to avoid shipping
      it in the first place, and avoid tracking it in git.
      
      Meanwhile, there is a build dependency - since the RPC code is
      generated, it can be built early; but when dtrace is enabled, we
      must ensure probes.h is built even earlier.  Commit 1afcfbdd tried
      to fix this, but did so in a way that added probes.h into the
      tarball, and broke VPATH as well.  Commit ecbca767 fixed VPATH,
      but didn't fix the more fundamental problem.  This patch solves
      the issue by adding a dependency instead.
      
      Tested with 'make dist' in a clean VPATH builds, for both
      './configure --without-dtrace' and './configure --with-dtrace';
      all configurations were able to correctly build a tarball, and
      the dtrace configuration no longer sticks probes.h in the tarball.
      
      * src/Makefile.am (REMOTE_DRIVER_GENERATED): Don't ship probes.h;
      rather, make it a dependency.
      55d76a72
  4. 01 12月, 2011 23 次提交
  5. 30 11月, 2011 5 次提交
    • D
      Fix leak build config file path · 87e8ff1b
      Daniel P. Berrange 提交于
      * src/libvirt.c: Free user directory path
      87e8ff1b
    • D
      Remove time APIs from src/util/util.h · a8bb75a3
      Daniel P. Berrange 提交于
      The virTimestamp and virTimeMs functions in src/util/util.h
      duplicate functionality from virtime.h, in a non-async signal
      safe manner. Remove them, and convert all code over to the new
      APIs.
      
      * src/util/util.c, src/util/util.h: Delete virTimeMs and virTimestamp
      * src/lxc/lxc_driver.c, src/qemu/qemu_domain.c,
        src/qemu/qemu_driver.c, src/qemu/qemu_migration.c,
        src/qemu/qemu_process.c, src/util/event_poll.c: Convert to use
        virtime APIs
      a8bb75a3
    • D
      Make logging async signal safe wrt time stamp generation · 32d3ec74
      Daniel P. Berrange 提交于
      Use the new virTimeStringNowRaw() API for generating log timestamps
      in an async signal safe manner
      
      * src/util/logging.c: Use virTimeStringNowRaw
      32d3ec74
    • D
      Add internal APIs for dealing with time · 3ec12898
      Daniel P. Berrange 提交于
      The logging APIs need to be able to generate formatted timestamps
      using only async signal safe functions. This rules out using
      gmtime/localtime/malloc/gettimeday(!) and much more.
      
      Introduce a new internal API which is async signal safe.
      
        virTimeMillisNowRaw replacement for gettimeofday. Uses clock_gettime
                            where available, otherwise falls back to the unsafe
                            gettimeofday
      
        virTimeFieldsNowRaw  replacements for gmtime(), convert a timestamp
        virTimeFieldsThenRaw into a broken out set of fields. No localtime()
                             replacement is provided, because converting to
                             local time is not practical with only async signal
                             safe APIs.
      
        virTimeStringNowRaw  replacements for strftime() which print a timestamp
        virTimeStringThenRaw into a string, using a pre-determined format, with
                             a fixed size buffer (VIR_TIME_STRING_BUFLEN)
      
      For each of these there is also a version without the Raw postfix
      which raises a full libvirt error. These versions are not async
      signal safe
      
      * src/Makefile.am, src/util/virtime.c, src/util/virtime.h: New files
      * src/libvirt_private.syms: New APis
      * configure.ac: Check for clock_gettime in -lrt
      * tests/virtimetest.c, tests/Makefile.am: Test new APIs
      3ec12898
    • D
      Remove obsolete virGetPMCapabilities sym from private symbols file · 380110cf
      Daniel P. Berrange 提交于
      Fix the build on Mingw32 by removing the now obsolete
      virGetPMCapabilities symbol from the private exports file
      
      * src/libvirt_private.syms: Remove virGetPMCapabilities
      380110cf