1. 10 1月, 2017 26 次提交
    • J
      storage: Move and rename disk backend label checking · a48c674f
      John Ferlan 提交于
      Rather than have the Disk code having to use PARTED to determine if
      there's something on the device, let's use the virStorageBackendDeviceProbe.
      and only fallback to the PARTED probing if the BLKID code isn't built in.
      
      This will also provide a mechanism for the other current caller (File
      System Backend) to utilize a PARTED parsing algorithm in the event that
      BLKID isn't built in to at least see if *something* exists on the disk
      before blindly trying to use. The PARTED error checking will not find
      file system types, but if there is a partition table set on the device,
      it will at least cause a failure.
      
      Move virStorageBackendDiskValidLabel and virStorageBackendDiskFindLabel
      to storage_backend and rename/rework the code to fit the new model.
      
      Update the virsh.pod description to provide a more generic description
      of the process since we could now use either blkid or parted to find
      data on the target device.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      a48c674f
    • J
      storage: For FS pool check for properly formatted target volume · a11fd697
      John Ferlan 提交于
      Prior to starting up, let's be sure the target volume device is
      formatted as we expect; otherwise, inhibit the start.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      a11fd697
    • J
      storage: Add writelabel bool for virStorageBackendDeviceProbe · 19ced38f
      John Ferlan 提交于
      It's possible that the API could be called from a startup path in
      order to check whether the label on the device matches what our
      format is. In order to handle that condition, add a 'writelabel'
      boolean to the API in order to indicate whether a write or just
      read is about to happen.
      
      This alters two "error" conditions that would care about knowing.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      19ced38f
    • J
      storage: Add partition type checks for BLKID probing · a22e1a00
      John Ferlan 提交于
      A device may be formatted using some sort of disk partition format type.
      We can check that using the blkid_ API's as well - so alter the logic to
      allow checking the device for both a filesystem and a disk partition.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      a22e1a00
    • J
      storage: Fix implementation of no-overwrite for file system backend · f23d4bbc
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1363586
      
      Commit id '27758859' introduced the "NO_OVERWRITE" flag check for
      file system backends; however, the implementation, documentation,
      and algorithm was inconsistent. For the "flag" description for the
      API the flag was described as "Do not overwrite existing pool";
      however, within the storage backend code the flag is described
      as "it probes to determine if filesystem already exists on the
      target device, renurning an error if exists".
      
      The code itself was implemented using the paradigm to set up the
      superblock probe by creating a filter that would cause the code
      to only search for the provided format type. If that type wasn't
      found, then the algorithm would return success allowing the caller
      to format the device. If the format type already existed on the
      device, then the code would fail indicating that the a filesystem
      of the same type existed on the device.
      
      The result is that if someone had a file system of one type on the
      device, it was possible to overwrite it if a different format type
      was specified in updated XML effectively trashing whatever was on
      the device already.
      
      This patch alters what NO_OVERWRITE does for a file system backend
      to be more realistic and consistent with what should be expected when
      the caller requests to not overwrite the data on the disk.
      
      Rather than filter results based on the expected format type, the
      code will allow success/failure be determined solely on whether the
      blkid_do_probe calls finds some known format on the device. This
      adjustment also allows removal of the virStoragePoolProbeResult
      enum that was under utilized.
      
      If it does find a formatted file system different errors will be
      generated indicating a file system of a specific type already exists
      or a file system of some other type already exists.
      
      In the original virsh support commit id 'ddcd5674', the description
      for '--no-overwrite' within the 'pool-build' command help output
      has an ambiguous "of this type" included in the short description.
      Compared to the longer description within the "Build a given pool."
      section of the virsh.pod file it's more apparent that the meaning
      of this flag would cause failure if a probe of the target already
      has a filesystem.
      
      So this patch also modifies the short description to just be the
      antecedent of the 'overwrite' flag, which matches the API description.
      This patch also modifies the grammar in virsh.pod for no-overwrite
      as well as reworking the paragraph formats to make it easier to read.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      f23d4bbc
    • J
      storage: Introduce virStorageBackendDeviceIsEmpty · 553d21da
      John Ferlan 提交于
      Rename virStorageBackendFileSystemProbe and to virStorageBackendBLKIDFindFS
      and move to the more common storage_backend module.
      
      Create a shim virStorageBackendDeviceIsEmpty which will make the call
      to the virStorageBackendBLKIDFindFS and check the return value.
      Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
      553d21da
    • M
      qemu: Drop qemuDomainDeleteNamespace · 406e3909
      Michal Privoznik 提交于
      After previous commits, this function is no longer needed.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      406e3909
    • M
      qemuDomainCreateNamespace: move mkdir to qemuDomainBuildNamespace · 5d198c2b
      Michal Privoznik 提交于
      Again, there is no need to create /var/lib/libvirt/$domain.*
      directories in CreateNamespace(). It is sufficient to create them
      as soon as we need them which is in BuildNamespace. This way we
      don't leave them around for the whole lifetime of domain.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5d198c2b
    • M
      qemuDomainGetPreservedMounts: Do not special case /dev · 5d300576
      Michal Privoznik 提交于
      The c1140eb9 got me thinking. We don't want to special case /dev
      in qemuDomainGetPreservedMounts(), but in all other places in the
      code we special case it anyway. I mean,
      /var/run/libvirt/$domain.dev path is constructed separately just
      so that it is not constructed here. It makes only a little sense
      (if any at all).
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5d300576
    • M
      qemuDomainCreateNamespace: s/unlink/rmdir/ · 40ebbf72
      Michal Privoznik 提交于
      If something goes wrong in this function we try a rollback. That
      is unlink all the directories we created earlier. For some weird
      reason unlink() was called instead of rmdir().
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      40ebbf72
    • M
      qemu: Use transactions from security driver · 095f042e
      Michal Privoznik 提交于
      So far if qemu is spawned under separate mount namespace in order
      to relabel everything it needs an access to the security driver
      to run in that namespace too. This has a very nasty down side -
      it is being run in a separate process, so any internal state
      transition is NOT reflected in the daemon. This can lead to many
      sleepless nights. Therefore, use the transaction APIs so that
      libvirt developers can sleep tight again.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      095f042e
    • M
      4674fc6a
    • M
      security_dac: Implement transaction APIs · 67232478
      Michal Privoznik 提交于
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      67232478
    • M
      security driver: Introduce transaction APIs · 95576b4d
      Michal Privoznik 提交于
      With our new qemu namespace code in place, the relabelling of
      devices is done not as good is it could: a child process is
      spawned, it enters the mount namespace of the qemu process and
      then runs desired API of the security driver.
      
      Problem with this approach is that internal state transition of
      the security driver done in the child process is not reflected in
      the parent process. While currently it wouldn't matter that much,
      it is fairly easy to forget about that. We should take the extra
      step now while this limitation is still fresh in our minds.
      
      Three new APIs are introduced here:
        virSecurityManagerTransactionStart()
        virSecurityManagerTransactionCommit()
        virSecurityManagerTransactionAbort()
      
      The Start() is going to be used to let security driver know that
      we are starting a new transaction. During a transaction no
      security labels are actually touched, but rather recorded and
      only at Commit() phase they are actually updated. Should
      something go wrong Abort() aborts the transaction freeing up all
      memory allocated by transaction.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      95576b4d
    • M
      security_dac: Resolve virSecurityDACSetOwnershipInternal const correctness · 39779eb1
      Michal Privoznik 提交于
      The code at the very bottom of the DAC secdriver that calls
      chown() should be fine with read-only data. If something needs to
      be prepared it should have been done beforehand.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      39779eb1
    • A
      feeaa015
    • A
      aa36a26e
    • A
      qemu: Use virtio-pci by default for mach-virt guests · 1d845463
      Andrea Bolognani 提交于
      virtio-pci is the way forward for aarch64 guests: it's faster
      and less alien to people coming from other architectures.
      Now that guest support is finally getting there (Fedora 24,
      CentOS 7.3, Ubuntu 16.04 and Debian testing all support
      virtio-pci out of the box), we'd like to start using it by
      default instead of virtio-mmio.
      
      Users and applications can already opt-in by explicitly using
      
        <address type='pci'/>
      
      inside the relevant elements, but that's kind of cumbersome and
      requires all users and management applications to adapt, which
      we'd really like to avoid.
      
      What we can do instead is use virtio-mmio only if the guest
      already has at least one virtio-mmio device, and use virtio-pci
      in all other situations.
      
      That means existing virtio-mmio guests will keep using the old
      addressing scheme, and new guests will automatically be created
      using virtio-pci instead. Users can still override the default
      in either direction.
      
      Existing tests such as aarch64-aavmf-virtio-mmio and
      aarch64-virtio-pci-default already cover all possible
      scenarios, so no additions to the test suites are necessary.
      1d845463
    • P
      qemu: setvcpus: Properly coldplug vcpus when hotpluggable vcpus are present · a946ea1a
      Peter Krempa 提交于
      When coldplugging vcpus to a VM that already has a few hotpluggable
      vcpus the code might generate invalid configuration as
      non-hotpluggable cpus need to be clustered starting from vcpu 0.
      
      This fix forces the added vcpus to be hotpluggable in such case.
      
      Fixes a corner case described in:
      https://bugzilla.redhat.com/show_bug.cgi?id=1370357
      a946ea1a
    • L
      docs: fix list of domain states in virsh manpage · 24d4a0a1
      Laine Stump 提交于
      The virsh manpage lists "shutdown" and "dying" as two of the possible
      domain states that could be listed in the output of the "virsh list"
      command. However, a domain that is being shutdown will be listed as
      "in shutdown", and the "dying" state doesn't even exist (and never
      has, as far as I can tell from looking through git history - it was
      shown in the original import of the virsh.pod file in 2006; there was
      no VIR_DOMAIN_DYING state then, there wasn't one when those lines of
      virsh.pod were tweaked in 2008, and there still isn't one
      today. Apparently it was just something that sounded like a good idea
      to someone at some time, but was never implemented...)
      
      Resolves: https://bugzilla.redhat.com/1408778
      24d4a0a1
    • N
      perf: Add cache_l1d perf event support · ae16c95f
      Nitesh Konkar 提交于
      This patch adds support and documentation for
      a generalized hardware cache event called cache_l1d
      perf event.
      Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
      ae16c95f
    • N
      docs: Reword virsh manpage for --uuid --name --table options · 0977ada8
      Nitesh Konkar 提交于
      The virsh manpage lists options --uuid and --name as
      mutually exclusive along option --table when actually
      the option --table is mutually exclusive and can't go
      with options --uuid and/or --name. This patch rewords the
      virsh manpage to state the correct meaning.
      Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
      0977ada8
    • N
      virsh: Display perf enabled/disabled message for set operations · 0289b8b2
      Nitesh Konkar 提交于
      When setting perf events, the enabled/disabled perf events are not
      listed. Since we know which events were changed it's possible to
      print out the values on successful set, such as :
      
          virsh perf Domain --enable instructions --disable cache_misses
          instructions   : enabled
          cache_misses   : disabled
      
      Created a helper to print the messages - use the vshPrintExtra to
      adhere to the --quiet|-q option being set by some script. This will
      cause the get code to print nothing, but will return success/failure.
      Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
      0289b8b2
    • N
      virsh: Fix English grammar in the virsh perf manpage · 779073c5
      Nitesh Konkar 提交于
      779073c5
    • J
      Update remote_protocol-structs for new events · dc2bfdc8
      Jiri Denemark 提交于
      Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      dc2bfdc8
    • D
      secret: add support for value change events · 42241208
      Daniel P. Berrange 提交于
      Emit an event whenever a secret value changes
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      42241208
  2. 09 1月, 2017 13 次提交
  3. 07 1月, 2017 1 次提交