1. 10 8月, 2012 9 次提交
    • M
      docs: fix 404 page when fetched from different location · 3924072e
      Martin Kletzander 提交于
      Error 404 page had relative paths specified for both the image and
      stylesheets which caused a problem when requested URL included a
      subfolder (e.g. http://libvirt.org/asdf/asdf ). This patch corrects
      this behaviour by modifying href_base to '/' (for style-sheets) and
      changing the src of the image (to be '/' always).
      3924072e
    • L
      nwfilter: fix crash during filter define when lxc driver failed startup · b8a56f12
      Laine Stump 提交于
      The meat of this patch is just moving the calls to
      virNWFilterRegisterCallbackDriver from each hypervisor's "register"
      function into its "initialize" function. The rest is just code
      movement to allow that, and a new virNWFilterUnRegisterCallbackDriver
      function to undo what the register function does.
      
      The long explanation:
      
      There is an array in nwfilter called callbackDrvArray that has
      pointers to a table of functions for each hypervisor driver that are
      called by nwfilter. One of those function pointers is to a function
      that will lock the hypervisor driver. Entries are added to the table
      by calling each driver's "register" function, which happens quite
      early in libvirtd's startup.
      
      Sometime later, each driver's "initialize" function is called. This
      function allocates a driver object and stores a pointer to it in a
      static variable that was previously initialized to NULL. (and here's
      the important part...) If the "initialize" function fails, the driver
      object is freed, and that pointer set back to NULL (but the entry in
      nwfilter's callbackDrvArray is still there).
      
      When the "lock the driver" function mentioned above is called, it
      assumes that the driver was successfully loaded, so it blindly tries
      to call virMutexLock on "driver->lock".
      
      BUT, if the initialize never happened, or if it failed, "driver" is
      NULL. And it just happens that "lock" is always the first field in
      driver so it is also NULL.
      
      Boom.
      
      To fix this, the call to virNWFilterRegisterCallbackDriver for each
      driver shouldn't be called until the end of its (*already guaranteed
      successful*) "initialize" function, not during its "register" function
      (which is currently the case). This implies that there should also be
      a virNWFilterUnregisterCallbackDriver() function that is called in a
      driver's "shutdown" function (although in practice, that function is
      currently never called).
      b8a56f12
    • E
      build: fix PROBE() usage of intptr_t · 51ee43aa
      Eric Blake 提交于
      Otherwise, in locations like virobject.c where PROBE is used,
      for certain configure options, the compiler warns:
      
      util/virobject.c:110:1: error: 'intptr_t' undeclared (first use in this function)
      
      As long as we are making this header always available, we can
      clean up several other files.
      
      * src/internal.h (includes): Pull in <stdint.h>.
      * src/conf/nwfilter_conf.h: Rely on internal.h.
      * src/storage/storage_backend.c: Likewise.
      * src/storage/storage_backend.h: Likewise.
      * src/util/cgroup.c: Likewise.
      * src/util/sexpr.h: Likewise.
      * src/util/virhashcode.h: Likewise.
      * src/util/virnetdevvportprofile.h: Likewise.
      * src/util/virnetlink.h: Likewise.
      * src/util/virrandom.h: Likewise.
      * src/vbox/vbox_driver.c: Likewise.
      * src/xenapi/xenapi_driver.c: Likewise.
      * src/xenapi/xenapi_utils.c: Likewise.
      * src/xenapi/xenapi_utils.h: Likewise.
      * src/xenxs/xenxs_private.h: Likewise.
      * tests/storagebackendsheepdogtest.c: Likewise.
      51ee43aa
    • E
      build: fix author of previous commit · 7d7ee14b
      Eric Blake 提交于
      Stefan's attribution came through with an extra 'n' in the email address.
      7d7ee14b
    • M
      esx: Implement network driver · b8fa5fd0
      Matthias Bolte 提交于
      An ESX server has one or more PhysicalNics that represent the actual
      hardware NICs. Those can be listed via the interface driver.
      
      A libvirt virtual network is mapped to a HostVirtualSwitch. On the
      physical side a HostVirtualSwitch can be connected to PhysicalNics.
      On the virtual side a HostVirtualSwitch has HostPortGroups that are
      mapped to libvirt virtual network's portgroups. Typically there is
      HostPortGroups named 'VM Network' that is used to connect virtual
      machines to a HostVirtualSwitch. A second HostPortGroup typically
      named 'Management Network' is used to connect the hypervisor itself
      to the HostVirtualSwitch. This one is not mapped to a libvirt virtual
      network's portgroup. There can be more HostPortGroups than those
      typical two on a HostVirtualSwitch.
      
               +---------------+-------------------+
         ...---|               |                   |   +-------------+
               | HostPortGroup |                   |---| PhysicalNic |
               |   VM Network  |                   |   |    vmnic0   |
         ...---|               |                   |   +-------------+
               +---------------+ HostVirtualSwitch |
                               |     vSwitch0      |
               +---------------+                   |
               | HostPortGroup |                   |
         ...---|   Management  |                   |
               |    Network    |                   |
               +---------------+-------------------+
      
      The virtual counterparts of the PhysicalNic is the HostVirtualNic for
      the hypervisor and the VirtualEthernetCard for the virtual machines
      that are grouped into HostPortGroups.
      
         +---------------------+   +---------------+---...
         | VirtualEthernetCard |---|               |
         +---------------------+   | HostPortGroup |
         +---------------------+   |   VM Network  |
         | VirtualEthernetCard |---|               |
         +---------------------+   +---------------+
                                                   |
                                   +---------------+
         +---------------------+   | HostPortGroup |
         |    HostVirtualNic   |---|   Management  |
         +---------------------+   |    Network    |
                                   +---------------+---...
      
      The currently implemented network driver can list, define and undefine
      HostVirtualSwitches including HostPortGroups for virtual machines.
      Existing HostVirtualSwitches cannot be edited yet. This will be added
      in a followup patch.
      b8fa5fd0
    • M
      esx: Remove redundant checks for esxVI_LookupHostSystemProperties result · ba86e5cd
      Matthias Bolte 提交于
      esxVI_LookupHostSystemProperties guarantees that hostSystem is non-NULL.
      Remove redundant NULL checks from callers.
      
      Also prefer esxVI_GetStringValue over open-coding the logic.
      ba86e5cd
    • M
      esx: Fix dynamic deep copy · c10cc254
      Matthias Bolte 提交于
      The static deep copy allocates storage for the copy. The dynamic
      version injected the dynamic dispatch after the allocation. This
      triggered the invalid argument check in the dynamically dispatched
      deep copy call. The deep copy function expects its dest parameter
      to be a pointer to a NULL-pointer. This expectation wasn't met due
      to the dispatching deep copy doing the allocation before the call.
      
      Fix this by dynamically dispatching to the correct type before the
      allocation.
      c10cc254
    • M
      esx: Implement interface driver · b9dfbf57
      Matthias Bolte 提交于
      Lists available PhysicalNic devices. A PhysicalNic is always active
      and can neither be defined nor undefined.
      
      A PhysicalNic is used to bridge a HostVirtualSwitch to the physical
      network.
      b9dfbf57
    • S
      nwfilter: remove target table before renaming it · 98c7d8b2
      Stefan Berger 提交于
      Remove the target table before renaming a table to it, i.e.,
      remove table B before renaming A to B. This makes the
      renaming more robust against unconnected left-over tables.
      98c7d8b2
  2. 09 8月, 2012 8 次提交
    • D
      Add APIs for obtaining the unique ID of LVM & SCSI volumes · efd6824c
      Daniel P. Berrange 提交于
      Both LVM volumes and SCSI LUNs have a globally unique
      identifier associated with them. It is useful to be able
      to query this identifier to then perform disk locking,
      rather than try to figure out a stable pathname.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      efd6824c
    • J
      qemu: Fix debug message in p2p migration · e18396f3
      Jiri Denemark 提交于
      When entering "confirm" phase, we are interested in the value of
      cancelled rather then ret variable which was interesting before "finish"
      phase and didn't change since then.
      e18396f3
    • J
      examples: Update strings for event details · 462c2112
      Jiri Denemark 提交于
      462c2112
    • J
      qemu: Migrate at unlimited speed by default · 6cfdeaac
      Jiri Denemark 提交于
      Previously, qemu did not respond to monitor commands during migration if
      the limit was too high. This prevented us from raising the limit
      earlier. The qemu issue seems to be fixed (according to my testing) and
      we may remove the 32Mb/s limit.
      6cfdeaac
    • P
      qemu: Refactor parsing of block device IO tuning parameters. · aba9abc5
      Peter Krempa 提交于
      This patch refactors the JSON parsing function that extracts the block
      IO tuning parameters from qemu's output. The most impacting change
      concerns the error message that is returned if the reply from qemu does
      not contain the needed data. The data for IO parameter tuning were added
      in qemu 1.1 and the previous error message was confusing.
      
      This patch also breaks long lines and extracts a multiple time used code
      pattern to a macro.
      aba9abc5
    • P
      remote: Clean up coding style and refactor remote connection opening · 6758ad4f
      Peter Krempa 提交于
      Remove spaces before function calls and some other coding nits in some
      parts of the remote driver and refactor getting of URI argument
      components into variables used by libvirt later on.
      6758ad4f
    • P
      Allow rbd backing stores · 16d3ab86
      Peter Feiner 提交于
      Prevents libvirt from treating RBD backing stores as files. Without this
      patch, creating a domain with a qcow2 overlay on an RBD would fail.
      
      This patch essentially extends 9c7c4a4f,
      which allows nbd backing stores, to allow rbd backing stores.
      16d3ab86
    • P
      Fix errno check, prevent spurious errors under heavy load · bfa74ebe
      Peter Feiner 提交于
      From man poll(2), poll does not set errno=EAGAIN on interrupt, however
      it does set errno=EINTR. Have libvirt retry on the appropriate errno.
      
      Under heavy load, a program of mine kept getting libvirt errors 'poll on
      socket failed: Interrupted system call'. The signals were SIGCHLD from
      processes forked by threads unrelated to those using libvirt.
      bfa74ebe
  3. 08 8月, 2012 5 次提交
    • G
      qemu:rename qemuCheckScsiControllerModel function · d7d468f0
      Guannan Ren 提交于
      d7d468f0
    • G
      rpc: fix a virObject typo error in struct _virNetServer · 41185927
      Guannan Ren 提交于
      This typo will crash libvirtd when it recevies signal SIGINT
      41185927
    • G
      qemu: add two qemu caps for lsi and virtio-scsi SCSI controllers · 015c603b
      Guannan Ren 提交于
      Rename qemuDefaultScsiControllerModel to qemuCheckScsiControllerModel.
      When scsi model is given explicitly in XML(model > 0) checking if the
      underlying QEMU supports it or not first, raise an error on checking
      failure.
      When the model is not given(mode <= 0), return LSI by default, if
      the QEMU doesn't support it, raise an error.
      015c603b
    • G
      qemu: add capabilities flags related to scsi controller · 8694c716
      Guannan Ren 提交于
        QEMU_CAPS_SCSI_LSI
          set the flag when "lsi53c895a", bus PCI, alias "lsi" in
          the output of "qemu -device ?"
          -device lsi in qemu command line
      
        QEMU_CAPS_VIRTIO_SCSI_PCI
          set the flag when "name "virtio-scsi-pci", bus PCI" in
          the output of qemu devices query.
          -device virtio-scsi-pci in qemu command line
      8694c716
    • L
      util: include stderr in log message when an external command fails · b8c298d3
      Laine Stump 提交于
      This patch is in response to:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=818467
      
      If a caller to virCommandRun doesn't ask for the exitstatus of the
      program it's running, the virCommand functions assume that they should
      log an error message and return failure if the exit code isn't
      0. However, only the commandline and exit status are logged, while
      potentially useful information sent by the program to stderr is
      discarded.
      
      Fortunately, virCommandRun is already checking if the caller had asked
      for stderr to be saved and, if not, sets things up to save it in
      *cmd->errbuf. This makes it fairly simple for virCommandWait to
      include *cmd->errbuf in the error log (there are still other callers
      that don't setup errbuf, and even virCommandRun won't set it up if the
      command is being daemonized, so we have to check that it's non-zero).
      b8c298d3
  4. 07 8月, 2012 12 次提交
  5. 06 8月, 2012 6 次提交
    • R
      apparmor: QEMU bridge helper policy updates · b0e47898
      Richa Marwaha 提交于
      This patch provides AppArmor policy updates for the QEMU bridge helper.
      The QEMU bridge helper is a SUID executable exec'd by QEMU that drops
      capabilities to CAP_NET_ADMIN and adds a tap device to a network bridge.
      Signed-off-by: NRicha Marwaha <rmarwah@linux.vnet.ibm.com>
      Signed-off-by: Corey Bryant<coreyb@linux.vnet.ibm.com>
      b0e47898
    • R
      Add -netdev bridge support · e060f864
      Richa Marwaha 提交于
      This patch adds the support to run the QEMU network helper
      under unprivileged user. It also adds the support for
      attach-interface option in virsh to run under unprivileged
      user.
      Signed-off-by: NRicha Marwaha <rmarwah@linux.vnet.ibm.com>
      Signed-off-by: Corey Bryant<coreyb@linux.vnet.ibm.com>
      e060f864
    • R
      Add -netdev bridge capabilities · 756fe786
      Richa Marwaha 提交于
      This patch adds the capability in libvirt to check if
      -netdev bridge option is supported or not.
      Signed-off-by: NRicha Marwaha <rmarwah@linux.vnet.ibm.com>
      Signed-off-by: Corey Bryant<coreyb@linux.vnet.ibm.com>
      756fe786
    • E
      virrandom: make virRandomInitialize an automatic one-shot · 87de27b7
      Eric Blake 提交于
      All callers used the same initialization seed (well, the new
      viratomictest forgot to look at getpid()); so we might as well
      make this value automatic.  And while it may feel like we are
      giving up functionality, I documented how to get it back in the
      unlikely case that you actually need to debug with a fixed
      pseudo-random sequence.  I left that crippled by default, so
      that a stray environment variable doesn't cause a lack of
      randomness to become a security issue.
      
      * src/util/virrandom.c (virRandomInitialize): Rename...
      (virRandomOnceInit): ...and make static, with one-shot call.
      Document how to do fixed-seed debugging.
      * src/util/virrandom.h (virRandomInitialize): Drop prototype.
      * src/libvirt_private.syms (virrandom.h): Don't export it.
      * src/libvirt.c (virInitialize): Adjust caller.
      * src/lxc/lxc_controller.c (main): Likewise.
      * src/security/virt-aa-helper.c (main): Likewise.
      * src/util/iohelper.c (main): Likewise.
      * tests/seclabeltest.c (main): Likewise.
      * tests/testutils.c (virtTestMain): Likewise.
      * tests/viratomictest.c (mymain): Likewise.
      87de27b7
    • E
      build: drop conditional use of mdns code · 1d5bc382
      Eric Blake 提交于
      Commit 1f6f723c missed a step.  At first I was worried that scrubbing
      the conditionals would lead to a runtime failure when compiled without
      avahi, but my testing makes it appear that the runtime error will only
      occur if the .conf files in /etc request mdns advertisement; and the
      old behavior was to silently ignore the request, so this is actually
      a better behavior of only failing when the config requests the
      impossible.
      
      * src/rpc/virnetserver.c: Drop HAVE_AVAHI conditionals; all
      callers already passed NULL if mdns_adv was not configured.
      1d5bc382
    • M
      qemu: Set reasonable RSS limit on domain startup · addeb7cd
      Michal Privoznik 提交于
      If there's a memory leak in qemu or qemu is exploited the host's
      system will sooner or later start trashing instead of killing
      the bad process. This however has impact on performance and other
      guests as well. Therefore we should set a reasonable RSS limit
      even when user hasn't set any. It's better to be secure by default.
      addeb7cd