1. 15 8月, 2012 15 次提交
    • L
      conf: output forward device connections count in network XML · 92a83040
      Laine Stump 提交于
      It may be useful for management applications to know which physical
      network devices are in use by guests. This information is already
      available in the network objects, but wasn't output in the XML. This
      patch outputs it when the INACTIVE flag isn't set (and if it's non-0).
      92a83040
    • L
      conf: rename interface "usageCount" to "connections" · 643feae7
      Laine Stump 提交于
      I want to include this count in the xml output of networks, but
      calling it "connections" in the XML sounds better than "usageCount", and it
      would be better if the name in the XML matched the variable name.
      
      In a few places, usageCount was being initialized to 0, but this is
      unnecessary, because VIR_ALLOC_N zero-fills everything anyway.
      643feae7
    • L
      conf: use a unique data type for PF array in virDomainNetDef · 95ae4e7f
      Laine Stump 提交于
      This array was originally defined using the existing
      virNetworkForwardIfDef, but that struct has a UsageCount field that
      isn't used in the case of PFs. This patch just copies that struct and
      removes UsageCount. It ends up being a struct with a single field, but
      I left it as a struct in case we need to add other fields to it in the
      future.
      95ae4e7f
    • E
      random: link with -lm when needed · c606671a
      Eric Blake 提交于
      Use of ldexp() requires -lm on some platforms; use gnulib to determine
      this for our makefile.  Also, optimize virRandomInt() for the case
      of a power-of-two limit (actually rather common, given that Daniel
      has a pending patch to replace virRandomBits(10) with code that will
      default to virRandomInt(1024) on default SELinux settings).
      
      * .gnulib: Update to latest, for ldexp.
      * bootstrap.conf (gnulib_modules): Import ldexp.
      * src/Makefile.am (libvirt_util_la_CFLAGS): Link with -lm when
      needed.
      * src/util/virrandom.c (virRandomInt): Optimize powers of 2.
      c606671a
    • L
      network: merge relevant virtualports rather than choosing one · 6a3691b7
      Laine Stump 提交于
      One of the original ideas behind allowing a <virtualport> in an
      interface definition as well as in the <network> definition *and*one
      or more <portgroup>s within the network, was that guest-specific
      parameteres (like instanceid and interfaceid) could be given in the
      interface's virtualport, and more general things (portid, managerid,
      etc) could be given in the network and/or portgroup, with all the bits
      brought together at guest startup time and combined into a single
      virtualport to be used by the guest. This was somehow overlooked in
      the implementation, though - it simply picks the "most specific"
      virtualport, and uses the entire thing, with no attempt to merge in
      details from the others.
      
      This patch uses virNetDevVPortProfileMerge3() to combine the three
      possible virtualports into one, then uses
      virNetDevVPortProfileCheck*() to verify that the resulting virtualport
      type is appropriate for the type of network, and that all the required
      attributes for that type are present.
      
      An example of usage is this: assuming a <network> definitions on host
      ABC of:
      
        <network>
          <name>testA</name>
          ...
          <virtualport type='openvswitch'/>
          ...
          <portgroup name='engineering'>
            <virtualport>
              <parameters profileid='eng'/>
            </virtualport>
          </portgroup>
          <portgroup name='sales'>
            <virtualport>
              <parameters profileid='sales'/>
            </virtualport>
          </portgroup>
        </network>
      
      and the same <network> on host DEF of:
      
        <network>
          <name>testA</name>
          ...
          <virtualport type='802.1Qbg'>
            <parameters typeid="1193047" typeidversion="2"/>
          </virtualport>
          ...
          <portgroup name='engineering'>
            <virtualport>
              <parameters managerid="11"/>
            </virtualport>
          </portgroup>
          <portgroup name='sales'>
            <virtualport>
              <parameters managerid="55"/>
            </virtualport>
          </portgroup>
        </network>
      
      and a guest <interface> definition of:
      
        <interface type='network'>
          <source network='testA' portgroup='sales'/>
          <virtualport>
            <parameters instanceid="09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f"
                        interfaceid="09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f"\>
          </virtualport>
          ...
        </interface>
      
      If the guest was started on host ABC, the <virtualport> used would be:
      
        <virtualport type='openvswitch'>
          <parameters interfaceid='09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f'
                      profileid='sales'/>
        </virtualport>
      
      but if that guest was started on host DEF, the <virtualport> would be:
      
          <virtualport type='802.1Qbg'>
            <parameters instanceid="09b11c53-8b5c-4eeb-8f00-d84eaa0aaa4f"
                        typeid="1193047" typeidversion="2"
                        managerid="55"/>
          </virtualport>
      
      Additionally, if none of the involved <virtualport>s had a specified type
      (this includes cases where no virtualport is given at all),
      6a3691b7
    • L
      conf: support partially-specified <virtualport> in parser and formatter · 4af3cbaf
      Laine Stump 提交于
      Until now, all attributes in a <virtualport> parameter list that were
      acceptable for a particular type, were also required. There were no
      optional attributes.
      
      One of the aims of supporting <virtualport> in libvirt's virtual
      networks and portgroups is to allow specifying the group-wide
      parameters in the network's virtualport, and merge that with the
      interface's virtualport, which will have the instance-specific info
      (i.e. the interfaceid or instanceid).
      
      Additionally, the guest's interface XML shouldn't need to know what
      type of network connection will be used prior to runtime - it could be
      openvswitch, 802.1Qbh, 802.1Qbg, or none of the above - but should
      still be able to specify instance-specific info just in case it turns
      out to be applicable.
      
      Finally, up to now, the parser for virtualport has always generated a
      random instanceid/interfaceid when appropriate, making it impossible
      to leave it blank (which is what's required for virtualports within a
      network/portprofile definition).
      
      This patch modifies the parser and formatter of the <virtualport>
      element in the following ways:
      
      * because most of the attributes in a virNetDevVPortProfile are fixed
        size binary data with no reserved values, there is no way to embed a
        "this value wasn't specified" sentinel into the existing data. To
        solve this problem, the new *_specified fields in the
        virNetDevVPortProfile object that were added in a previous patch of
        this series are now set when the corresponding attribute is present
        during the parse.
      
      * allow parsing/formatting a <virtualport> that has no type set. In
        this case, all fields are settable, but all are also optional.
      
      * add a GENERATE_MISSING_DEFAULTS flag to the parser - if this flag is
        set and an instanceid/interfaceid is expected but not provided, a
        random one will be generated. This was previously the default
        behavior, but is now done only for virtualports inside an
        <interface> definition, not for those in <network> or <portgroup>.
      
      * add a REQUIRE_ALL_ATTRIBUTES flag to the parser - if this flag is
        set the parser will call the new
        virNetDevVPortProfileCheckComplete() functions at the end of the
        parser to check for any missing attributes (based on type), and
        return failure if anything is missing. This used to be default
        behavior. Now it is only used for the virtualport defined inside an
        interface's <actual> element (by the time you've figured out the
        contents of <actual>, you should have all the necessary data to fill
        in the entire virtualport)
      
      * add a REQUIRE_TYPE flag to the parser - if this flag is set, the
        parser will return an error if the virtualport has no type
        attribute. This also was previously the default behavior, but isn't
        needed in the case of the virtualport for a type='network' interface
        (i.e. the exact type isn't yet known), or the virtualport of a
        portgroup (i.e. the portgroup just has modifiers for the network's
        virtualport, which *does* require a type) - in those cases, the
        check will be done at domain startup, once the final virtualport is
        assembled (this is handled in the next patch).
      4af3cbaf
    • L
      conf: simplify Buffer Indentation in virDomainNetDefFormat · ff1efc09
      Laine Stump 提交于
      This function has several calls to increase the buffer indent by 6,
      then decrease it again, then increase, then decrease. Additionally,
      there were several printfs that had 6 spaces at the beginning of the
      line.
      
      virDomainActualNetDefFormat, which is called by virDomainNetDefFormat,
      had similar ugliness.
      
      This patch changes both functions to just increase the indent at the
      beginning, decrease it at (well, just before*) the end, and remove all
      of the occurences of 6/8 spaces at the beginning of lines.
      
      *The indent had to be reset before the end of the function because
      virDomainDeviceInfoFormat assumes a 0 indent and is called from many
      other places, and I didn't want to do an overhaul of every caller of
      that function. A separate patch to switch all of domain_conf.c would
      be a useful exercise, but my current goal is unrelated to that, so
      I'll leave it for another day.
      ff1efc09
    • L
      conf: make error returns from virDomainActualNetDefFormat consistent · 2841a0ad
      Laine Stump 提交于
      There was an error: label that simply did "return ret", but ret was
      defaulted to -1, and was never used other than setting it manually to
      0 just before a non-error return. Aside from this, some of the error
      return paths used "goto error" and others used "return ret".
      
      This patch removes ret and the error: label, and makes all error
      returns just consistently do "return -1".
      2841a0ad
    • L
      conf: move virtPortProfile out of unions in virDomainNetDef · 1d174428
      Laine Stump 提交于
      virtPortProfile is now used by 4 different types of network devices
      (NETWORK, BRIDGE, DIRECT, and HOSTDEV), and it's getting cumbersome to
      replicate so much code in 4 different places just because each type
      has the virtPortProfile in a slightly different place. This patch puts
      a single virtPortProfile in a common place (outside the type-specific
      union) in both virDomainNetDef and virDomainActualNetDef, and adjusts
      the parse and format code (and the few other places where it is used)
      accordingly.
      
      Note that when a <virtualport> element is found, the parse functions
      verify that the interface is of a type that supports one, otherwise an
      error is generated (CONFIG_UNSUPPORTED in the case of <interface>, and
      INTERNAL in the case of <actual>, since the contents of <actual> are
      always generated by libvirt itself).
      1d174428
    • L
      util: utility functions for virNetDevVPortProfile · 1c02ed14
      Laine Stump 提交于
      This patch adds three utility functions that operate on
      virNetDevVPortProfile objects.
      
      * virNetDevVPortProfileCheckComplete() - verifies that all attributes
          required for the type of the given virtport are specified.
      
      * virNetDevVPortProfileCheckNoExtras() - verifies that there are no
          attributes specified which are inappropriate for the type of the
          given virtport.
      
      * virNetDevVPortProfileMerge3() - merges 3 virtports into a single,
          newly allocated virtport. If any attributes are specified in
          more than one of the three sources, and do not exactly match,
          an error is logged and the function fails.
      
      These new functions depend on new fields in the virNetDevVPortProfile
      object that keep track of whether or not each attribute was
      specified. Since the higher level parse function doesn't yet set those
      fields, these functions are not actually usable yet (but that's okay,
      because they also aren't yet used - all of that functionality comes in
      a later patch.)
      
      Note that these three functions return 0 on success and -1 on
      failure. This may seem odd for the first two Check functions, since
      they could also easily return true/false, but since they actually log
      an error when the requested condition isn't met (and should result in
      a failure of the calling function), I thought 0/-1 was more
      appropriate.
      1c02ed14
    • L
      util: add openvswitch case to virNetDevVPortProfileEqual · 8450d7b2
      Laine Stump 提交于
      This function was overlooked when openvswitch support was
      added. Fortunately it's only use for update-device, which is
      relatively new and seldom-used.
      8450d7b2
    • L
      util: eliminate union in virNetDevVPortProfile · 21ea73e8
      Laine Stump 提交于
      virNetDevVPortProfile has (had) a type field that can be set to one of
      several values, and a union of several structs, one for each
      type. When a domain's interface object is of type "network", the
      domain config may not know beforehand which type of virtualport is
      going to be provided in the actual device handed down from the network
      driver at runtime, but may want to set some values in the virtualport
      that may or may not be used, depending on the type. To support this
      usage, this patch replaces the union of structs with toplevel fields
      in the struct, making it possible for all of the fields to be set at
      the same time.
      21ea73e8
    • L
      util: make return value of virUUIDFormat and virMacAddrFormat useful · 85d9c17d
      Laine Stump 提交于
      Both of these functions returned void, but it's convenient for them to
      return a const char* of the char* that is passed in. This was you can
      call the function and use the result in the same expression/arg.
      85d9c17d
    • E
      build: fix link error with appArmor · 37f3cd41
      Eric Blake 提交于
      Commit bb705e25 missed that the appArmor helper file also needs to
      resolve the new symbols dragged in by domain_conf.c.
      
      * src/Makefile.am (SECURITY_DRIVER_APPARMOR_HELPER_SOURCES): Pull
      in datatypes.c.
      37f3cd41
    • E
      maint: drop a leftover comment line · a40f9e9a
      Eric Blake 提交于
      * tests/viratomictest.c: Fix copy-and-paste bug.
      a40f9e9a
  2. 14 8月, 2012 19 次提交
    • D
      openvz: unlock virDomainObj objects in openvzOpen · cf24bed0
      Dmitry Guryanov 提交于
      openvzOpen fucntion must leave unlocked virDomainObj objects in
      driver->domains.
      
      Now even simple commands like list or domain lookup hang,
      for example virsh -c openvz:///system list --all.
      Signed-off-by: NDmitry Guryanov <dguryanov@parallels.com>
      cf24bed0
    • D
      Pull code which finds a free MCS label out into its own method · b6e66cb6
      Daniel P. Berrange 提交于
      The code for picking a MCS label is about to get significantly
      more complicated, so it deserves to be in a standlone method,
      instead of a switch/case body.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b6e66cb6
    • D
      Honour current user and role in SELinux label generation · b77e9814
      Daniel P. Berrange 提交于
      When generating an SELinux context for a VM from the template
      "system_u:system_r:svirt_t:s0", copy the role + user from the
      current process instead of the template context. So if the
      current process is
      
         unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
      
      then the VM context ends up as
      
        unconfined_u:unconfined_r:svirt_t:s0:c386,c703
      
      instead of
      
         system_u:system_r:svirt_t:s0:c177,c424
      
      Ideally the /etc/selinux/targeted/contexts/virtual_domain_context
      file would have just shown the 'svirt_t' type, and not the full
      context, but that can't be changed now for compatibility reasons.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b77e9814
    • D
      Fix error reporting in virSecuritySELinuxGenNewContext · cbe67ff9
      Daniel P. Berrange 提交于
      The virSecuritySELinuxGenNewContext method was not reporting any
      errors, leaving it up to the caller to report a generic error.
      In addition it could potentially trigger a strdup(NULL) in an
      OOM scenario. Move all error reporting into the
      virSecuritySELinuxGenNewContext method where accurate info
      can be provided
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      cbe67ff9
    • D
      Use VIR_ERR_CONFIG_UNSUPPORTED if requested security driver is disabled · 51b23ed3
      Daniel P. Berrange 提交于
      There is currently no way to distinguish the case that a requested
      security driver was disabled, from the case where no security driver
      was available. Use VIR_ERR_CONFIG_UNSUPPORTED as the error when an
      explicitly requested security driver was disabled
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      51b23ed3
    • D
      Add missing domain_conf.h include in security_manager.h · fd016806
      Daniel P. Berrange 提交于
      The security_manager.h header is not self-contained because it
      uses the virDomainDefPtr without first including domain_conf.h
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      fd016806
    • D
      Add virRandom() API to generate numbers with non-power-of-2 limit · aa5bd8b9
      Daniel P. Berrange 提交于
      The current virRandomBits() API is only usable if the caller wants
      a random number in the range [0, n-1) where n is a power of two.
      This adds a virRandom() API which generates a double in the
      range [0.0,1.0) with 48 bits of entropy. It then also adds a
      virRandomInt(uint32_t max) API which generates an unsigned
      in the range [0,@max)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      aa5bd8b9
    • M
      util: typos in fallback code fo virDoubleToStr · 0a6504d4
      Martin Kletzander 提交于
      Fixes for some typos that somehow didn't get to the final push of the
      commit 43bfa23e.
      0a6504d4
    • D
      Fix timebomb in LIBVIRT_VERSION_INFO calculation · 3b0cd660
      Daniel P. Berrange 提交于
      The way LIBVIRT_VERSION_INFO is calculated has a timebomb that
      will cause us to accidentally break soname when we change the
      major version number to a non-zero value !
      
      Given CURRENT:REVISION:AGE, libtool will generate
      
         libvirt.so.($CURRENT-$AGE).$AGE.$REVISION
      
      We set CURRENT to be MAJOR+MINOR and AGE to $MINOR, so as
      soon as MAJOR changes to non-zero, we get libvirt.so.1
      as the soname, eg  1.3.9 would create libvirt.so.1.3.9
      Looks natural but is not ABI compatible with libvirt.so.0.x.y
      
      The fix is to set CURRENT to always be exactly the same
      as AGE. We want to have the major version reflected in
      the so symlinks though. So then we set AGE to MAJOR*1000+MINOR
      eg, so 1.3.9 would create libvirt.so.0.1003.9 and libvirt
      2.51.3 would create libvirt.so.0.2051.3
      3b0cd660
    • O
      Destroy virdomainlist.[ch] · bb705e25
      Osier Yang 提交于
      As the consensus in:
      https://www.redhat.com/archives/libvir-list/2012-July/msg01692.html,
      this patch is to destroy conf/virdomainlist.[ch], folding the
      helpers into conf/domain_conf.[ch].
      
      * src/Makefile.am:
        - Various indention fixes incidentally
        - Add macro DATATYPES_SOURCES (datatypes.[ch])
        - Link datatypes.[ch] for libvirt_lxc
      
      * src/conf/domain_conf.c:
        - Move all the stuffs from virdomainlist.c into it
        - Use virUnrefDomain and virUnrefDomainSnapshot instead of
          virDomainFree and virDomainSnapshotFree, which are defined
          in libvirt.c, and we don't want to link to it.
        - Remove "if" before "free" the object, as virObjectUnref
          is in the list "useless_free_options".
      
      * src/conf/domain_conf.h:
        - Move all the stuffs from virdomainlist.h into it
        - s/LIST_FILTER/LIST_DOMAINS_FILTER/
      
      * src/libxl/libxl_driver.c:
        - s/LIST_FILTER/LIST_DOMAINS_FILTER/
        - no (include "virdomainlist.h")
      
      * src/libxl/libxl_driver.c: Likewise
      
      * src/lxc/lxc_driver.c: Likewise
      
      * src/openvz/openvz_driver.c: Likewise
      
      * src/parallels/parallels_driver.c: Likewise
      
      * src/qemu/qemu_driver.c: Likewise
      
      * src/test/test_driver.c: Likewise
      
      * src/uml/uml_driver.c: Likewise
      
      * src/vbox/vbox_tmpl.c: Likewise
      
      * src/vmware/vmware_driver.c: Likewise
      
      * tools/virsh-domain-monitor.c: Likewise
      
      * tools/virsh.c: Likewise
      bb705e25
    • M
      json: fix interface locale dependency · 43bfa23e
      Martin Kletzander 提交于
      libvirt creates invalid commands if wrong locale is selected. For
      example with locale that uses comma as a decimal point, JSON commands
      created with decimal numbers are invalid because comma separates the
      entries in JSON. Fortunately even when decimal point is affected,
      thousands grouping is not, because for grouping to be enabled with
      *printf, there has to be an apostrophe flag specified (and supported).
      
      This patch adds specific internal function for converting doubles to
      strings with C locale.
      43bfa23e
    • J
      virsh: say save-image-edit failed only when it does · 863399f0
      Ján Tomko 提交于
      The common code for editing files in virsh-edit.c expects EDIT_DEFINE to
      return 0 on failure. virDomainSaveImageDefineXML returns 0 on success.
      863399f0
    • A
      sanlock: don't unlink lockspace if registration fails · ff73c6d3
      Asad Saeed 提交于
      This is a patch for bug 847848
      If registering an existing lockspace with the sanlock daemon
      returns an error, libvirt should not proceed to unlink the lockspace.
      Signed-off-by: NAsad Saeed <asad.saeed@acidseed.com>
      ff73c6d3
    • C
      virsh: make 'help' command ignore spurious options · 86157b59
      Cole Robinson 提交于
      Similar to the previous patch, prepending 'help' to a partial
      command string doesn't cut us any slack.
      
      $ virsh help pool-define-as --name foo --type dir
      error: command 'help' doesn't support option --name
      
      This patch adds a few hacks to make 'help' ignore everything after the
      first data bit, so the above command shows help output for pool-define-as.
      86157b59
    • C
      virsh: Convert '<cmd> --help' to 'help <cmd>' · d2f97139
      Cole Robinson 提交于
      Often times I find myself halfway through typing a long command when
      I want to see 'help' output. I instinctively append '--help' to the
      command I'm typing, only to get an error:
      
          $ virsh vol-create-as foo --help
          error: command 'vol-create-as' doesn't support option --help
      
      This patch makes --help work in a pretty hacky way. One missing piece
      here is that --help isn't listed as an option in the actual 'help <cmd>'
      output, but maybe this can be a starting point for someone.
      d2f97139
    • C
      virsh.c: Fix compiler warning · e7d1bdfb
      Cole Robinson 提交于
      For some reason I only get this after applying subsequent upcoming
      patches that touch virsh, but don't seem to actually cause the warning.
      
      virsh.c: In function ‘vshCommandParse’:
      virsh.c:2014:46: error: ‘opt_index’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
      cc1: all warnings being treated as errors
      e7d1bdfb
    • C
      build: Distribute check-symfile.pl · 7e6f8010
      Cole Robinson 提交于
      Otherwise distcheck can fail with:
      
        GEN      check-symfile
        Can't open perl script "../../src/check-symfile.pl": No such file or directory
        make[4]: *** [check-symfile] Error 2
      7e6f8010
    • E
      maint: add attribution for last patch · 4c8cf294
      Eric Blake 提交于
      * AUTHORS: Add Frido Roose.
      4c8cf294
    • F
      Release only specific sanlock resource · a58cb1ac
      Frido Roose 提交于
      This is a patch for bug 826704
      All sanlock resources get released when hot-dettaching a disk from the domain
      because virLockManagerSanlockRelease uses the wrong function parameters/flags.
      With the patch only the resources that should be released are cleaned up.
      Signed-off-by: NFrido Roose <frido.roose@gmail.com>
      a58cb1ac
  3. 11 8月, 2012 2 次提交
    • P
      virterror: Add error message for unsupported operations. · e9a24e3e
      Peter Krempa 提交于
      This patch introduces a new error code VIR_ERR_OPERATION_UNSUPPORTED to
      mark error messages regarding operations that failed due to lack of
      support on the hypervisor or other than libvirt issues.
      
      The code is first used in reporting error if qemu does not support block
      IO tuning variables yielding error message:
      error: Unable to get block I/O throttle parameters
      error: Operation not supported: block_io_throttle field
      'total_bytes_sec' missing in qemu's output
      
      instead of:
      error: Unable to get block I/O throttle parameters
      error: internal error cannot read total_bytes_sec
      e9a24e3e
    • L
      build: fix binary location in stap files --with-driver-modules · 54264111
      Laine Stump 提交于
      libvirt_qemu_probes.stp stopped working after switching to a build
      that used --with-driver-modules. This was because the symbols listed
      int libvirt_qemu_probes.stp are no longer in $(bindir)/libvirtd, but
      are now in $(libdir)/connection-driver/libvirt_driver_qemu.so.
      
      This patch enhances dtrace2systemtap.pl (which generates the .stp
      files from .d files) to look for a new "module" setting in the
      comments of the .d file (similar to the existing "binary" setting),
      and to look for a --with-modules option. If the --with-modules option
      is set *and* a "module" setting is present in the .d file, the process
      name for the stap line is set to
      
         $libdir/$module
      
      If either of these isn't true, it reverts to the old behavior.
      
      src/Makefile.am was also modified to add the --with-modules option
      when the build calls for it, and src/libvirt_qemu_probes.d has added a
      "module" line pointing to the correct .so file for the qemu driver.
      54264111
  4. 10 8月, 2012 4 次提交
    • M
      docs/virsh: various minor fixes · 4d448b11
      Martin Kletzander 提交于
      List:
       - some old libvir/libvirt rename leftovers (the only problem can be
         if somebody parses 'virsh version' output really badly)
       - remove pointless tags specified in some pages that are not used
      4d448b11
    • M
      docs: autogenerate search.php · 28183590
      Martin Kletzander 提交于
      This patch makes search.php autogenerated from search.php.in, thus
      removing hardcoded menus, footer etc. and the search.php is added to
      .gitignore.
      
      There is new rule added for *.php files (to make it bit less
      hardcoded) that takes *.php.code.in and injects it inside the
      generated *.php (xslt was not happy about php code in the source xml).
      28183590
    • 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