1. 13 5月, 2011 1 次提交
  2. 10 5月, 2011 1 次提交
  3. 06 5月, 2011 1 次提交
    • E
      maint: rename virBufferVSprintf to virBufferAsprintf · 68ea80cf
      Eric Blake 提交于
      We already have virAsprintf, so picking a similar name helps for
      seeing a similar purpose.  Furthermore, the prefix V before printf
      generally implies 'va_list', even though this variant was '...', and
      the old name got in the way of adding a new va_list version.
      
      global rename performed with:
      
      $ git grep -l virBufferVSprintf \
        | xargs -L1 sed -i 's/virBufferVSprintf/virBufferAsprintf/g'
      
      then revert the changes in ChangeLog-old.
      68ea80cf
  4. 16 4月, 2011 1 次提交
    • E
      maint: use lighter-weight function for straight appends · dbe3bad9
      Eric Blake 提交于
      It costs quite a few processor cycles to go through printf parsing
      just to determine that we only meant to append.
      
      * src/xen/xend_internal.c (xend_op_ext): Consolidate multiple
      printfs into one.
      * src/qemu/qemu_command.c (qemuBuildWatchdogDevStr)
      (qemuBuildUSBInputDevStr, qemuBuildSoundDevStr)
      (qemuBuildSoundCodecStr, qemuBuildVideoDevStr): Likewise.
      (qemuBuildCpuArgStr, qemuBuildCommandLine): Prefer virBufferAdd
      over virBufferVsprintf for trivial appends.
      * src/phyp/phyp_driver.c (phypExec, phypUUIDTable_Push)
      (phypUUIDTable_Pull): Likewise.
      * src/conf/nwfilter_conf.c (macProtocolIDFormatter)
      (arpOpcodeFormatter, formatIPProtocolID, printStringItems)
      (virNWFilterPrintStateMatchFlags, virNWIPAddressFormat)
      (virNWFilterDefFormat): Likewise.
      * src/security/virt-aa-helper.c (main): Likewise.
      * src/util/sexpr.c (sexpr2string): Likewise.
      * src/xenxs/xen_sxpr.c (xenFormatSxprChr): Likewise.
      * src/xenxs/xen_xm.c (xenFormatXMDisk): Likewise.
      dbe3bad9
  5. 05 4月, 2011 1 次提交
  6. 24 2月, 2011 1 次提交
  7. 15 1月, 2011 1 次提交
    • E
      domain_conf: split source data out from ChrDef · 98334e7c
      Eric Blake 提交于
      This opens up the possibility of reusing the smaller ChrSourceDef
      for both qemu monitor and a passthrough smartcard device.
      
      * src/conf/domain_conf.h (_virDomainChrDef): Factor host
      details...
      (_virDomainChrSourceDef): ...into new struct.
      (virDomainChrSourceDefFree): New prototype.
      * src/conf/domain_conf.c (virDomainChrDefFree)
      (virDomainChrDefParseXML, virDomainChrDefFormat): Split...
      (virDomainChrSourceDefClear, virDomainChrSourceDefFree)
      (virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
      ...into new functions.
      (virDomainChrDefParseTargetXML): Update clients to reflect type
      split.
      * src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
      (virVMXFormatSerial, virVMXFormatParallel): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
      * src/xen/xend_internal.c (xenDaemonParseSxprChar)
      (xenDaemonFormatSxprChr): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
      (vboxAttachParallel): Likewise.
      * src/security/security_dac.c (virSecurityDACSetChardevLabel)
      (virSecurityDACSetChardevCallback)
      (virSecurityDACRestoreChardevLabel)
      (virSecurityDACRestoreChardevCallback): Likewise.
      * src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
      (SELinuxSetSecurityChardevCallback)
      (SELinuxRestoreSecurityChardevLabel)
      (SELinuxSetSecurityChardevCallback): Likewise.
      * src/security/virt-aa-helper.c (get_files): Likewise.
      * src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
      Likewise.
      * src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
      * src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
      (umlDomainOpenConsole): Likewise.
      * src/qemu/qemu_command.c (qemuBuildChrChardevStr)
      (qemuBuildChrArgStr, qemuBuildCommandLine)
      (qemuParseCommandLineChr): Likewise.
      * src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
      (qemuDomainObjPrivateXMLParse): Likewise.
      * src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
      * src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
      (qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
      (qemuPrepareMonitorChr, qemudShutdownVMDaemon)
      (qemuDomainOpenConsole): Likewise.
      * src/qemu/qemu_command.h (qemuBuildChrChardevStr)
      (qemuBuildChrArgStr): Delete, now that they are static.
      * src/libvirt_private.syms (domain_conf.h): New exports.
      * cfg.mk (useless_free_options): Update list.
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
      tests.
      98334e7c
  8. 18 11月, 2010 3 次提交
    • M
      virt-aa-helper: Fix several compile errors · c505eafe
      Matthias Bolte 提交于
      Include locale.h for setlocale().
      
      Revert the usage string back to it's original form.
      
      Use puts() instead of fputs(), as fputs() expects a FILE*.
      
      Add closing parenthesis to some vah_error() calls.
      
      Use argv[0] instead of an undefined argv0.
      c505eafe
    • E
      virt-aa-helper: translate error messages · c811d46f
      Eric Blake 提交于
      These messages are visible to the user, so they should be
      consistently translated.
      
      * cfg.mk (msg_gen_function): Add vah_error, vah_warning.
      * src/security/virt-aa-helper.c: Translate messages.
      (catchXMLError): Fix capitalization.
      c811d46f
    • E
      maint: improve i18n on non-Linux · 981d2cda
      Eric Blake 提交于
      Per the gettext developer:
      http://lists.gnu.org/archive/html/bug-gnu-utils/2010-10/msg00019.html
      http://lists.gnu.org/archive/html/bug-gnu-utils/2010-10/msg00021.html
      
      gettext() doesn't work correctly on all platforms unless you have
      called setlocale().  Furthermore, gnulib's gettext.h has provisions
      for setting up a default locale, which is the preferred method for
      libraries to use gettext without having to call textdomain() and
      override the main program's default domain (virInitialize already
      calls bindtextdomain(), but this is insufficient without the
      setlocale() added in this patch; and a redundant bindtextdomain()
      in this patch doesn't hurt, but serves as a good example for other
      packages that need to bind a second translation domain).
      
      This patch is needed to silence a new gnulib 'make syntax-check'
      rule in the next patch.
      
      * daemon/libvirtd.c (main): Setup locale and gettext.
      * src/lxc/lxc_controller.c (main): Likewise.
      * src/security/virt-aa-helper.c (main): Likewise.
      * src/storage/parthelper.c (main): Likewise.
      * tools/virsh.c (main): Fix exit status.
      * src/internal.h (DEFAULT_TEXT_DOMAIN): Define, for gettext.h.
      (_): Simplify definition accordingly.
      * po/POTFILES.in: Add src/storage/parthelper.c.
      981d2cda
  9. 17 11月, 2010 1 次提交
    • E
      maint: use gnulib configmake rather than open-coding things · 0d5f54bb
      Eric Blake 提交于
      * bootstrap.conf (gnulib_modules): Add configmake.
      * daemon/Makefile.am (libvirtd_CFLAGS): Drop defines provided by
      gnulib.
      * src/Makefile.am (INCLUDES): Likewise.
      * tests/Makefile.am (INCLUDES): Likewise.
      * tools/Makefile.am (virsh_CFLAGS): Likewise.
      * daemon/libvirtd.c (qemudInitPaths, usage, main): Update
      clients.
      * src/cpu/cpu_map.c (CPUMAPFILE): Likewise.
      * src/driver.c (DEFAULT_DRIVER_DIR): Likewise.
      * src/internal.h (_): Likewise.
      * src/libvirt.c (virInitialize): Likewise.
      * src/lxc/lxc_conf.h (LXC_CONFIG_DIR, LXC_STATE_DIR, LXC_LOG_DIR):
      Likewise.
      * src/lxc/lxc_conf.c (lxcCapsInit, lxcLoadDriverConfig):
      Likewise.
      * src/network/bridge_driver.c (NETWORK_PID_DIR)
      (NETWORK_STATE_DIR, DNSMASQ_STATE_DIR, networkStartup): Likewise.
      * src/nwfilter/nwfilter_driver.c (nwfilterDriverStartup):
      Likewise.
      * src/qemu/qemu_conf.c (qemudLoadDriverConfig): Likewise.
      * src/qemu/qemu_driver.c (qemudStartup): Likewise.
      * src/remote/remote_driver.h (LIBVIRTD_PRIV_UNIX_SOCKET)
      (LIBVIRTD_PRIV_UNIX_SOCKET_RO, LIBVIRTD_CONFIGURATION_FILE)
      (LIBVIRT_PKI_DIR): Likewise.
      * src/secret/secret_driver.c (secretDriverStartup): Likewise.
      * src/security/security_apparmor.c (VIRT_AA_HELPER): Likewise.
      * src/security/virt-aa-helper.c (main): Likewise.
      * src/storage/storage_backend_disk.c (PARTHELPER): Likewise.
      * src/storage/storage_driver.c (storageDriverStartup): Likewise.
      * src/uml/uml_driver.c (TEMPDIR, umlStartup): Likewise.
      * src/util/hooks.c (LIBVIRT_HOOK_DIR): Likewise.
      * tools/virsh.c (main): Likewise.
      * docs/hooks.html.in: Likewise.
      0d5f54bb
  10. 12 11月, 2010 1 次提交
  11. 10 11月, 2010 1 次提交
    • S
      bye to close(), welcome to VIR_(FORCE_)CLOSE() · 60ae1c34
      Stefan Berger 提交于
      Using automated replacement with sed and editing I have now replaced all
      occurrences of close() with VIR_(FORCE_)CLOSE() except for one, of
      course. Some replacements were straight forward, others I needed to pay
      attention. I hope I payed attention in all the right places... Please
      have a look. This should have at least solved one more double-close
      error.
      60ae1c34
  12. 01 10月, 2010 1 次提交
    • J
      implement usb and pci hot attach in AppArmor driver · 593e0072
      Jamie Strandboge 提交于
      Description: Implement AppArmorSetSecurityHostdevLabel() and
      AppArmorRestoreSecurityHostdevLabel() for hostdev and pcidev attach.
      
      virt-aa-helper also has to be adjusted because *FileIterate() is used for pci
      and usb devices and the corresponding XML for hot attached hostdev and pcidev
      is not in the XML passed to virt-aa-helper. The new '-F filename' option is
      added to append a rule to the profile as opposed to the existing '-f
      filename', which rewrites the libvirt-<uuid>.files file anew. This new '-F'
      option will append a rule to an existing libvirt-<uuid>.files if it exists,
      otherwise it acts the same as '-f'.
      
      load_profile() and reload_profile() have been adjusted to add an 'append'
      argument, which when true will use '-F' instead of '-f' when executing
      virt-aa-helper.
      
      All existing calls to load_profile() and reload_profile() have been adjusted
      to use the old behavior (ie append==false) except AppArmorSetSavedStateLabel()
      where it made sense to use the new behavior.
      
      This patch also adds tests for '-F'.
      
      Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/640993
      593e0072
  13. 24 9月, 2010 1 次提交
  14. 17 8月, 2010 1 次提交
  15. 24 7月, 2010 3 次提交
    • M
      virt-aa-helper: Make getopt accept the p option · d01340e7
      Matthias Bolte 提交于
      Commit 68719c4b added the
      p option to control disk format probing, but it wasn't added
      to the getopt_long optstring parameter.
      
      Add the p option to the getopt_long optstring parameter.
      d01340e7
    • M
      virt-aa-helper: Fix return value of add_file_path · adde0e2c
      Matthias Bolte 提交于
      Commit a8853344 added this
      function and wrapped vah_add_file in it. vah_add_file may
      return -1, 0, 1. It returns 1 in case the call to valid_path
      detects a restricted file. The original code treated a return
      value != 0 as error. The refactored code treats a return
      value < 0 as error. This triggers segfault in virt-aa-helper
      and breaks virt-aa-helper-test for the restricted file tests.
      
      Make sure that add_file_path returns -1 on error.
      adde0e2c
    • M
      virt-aa-helper: Ignore open errors again · 05c9a413
      Matthias Bolte 提交于
      virt-aa-helper used to ignore errors when opening files.
      Commit a8853344 refactored
      the related code and changed this behavior. virt-aa-helper
      didn't ignore open errors anymore and virt-aa-helper-test
      fails.
      
      Make sure that virt-aa-helper ignores open errors again.
      05c9a413
  16. 20 7月, 2010 3 次提交
    • D
      Disable all disk probing in QEMU driver & add config option to re-enable · 68719c4b
      Daniel P. Berrange 提交于
      Disk format probing is now disabled by default. A new config
      option in /etc/qemu/qemu.conf will re-enable it for existing
      deployments where this causes trouble
      68719c4b
    • D
      Convert all disk backing store loops to shared helper API · a8853344
      Daniel P. Berrange 提交于
      Update the QEMU cgroups code, QEMU DAC security driver, SELinux
      and AppArmour security drivers over to use the shared helper API
      virDomainDiskDefForeachPath().
      
      * src/qemu/qemu_driver.c, src/qemu/qemu_security_dac.c,
        src/security/security_selinux.c, src/security/virt-aa-helper.c:
        Convert over to use virDomainDiskDefForeachPath()
      a8853344
    • D
      Require format to be passed into virStorageFileGetMetadata · bf80fc68
      Daniel P. Berrange 提交于
      Require the disk image to be passed into virStorageFileGetMetadata.
      If this is set to VIR_STORAGE_FILE_AUTO, then the format will be
      resolved using probing. This makes it easier to control when
      probing will be used
      
      * src/qemu/qemu_driver.c, src/qemu/qemu_security_dac.c,
        src/security/security_selinux.c, src/security/virt-aa-helper.c:
        Set VIR_STORAGE_FILE_AUTO when calling virStorageFileGetMetadata.
      * src/storage/storage_backend_fs.c: Probe for disk format before
        calling virStorageFileGetMetadata.
      * src/util/storage_file.h, src/util/storage_file.c: Remove format
        from virStorageFileMeta struct & require it to be passed into
        method.
      bf80fc68
  17. 19 5月, 2010 1 次提交
    • J
      initialize "meta" in virStorageFileGetMetadata, not in each caller · dcf30d9c
      Jim Meyering 提交于
      Do not require each caller of virStorageFileGetMetadata and
      virStorageFileGetMetadataFromFD to first clear the storage of the
      "meta" buffer.  Instead, initialize that storage in
      virStorageFileGetMetadataFromFD.
      * src/util/storage_file.c (virStorageFileGetMetadataFromFD): Clear
      "meta" here, not before each of the following callers.
      * src/qemu/qemu_driver.c (qemuSetupDiskCgroup): Don't clear "meta" here.
      (qemuTeardownDiskCgroup): Likewise.
      * src/qemu/qemu_security_dac.c (qemuSecurityDACSetSecurityImageLabel):
      Likewise.
      * src/security/security_selinux.c (SELinuxSetSecurityImageLabel):
      Likewise.
      * src/security/virt-aa-helper.c (get_files): Likewise.
      dcf30d9c
  18. 18 5月, 2010 1 次提交
    • J
      maint: add more free-like functions to the list and deal with fallout · a986892e
      Jim Meyering 提交于
      * cfg.mk (useless_free_options): Add many vir*Free* function names,
      and then remove the useless if-before-free tests exposed by running
      make syntax-check.
      * src/conf/interface_conf.c (virInterfaceDefFree): Remove useless "if".
      (virInterfaceAssignDef): Likewise.
      * src/conf/network_conf.c (virNetworkAssignDef): Likewise.
      * src/conf/storage_conf.c (virStoragePoolObjAssignDef): Likewise.
      * src/node_device/node_device_hal.c (dev_create): Likewise.
      * src/security/virt-aa-helper.c (vahDeinit): Likewise.
      * src/test/test_driver.c (testNodeDeviceCreateXML): Likewise.
      * src/util/conf.c (virConfSetValue): Likewise.
      a986892e
  19. 07 4月, 2010 5 次提交
  20. 05 3月, 2010 1 次提交
    • D
      Fix USB passthrough based on product/vendor · 09ed0729
      Daniel P. Berrange 提交于
      Changeset
      
        commit 5073aa99
        Author: Cole Robinson <crobinso@redhat.com>
        Date:   Mon Jan 11 11:40:46 2010 -0500
      
      Added support for product/vendor based passthrough, but it only
      worked at the security driver layer. The main guest XML config
      was not updated with the resolved bus/device ID. When the QEMU
      argv refactoring removed use of product/vendor, this then broke
      launching guests.
      
      THe solution is to move the product/vendor resolution up a layer
      into the QEMU driver. So the first thing QEMU does is resolve
      the product/vendor to a bus/device and updates the XML config
      with this info. The rest of the code, including security drivers
      and QEMU argv generated can now rely on bus/device always being
      set.
      
      * src/util/hostusb.c, src/util/hostusb.h: Split vendor/product
        resolution code out of usbGetDevice and into usbFindDevice.
        Add accessors for bus/device ID
      * src/security/virt-aa-helper.c, src/security/security_selinux.c,
        src/qemu/qemu_security_dac.c: Remove vendor/product from the
        usbGetDevice() calls
      * src/qemu/qemu_driver.c: Use usbFindDevice to resolve vendor/product
        into a bus/device ID
      09ed0729
  21. 12 2月, 2010 1 次提交
  22. 09 2月, 2010 3 次提交
  23. 15 1月, 2010 1 次提交
  24. 14 1月, 2010 1 次提交
    • C
      Implement path lookup for USB by vendor:product · 5073aa99
      Cole Robinson 提交于
      Based off how QEMU does it, look through /sys/bus/usb/devices/* for
      matching vendor:product info, and if found, use info from the surrounding
      files to build the device's /dev/bus/usb path.
      
      This fixes USB device assignment by vendor:product when running qemu
      as non-root (well, it should, but for some reason I couldn't reproduce
      the failure people are seeing in [1], but it appears to work properly)
      
      [1] https://bugzilla.redhat.com/show_bug.cgi?id=542450
      5073aa99
  25. 10 12月, 2009 1 次提交
    • M
      Add virBufferFreeAndReset() and replace free() · 1b9d0744
      Matthias Bolte 提交于
      Replace free(virBufferContentAndReset()) with virBufferFreeAndReset().
      Update documentation and replace all remaining calls to free() with
      calls to VIR_FREE(). Also add missing calls to virBufferFreeAndReset()
      and virReportOOMError() in OOM error cases.
      1b9d0744
  26. 13 11月, 2009 3 次提交
    • J
      AppArmor handling of accesses to readonly files · d0d4b8ad
      Jamie Strandboge 提交于
      Fixes https://launchpad.net/bugs/453335
      
      * src/security/virt-aa-helper.c: suppress confusing and misleading
        apparmor denied message when kvm/qemu tries to open a libvirt specified
        readonly file (such as a cdrom) with write permissions. libvirt uses
        the readonly attribute for the security driver only, and has no way
        of telling kvm/qemu that the device should be opened readonly
      d0d4b8ad
    • J
      AppArmor require absolute paths · dae7054b
      Jamie Strandboge 提交于
      Fixes https://launchpad.net/bugs/460271
      
      * src/security/virt-aa-helper.c: require absolute path for dynamic added
        files. This is required by AppArmor and conveniently prevents adding
        tcp consoles to the profile
      dae7054b
    • J
      Fix virt-aa-helper when host and os.type arch differ · 308b8533
      Jamie Strandboge 提交于
      * src/security/virt-aa-helper.c: get_definition() now calls the new
        caps_mockup() function which will parse the XML for os.type,
        os.type.arch and then sets the wordsize.  These attributes are needed
        only to get a valid virCapsPtr for virDomainDefParseString(). The -H
        and -b options are now removed from virt-aa-helper (they weren't used
        yet anyway).
      * tests/virt-aa-helper-test: extend and fixes tests, chmod'ed 755
      308b8533