1. 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
  2. 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
  3. 24 9月, 2010 1 次提交
  4. 17 8月, 2010 1 次提交
  5. 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
  6. 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
  7. 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
  8. 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
  9. 07 4月, 2010 5 次提交
  10. 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
  11. 12 2月, 2010 1 次提交
  12. 09 2月, 2010 3 次提交
  13. 15 1月, 2010 1 次提交
  14. 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
  15. 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
  16. 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
  17. 08 10月, 2009 1 次提交
    • J
      sVirt AppArmor security driver · bbaecd6a
      Jamie Strandboge 提交于
      * configure.in: look for AppArmor and devel
      * src/security/security_apparmor.[ch] src/security/security_driver.c
        src/Makefile.am: add and plug the new driver
      * src/security/virt-aa-helper.c: new binary which is used exclusively by
        the AppArmor security driver to manipulate AppArmor.
      * po/POTFILES.in: registers the new files
      * tests/Makefile.am tests/secaatest.c tests/virt-aa-helper-test:
        tests for virt-aa-helper and the security driver, secaatest.c is
        identical to seclabeltest.c except it initializes the 'apparmor'
        driver instead of 'selinux'
      bbaecd6a