1. 25 2月, 2011 4 次提交
    • E
      audit: add qemu hooks for auditing cgroup events · 6bb98d41
      Eric Blake 提交于
      * src/qemu/qemu_audit.h (qemuDomainCgroupAudit): New prototype.
      * src/qemu/qemu_audit.c (qemuDomainCgroupAudit): Implement it.
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Add audit.
      * src/qemu/qemu_cgroup.c (qemuSetupDiskPathAllow)
      (qemuSetupChardevCgroup, qemuSetupHostUsbDeviceCgroup)
      (qemuSetupCgroup, qemuTeardownDiskPathDeny): Likewise.
      6bb98d41
    • E
      audit: prepare qemu for listing vm in cgroup audits · b4d3434f
      Eric Blake 提交于
      * src/qemu/qemu_cgroup.h (struct qemuCgroupData): New helper type.
      (qemuSetupDiskPathAllow, qemuSetupChardevCgroup)
      (qemuTeardownDiskPathDeny): Drop unneeded prototypes.
      (qemuSetupDiskCgroup, qemuTeardownDiskCgroup): Adjust prototype.
      * src/qemu/qemu_cgroup.c
      (qemuSetupDiskPathAllow, qemuSetupChardevCgroup)
      (qemuTeardownDiskPathDeny): Mark static and use new type.
      (qemuSetupHostUsbDeviceCgroup): Use new type.
      (qemuSetupDiskCgroup): Alter signature.
      (qemuSetupCgroup): Adjust caller.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachHostUsbDevice)
      (qemuDomainDetachPciDiskDevice, qemuDomainDetachSCSIDiskDevice):
      Likewise.
      * src/qemu/qemu_driver.c (qemudDomainAttachDevice)
      (qemuDomainUpdateDeviceFlags): Likewise.
      b4d3434f
    • E
      cgroup: determine when skipping non-devices · 06173876
      Eric Blake 提交于
      * src/util/cgroup.c (virCgroupAllowDevicePath)
      (virCgroupDenyDevicePath): Don't fail with EINVAL for
      non-devices.
      * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Update caller.
      * src/qemu/qemu_cgroup.c (qemuSetupDiskPathAllow)
      (qemuSetupChardevCgroup, qemuSetupHostUsbDeviceCgroup)
      (qemuSetupCgroup, qemuTeardownDiskPathDeny): Likewise.
      06173876
    • E
      virExec: avoid uninitialized memory usage · fd21ecfd
      Eric Blake 提交于
      valgrind warns:
      
      ==21079== Syscall param rt_sigaction(act->sa_mask) points to uninitialised byte(s)
      ==21079==    at 0x329840F63E: __libc_sigaction (sigaction.c:67)
      ==21079==    by 0x4E5A8E7: __virExec (util.c:661)
      
      Regression introduced in commit ab07533e.  Technically, sa_mask
      shouldn't affect operation if sa_flags selects sa_handler, and
      sa_handler selects SIG_IGN, but better safe than sorry.
      
      * src/util/util.c (__virExec): Supply missing sigemptyset.
      fd21ecfd
  2. 24 2月, 2011 8 次提交
  3. 23 2月, 2011 5 次提交
    • D
      Expose name + UUID to LXC containers via env variables · 6704e3fd
      Daniel P. Berrange 提交于
      When spawning 'init' in the container, set
      
        LIBVIRT_LXC_UUID=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
        LIBVIRT_LXC_NAME=YYYYYYYYYYYY
      
      to allow guest software to detect & identify that they
      are in a container
      
      * src/lxc/lxc_container.c: Set LIBVIRT_LXC_UUID and
        LIBVIRT_LXC_NAME env vars
      6704e3fd
    • D
      Fix discard of expected errors · 449b4c87
      Daniel P. Berrange 提交于
      In a couple of commands virsh catches & ignores errors, but fails
      to reset last_error. Thus the error is ignored, but still reported
      to the user.
      
      * tools/virsh.c: Reset last_error if ignoring an error
      449b4c87
    • D
      Fix off-by-1 in virFileAbsPath. · 9f5bbe3b
      Daniel P. Berrange 提交于
      The virFileAbsPath was not taking into account the '/' directory
      separator when allocating memory for combining cwd + path. Convert
      to use virAsprintf to avoid this type of bug completely.
      
      * src/util/util.c: Convert virFileAbsPath to use virAsprintf
      9f5bbe3b
    • D
      Fix group/mode for /dev/pts inside LXC container · 08fb2a9c
      Daniel P. Berrange 提交于
      Normal practice for /dev/pts is to have it mode=620,gid=5
      but LXC was leaving mode=000,gid=0 preventing unprivilegd
      users in the guest use of PTYs
      
      * src/lxc/lxc_controller.c: Fix /dev/pts setup
      08fb2a9c
    • E
      security: avoid memory leak · 009fce98
      Eric Blake 提交于
      Leak introduced in commit d6623003.
      
      * src/qemu/qemu_driver.c (qemuSecurityInit): Avoid leak on failure.
      * src/security/security_stack.c (virSecurityStackClose): Avoid
      leaking component drivers.
      009fce98
  4. 22 2月, 2011 19 次提交
    • R
      802.1Qbh: Delay IFF_UP'ing interface until migration final stage · dfd39ccd
      Roopa Prabhu 提交于
      Current code does an IFF_UP on a 8021Qbh interface immediately after a port
      profile set. This is ok in most cases except when its the migration prepare
      stage. During migration we want to postpone IFF_UP'ing the interface on the
      destination host until the source host has disassociated the interface.
      This patch moves IFF_UP of the interface to the final stage of migration.
      The motivation for this change is to postpone any addr registrations on the
      destination host until the source host has done the addr deregistrations.
      
      While at it, for symmetry with associate move ifDown of a 8021Qbh interface
      to before disassociate
      dfd39ccd
    • O
      storage: make debug log more useful · 9f928af1
      Osier Yang 提交于
      "__func__" is useless there, as VIR_DEBUG will print the function
      name.
      
      * src/storage/storage_backend_mpath.c
      9f928af1
    • O
      virsh: replace vshPrint with vshPrintExtra for snapshot list · 8fcc76a6
      Osier Yang 提交于
      Otherwise extra information will be printed even if "--quiet"
      is specified.
      
      * tools/virsh.c
      8fcc76a6
    • W
      check device-mapper when building with mpath or disk storage driver · 606d6305
      Wen Congyang 提交于
      Currently, we need virIsDevMapperDevice() when we build libvirt with
      disk or mpath storage drivers.  So we should check device-mapper-devel
      when we build with disk storage driver but without mpath storage
      driver.
      606d6305
    • E
      build: add dependency on gnutls-utils · e57f8345
      Eric Blake 提交于
      * libvirt.spec.in (Requires): Add gnutls-utils, for virt-pki-validate.
      Suggested by Daniel P. Berrange.
      e57f8345
    • M
      Renamed functions in xenxs · 3e53c7f9
      Markus Groß 提交于
      3e53c7f9
    • M
      Moved XM formatting functions to xenxs · 2e69e66e
      Markus Groß 提交于
      2e69e66e
    • M
      Moved XM parsing functions to xenxs · 1556ced2
      Markus Groß 提交于
      1556ced2
    • M
      Moved SEXPR formatting functions to xenxs · 2f2a88b9
      Markus Groß 提交于
      2f2a88b9
    • M
      Moved SEXPR parsing functions to xenxs · 07129039
      Markus Groß 提交于
      07129039
    • M
      Moved some SEXPR functions from xen-unified · c71328b9
      Markus Groß 提交于
      c71328b9
    • M
      Moved SEXPR unit to utils · 8606ca0d
      Markus Groß 提交于
      8606ca0d
    • W
      protect the scsi controller to be deleted when it is in use · cf61114c
      Wen Congyang 提交于
      Steps to reproduce this bug:
      1. virsh attach-disk domain --source imagefile --target sdb --sourcetype file --driver qemu --subdriver raw
      2. virsh detach-device controller.xml # remove scsi controller 0
      3. virsh detach-disk domain sdb
         error: Failed to detach disk
         error: operation failed: detaching scsi0-0-1 device failed: Device 'scsi0-0-1' not found
      
      I think we should not detach a controller when it is used by some other device.
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      cf61114c
    • E
      maint: fix grammar in error message · f409661e
      Eric Blake 提交于
      * python/tests/create.py: Use correct wording.
      f409661e
    • D
      virt-*-validate.in: quote all variable references · b3ff07a0
      Dan Kenigsberg 提交于
      Alas, the shell is not a real programming language.
      
      Patch generated by manual confirmation of vim's
      s/[^"]\@<=\$\S\+\s\@=/"&"/gc
      and
      s/\(echo \)\@<=[^"].*\$.*$/"&"/c matches.
      
      This patch generate a lot of noise and carries little benefits, as
      I do not really expect $PKI to contain spaces or backticks. I'm just
      fuming, and would not really mind if this patch is ignored
      b3ff07a0
    • D
      virt-pki-validate: behave when CERTTOOL is missing · 9b479159
      Dan Kenigsberg 提交于
      9b479159
    • E
      autobuild.sh: use VPATH build · ec28eb29
      Eric Blake 提交于
      Try to avoid future regressions on the VPATH front.
      
      * autobuild.sh: Uncomment VPATH use.
      * .gitignore: Exclude build directory.
      ec28eb29
    • E
      maint: fix 'make dist' in VPATH build · 7e1dd7e0
      Eric Blake 提交于
      A diff of 'make dist' from in-tree vs. a VPATH build showed
      that we were missing docs/api_extension/*.patch files, but
      shipping other files that we didn't need.
      
      * bootstrap.conf (gnulib_extra_files): Don't distribute files we
      don't care about.
      * docs/Makefile.am (patches): Perform wildcard correctly.
      7e1dd7e0
    • E
      build: don't require pod2man for tarball builds · 6db98a2d
      Eric Blake 提交于
      Right now, 'man libvirtd' includes information that depends on
      configure results, so it must be generated on the fly and live
      in $(builddir); however, requiring pod2man on all end user
      machines is overkill.  Meanwhile, 'man virsh' doesn't mention
      any configure results, so it can be built at 'make dist' time.
      If that situation changes in the future, we can generate virsh.1
      in the same way that we generate libvirtd.8.
      
      * daemon/Makefile.am (libvirtd.8.in): New rule, to run pod2man in
      advance of distribution.
      (libvirtd.8): Use only sed from tarball.
      (EXTRA_DIST): Ship new file.
      (libvirtd.pod): Delete unused rule.
      (man8_MANS): Let automake know which section to use.
      (CLEANFILES, MAINTAINERCLEANFILES): Adjust to new files.
      * tools/Makefile.am (dist_man1_MANS): Distribute pre-built man
      pages, fine since they don't require any substitution.
      (virt-xml-validate.1, virt-pki-validate.1): Change input source.
      (virsh.1): Build into srcdir.
      (CLEANFILES, MAINTAINERCLEANFILES): Adjust to new build style.
      * daemon/.gitignore: Update.
      Reported by Diego Elio Pettenò.
      6db98a2d
  5. 21 2月, 2011 4 次提交
    • E
      maint: kill all remaining uses of old DEBUG macro · 994e7567
      Eric Blake 提交于
      Done mechanically with:
      $ git grep -l '\bDEBUG0\? *(' | xargs -L1 sed -i 's/\bDEBUG0\? *(/VIR_&/'
      
      followed by manual deletion of qemudDebug in daemon/libvirtd.c, along
      with a single 'make syntax-check' fallout in the same file, and the
      actual deletion in src/util/logging.h.
      
      * src/util/logging.h (DEBUG, DEBUG0): Delete.
      * daemon/libvirtd.h (qemudDebug): Likewise.
      * global: Change remaining clients over to VIR_DEBUG counterpart.
      994e7567
    • E
      hash: make virHashFree more free-like · 03ba07cb
      Eric Blake 提交于
      Two-argument free functions are uncommon; match the style elsewhere
      by caching the callback at creation.
      
      * src/util/hash.h (virHashCreate, virHashFree): Move deallocator
      argument to creation.
      * cfg.mk (useless_free_options): Add virHashFree.
      * src/util/hash.c (_virHashTable): Track deallocator.
      (virHashCreate, virHashFree): Update to new signature.
      * src/conf/domain_conf.c (virDomainObjListDeinit)
      (virDomainObjListInit, virDomainDiskDefForeachPath)
      (virDomainSnapshotObjListDeinit, virDomainSnapshotObjListInit):
      Update callers.
      * src/conf/nwfilter_params.c (virNWFilterHashTableFree)
      (virNWFilterHashTableCreate): Likewise.
      * src/conf/nwfilter_conf.c (virNWFilterTriggerVMFilterRebuild):
      Likewise.
      * src/cpu/cpu_generic.c (genericHashFeatures, genericBaseline):
      Likewise.
      * src/xen/xm_internal.c (xenXMOpen, xenXMClose): Likewise.
      * src/nwfilter/nwfilter_learnipaddr.c (virNWFilterLearnInit)
      (virNWFilterLearnShutdown): Likewise.
      * src/qemu/qemu_command.c (qemuDomainPCIAddressSetCreate)
      (qemuDomainPCIAddressSetFree): Likewise.
      * src/qemu/qemu_process.c (qemuProcessWaitForMonitor): Likewise.
      03ba07cb
    • J
      build: Fix API docs generation in VPATH build · 6e9f3dfa
      Jiri Denemark 提交于
      XSLT allows for two ways of generating the output of transformation.
      Either implicit, which xsltproc prints to stdout and can be redirected
      to a file using -o file. Or explicit, which means the stylesheet
      contains <xsl:document> element which specifies where the output should
      be saved. This can be used for generating more files by a single run of
      xsltproc and -o directory/ can change the directory where the output
      files will be stored.
      
      devhelp.xsl is special in that it combines both options in one
      stylesheet, which doesn't work well with -o:
      
      xsltproc --nonet -o ./devhelp/ ./devhelp/devhelp.xsl ./libvirt-api.xml
      
      Outputs 4 *.html files into ./devhelp but then tries to write to
      ./devhelp/ as a file (hence the I/O error) rather than writing output to
      the fifth file devhelp/libvirt.devhelp.
      
      This patch modifies devhelp.xsl so that all files are generated using
      <xsl:document> element and -o directory/ can be used to override output
      directory where those files are saved.
      6e9f3dfa
    • D
      Remove all object hashtable caches from virConnectPtr · 2ff4c137
      Daniel P. Berrange 提交于
      The virConnectPtr struct will cache instances of all other
      objects. APIs like virDomainLookupByUUID will return a
      cached object, so if you do virDomainLookupByUUID twice in
      a row, you'll get the same exact virDomainPtr instance.
      
      This does not have any performance benefit, since the actual
      logic in virDomainLookupByUUID (and other APIs returning
      virDomainPtr, etc instances) is not short-circuited. All
      it does is to ensure there is only one single virDomainPtr
      in existance for any given UUID.
      
      The caching has a number of downsides though, all relating
      to stale data. If APIs aren't careful to always overwrite
      the 'id' field in virDomainPtr it may become out of data.
      Likewise for the name field, if a guest is renamed, or if
      a guest is deleted, and then a new one created with the
      same UUID but different name.
      
      This has been an ongoing, endless source of bugs for all
      applications using libvirt from languages with garbage
      collection, causing them to get virDomainPtr instances
      from long ago with stale data.
      
      The caching is also a waste of memory resources, since
      both applications, and language bindings often maintain
      their own hashtable caches of object instances.
      
      This patch removes all the hash table caching, so all
      APIs return brand new virDomainPtr (etc) object instances.
      
      * src/datatypes.h: Delete all hash tables.
      * src/datatypes.c: Remove all object caching code
      2ff4c137