1. 15 3月, 2019 13 次提交
    • P
      qemu: hotplug: Remove 'ret' variable in qemuDomainDetachDeviceDiskLive · 70d06898
      Peter Krempa 提交于
      We don't have any cleanup section, we can return the value directly.
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      70d06898
    • E
      snapshot: More clarification about REDEFINE · a6a25d5c
      Eric Blake 提交于
      Based on recent list questions about the proposed addition of
      virDomainCheckpointCreateXML(REDEFINE), it is worth adding some
      clarification to the existing snapshot redefine documentation that is
      serving as the basis for checkpoints.
      
      Normal snapshot creation requires very few elements from the user XML
      (libvirt can pick sane defaults for items that are omitted, and many
      fields, including <domain>, are documented as readonly output fields
      ignored on input, produced by drivers that track it). But during
      REDEFINE, the API wants the complete XML produced by an earlier
      virDomainSnapshotGetXMLDesc; as the domain definition has likely
      changed since the snapshot was first created, libvirt is unable to
      recreate a <domain> sub-element that matches the original output
      representing the domain state at the time the snapshot was first
      created. In fact, reverting without a <domain> sub-element is risky
      enough that we had to add a FORCE flag for virDomainSnapshotRevert().
      In short, we only support omitting domain for qemu because of
      backwards-compatibility to snapshots created before 0.9.5 started
      capturing <domain>; even though there are other drivers like vbox that
      do not output <domain> because they have other reliable ways to
      revert.
      
      And based on the confusion caused when omitting <domain> from snapshot
      XML, the initial design for checkpoints in later patches will make
      <domain> a mandatory element during its REDEFINE.
      
      [Side note: the fact that <domain> can appear in <domainsnapshot> is a
      reason we cannot add a new API for a bulk listing or redefine of all
      snapshots of a single domain in one XML call (for example, a 1M
      <domain> XML * 16 snapshots explodes into 16M in a bulk form, which
      gets difficult to send over RPC). Perhaps we could add a flag to
      request that the <domain> sub-element be omitted on output, but such
      output is no longer suitable for sane REDEFINE input.]
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      a6a25d5c
    • E
      virobject: Improve documentation · 632ac8f8
      Eric Blake 提交于
      I had to inspect the code to learn whether a final virObjectUnref()
      calls ALL dispose callbacks in child-to-parent order (akin to C++
      destructors), or whether I manually had to call a parent-class dispose
      when writing a child class dispose method.  The answer is the
      former. (Thankfully, since VIR_FREE wipes out pointers for safety,
      even if I had guessed wrong, I probably would not have tripped over a
      double-free fault when the parent dispose ran for the second time).  I
      also had to read the code to learn if a dispose method was even
      mandatory (it is not, although getting NULL through VIR_CLASS_NEW
      requires a macro).  While at it, the VIR_CLASS_NEW macro requires that
      the virObject component at offset 0 be reached through the name
      'parent', not 'object'.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      632ac8f8
    • M
      qemu_hotplug: Fix a rare race condition when detaching a device twice · c2bc4191
      Michal Privoznik 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1623389
      
      If a device is detached twice from the same domain the following
      race condition may happen:
      
      1) The first DetachDevice() call will issue "device_del" on qemu
      monitor, but since the DEVICE_DELETED event did not arrive in
      time, the API ends claiming "Device detach request sent
      successfully".
      
      2) The second DetachDevice() therefore still find the device in
      the domain and thus proceeds to detaching it again. It calls
      EnterMonitor() and qemuMonitorSend() trying to issue "device_del"
      command again. This gets both domain lock and monitor lock
      released.
      
      3) At this point, qemu sends us the DEVICE_DELETED event which is
      going to be handled by the event loop which ends up calling
      qemuDomainSignalDeviceRemoval() to determine who is going to
      remove the device from domain definition. Whether it is the
      caller that marked the device for removal or whether it is going
      to be the event processing thread.
      
      4) Because the device was marked for removal,
      qemuDomainSignalDeviceRemoval() returns true, which means the
      event is to be processed by the thread that has marked the device
      for removal (and is currently still trying to issue "device_del"
      command)
      
      5) The thread finally issues the "device_del" command, which
      fails (obviously) and therefore it calls
      qemuDomainResetDeviceRemoval() to reset the device marking and
      quits immediately after, NOT removing any device from the domain
      definition.
      
      At this point, the device is still present in the domain
      definition but doesn't exist in qemu anymore. Worse, there is no
      way to remove it from the domain definition.
      
      Solution is to note down that we've seen the event and if the
      second "device_del" fails, not take it as a failure but carry on
      with the usual execution.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ACKed-by: NPeter Krempa <pkrempa@redhat.com>
      c2bc4191
    • M
      qemuMonitorJSONDelDevice: Return -2 on DeviceNotFound error · 229a0358
      Michal Privoznik 提交于
      A caller might be interested in differentiating the cause for
      error, especially if DeviceNotFound error occurred.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ACKed-by: NPeter Krempa <pkrempa@redhat.com>
      229a0358
    • M
      qemu_hotplug: Introduce and use qemuDomainDeleteDevice · 4cd13478
      Michal Privoznik 提交于
      The aim of this function will be to fix return value of
      qemuMonitorDelDevice() in one specific case. But that is yet to
      come. Right now this is nothing but a plain substitution.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      ACKed-by: NPeter Krempa <pkrempa@redhat.com>
      4cd13478
    • A
      run: Don't export unnecessary paths · 641438fb
      Andrea Bolognani 提交于
      We're using virFileFindResourceFull() to locate resources
      nowadays, which makes exporting these information in the
      environment unnecessary: see
      
        virDriverLoadModule() for LIBVIRT_DRIVER_DIR
        virLockManagerPluginNew() for LIBVIRT_LOCK_MANAGER_PLUGIN_DIR
        virLockManagerLockDaemonConnectionNew() for VIRTLOCKD_PATH
        doRemoteOpen() for LIBVIRTD_PATH
      
      As further proof that we don't need to expose the information
      this way anymore, we're not even exporting VIRTLOGD_PATH, which
      would be necessary if virLogManagerConnect() didn't already
      take care of that for us.
      Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
      Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
      641438fb
    • J
      qemu: Set job statsType for external memory snapshot · 1c2a9260
      Jiri Denemark 提交于
      Any job which is able to provide statistics that can be queried via
      virDomainGetJob{Stats,Info} has to set an appropriate statsType.
      
      Without a proper statsType qemuDomainJobInfoToParams and
      qemuDomainJobInfoToInfo have no idea what statistics should be sent to
      the API caller.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1688774Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      Reviewed-by: NErik Skultety <eskultet@redhat.com>
      1c2a9260
    • C
      test: storage: Fill in default vol types for every pool · 4ec884e3
      Cole Robinson 提交于
      Fill in a default volume type for every pool type, as reported
      by the VolGetInfo API. Now that we cover the whole enum, report
      an error for invalid values.
      Reviewed-by: NAndrea Bolognani <abologna@redhat.com>
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      4ec884e3
    • C
    • C
      configure: Remove --enable-test-coverage · f38d553e
      Cole Robinson 提交于
      We provide a custom configure option --enable-test-coverage and
      'make cov' target to generate code coverage reports. However gnulib
      already provides a 'make coverage' which 'just works' and doesn't
      require a special configure option.
      
      This drops our custom implementation in favor of 'make coverage'.
      Reports are now output to cov/index.html
      Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
      Signed-off-by: NCole Robinson <crobinso@redhat.com>
      f38d553e
    • M
      virt-driver-qemu.m4: Require YAJL · 2a00ef6e
      Michal Privoznik 提交于
      There is no way that qemu driver can work without being able to
      format/parse JSON.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJán Tomko <jtomko@redhat.com>
      2a00ef6e
    • M
      virt-driver-qemu.m4: Make qemu driver optional · 5f2adfab
      Michal Privoznik 提交于
      The basic idea of our configure script is to probe for things
      rather than have them enabled by default. This is even more
      visible in the next commit where configure fails if qemu driver
      is enabled but no yajl is found.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
      5f2adfab
  2. 14 3月, 2019 20 次提交
  3. 13 3月, 2019 7 次提交