1. 01 6月, 2013 1 次提交
  2. 22 5月, 2013 1 次提交
    • G
      conf: add 'sharePolicy' attribute to graphics element for vnc · 2a58d076
      Guannan Ren 提交于
       -vnc :5900,share=allow-exclusive
      allows clients to ask for exclusive access which is
      implemented by dropping other connections Connecting
      multiple clients in parallel requires all clients asking
      for a shared session (vncviewer: -shared switch)
      
       -vnc :5900,share=force-shared
      disables exclusive client access.  Useful for shared
      desktop sessions, where you don't want someone forgetting
      specify -shared disconnect everybody else.
      
       -vnc :5900,share=ignore
      completely ignores the shared flag and allows everybody
      connect unconditionally
      2a58d076
  3. 21 5月, 2013 1 次提交
  4. 16 5月, 2013 1 次提交
  5. 15 5月, 2013 1 次提交
    • O
      qemu: Support discard for disk · a7c4202c
      Osier Yang 提交于
      QEMU introduced "discard" option for drive since commit a9384aff53,
      
      <...>
      @var{discard} is one of "ignore" (or "off") or "unmap" (or "on") and
      controls whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap})
      requests are ignored or passed to the filesystem.  Some machine types
      may not support discard requests.
      </...>
      
      This patch exposes the support in libvirt.
      
      QEMU supported "discard" for "-drive" since v1.5.0-rc0:
      
      % git tag --contains a9384aff53
      contains
      v1.5.0-rc0
      v1.5.0-rc1
      
      So this only detects the capability bit using virQEMUCapsProbeQMPCommandLine.
      a7c4202c
  6. 14 5月, 2013 2 次提交
    • E
      json: support removing a value from an object · 547a7c77
      Eric Blake 提交于
      In an upcoming patch, I need the way to safely transfer a nested
      virJSON object out of its parent container for independent use,
      even after the parent is freed.
      
      * src/util/virjson.h (virJSONValueObjectRemoveKey): New function.
      (_virJSONObject, _virJSONArray): Use correct type.
      * src/util/virjson.c (virJSONValueObjectRemoveKey): Implement it.
      * src/libvirt_private.syms (virjson.h): Export it.
      * tests/jsontest.c (mymain): Test it.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      547a7c77
    • G
      Support for static routes on a virtual bridge · ccff335f
      Gene Czarcinski 提交于
      network: static route support for <network>
      
      This patch adds the <route> subelement of <network> to define a static
      route.  the address and prefix (or netmask) attribute identify the
      destination network, and the gateway attribute specifies the next hop
      address (which must be directly reachable from the containing
      <network>) which is to receive the packets destined for
      "address/(prefix|netmask)".
      
      These attributes are translated into an "ip route add" command that is
      executed when the network is started. The command used is of the
      following form:
      
        ip route add <address>/<prefix> via <gateway> \
                     dev <virbr-bridge> proto static metric <metric>
      
      Tests are done to validate that the input data are correct.  For
      example, for a static route ip definition, the address must be a
      network address and not a host address.  Additional checks are added
      to ensure that the specified gateway is directly reachable via this
      network (i.e. that the gateway IP address is in the same subnet as one
      of the IP's defined for the network).
      
      prefix='0' is supported for both family='ipv4' address='0.0.0.0'
      netmask='0.0.0.0' or prefix='0', and for family='ipv6' address='::',
      prefix=0', although care should be taken to not override a desired
      system default route.
      
      Anytime an attempt is made to define a static route which *exactly*
      duplicates an existing static route (for example, address=::,
      prefix=0, metric=1), the following error message will be sent to
      syslog:
      
          RTNETLINK answers: File exists
      
      This can be overridden by decreasing the metric value for the route
      that should be preferred, or increasing the metric for the route that
      shouldn't be preferred (and is thus in place only in anticipation that
      the preferred route may be removed in the future).  Caution should be
      used when manipulating route metrics, especially for a default route.
      
      Note: The use of the command-line interface should be replaced by
      direct use of libnl so that error conditions can be handled better.  But,
      that is being left as an exercise for another day.
      Signed-off-by: NGene Czarcinski <gene@czarc.net>
      Signed-off-by: NLaine Stump <laine@laine.org>
      ccff335f
  7. 13 5月, 2013 2 次提交
  8. 11 5月, 2013 2 次提交
    • D
      Allow the iohelper path to be customized by test programs · 8ab7d8ee
      Daniel P. Berrange 提交于
      Currently the fdstream function hardcodes the location
      of the iohelper to LIBEXECDIR "/libvirt_iohelper". This
      is not convenient when trying to write test cases which
      use this code. Add a virFDStreamSetIOHelper method to
      allow the test cases to point to the location of the
      un-installed iohelper binary.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8ab7d8ee
    • L
      util: move virFile* functions from virutil.c to virfile.c · bfe7721d
      Laine Stump 提交于
      These all existed before virfile.c was created, and for some reason
      weren't moved.
      
      This is mostly straightfoward, although the syntax rule prohibiting
      write() had to be changed to have an exception for virfile.c instead
      of virutil.c.
      
      This movement pointed out that there is a function called
      virBuildPath(), and another almost identical function called
      virFileBuildPath(). They really should be a single function, which
      I'll take care of as soon as I figure out what the arglist should look
      like.
      bfe7721d
  9. 08 5月, 2013 2 次提交
  10. 05 5月, 2013 1 次提交
    • M
      virstring: Introduce VIR_STRDUP and VIR_STRNDUP · c3abb5c4
      Michal Privoznik 提交于
      The code adaptation is not done right now, but in subsequent patches.
      Hence I am not implementing syntax-check rule as it would break
      compilation. Developers are strongly advised to use these new macros.
      They are similar to VIR_ALLOC() logic: VIR_STRDUP(dst, src) returns zero
      on success, -1 otherwise. In case you don't want to report OOM error,
      use the _QUIET variant of a macro.
      c3abb5c4
  11. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  12. 27 4月, 2013 1 次提交
  13. 26 4月, 2013 3 次提交
    • L
      util: new virCommandSetMax(MemLock|Processes|Files) · 776d49f4
      Laine Stump 提交于
      This patch adds two sets of functions:
      
      1) lower level virProcessSet*() functions that will immediately set
      the RLIMIT_MEMLOCK. RLIMIT_NPROC, or RLIMIT_NOFILE of either the
      current process (using setrlimit()) or any other process (using
      prlimit()). "current process" is indicated by passing a 0 for pid.
      
      2) functions for virCommand* that will setup a virCommand object to
      set those limits at a later time just after it has forked a new
      process, but before it execs the new program.
      
      configure.ac has prlimit and setrlimit added to the list of functions
      to check for, and the low level functions log an "unsupported" error)
      on platforms that don't support those functions.
      776d49f4
    • L
      util: new function virPCIDeviceGetVFIOGroupDev · b210208f
      Laine Stump 提交于
      Given a virPCIDevice, this function returns the path for the device
      that controls the vfio group the device belongs to,
      e.g. "/dev/vfio/15".
      b210208f
    • L
      pci: keep a stubDriver in each virPCIDevice · be64199e
      Laine Stump 提交于
      This can be set when the virPCIDevice is created and placed on a list,
      then used later when traversing the list to determine which stub
      driver to bind/unbind for managed devices.
      
      The existing Detach and Attach functions' signatures haven't been
      changed (they still accept a stub driver name in the arg list), but if
      the arg list has NULL for stub driver and one is available in the
      device's object, that will be used. (we may later deprecate and remove
      the arg from those functions).
      be64199e
  14. 25 4月, 2013 2 次提交
    • J
      qemu: auto-add pci-root controller for pc machine types · b33eb0dc
      Ján Tomko 提交于
      <controller type='pci' index='0' model='pci-root'/>
      is auto-added to pc* machine types.
      Without this controller PCI bus 0 is not available and
      no PCI addresses are assigned by default.
      
      Since older libvirt supported PCI bus 0 even without
      this controller, it is removed from the XML when migrating.
      b33eb0dc
    • J
      qemu: call post-parse callbacks when parsing command line too · 024e9af3
      Ján Tomko 提交于
      Now we set the default disk driver name when parsing
      the qemu command line too, hence all the test changes.
      
      Assume format type is 'auto' when none is specified on
      qemu command line.
      024e9af3
  15. 24 4月, 2013 2 次提交
  16. 23 4月, 2013 2 次提交
    • P
      qemu: Fix setting of memory tunables · fa006c4f
      Peter Krempa 提交于
      Refactoring done in 19c6ad9a didn't
      correctly take into account the order cgroup limit modification needs to
      be done in. This resulted into errors when decreasing the limits.
      
      The operations need to take place in this order:
      
      decrease hard limit
      change swap hard limit
      
      or
      
      change swap hard limit
      increase hard limit
      
      This patch also fixes the check if the hard_limit is less than
      swap_hard_limit to print better error messages. For this purpose I
      introduced a helper function virCompareLimitUlong to compare limit
      values where value of 0 is equal to unlimited. Additionally the check is
      now applied also when the user does not provide all of the tunables
      through the API and in that case the currently set values are used.
      
      This patch resolves:
      https://bugzilla.redhat.com/show_bug.cgi?id=950478
      fa006c4f
    • G
      create virSocketAddrGetIpPrefix utility function · bd7c7c1b
      Gene Czarcinski 提交于
      Create the utility function virSocketAddrGetIpPrefix() to
      determine the prefix for this network.  The code in this
      function was adapted from virNetworkIpDefPrefix().
      
      Update virNetworkIpDefPrefix() in src/conf/network_conf.c
      to use the new utility function.
      Signed-off-by: NGene Czarcinski <gene@czarc.net>
      bd7c7c1b
  17. 19 4月, 2013 1 次提交
    • P
      network: bridge_driver: don't lose transient networks on daemon restart · 446dd66b
      Peter Krempa 提交于
      Until now tranisent networks weren't really useful as libvirtd wasn't
      able to remember them across restarts. This patch adds support for
      loading status files of transient networks (that already were generated)
      so that the status isn't lost.
      
      This patch chops up virNetworkObjUpdateParseFile and turns it into
      virNetworkLoadState and a few friends that will help us to load status
      XMLs and refactors the functions that are loading the configs to use
      them.
      446dd66b
  18. 16 4月, 2013 4 次提交
  19. 13 4月, 2013 3 次提交
  20. 09 4月, 2013 1 次提交
  21. 08 4月, 2013 4 次提交
    • D
      Rename virCgroupMounted to virCgroupHasController & make it more robust · dca927c8
      Daniel P. Berrange 提交于
      The virCgroupMounted method is badly named, since a controller can be
      mounted, but disabled in the current object. Rename the method to be
      virCgroupHasController. Also make it tolerant to a  NULL virCgroupPtr
      and out-of-range controller index, to avoid duplication of these
      checks in all callers
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      dca927c8
    • O
      storage: Guess the parent if it's not specified for vHBA · f5a61087
      Osier Yang 提交于
      This finds the parent for vHBA by iterating over all the HBA
      which supports vport_ops capability on the host, and return
      the first one which is online, not saturated (vports in use
      is less than max_vports).
      f5a61087
    • O
      util: Add helper to get the scsi host name by iterating over sysfs · b52fbad1
      Osier Yang 提交于
      The helper iterates over sysfs, to find out the matched scsi host
      name by comparing the wwnn,wwpn pair. It will be used by checkPool
      and refreshPool of storage scsi backend. New helper getAdapterName
      is introduced in storage_backend_scsi.c, which uses the new util
      helper virGetFCHostNameByWWN to get the fc_host adapter name.
      b52fbad1
    • O
      New XML attributes for storage pool source adapter · 9f781da6
      Osier Yang 提交于
      This introduces 4 new attributes for storage pool source adapter.
      E.g.
      
      <adapter type='fc_host' parent='scsi_host5' wwnn='20000000c9831b4b' wwpn='10000000c9831b4b'/>
      
      Attribute 'type' can be either 'scsi_host' or 'fc_host', and defaults
      to 'scsi_host' if attribute 'name' is specified. I.e. It's optional
      for 'scsi_host' adapter, for back-compat reason. However, mandatory
      for 'fc_host' adapter and any new future adapter types. Attribute
      'parent' is to specify the parent for the fc_host adapter.
      
      * docs/formatstorage.html.in:
        - Add documents for the 4 new attrs
      * docs/schemas/storagepool.rng:
        - Add RNG schema
      * src/conf/storage_conf.c:
        - Parse and format the new XMLs
      * src/conf/storage_conf.h:
        - New struct virStoragePoolSourceAdapter, replace "char *adapter" with it;
        - New enum virStoragePoolSourceAdapterType
      * src/libvirt_private.syms:
        - Export TypeToString and TypeFromString
      * src/phyp/phyp_driver.c:
        - Replace "adapter" with "adapter.data.name", which is member of the union
          of the new struct virStoragePoolSourceAdapter now. Later patch will
          add the checking, as "adapter.data.name" is only valid for "scsi_host"
          adapter.
      * src/storage/storage_backend_scsi.c:
        - Like above
      * tests/storagepoolxml2xmlin/pool-scsi-type-scsi-host.xml:
      * tests/storagepoolxml2xmlin/pool-scsi-type-fc-host.xml:
        - New test for 'fc_host' and "scsi_host" adapter
      * tests/storagepoolxml2xmlout/pool-scsi.xml:
        - Change the expected output, as the 'type' defaults to 'scsi_host' if 'name"
          specified now
      * tests/storagepoolxml2xmlout/pool-scsi-type-scsi-host.xml:
      * tests/storagepoolxml2xmlout/pool-scsi-type-fc-host.xml:
        - New test
      * tests/storagepoolxml2xmltest.c:
        - Include the test
      9f781da6
  22. 06 4月, 2013 1 次提交
  23. 05 4月, 2013 1 次提交