1. 08 7月, 2011 13 次提交
    • J
      util: Don't try to fchown files opened as non-root · 2f4d2496
      Jiri Denemark 提交于
      When virFileOpenAs is called with VIR_FILE_OPEN_AS_UID flag and uid/gid
      different from root/root while libvirtd is running as root, we fork a
      new child, change its effective UID/GID to uid/gid and run
      virFileOpenAsNoFork. It doesn't make any sense to fchown() the opened
      file in this case since we already know that uid/gid can access the file
      when open succeeds and one of the following situations may happen:
      
      - the file is already owned by uid/gid and we skip fchown even before
        this patch
      - the file is owned by uid but not gid because it was created in a
        directory with SETGID set, in which case it is desirable not to change
        the group
      - the file may be owned by a completely different user and/or group
        because it was created on a root-squashed or even all-squashed NFS
        filesystem, in which case fchown would most likely fail anyway
      2f4d2496
    • M
      qemu: Don't chown files on NFS share if dynamic_ownership is off · 724819a1
      Michal Privoznik 提交于
      When dynamic ownership is disabled we don't want to chown any files,
      not just local.
      724819a1
    • J
      microblaze: Add architecture support · a1092070
      John Williams 提交于
      Add libvirt support for MicroBlaze architecture as a QEMU target.  Based on mips/mipsel pattern.
      Signed-off-by: NJohn Williams <john.williams@petalogix.com>
      a1092070
    • J
      Skip some xen tests if xend is not running · 41828514
      Jim Fehlig 提交于
      Currently, the xen statstest and reconnect tests are only compiled
      if xend is running.  Compile them unconditionally if xen headers
      are present, but skip the tests at runtime if xend is not running.
      
      This is in response to Eric's suggestion here
      
      https://www.redhat.com/archives/libvir-list/2011-July/msg00367.html
      41828514
    • E
      util: drop unused safezero argument · 17da0669
      Eric Blake 提交于
      No caller was using the flags argument, and this function is internal
      only, so we might as well skip it.
      
      * src/util/util.h (safezero): Update signature.
      * src/util/util.c (safezero): Update function.
      * src/locking/lock_driver_sanlock.c
      (virLockManagerSanlockSetupLockspace)
      (virLockManagerSanlockCreateLease): Update all callers.
      * src/storage/storage_backend.c (createRawFile): Likewise.
      17da0669
    • E
      conf: prefer unsigned int for flags · 7931639b
      Eric Blake 提交于
      * src/conf/domain_conf.c (virDomainGraphicsDefParseXML)
      (virDomainDeviceInfoFormat, virDomainDeviceInfoParseXML)
      (virDomainDiskDefParseXML, virDomainControllerDefParseXML)
      (virDomainFSDefParseXML, virDomainNetDefParseXML)
      (virDomainChrDefParseTargetXML, virDomainChrDefParseXML)
      (virDomainSmartcardDefParseXML, virDomainInputDefParseXML)
      (virDomainTimerDefParseXML, virDomainSoundDefParseXML)
      (virDomainWatchdogDefParseXML, virDomainMemballoonDefParseXML)
      (virDomainVideoDefParseXML)
      (virDomainHostdevSubsysUsbDefParseXML)
      (virDomainHostdevSubsysPciDefParseXML)
      (virDomainHostdevDefParseXML, virSecurityLabelDefParseXML)
      (virDomainVcpuPinDefParseXML, virDomainDefParseXML)
      (virDomainDefParse, virDomainDiskDefFormat)
      (virDomainControllerDefFormat, virDomainFSDefFormat)
      (virDomainNetDefFormat, virDomainChrSourceDefFormat)
      (virDomainChrDefFormat, virDomainSmartcardDefFormat)
      (virDomainSoundDefFormat, virDomainMemballoonDefFormat)
      (virDomainWatchdogDefFormat, virDomainVideoDefFormat)
      (virDomainInputDefFormat, virDomainGraphicsDefFormat)
      (virDomainHostdevDefFormat, virDomainObjFormat): Switch signature.
      (virDomainObjTaint, virDomainSaveStatus): Use unsigned flags.
      7931639b
    • E
      drivers: prefer unsigned int for flags · 1740c381
      Eric Blake 提交于
      Now that the public APIs always use unsigned flags, the internal
      driver callbacks might as well do likewise.
      
      * src/driver.h (vrDrvOpen, virDrvDomainCoreDump)
      (virDrvDomainGetXMLDesc, virDrvNetworkGetXMLDesc)
      (virDrvNWFilterGetXMLDesc): Update type.
      * src/remote/remote_protocol.x (remote_open_args)
      (remote_domain_core_dump_args, remote_domain_get_xml_desc_args)
      (remote_network_get_xml_desc_args)
      (remote_nwfilter_get_xml_desc_args): Likewise.
      * src/test/test_driver.c: Update clients.
      * src/remote/remote_driver.c: Likewise.
      * src/xen/xen_hypervisor.c: Likewise.
      * src/xen/xen_hypervisor.h: Likewise.
      * src/xen/xen_driver.c: Likewise.
      * src/xen/xend_internal.c: Likewise.
      * src/xen/xend_internal.h: Likewise.
      * src/xen/xm_internal.c: Likewise.
      * src/xen/xm_internal.h: Likewise.
      * src/xen/xs_internal.c: Likewise.
      * src/xen/xs_internal.h: Likewise.
      * src/xen/xen_inotify.c: Likewise.
      * src/xen/xen_inotify.h: Likewise.
      * src/phyp/phyp_driver.c: Likewise.
      * src/openvz/openvz_driver.c: Likewise.
      * src/vmware/vmware_driver.c: Likewise.
      * src/vbox/vbox_driver.c: Likewise.
      * src/vbox/vbox_tmpl.c: Likewise.
      * src/xenapi/xenapi_driver.c: Likewise.
      * src/esx/esx_driver.c: Likewise.
      * src/esx/esx_interface_driver.c: Likewise.
      * src/esx/esx_network_driver.c: Likewise.
      * src/esx/esx_storage_driver.c: Likewise.
      * src/esx/esx_device_monitor.c: Likewise.
      * src/esx/esx_secret_driver.c: Likewise.
      * src/esx/esx_nwfilter_driver.c: Likewise.
      * src/interface/netcf_driver.c: Likewise.
      * src/nwfilter/nwfilter_driver.c: Likewise.
      * src/libxl/libxl_driver.c: Likewise.
      * src/qemu/qemu_driver.c: Likewise.
      * src/lxc/lxc_driver.c: Likewise.
      * src/uml/uml_driver.c: Likewise.
      * src/network/bridge_driver.c: Likewise.
      * src/secret/secret_driver.c: Likewise.
      * src/storage/storage_driver.c: Likewise.
      * src/node_device/node_device_hal.c: Likewise.
      * src/node_device/node_device_udev.c: Likewise.
      * src/remote_protocol-structs: Likewise.
      1740c381
    • E
      public API: prefer unsigned int for flags · 18d561c7
      Eric Blake 提交于
      Most APIs use 'unsigned int flags'; but a few stragglers were using
      a signed value.  In particular, the vir*GetXMLDesc APIs were
      split-brain, with inconsistent choice of types.  Although it is
      an API break to use 'int' instead of 'unsigned int', it is ABI
      compatible (pre-compiled apps will have no difference in behavior),
      and generally apps can be recompiled without any issue (only rare
      apps that compiled with extremely high warning levels, or which
      pass libvirt API around as typed function pointers, would have to
      make any code changes to deal with the change).
      
      The migrate APIs use 'unsigned long flags', which can't be changed,
      due to ABI constraints.
      
      This patch intentionally touches only the public API, to prove the
      claim that most existing code (including driver callbacks and virsh)
      still compiles just fine in spite of the type change.
      
      * include/libvirt/libvirt.h.in (virConnectOpenAuth)
      (virDomainCoreDump, virDomainGetXMLDesc, virNetworkGetXMLDesc)
      (virNWFilterGetXMLDesc): Use unsigned int for flags.
      (virDomainHasCurrentSnapshot): Use consistent spelling.
      * src/libvirt.c (virConnectOpenAuth, virDomainCoreDump)
      (virDomainGetXMLDesc, virNetworkGetXMLDesc)
      (virNWFilterGetXMLDesc, do_open): Update accordingly.
      18d561c7
    • E
      maint: print flags in hex during debug · 313ac7fd
      Eric Blake 提交于
      Debugging decimal flags is a pain.
      
      * src/libvirt.c: Always print flags in hex.
      313ac7fd
    • E
      virsh: make destroy sound less scary · 085d2415
      Eric Blake 提交于
      Destroy has a rather negative English connotation.  Try to reduce
      the impact, so newbies aren't as scared to use it.
      
      * tools/virsh.c: Tweak all destroy documentation.
      * tools/virsh.pod: Likewise.
      085d2415
    • E
      build: use gnulib pthread_sigmask · 8437e738
      Eric Blake 提交于
      Gnulib finally learned how to do pthread_sigmask on mingw.
      
      * .gnulib: Update to latest, for pthread_sigmask.
      * bootstrap.conf (gnulib_modules): Add pthread_sigmask.
      * configure.ac (AC_CHECK_FUNCS): Drop redundant check.
      * src/rpc/virnetclient.c (virNetClientSetTLSSession)
      (virNetClientIOEventLoop): Make code unconditional.
      * src/util/command.c (virFork): Likewise.
      * tools/virsh.c (doMigrate, cmdMigrate): Likewise.
      8437e738
    • E
      build: fix virBufferVasprintf on mingw · c2dda6eb
      Eric Blake 提交于
      Gnulib documents that mingw vsnprintf is broken (it returns -1
      on out-of-space, instead of the count of what would have been
      printed); but while we were using the snprintf wrapper, we had
      not yet been using the vsnprintf wrapper.
      
      Meanwhile, mingw (but not mingw64) has a replacement snprintf
      that fixes return values, but still lacks %1$s support; so in
      that case, gnulib didn't replace snprintf, but libintl then
      went ahead and installed a version that supported %1$s but not
      return values.  Gnulib has since been fixed to guarantee that
      the snprintf module will always guarantee the constraints needed
      by libintl.
      
      Also, we want to guarantee that strdup sets errno on failure.
      
      * .gnulib: Update to latest, for vsnprintf fix.
      * bootstrap.conf (gnulib_modules): Add vsnprintf, strdup-posix.
      Reported by Matthias Bolte.
      c2dda6eb
    • J
      Fix compilation of statstest.c during make check · a34e193f
      Jim Fehlig 提交于
      a34e193f
  2. 07 7月, 2011 7 次提交
    • M
      python: Fix bogus label placement · 94538e14
      Matthias Bolte 提交于
      94538e14
    • L
      util: close the ioctl socket at the end of if(Get|Set)MacAddress · 24442b60
      Laine Stump 提交于
      Otherwise this will leak an fd each time one of these functions is
      called.
      24442b60
    • L
      util: rename err_exit to cleanup in interface.c · de796a32
      Laine Stump 提交于
      This brings it in line with the recommendations in HACKING.
      de796a32
    • M
      sysinfo: delete unnecessary white space of sysinfo. · 107ee906
      Minoru Usui 提交于
        * Trim each element and delete null entry of sysinfo by
        virSkipSpacesBackwards().
      Signed-off-by: NMinoru Usui <usui@mxm.nes.nec.co.jp>
      107ee906
    • E
      util: add virTrimSpaces · 01374ec8
      Eric Blake 提交于
      The next patch wants to adjust an end pointer to trim trailing
      spaces but without modifying the underlying string, but a more
      generally useful ability to trim trailing spaces in place is
      also worth providing.
      
      * src/util/util.h (virTrimSpaces, virSkipSpacesBackwards): New
      prototypes.
      * src/util/util.c (virTrimSpaces, virSkipSpacesBackwards): New
      functions.
      * src/libvirt_private.syms (util.h): Export new functions.
      Inspired by a patch by Minoru Usui.
      01374ec8
    • E
      util: fix virSkipSpaces · 82162316
      Eric Blake 提交于
      Most clients of virSkipSpaces don't want to omit backslashes.
      Also, open-coding the list of spaces is not as nice as using
      c_isspace.
      
      * src/util/util.c (virSkipSpaces): Use c_isspace.
      (virSkipSpacesAndBackslash): New function.
      * src/util/util.h (virSkipSpacesAndBackslash): New prototype.
      * src/xen/xend_internal.c (sexpr_to_xend_topology): Update caller.
      * src/libvirt_private.syms (util.h): Export new function.
      82162316
    • E
      docs: minor whitespace cleanups · 864e9457
      Eric Blake 提交于
      No change in wording.  One spacing change in a <pre>, noticed because
      of odd XML formatting online; the rest is in free-flowing text to
      make it easier to see nesting levels in the document.
      
      * docs/formatdomain.html.in: Adjust spacing.  Break long lines.
      864e9457
  3. 06 7月, 2011 11 次提交
  4. 05 7月, 2011 3 次提交
  5. 04 7月, 2011 6 次提交
    • D
      Add documentation for the seclabel XML element · 6bcd732e
      Daniel P. Berrange 提交于
      The domain XML documentation is missing information about the
      <seclabel> element used by security drivers
      
      * formatdomain.html.in: Document <seclabel>
      6bcd732e
    • D
      Allow for resource relabelling with static labels · 6321fd97
      Daniel P. Berrange 提交于
      Add a new attribute to the <seclabel> XML to allow resource
      relabelling to be enabled with static label usage.
      
        <seclabel model='selinux' type='static' relabel='yes'>
          <label>system_u:system_r:svirt_t:s0:c392,c662</label>
        </seclabel>
      
      * docs/schemas/domain.rng: Add relabel attribute
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Parse
        the 'relabel' attribute
      * src/qemu/qemu_process.c: Unconditionally clear out the
        'imagelabel' attribute
      * src/security/security_apparmor.c: Skip based on 'relabel'
        attribute instead of label type
      * src/security/security_selinux.c: Skip based on 'relabel'
        attribute instead of label type and fill in <imagelabel>
        attribute if relabel is enabled.
      6321fd97
    • D
      Allow a base label to be specified in dynamic labelling mode · 4ebfc427
      Daniel P. Berrange 提交于
      Normally the dynamic labelling mode will always use a base
      label of 'svirt_t' for VMs. Introduce a <baselabel> field
      in the <seclabel> XML to allow this base label to be changed
      
      eg
      
         <seclabel type='dynamic' model='selinux'>
           <baselabel>system_u:object_r:virt_t:s0</baselabel>
         </seclabel>
      
      * docs/schemas/domain.rng: Add <baselabel>
      * src/conf/domain_conf.c, src/conf/domain_conf.h: Parsing
        of base label
      * src/qemu/qemu_process.c: Don't reset 'model' attribute if
        a base label is specified
      * src/security/security_apparmor.c: Refuse to support base label
      * src/security/security_selinux.c: Use 'baselabel' when generating
        label, if available
      4ebfc427
    • O
      storage: Do not override the exact error of createRawFile · 49826eda
      Osier Yang 提交于
      virStorageBackendCreateRaw: createRawFile already reported the
      exact error.
      
      Before the fix:
      
      error: Failed to create vol vol-create.img
      error: cannot create path '/var/lib/libvirt/images/vol-create.img': Unknown error 18446744073709551597
      
      After the fix:
      
      error: Failed to create vol vol-create.img
      error: cannot fill file '/var/lib/libvirt/images/vol-create.img': No space left on device
      49826eda
    • D
      Release of libvirt-0.9.3 · 7976d96d
      Daniel Veillard 提交于
      * configure.ac docs/news.html.in libvirt.spec.in: update for the
        new release
      * po/*.po*: updated and regenerated localizations
      7976d96d
    • W
      initialize pointer to NULL · 1aa5f85b
      Wen Congyang 提交于
      cmd is not initialized to NULL, but we try to freed it if we
      meet some error.
      1aa5f85b