1. 15 11月, 2011 6 次提交
    • D
      Rename the LXC veth management APIs and delete duplicated APIs · 29b242ad
      Daniel P. Berrange 提交于
      The src/lxc/veth.c file contains APIs for managing veth devices,
      but some of the APIs duplicate stuff from src/util/virnetdev.h.
      Delete thed duplicate APIs and rename the remaining ones to
      follow virNetDevVethXXXX
      
      * src/lxc/veth.c, src/lxc/veth.h: Rename APIs & delete duplicates
      * src/lxc/lxc_container.c, src/lxc/lxc_controller.c,
        src/lxc/lxc_driver.c: Update for API renaming
      29b242ad
    • D
      Split src/util/network.{c,h} into 5 pieces · d3406045
      Daniel P. Berrange 提交于
      The src/util/network.c file is a dumping ground for many different
      APIs. Split it up into 5 pieces, along functional lines
      
       - src/util/virnetdevbandwidth.c: virNetDevBandwidth type & helper APIs
       - src/util/virnetdevvportprofile.c: virNetDevVPortProfile type & helper APIs
       - src/util/virsocketaddr.c: virSocketAddr and APIs
       - src/conf/netdev_bandwidth_conf.c: XML parsing / formatting
         for virNetDevBandwidth
       - src/conf/netdev_vport_profile_conf.c: XML parsing / formatting
         for virNetDevVPortProfile
      
      * src/util/network.c, src/util/network.h: Split into 5 pieces
      * src/conf/netdev_bandwidth_conf.c, src/conf/netdev_bandwidth_conf.h,
        src/conf/netdev_vport_profile_conf.c, src/conf/netdev_vport_profile_conf.h,
        src/util/virnetdevbandwidth.c, src/util/virnetdevbandwidth.h,
        src/util/virnetdevvportprofile.c, src/util/virnetdevvportprofile.h,
        src/util/virsocketaddr.c, src/util/virsocketaddr.h: New pieces
      * daemon/libvirtd.h, daemon/remote.c, src/conf/domain_conf.c,
        src/conf/domain_conf.h, src/conf/network_conf.c,
        src/conf/network_conf.h, src/conf/nwfilter_conf.h,
        src/esx/esx_util.h, src/network/bridge_driver.c,
        src/qemu/qemu_conf.c, src/rpc/virnetsocket.c,
        src/rpc/virnetsocket.h, src/util/dnsmasq.h, src/util/interface.h,
        src/util/iptables.h, src/util/macvtap.c, src/util/macvtap.h,
        src/util/virnetdev.h, src/util/virnetdevtap.c,
        tools/virsh.c: Update include files
      d3406045
    • D
      Fix error reporting in port profile parsing/formatting APIs · df64f480
      Daniel P. Berrange 提交于
      The virtual port profile parsing/formatting APIs do not
      correctly handle unknown profile type strings/numbers.
      They behave as a no-op, instead of raising an error
      
      * src/util/network.c, src/util/network.h: Fix error
        handling of port profile APIs
      * src/conf/domain_conf.c, src/conf/network_conf.c: Update
        for API changes
      df64f480
    • D
      Rename virVirtualPortProfileParams & APIs · 767e01ce
      Daniel P. Berrange 提交于
      Rename the virVirtualPortProfileParams struct to be
      virNetDevVPortProfile, and rename the APIs to match
      this prefix.
      
      * src/util/network.c, src/util/network.h: Rename port profile
        APIs
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/conf/network_conf.c, src/conf/network_conf.h,
        src/network/bridge_driver.c, src/qemu/qemu_hotplug.c,
        src/util/macvtap.c, src/util/macvtap.h: Update for
        renamed APIs/structs
      767e01ce
    • M
      PATCH: Fix build without MACVTAP · be622a63
      Michael Wood 提交于
      Hi
      
      Commit c31d23a7 removed the "conn"
      parameter from qemuPhysIfaceConnect(), but it's still used if
      WITH_MACVTAP is false.  Also, it's still mentioned in the comment
      above the function:
      
      /**
       * qemuPhysIfaceConnect:
       * @def: the definition of the VM (needed by 802.1Qbh and audit)
       * @conn: pointer to virConnect object
       * @driver: pointer to the qemud_driver
       * @net: pointer to he VM's interface description with direct device type
       * @qemuCaps: flags for qemu
       *
       * Returns a filedescriptor on success or -1 in case of error.
       */
      int
      qemuPhysIfaceConnect(virDomainDefPtr def,
                           struct qemud_driver *driver,
                           virDomainNetDefPtr net,
                           virBitmapPtr qemuCaps,
                           enum virVMOperationType vmop)
      {
          int rc;
      #if WITH_MACVTAP
      [...]
      #else
          (void)def;
          (void)conn;
          (void)net;
          (void)qemuCaps;
          (void)driver;
          (void)vmop;
          qemuReportError(VIR_ERR_INTERNAL_ERROR,
                          "%s", _("No support for macvtap device"));
          rc = -1;
      #endif
          return rc;
      }
      
      --
      Michael Wood <esiotrot@gmail.com>
      
      From f4fc43b4111a4c099395c55902e497b8965e2b53 Mon Sep 17 00:00:00 2001
      From: Michael Wood <esiotrot@gmail.com>
      Date: Sat, 12 Nov 2011 13:37:53 +0200
      Subject: [PATCH] Fix build without MACVTAP.
      be622a63
    • G
      storage: forbid rebuilding existing disk storage pools · afa1029a
      Guido Günther 提交于
      which would blow away all volumes. Honor VIR_STORAGE_POOL_BUILD_OVERWRITE
      to force a rebuild.
      
      This was caught by libvirt-tck's storage/110-disk-pool.t.
      afa1029a
  2. 12 11月, 2011 8 次提交
    • E
      API: add trivial qemu support for VIR_TYPED_PARAM_STRING · 342c0957
      Eric Blake 提交于
      Qemu will be the first driver to make use of a typed string in the
      next round of additions.  Separate out the trivial addition.
      
      * src/qemu/qemu_driver.c (qemudSupportsFeature): Advertise feature.
      (qemuDomainGetBlkioParameters, qemuDomainGetMemoryParameters)
      (qemuGetSchedulerParametersFlags, qemudDomainBlockStatsFlags):
      Allow typed strings flag where trivially supported.
      342c0957
    • E
      API: remote support for VIR_TYPED_PARAM_STRING · 40624d32
      Eric Blake 提交于
      Send and receive string typed parameters across RPC.  This also
      completes the back-compat mentioned in the previous patch - the
      only time we have an older client talking to a newer server is
      if RPC is in use, so filtering out strings during RPC prevents
      returning an unknown type to the older client.
      
      * src/remote/remote_protocol.x (remote_typed_param_value): Add
      another union value.
      * daemon/remote.c (remoteDeserializeTypedParameters): Handle
      strings on rpc.
      (remoteSerializeTypedParameters): Likewise; plus filter out
      strings when replying to older clients.  Adjust callers.
      * src/remote/remote_driver.c (remoteFreeTypedParameters)
      (remoteSerializeTypedParameters)
      (remoteDeserializeTypedParameters): Handle strings on rpc.
      * src/rpc/gendispatch.pl: Properly clean up typed arrays.
      * src/remote_protocol-structs: Update.
      Based on an initial patch by Hu Tao, with feedback from
      Daniel P. Berrange.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      40624d32
    • E
      API: add VIR_TYPED_PARAM_STRING · a218c81d
      Eric Blake 提交于
      This allows strings to be transported between client and server
      in the context of name-type-value virTypedParameter functions.
      For compatibility,
      
          o new clients will not send strings to old servers, based on
            a feature check
          o new servers will not send strings to old clients without the
            flag VIR_TYPED_PARAM_STRING_OKAY; this will be enforced at
            the RPC layer in the next patch, so that drivers need not
            worry about it in general.  The one exception is that
            virDomainGetSchedulerParameters lacks a flags argument, so
            it must not return a string; drivers that forward that
            function on to virDomainGetSchedulerParametersFlags will
            have to pay attention to the flag.
          o the flag VIR_TYPED_PARAM_STRING_OKAY is set automatically,
            based on a feature check (so far, no driver implements it),
            so clients do not have to worry about it
      
      Future patches can then enable the feature on a per-driver basis.
      
      This patch also ensures that drivers can blindly strdup() field
      names (previously, a malicious client could stuff 80 non-NUL bytes
      into field and cause a read overrun).
      
      * src/libvirt_internal.h (VIR_DRV_FEATURE_TYPED_PARAM_STRING): New
      driver feature.
      * src/libvirt.c (virTypedParameterValidateSet)
      (virTypedParameterSanitizeGet): New helper functions.
      (virDomainSetMemoryParameters, virDomainSetBlkioParameters)
      (virDomainSetSchedulerParameters)
      (virDomainSetSchedulerParametersFlags)
      (virDomainGetMemoryParameters, virDomainGetBlkioParameters)
      (virDomainGetSchedulerParameters)
      (virDomainGetSchedulerParametersFlags, virDomainBlockStatsFlags):
      Use them.
      * src/util/util.h (virTypedParameterArrayClear): New helper
      function.
      * src/util/util.c (virTypedParameterArrayClear): Implement it.
      * src/libvirt_private.syms (util.h): Export it.
      Based on an initial patch by Hu Tao, with feedback from
      Daniel P. Berrange.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      a218c81d
    • E
      util: fix compile error on debian · 329b2b28
      Eli Qiao 提交于
      Add virnetdev.h,virnetdevbridge.h,virnetdevtap.h to private symbols,
      since debian linker no longer allows transitive link resolution
      Signed-off-by: NEli Qiao <taget@linux.vnet.ibm.com>
      329b2b28
    • E
      qemu: fix domjobabort regression · 61f2b6ba
      Eric Blake 提交于
      This reverts commit ef1065cf; see also this bug report:
      https://bugzilla.redhat.com/show_bug.cgi?id=751900
      
      In qemu 0.15.1 and earlier, during migration to file, the
      qemu_savevm_state_begin and qemu_savevm_state_iterate methods
      will both process as much migration data as possible until either
      
        1. The file descriptor returns EAGAIN
        2. The bandwidth rate limit is reached
      
      If we set the rate limit to ULONG_MAX, test 2 never becomes true. We're
      passing a plain file descriptor to QEMU and POSIX does not support EAGAIN on
      regular files / block devices, so test 1 never becomes true either.
      
      In the 'virsh save --bypass-cache' case, we pass a pipe instead of a
      regular fd, but using a pipe adds I/O overhead, so always passing a
      pipe just so qemu can see EAGAIN doesn't seem nice.
      
      The ultimate fix needs to come from qemu - background migration must
      respect asynchronous abort requests, or else periodically return
      control to the main handling loop without an EAGAIN and without
      waiting to hit an insanely large amount of data.  But until a
      version of qemu is fixed to support "unlimited" data rates while
      still allowing cancellation, the best we can do is avoid the
      automatic use of unlimited rates from within libvirt (users can
      still explicitly change the migration rates, if they are aware that
      they are giving up the ability to cancel a job).
      
      Reverting the lone use of QEMU_DOMAIN_FILE_MIG_BANDWIDTH_MAX is
      the simplest patch; this slows migration back down to a default
      32M/sec cap, but also ensures that the main qemu processing loop
      will still be responsive to cancellation requests.  Hopefully
      upstream qemu will provide us a means of safely using unlimited
      speed, including a runtime probe of that capability.
      
      * src/qemu/qemu_migration.c (qemuMigrationToFile): Revert attempt
      to use unlimited migration bandwidth when migrating to file.
      Signed-off-by: NDaniel Veillard <veillard@redhat.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      61f2b6ba
    • H
      fix two bugs in bridge_driver.c · d3da21d6
      Hu Tao 提交于
      steps to reproduce:
      
      1. having a network xml file(named default.xml) like this one:
      
      <network>
        <name>default</name>
        <uuid>c5322c4c-81d0-4985-a363-ad6389780d89</uuid>
        <bridge name="virbr0" />
        <forward/>
        <ip address="192.168.122.1" netmask="255.255.255.0">
          <dhcp>
            <range start="192.168.122.2" end="192.168.122.254" />
          </dhcp>
        </ip>
      </network>
      
      in /etc/libvirt/qemu/networks/, and mark it as autostart:
      
      $ ls -l /etc/libvirt/qemu/networks/autostart
      total 0
      lrwxrwxrwx 1 root root 14 Oct 12 14:02 default.xml -> ../default.xml
      
      2. start libvirtd and the device virbr0 is not automatically up.
      
      The reason is that the function virNetDevExists is now returns 1 if
      the device exists, comparing to the former one returns 0 if the device
      exists. But with only this fix will cause a segmentation fault(the same
      steps as above)  that is fixed by the second chunk of code.
      d3da21d6
    • E
      build: drop useless dirent.h includes · e55ec69d
      Eric Blake 提交于
      * .gnulib: Update to latest, for improved syntax-check.
      * src/lxc/lxc_container.c (includes): Drop unused include.
      * src/network/bridge_driver.c: Likewise.
      * src/node_device/node_device_linux_sysfs.c: Likewise.
      * src/openvz/openvz_driver.c: Likewise.
      * src/qemu/qemu_conf.c: Likewise.
      * src/storage/storage_backend_iscsi.c: Likewise.
      * src/storage/storage_backend_mpath.c: Likewise.
      * src/uml/uml_conf.c: Likewise.
      * src/uml/uml_driver.c: Likewise.
      e55ec69d
    • E
      xenapi: remove unused variable · 787b0a22
      Eric Blake 提交于
        CC     libvirt_driver_xenapi_la-xenapi_driver.lo
      xenapi/xenapi_driver.c: In function 'xenapiDomainGetVcpus':
      xenapi/xenapi_driver.c:1209:21: error: variable 'cpus' set but not used [-Werror=unused-but-set-variable]
      
      * src/xenapi/xenapi_driver.c (xenapiDomainGetVcpus): Silence
      compiler warning.
      787b0a22
  3. 11 11月, 2011 1 次提交
  4. 10 11月, 2011 12 次提交
    • E
      nwfilter: simplify execution of ebiptables scripts · 3b7122c0
      Eric Blake 提交于
      It's not worth even worrying about a temporary file, unless we
      ever expect the script to exceed maximum command-line argument
      length limits.
      
      * src/nwfilter/nwfilter_ebiptables_driver.c (ebiptablesExecCLI):
      Run the commands as an argument to /bin/sh, rather than worrying
      about a temporary file.
      (ebiptablesWriteToTempFile): Delete unused function.
      3b7122c0
    • E
      nwfilter: avoid failure with noexec /tmp · bd6083c9
      Eric Blake 提交于
      If /tmp is mounted with the noexec flag (common on security-conscious
      systems), then nwfilter will fail to initialize, because we cannot
      run any temporary script via virRun("/tmp/script"); but we _can_
      use "/bin/sh /tmp/script".  For that matter, using /tmp risks collisions
      with other unrelated programs; we already have /var/run/libvirt as a
      dedicated temporary directory for use by libvirt.
      
      * src/nwfilter/nwfilter_ebiptables_driver.c
      (ebiptablesWriteToTempFile): Use internal directory, not /tmp;
      drop attempts to make script executable; and detect close error.
      (ebiptablesExecCLI): Switch to virCommand, and invoke the shell to
      read the script, rather than requiring an executable script.
      bd6083c9
    • D
      Adjust naming of network device bandwidth management APIs · 0eee075d
      Daniel P. Berrange 提交于
      Rename virBandwidth to virNetDevBandwidth, and virRate to
      virNetDevBandwidthRate.
      
      * src/util/network.c, src/util/network.h: Rename bandwidth
        structs and APIs
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/conf/network_conf.c, src/conf/network_conf.h,
        src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/qemu/qemu_command.c, src/util/macvtap.c,
        src/util/macvtap.h, tools/virsh.c: Update for API changes.
      0eee075d
    • D
      Santize naming of socket address APIs · 4c544e6c
      Daniel P. Berrange 提交于
      The socket address APIs in src/util/network.h either take the
      form  virSocketAddrXXX, virSocketXXX or virSocketXXXAddr.
      
      Sanitize this so everything is virSocketAddrXXXX, and ensure
      that the virSocketAddr parameter is always the first one.
      
      * src/util/network.c, src/util/network.h: Santize socket
        address API naming
      * src/conf/domain_conf.c, src/conf/network_conf.c,
        src/conf/nwfilter_conf.c, src/network/bridge_driver.c,
        src/nwfilter/nwfilter_ebiptables_driver.c,
        src/nwfilter/nwfilter_learnipaddr.c,
        src/qemu/qemu_command.c, src/rpc/virnetsocket.c,
        src/util/dnsmasq.c, src/util/iptables.c,
        src/util/virnetdev.c, src/vbox/vbox_tmpl.c: Update for
        API renaming
      4c544e6c
    • D
      Split bridge.h into three separate files · e49c9bf2
      Daniel P. Berrange 提交于
      Following the renaming of the bridge management APIs, we can now
      split the source file into 3 corresponding pieces
      
       * src/util/virnetdev.c: APIs for any type of network interface
       * src/util/virnetdevbridge.c: APIs for bridge interfaces
       * src/util/virnetdevtap.c: APIs for TAP interfaces
      
      * src/util/virnetdev.c, src/util/virnetdev.h,
        src/util/virnetdevbridge.c, src/util/virnetdevbridge.h,
        src/util/virnetdevtap.c, src/util/virnetdevtap.h: Copied
        from bridge.{c,h}
      * src/util/bridge.c, src/util/bridge.h: Split into 3 pieces
      * src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/openvz/openvz_driver.c, src/qemu/qemu_command.c,
        src/qemu/qemu_conf.h, src/uml/uml_conf.c, src/uml/uml_conf.h,
        src/uml/uml_driver.c: Update #include directives
      e49c9bf2
    • D
      Remove usage of brctl command line tool · c1df2c14
      Daniel P. Berrange 提交于
      Convert the virNetDevBridgeSetSTP and virNetDevBridgeSetSTPDelay
      to use ioctls instead of spawning brctl.
      
      Implement the virNetDevBridgeGetSTP and virNetDevBridgeGetSTPDelay
      methods which were declared in the header but never existed
      
      * src/util/bridge.c: Convert to use bridge ioctls instead of brctl
      c1df2c14
    • D
      Add an API for retrieving the MAC address of an interface · ccc24347
      Daniel P. Berrange 提交于
      * src/util/bridge.c, src/util/bridge.h: Add virNetDevGetMAC
      ccc24347
    • D
      Expose MTU management APIs · dfb454ce
      Daniel P. Berrange 提交于
      The MTU management APIs are useful to other code inside libvirt,
      so should be exposed as non-static APIs.
      
      * src/util/bridge.c, src/util/bridge.h: Expose virNetDevSetMTU,
        virNetDevSetMTUFromDevice & virNetDevGetMTU
      dfb454ce
    • D
      Turn two int parameters into bools in bridge APIs · d8a62d95
      Daniel P. Berrange 提交于
      * src/util/bridge.c, src/util/bridge.h: s/int/bool/ in
        virNetDevSetOnline and virNetDevBridgeSetSTP
      d8a62d95
    • D
      Rename all brXXXX APIs to follow new convention · dced27c8
      Daniel P. Berrange 提交于
      The existing brXXX APIs in src/util/bridge.h are renamed to
      follow one of three different conventions
      
       - virNetDevXXX       - operations for any type of interface
       - virNetDevBridgeXXX - operations for bridge interfaces
       - virNetDevTapXXX    - operations for tap interfaces
      
      * src/util/bridge.h, src/util/bridge.c: Rename all APIs
      * src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/qemu/qemu_command.c, src/uml/uml_conf.c,
        src/uml/uml_driver.c: Update for API renaming
      dced27c8
    • D
      Make all brXXX APIs raise errors, instead of returning errnos · 4f4fd8f7
      Daniel P. Berrange 提交于
      Currently every caller of the brXXX APIs has to store the returned
      errno value and then raise an error message. This results in
      inconsistent error messages across drivers, additional burden on
      the callers and makes the error reporting inaccurate since it is
      hard to distinguish different scenarios from 1 errno value.
      
      * src/util/bridge.c: Raise errors instead of returning errnos
      * src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/qemu/qemu_command.c, src/uml/uml_conf.c,
        src/uml/uml_driver.c: Remove error reporting code
      4f4fd8f7
    • D
      Remove 'brControl' object · 6cfeb9a7
      Daniel P. Berrange 提交于
      The bridge management APIs in src/util/bridge.c require a brControl
      object to be passed around. This holds the file descriptor for the
      control socket. This extra object complicates use of the API for
      only a minor efficiency gain, which is in turn entirely offset by
      the need to fork/exec the brctl command for STP configuration.
      
      This patch removes the 'brControl' object entirely, instead opening
      the control socket & closing it again within the scope of each method.
      
      The parameter names for the APIs are also made to consistently use
      'brname' for bridge device name, and 'ifname' for an interface
      device name. Finally annotations are added for non-NULL parameters
      and return check validation
      
      * src/util/bridge.c, src/util/bridge.h: Remove brControl object
        and update API parameter names & annotations.
      * src/lxc/lxc_driver.c, src/network/bridge_driver.c,
        src/uml/uml_conf.h, src/uml/uml_conf.c, src/uml/uml_driver.c,
        src/qemu/qemu_command.c, src/qemu/qemu_conf.h,
        src/qemu/qemu_driver.c: Remove reference to 'brControl' object
      6cfeb9a7
  5. 09 11月, 2011 3 次提交
  6. 08 11月, 2011 1 次提交
    • E
      build: fix build on platforms without ptsname_r · f7bd00c1
      Eric Blake 提交于
      MacOS lacks ptsname_r, and gnulib doesn't (yet) provide it.
      But we can avoid it altogether, by using gnulib openpty()
      instead.  Note that we do _not_ want the pt_chown module;
      gnulib uses it only to implement a replacement openpty() if
      the system lacks both openpty() and granpt(), but all
      systems that we currently port to either have at least one of
      openpty() and/or grantpt(), or lack ptys altogether.  That is,
      we aren't porting to any system that requires us to deal with
      the hassle of installing a setuid pt_chown helper just to use
      gnulib's ability to provide openpty() on obscure platforms.
      
      * .gnulib: Update to latest, for openpty fixes
      * bootstrap.conf (gnulib_modules): Add openpty, ttyname_r.
      (gnulib_tool_option_extras): Exclude pt_chown module.
      * src/util/util.c (virFileOpenTty): Rewrite in terms of openpty
      and ttyname_r.
      * src/util/util.h (virFileOpenTtyAt): Delete dead prototype.
      f7bd00c1
  7. 07 11月, 2011 2 次提交
    • D
      Add missing defaultConsoleTargetType callback for AppArmour · 07bf96ee
      Daniel P. Berrange 提交于
      Every instance of virCapsPtr must have the defaultConsoleTargetType
      field set.
      
      * src/security/virt-aa-helper.c: Add defaultConsoleTargetType to
        virCapsPtr
      07bf96ee
    • D
      Fix sending/receiving of FDs when stream returns EAGAIN · b2c62316
      Daniel P. Berrange 提交于
      The code calling sendfd/recvfd was mistakenly assuming those
      calls would never block. They can in fact return EAGAIN and
      this is causing us to drop the client connection when blocking
      ocurrs while sending/receiving FDs.
      
      Fixing this is a little hairy on the incoming side, since at
      the point where we see the EAGAIN, we already thought we had
      finished receiving all data for the packet. So we play a little
      trick to reset bufferOffset again and go back into polling for
      more data.
      
      * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Update
        virNetSocketSendFD/RecvFD to return 0 on EAGAIN, or 1
        on success
      * src/rpc/virnetclient.c: Move decoding of header & fds
        out of virNetClientCallDispatch and into virNetClientIOHandleInput.
        Handling blocking when sending/receiving FDs
      * src/rpc/virnetmessage.h: Add a 'donefds' field to track
        how many FDs we've sent / received
      * src/rpc/virnetserverclient.c: Handling blocking when
        sending/receiving FDs
      b2c62316
  8. 05 11月, 2011 3 次提交
    • E
      build: silence compiler warning on BSD · 4d970fd2
      Eric Blake 提交于
      Building on 64-bit FreeBSD 8.2 complained about a cast between
      a pointer and a smaller integer.  Going through an intermediate
      cast shuts up the compiler.
      
      * src/util/threads-pthread.c (virThreadSelfID): Silence a warning.
      4d970fd2
    • E
      build: fix linking on BSD · 9d86cbcf
      Eric Blake 提交于
      While building on FreeBSD (and after fixing a ptsname_r link error),
      I got this failure:
      
      ./.libs/libvirt_util.a(libvirt_util_la-threads.o)(.text+0x240): In function `virThreadCreate':
      util/threads-pthread.c:185: undefined reference to `pthread_create'
      
      It turns out that gnulib used only pthread_join for LIB_PTHREAD,
      but on FreeBSD, libc provides that (as a stub function); whereas
      the more complex pthread_create really does require -pthread,
      which gnulib tracked under [LT]LIBMULTITHREAD.
      
      * configure.ac (LIBS): Check LIBMULTITHREAD alongside LIB_PTHREAD.
      * src/Makefile.am (THREAD_LIBS): New variable.
      (libvirt_util_la_LIBADD, libvirt_lxc_LDADD): Use it.
      9d86cbcf
    • L
      remote: fix mingw32 build · 53c91e99
      Laine Stump 提交于
      tty is initialized, and later set in code that is compiled for all
      platforms, but is only used in a section that's inside #ifndef WIN32.
      53c91e99
  9. 04 11月, 2011 4 次提交
    • E
      lxc: avoid use-after-free · 04d2a7f2
      Eric Blake 提交于
      I got this weird failure:
      
      error: Failed to start domain simple
      error: internal error cannot mix caller fds with blocking execution
      
      and tracked it down to a use-after-free - virCommandSetOutputFD
      was storing the address of a stack-local variable, which then
      went out of scope before the virCommandRun that dereferenced it.
      
      Bug introduced in commit 451cfd05 (0.9.2).
      
      * src/lxc/lxc_driver.c (lxcBuildControllerCmd): Move log fd
      registration...
      (lxcVmStart): ...to caller.
      04d2a7f2
    • D
      Fix naming of constant for disk event · 26ff8996
      Daniel P. Berrange 提交于
      All constants related to events should have a prefix of
      VIR_DOMAIN_EVENT_
      
      * include/libvirt/libvirt.h.in, src/qemu/qemu_domain.c:
        Rename VIR_DOMAIN_DISK_CHANGE_MISSING_ON_START to
        VIR_DOMAIN_EVENT_DISK_CHANGE_MISSING_ON_START
      26ff8996
    • J
      conf: Don't free uninitialized pointer · 15fd90b6
      Jiri Denemark 提交于
      This causes libvirtd to crash when both <boot dev='...'/> and <boot
      order='...'/> are used in one domain XML. Introduced by
      5fa3d775
      15fd90b6
    • E
      build: fix deep VPATH builds · 5d4b0c4c
      Eric Blake 提交于
      I ran into the following build failure:
      $ mkdir -p build1 build2/a/very/deep/hierarcy
      $ cd build2/a/very/deep/hierarcy
      $ ../../../../../configure && make
      $ cd ../../../../build1
      $ ../configure && make
      ...
      ../../src/remote/remote_protocol.c:7:55: fatal error: ../../../../../src/remote/remote_protocol.h: No such file or directory
      
      Turns out that we were sometimes generating the remote_protocol.c
      file with information from the VPATH build, which is bad, since
      any file shipped in the tarball should be idempotent no matter how
      deep the VPATH build tree that created it.
      
      * src/rpc/genprotocol.pl: Don't embed VPATH into generated file.
      5d4b0c4c