1. 16 7月, 2013 23 次提交
    • J
      Add new public API virDomainSetMemoryStatsPeriod · d5c67e7f
      John Ferlan 提交于
      Add new API in order to set the balloon memory driver statistics collection
      period in order to allow dynamic period adjustment for the virsh dommemstats to
      display balloon stats data
      d5c67e7f
    • J
      Add capability to fetch balloon stats · ab600621
      John Ferlan 提交于
      This patch will add the qemuMonitorJSONGetMemoryStats() to execute a
      "guest-stats" on the balloonpath using "get-qom" replacing the former
      mechanism which looked through the "query-ballon" returned data for
      the fields.  The "query-balloon" code only returns 'actual' memory.
      Rather than duplicating the existing code, have the JSON API use the
      GetBalloonInfo API.
      
      A check in the qemuMonitorGetMemoryStats() will be made to ensure the
      balloon driver path has been set.  Since the underlying JSON code can
      return data not associated with the balloon driver, we don't fail on
      a failure to get the balloonpath.  Of course since we've made the check,
      we can then set the ballooninit flag.  Getting the path here is primarily
      due to the process reconnect path which doesn't attempt to set the
      collection period.
      ab600621
    • J
      Determine whether to start balloon memory stats gathering. · ffdf82a9
      John Ferlan 提交于
      At vm startup and attach attempt to set the balloon driver statistics
      collection period based on the value found in the domain xml file. This
      is not done at reconnect since it's possible that a collection period
      was set on the live guest and making the set period call would reset to
      whatever value is stored in the config file.
      
      Setting the stats collection period has a side effect of searching through
      the qom-list output for the virtio balloon driver and making sure that it
      has the right properties in order to allow setting of a collection period
      and eventually fetching of statistics.
      
      The walk through the qom-list is expensive and thus the balloonpath will
      be saved in the monitor private structure as well as a flag indicating
      that the initialization has already been attempted (in the event that a
      path is not found, no sense to keep checking).
      
      This processing model conforms to the qom object model model which
      requires setting object properties after device startup. That is, it's
      not possible to pass the period along via the startup code as it won't
      be recognized.
      ffdf82a9
    • J
      Add 'period' for Memballoon statistics gathering capability · 9ed3a5ca
      John Ferlan 提交于
      Add a period in seconds to allow/enable statistics gathering from the
      Balloon driver for 'virsh dommemstat <domain>'.
      9ed3a5ca
    • A
      qemu: Prevent crash of libvirtd without guest agent configuration · 96518d43
      Alex Jia 提交于
      If users haven't configured guest agent then qemuAgentCommand() will
      dereference a NULL 'mon' pointer, which causes crash of libvirtd when
      using agent based cpu (un)plug.
      
      With the patch, when the qemu-ga service isn't running in the guest,
      a expected error "error: Guest agent is not responding: Guest agent
      not available for now" will be raised, and the error "error: argument
      unsupported: QEMU guest agent is not configured" is raised when the
      guest hasn't configured guest agent.
      
      GDB backtrace:
      
       (gdb) bt
       #0  virNetServerFatalSignal (sig=11, siginfo=<value optimized out>, context=<value optimized out>) at rpc/virnetserver.c:326
       #1  <signal handler called>
       #2  qemuAgentCommand (mon=0x0, cmd=0x7f39300017b0, reply=0x7f394b090910, seconds=-2) at qemu/qemu_agent.c:975
       #3  0x00007f39429507f6 in qemuAgentGetVCPUs (mon=0x0, info=0x7f394b0909b8) at qemu/qemu_agent.c:1475
       #4  0x00007f39429d9857 in qemuDomainGetVcpusFlags (dom=<value optimized out>, flags=9) at qemu/qemu_driver.c:4849
       #5  0x00007f3957dffd8d in virDomainGetVcpusFlags (domain=0x7f39300009c0, flags=8) at libvirt.c:9843
      
      How to reproduce?
      
       # To start a guest without guest agent configuration
       # then run the following cmdline
      
       # virsh vcpucount foobar --guest
       error: End of file while reading data: Input/output error
       error: One or more references were leaked after disconnect from the hypervisor
       error: Failed to reconnect to the hypervisor
      
      RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=984821Signed-off-by: NAlex Jia <ajia@redhat.com>
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      96518d43
    • M
      Make logical pools independent on target path · efab27af
      Martin Kletzander 提交于
      When using logical pools, we had to trust the target->path provided.
      This parameter, however, can be completely ommited and we can use
      '/dev/<source.name>' safely and populate it to target.path.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=952973
      efab27af
    • M
      qemuhotplugtest: Introduce test for chardev hotplug · 9e45b3df
      Michal Privoznik 提交于
      The test is currently testing just device update function. However,
      chardev hotplug is implemented just for device attach and detach. This
      fact means, the test needs to be rewritten (the majority of the code is
      still shared). Moreover, we are now able to pass VM among multiple test
      runs. So for instance, while we add a device in the first run, we can
      remove it in the second run.
      9e45b3df
    • M
      qemu: Implement chardev hotplug on live level · 24b08219
      Michal Privoznik 提交于
      Since previous patches has prepared everything for us, we may now
      implement live hotplug of a character device.
      24b08219
    • M
      qemu: Implement chardev hotplug on config level · 75f0fd51
      Michal Privoznik 提交于
      There are two levels on which a device may be hotplugged: config
      and live. The config level requires just an insert or remove from
      internal domain definition structure, which is exactly what this
      patch does. There is currently no implementation for a chardev
      update action, as there's not much to be updated. But more
      importantly, the only thing that can be updated is path or socket
      address by which chardevs are distinguished. So the update action
      is currently not supported.
      75f0fd51
    • M
      domain_conf: Auto fill chardev port · 6b9e3dbd
      Michal Privoznik 提交于
      Now that we have callbacks, we should auto fill in omitted pieces of
      information. It's important for chardev hotplug to fill in the correct
      /{serial,parallel,console,channel}/target/@port if no value has been
      provided by user.
      6b9e3dbd
    • P
      cpu: Allow fine tuning of "host-model" cpu · 3c8be55c
      Peter Krempa 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=799354
      
      Until now, the "host-model" cpu mode couldn't be influenced. This patch
      allows to use the <feature> elements to either enable or disable
      specific CPU flags. This can be used to force flags that can be emulated
      even if the host CPU doesn't support them.
      3c8be55c
    • P
      cpu: Clean up code style · 90f9fb5a
      Peter Krempa 提交于
      90f9fb5a
    • P
      cpu: Add virCPUDefUpdateFeature() · 13cdd389
      Peter Krempa 提交于
      This new function updates or adds a feature to a existing cpu model
      definition. This function will be helpful to allow tuning of
      "host-model" features in later patches.
      13cdd389
    • P
      conf: Clean up error reporting in cpu definition parsing · b4275287
      Peter Krempa 提交于
      Use VIR_ERR_XML_ERROR instead of VIR_ERR_INTERNAL_ERROR in XML parsing
      code and move "%s" formating strings right after the error code.
      b4275287
    • J
      storage_conf: Merge AuthChap and AuthCephx into AuthSecret · 41ac8184
      John Ferlan 提交于
      Merge virStoragePoolDefParseAuthChap and virStoragePoolDefParseAuthCephx
      into a common virStoragePoolDefParseAuthSecret.  Change the output to be
      common for both by putting 'type' first followed by 'username'.
      41ac8184
    • J
      storage_conf: Move username processing into common function · 37029be4
      John Ferlan 提交于
      Move the auth->username processing into virStoragePoolDefParseAuth
      save the resulting username into chap/cephx specific data
      37029be4
    • J
      storage_pool: Rework chap XML to mimic ceph · eb0d79c6
      John Ferlan 提交于
      The existing 'chap' XML logic was never used - just defined.  Rather than
      try to insert a square peg into a round hole, blow it up and rewrite the
      logic to follow the 'ceph' format.
      
      Remove the former "chap.login" and "chap.passwd" fields and replace
      with "chap.username" and "chap.secret" in _virStoragePoolAuthChap.
      Adjust the virStoragePoolDefParseAuthChap() to process.
      
      Change the rng file to describe the new layout
      
      Update the formatstorage.html to describe the usage of the secret element
      to mention that the secret type "iscsi" and "ceph" can be used
      to storage pool too.
      
      Update the formatsecret.html to include a reference to the storage pool
      
      Update tests to handle the changes from 'login' and 'passwd' to 'username'
      and '<secret>' format
      eb0d79c6
    • J
      storage_conf: Move auth processing into virStoragePoolDefParseAuth · 092ca968
      John Ferlan 提交于
      Split processing of "<auth" into its own function
      092ca968
    • J
      storage_conf: Introduce virStoragePoolAuthSecretPtr · 92c5591f
      John Ferlan 提交于
      Split out the _virStoragePoolAuthSecret data from _virStoragePoolAuthCephx
      into its own structure
      92c5591f
    • J
      storage_conf: Adjust virStoragePoolAuthType enum · 26a84311
      John Ferlan 提交于
      Generate and use the virStoragePoolAuthTypeType{To|From}String helpers
      26a84311
    • J
      Add qemuMonitorJSONSetObjectProperty() method for QMP qom-set command · 50336d87
      John Ferlan 提交于
      Add a new qemuMonitorJSONSetObjectProperty() method to support invocation
      of the 'qom-set' JSON monitor command with a provided path, property, and
      expected data type to set.
      
      NOTE: The set API was added only for the purpose of the qemumonitorjsontest
      
      The test code uses the same "/machine/i440fx" property as the get test and
      attempts to set the "realized" property to "true" (which it should be set
      at anyway).
      50336d87
    • J
      Add qemuMonitorJSONGetObjectProperty() method for QMP qom-get command · bdce2789
      John Ferlan 提交于
      Add a new qemuMonitorJSONGetObjectProperty() method to support invocation
      of the 'qom-get' JSON monitor command with a provided path, property, and
      expected data type return. The qemuMonitorJSONObjectProperty is similar to
      virTypedParameter; however, a future patch will extend it a bit to include
      a void pointer to balloon driver statistic data.
      
      NOTE: The ObjectProperty structures and API are added only for the
            purpose of the qemumonitorjsontest
      
      The provided test will execute a qom-get on "/machine/i440fx" which will
      return a property "realized".
      bdce2789
    • J
      Add qemuMonitorJSONGetObjectListPaths() method for QMP qom-list command · d76a8978
      John Ferlan 提交于
      Add a new qemuMonitorJSONGetObjectListPaths() method to support invocation
      of the 'qom-list' JSON monitor command with a provided path.
      
      NOTE: The ListPath structures and API's are added only for the
            purpose of the qemumonitorjsontest
      
      The returned list of paired data fields of "name" and "type" that can
      be used to peruse QOM configuration data and eventually utilize for the
      balloon statistics.
      
      The test does a "{"execute":"qom-list", "arguments": { "path": "/"}}" which
      returns "{"return": [{"name": "machine", "type": "child<container>"},
      {"name": "type", "type": "string"}]}" resulting in a return of an array
      of 2 elements with [0].name="machine", [0].type="child<container>".  The [1]
      entry appears to be a header that could be used some day via a command such
      as "virsh qemuobject --list" to format output.
      d76a8978
  2. 15 7月, 2013 5 次提交
    • M
      qemu: add macvlan delete to qemuDomainAttachNetDevice cleanup · 97f97a49
      Matthew Rosato 提交于
      If an error occurs during qemuDomainAttachNetDevice after the macvtap
      was created in qemuPhysIfaceConnect, the macvtap device gets left behind.
      This patch adds code to the cleanup routine to delete the macvtap.
      Signed-off-by: NMatthew Rosato <mjrosato@linux.vnet.ibm.com>
      Reviewed-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      97f97a49
    • L
      pci: make virPCIDeviceReset more autonomous · 9e37f57f
      Laine Stump 提交于
      I recently patches the callers to virPCIDeviceReset() to not call it
      if the current driver for a device was vfio-pci (since that driver
      will always reset the device itself when appropriate. At the time, Dan
      Berrange suggested that I could instead modify virPCIDeviceReset
      to check the currently bound driver for the device, and decide
      for itself whether or not to go ahead with the reset.
      
      This patch removes the previously added checks, and replaces them with
      a check down in virPCIDeviceReset(), as suggested.
      
      The functional difference here is that previously we were deciding
      based on either the hostdev configuration or the value of
      stubDriverName in the virPCIDevice object, but now we are actually
      comparing to the "driver" link in the device's sysfs entry
      directly. In practice, both should be the same.
      9e37f57f
    • L
      pci: reorder static functions · 333a2a72
      Laine Stump 提交于
      virPCIDeviceGetDriverPathAndName is a static function that will need
      to be called by another function that occurs above it in the
      file. This patch reorders the static functions so that a forward
      declaration isn't needed.
      333a2a72
    • M
      qemuBuildChrDeviceCommandLine: Don't leak devstr · 797b1ffc
      Michal Privoznik 提交于
      It's caller's responsibility to free return value of
      qemuBuildChrDeviceStr().
      797b1ffc
    • G
      python: return dictionary without value in case of no blockjob · 0f9e67bf
      Guannan Ren 提交于
      Currently, when there is no blockjob, dom.blockJobInfo('vda')
      still reports error because it doesn't distinguish return value 0 from -1.
      libvirt.libvirtError: virDomainGetBlockJobInfo() failed
      
      virDomainGetBlockJobInfo() API return value:
       -1 in case of failure, 0 when nothing found, 1 found.
      
      And use PyDict_SetItemString instead of PyDict_SetItem when key is
      of string type. PyDict_SetItemString increments key/value reference
      count, so call Py_DECREF() for value. For key, we don't need to
      do this, because PyDict_SetItemString will handle it internally.
      0f9e67bf
  3. 12 7月, 2013 12 次提交