1. 23 4月, 2010 1 次提交
    • D
      Fix CPU hotplug command names · a980d123
      Daniel P. Berrange 提交于
      Probably as a result of a merge error, the CPU hotplug command
      names were completely wrong.
      
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Fix
        the CPU hotplug command names
      a980d123
  2. 19 4月, 2010 1 次提交
  3. 16 4月, 2010 1 次提交
    • D
      Rename parameter in qemuMonitorDeviceDel · fde060b8
      Daniel P. Berrange 提交于
      The parameter for the qemuMonitorDeviceDel() is a device alias,
      not a device config string. Rename the parameter reflect this
      and avoid confusion to readers.
      
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Rename devicestr to devalias in qemuMonitorDeviceDel()
      fde060b8
  4. 09 4月, 2010 1 次提交
    • R
      qemu: catch cdrom change error · 4a2dd00e
      Ryan Harper 提交于
      Currently when we attempt to change the cdrom in a qemu VM the monitor
      doesn't generate an error if the target filename doesn't exist.  I've
      submitted a patch[1] for this.  This patch is the libvirt qemu-driver
      side which catches the error message from the monitor and reportes the
      error to libvirt.  This means that virsh attach-disk cdrom commands
      won't appear to succeed when qemu change command actually failed.
      
      * src/qemu/qemu_monitor_text.c: in qemuMonitorTextChangeMedia() look
        for failure to access the new data
      4a2dd00e
  5. 05 4月, 2010 1 次提交
  6. 31 3月, 2010 1 次提交
    • E
      maint: remove redundant tests after virStrToLong · 9d6614df
      Eric Blake 提交于
      virStrToLong* guarantees (via strtol) that the end pointer will be set
      to the point at which parsing stopped (even on failure, this point is
      the start of the input string).
      
      * src/esx/esx_driver.c (esxGetVersion): Remove pointless
      conditional.
      * src/qemu/qemu_conf.c (qemuParseCommandLinePCI)
      (qemuParseCommandLineUSB, qemuParseCommandLineSmp): Likewise.
      * src/qemu/qemu_monitor_text.c
      (qemuMonitorTextGetMigrationStatus): Likewise.
      9d6614df
  7. 20 3月, 2010 1 次提交
  8. 15 3月, 2010 1 次提交
  9. 06 3月, 2010 1 次提交
    • J
      qemuMonitorTextGetMemoryStats: decrease risk of false positive in parsing · 4697def6
      Jim Meyering 提交于
      The code erroneously searched the entire "reply" for a comma, when
      its intent was to search only that portion after "balloon: actual="
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetMemoryStats):
      Search for "," only starting *after* the BALLOON_PREFIX string.
      Otherwise, we'd be more prone to false positives.
      4697def6
  10. 04 3月, 2010 1 次提交
    • D
      Support VCPU hotplug in QEMU guests · e8d6c289
      Daniel P. Berrange 提交于
      QEMU has a monitor command 'set_cpu' which allows a specific
      CPU to be toggled between online& offline state. libvirt CPU
      hotplug does not work in terms of individual indexes CPUs.
      Thus to support this, we iteratively toggle the online state
      when the total number of vCPUs is adjusted via libvirt
      
      NB, currently untested since QEMU segvs when running this!
      
      * src/qemu/qemu_driver.c: Toggle online state for CPUs when
        doing hotplug
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        monitor API for toggling a CPU's online status via 'set_cpu
      e8d6c289
  11. 03 3月, 2010 2 次提交
    • D
      Fix detection of errors in QEMU device_add command · 44f68729
      Daniel P. Berrange 提交于
      The code assumed that 'device_add' returned an empty string upon
      success. This is not true, it sometimes prints random debug info.
      THus we need to check for an explicit fail string
      
      * src/qemu/qemu_monitor_text.c: Fix error checking of the device_add
        monitor command
      44f68729
    • D
      Add QEMU driver support for job info on migration ops · 0d3eee7f
      Daniel P. Berrange 提交于
      Introduce support for  virDomainGetJobInfo in the QEMU driver. This
      allows for monitoring of any API that uses the 'info migrate' monitor
      command. ie virDomainMigrate, virDomainSave and virDomainCoreDump
      
      Unfortunately QEMU does not provide a way to monitor incoming migration
      so we can't wire up virDomainRestore yet.
      
      The virsh tool gets a new command 'domjobinfo' to query status
      
      * src/qemu/qemu_driver.c: Record virDomainJobInfo and start time
        in qemuDomainObjPrivatePtr objects. Add generic shared handler
        for calling 'info migrate' with all migration based APIs.
      * src/qemu/qemu_monitor_text.c: Fix parsing of 'info migration' reply
      * tools/virsh.c: add new 'domjobinfo' command to query progress
      0d3eee7f
  12. 02 3月, 2010 1 次提交
    • W
      Use device_del to remove SCSI controllers · 8540dadb
      Wolfgang Mauerer 提交于
      when the underlying qemu supports the drive/device model and the
      controller has been added this way.
      * src/qemu/qemu_driver.c: use qemuMonitorDelDevice() when detaching
        PCI controller and if supported
      * src/qemu/qemu_monitor.[ch]: add new qemuMonitorDelDevice() function
      * src/qemu/qemu_monitor_json.[ch]: JSON backend for DelDevice command
      * src/qemu/qemu_monitor_text.[ch]: Text backend for DelDevice command
      8540dadb
  13. 01 3月, 2010 1 次提交
  14. 17 2月, 2010 2 次提交
  15. 13 2月, 2010 1 次提交
    • D
      Support 'block_passwd' command for QEMU disk encryption · c31a116b
      Daniel P. Berrange 提交于
      The old text mode monitor prompts for a password when disks are
      encrypted. This interactive approach doesn't work for JSON mode
      monitor. Thus there is a new 'block_passwd' command that can be
      used.
      
      * src/qemu/qemu_driver.c: Split out code for looking up a disk
        secret from findVolumeQcowPassphrase, into a new method
        getVolumeQcowPassphrase. Enhance qemuInitPasswords() to also
        set the disk encryption password via the monitor
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        support for the 'block_passwd' monitor command.
      c31a116b
  16. 11 2月, 2010 1 次提交
    • D
      Fix disk stats retrieval with QEMU >= 0.12 · 73579750
      Daniel P. Berrange 提交于
      With QEMU >= 0.12 the host and guest side of disks no longer have
      the same naming convention. Specifically the host side will now
      get a 'drive-' prefix added to its name. The 'info blockstats'
      monitor command returns the host side name, so it is neccessary
      to strip this off when looking up stats since libvirt stores the
      guest side name !
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Move 'drive-' prefix
        string to a defined constant
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Strip
        off 'drive-' prefix (if found) when looking up disk stats
      73579750
  17. 10 2月, 2010 1 次提交
  18. 09 2月, 2010 2 次提交
  19. 03 2月, 2010 2 次提交
  20. 02 2月, 2010 1 次提交
    • J
      avoid format-related warnings · 4cd188d4
      Jim Meyering 提交于
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextGetAllPCIAddresses):
      Use %s.
      * src/storage/storage_backend_iscsi.c (virStorageBackendCreateIfaceIQN):
      Likewise.
      * tools/virsh.c (cmdSecretSetValue): Likewise.
      4cd188d4
  21. 26 1月, 2010 2 次提交
    • J
      qemuMonitorTextAttachDrive: avoid two leaks · 1af75828
      Jim Meyering 提交于
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextAttachDrive): Most other
      failures in this function would "goto cleanup", but one mistakenly
      returned directly, skipping the cleanup and resulting in a leak.
      In addition, iterating the "try_command" loop would clobber, and
      thus leak, the "cmd" allocated on the first iteration,
      so be careful to free it in addition to "reply" beforehand.
      1af75828
    • J
      qemuMonitorTextGetMemoryStats: plug a leak on an error path · 9827e0a4
      Jim Meyering 提交于
      * src/qemu/qemu_monitor_text.c (qemuMonitorCommandWithHandler):
      Always free *reply, upon failure.
      9827e0a4
  22. 21 1月, 2010 1 次提交
    • A
      domMemoryStats / qemu: Fix parsing of unknown stats · 80b4d20d
      Adam Litke 提交于
      Fix a small problem with the qemu memory stats parsing algorithm.  If qemu
      reports a stat that libvirt does not recognize, skip past it so parsing can
      continue.  This corrects a potential infinite loop in the parsing code that can
      only be triggered if new statistics are added to qemu.
      
      * src/qemu/qemu_monitor_text.c: qemuMonitorParseExtraBalloonInfo add a
        skip for extra ','
      80b4d20d
  23. 20 1月, 2010 1 次提交
  24. 18 1月, 2010 4 次提交
    • D
      Avoid free'ing a constant string in chardev lookup code · 2224989c
      Daniel P. Berrange 提交于
       * src/qemu/qemu_monitor_text.c: Don't free const string in
         qemuMonitorTextGetPtyPaths()
      2224989c
    • D
      Detect PCI addresses at QEMU startup · 989051a8
      Daniel P. Berrange 提交于
      Hotunplug of devices requires that we know their PCI address. Even
      hotplug of SCSI drives, required that we know the PCI address of
      the SCSI controller to attach the drive to. We can find this out
      by running 'info pci' and then correlating the vendor/product IDs
      with the devices we booted with.
      
      Although this approach is somewhat fragile, it is the only viable
      option with QEMU < 0.12, since there is no way for libvirto set
      explicit PCI addresses when creating devices in the first place.
      For QEMU > 0.12, this code will not be used.
      
      * src/qemu/qemu_driver.c: Assign all dynamic PCI addresses on
        startup of QEMU VM, matching vendor/product IDs
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        API for fetching PCI device address mapping
      989051a8
    • D
      Properly support SCSI drive hotplug · 3a6bf1bb
      Daniel P. Berrange 提交于
      The current SCSI hotplug support attaches a brand new SCSI controller
      for every disk. This is broken because the semantics differ from those
      used when starting the VM initially. In the latter case, each SCSI
      controller is filled before a new one is added.
      
      If the user specifies an high drive index (sdazz) then at initial
      startup, many intermediate SCSI controllers may be added with no
      drives.
      
      This patch changes SCSI hotplug so that it exactly matches the
      behaviour of initial startup. First the SCSI controller number is
      determined for the drive to be hotplugged. If any controller upto
      and including that controller number is not yet present, it is
      attached. Then finally the drive is attached to the last controller.
      
      NB, this breaks SCSI hotunplug, because there is no 'drive_del'
      command in current QEMU. Previous SCSI hotunplug was broken in
      any case because it was unplugging the entire controller, not
      just the drive in question.
      
      A future QEMU will allow proper SCSI hotunplug of a drive.
      
      This patch is derived from work done by Wolfgang Mauerer on disk
      controllers.
      
      * src/qemu/qemu_driver.c: Fix SCSI hotplug to add a drive to
       the correct controller, instead of just attaching a new
        controller.
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        support for 'drive_add' command
      3a6bf1bb
    • W
      Implement SCSI controller hotplug/unplug for QEMU · da9d937b
      Wolfgang Mauerer 提交于
      This patch allows for explicit hotplug/unplug of SCSI controllers.
      Ordinarily this is not required, since QEMU/libvirt will attach
      a new SCSI controller whenever one is required. Allowing explicit
      hotplug of controllers though, enables the caller to specify a
      static PCI address, instead of auto-assigning the next available
      PCI slot. Or it will when we have static PCI addressing.
      
      This patch is derived from Wolfgang Mauerer's disk controller
      patch series.
      
      * src/qemu/qemu_driver.c: Support hotplug & unplug of SCSI
        controllers
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h,
        src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h: Add
        new API for attaching PCI SCSI controllers
      da9d937b
  25. 16 1月, 2010 1 次提交
    • D
      Convert monitor over to use virDomainDeviceAddress · ab0da52b
      Daniel P. Berrange 提交于
      Convert the QEMU monitor APIs over to use virDomainDeviceAddress
      structs for passing addresses in/out, instead of individual bits.
      This makes the number of parameters smaller & easier to deal with.
      No functional change
      
      * src/qemu/qemu_driver.c, src/qemu/qemu_monitor.c,
        src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_text.c,
        src/qemu/qemu_monitor_text.h: Change monitor hotplug APIs to
        take an explicit address ptr for all host/guest addresses
      ab0da52b
  26. 07 1月, 2010 1 次提交
    • M
      Fix parsing of 'info chardev' line endings · c0a9b6a5
      Matthew Booth 提交于
      This change makes the 'info chardev' parser ignore any trailing
      whitespace on a line. This fixes a specific problem handling a '\r\n'
      line ending.
      
      * src/qemu/qemu_monitor_text.c: Ignore trailing whitespace in
        'info chardev' output.
      c0a9b6a5
  27. 20 12月, 2009 1 次提交
    • A
      Implements domainMemStats in the qemu driver · c7523b41
      Adam Litke 提交于
      Support for memory statistics reporting is accepted for qemu inclusion.
      Statistics are reported via the monitor command 'info balloon' as a comma
      seprated list:
      
      (qemu) info balloon
      balloon: actual=1024,mem_swapped_in=0,mem_swapped_out=0,major_page_faults=88,minor_page_faults=105535,free_mem=1017065472,total_mem=1045229568
      
      Libvirt, qemu, and the guest operating system may support a subset of the
      statistics defined by the virtio spec.  Thus, only statistics recognized by
      components will be reported.
      
      * src/qemu/qemu_driver.c src/qemu/qemu_monitor_text.[ch]: implement the
        new entry point by using info balloon monitor command
      c7523b41
  28. 14 12月, 2009 2 次提交
    • D
      Fix a couple of problems in last patch · a7d1eb3c
      Daniel Veillard 提交于
      Those were pointed by DanB in his review but not yet fixed
      
      * src/qemu/qemu_driver.c: qemudWaitForMonitor() use EnterMonitorWithDriver()
        and ExitMonitorWithDriver() there
      * src/qemu/qemu_monitor_text.c: checking fro strdu failure and hash
        table add error in qemuMonitorTextGetPtyPaths()
      a7d1eb3c
    • M
      Get QEMU pty paths from the monitor · 60e8977f
      Matthew Booth 提交于
      This change makes the QEMU driver get pty paths from the output of the
      monitor 'info chardev' command. This output is structured, and contains
      both the name of the device and the path on the same line. This is
      considerably more reliable than parsing the startup log output, which
      requires the parsing code to know which order QEMU will print pty
      information in.
      
      Note that we still need to parse the log output as the monitor itself
      may be on a pty. This should be rare, however, and the new code will
      replace all pty paths parsed by the log output method once the monitor
      is available.
      
      * src/qemu/qemu_monitor.(c|h) src/qemu_monitor_text.(c|h): Implement
        qemuMonitorGetPtyPaths().
      * src/qemu/qemu_driver.c: Get pty path information using
        qemuMonitorGetPtyPaths().
      60e8977f
  29. 09 12月, 2009 1 次提交
    • D
      Make QEMU text monitor parsing more robust · cce1998a
      Daniel P. Berrange 提交于
      The QEMU 0.10.0 release (and possibly other 0.10.x) has a bug where
      it sometimes/often forgets to display the initial monitor greeting
      line, soley printing a (qemu).  This in turn confuses the text
      console parsing because it has a '(qemu)' it is not expecting. The
      confusion results in a negative malloc. Bad things follow.
      
      This re-writes the text console handling to be more robust. The key
      idea is that it should only look for a (qemu), once it has seen the
      original command echo'd back. This ensures it'll skip the bogus stray
      (qemu) with broken QEMUs.
      
      * src/qemu/qemu_monitor.c: Add some (disabled) debug code
      * src/qemu/qemu_monitor_text.c: Re-write way command replies
        are detected
      cce1998a
  30. 08 12月, 2009 2 次提交
    • D
      Add a 'format' arg to qemuMonitorChangeMedia() since JSON will support it · 8c12b20c
      Daniel P. Berrange 提交于
      The current QEMU disk media change does not support setting the
      disk format. The new JSON monitor will support this, so add an
      extra parameter to pass this info in
      
      * src/qemu/qemu_driver.c: Pass in disk format when changing media
      * src/qemu/qemu_monitor.h, src/qemu/qemu_monitor.c,
        src/qemu/qemu_monitor_text.c, src/qemu/qemu_monitor_text.h:
        Add a 'format' arg to qemuMonitorChangeMedia()
      8c12b20c
    • D
      Fix migration cancellation for QEMU · 3fa3cff7
      Daniel P. Berrange 提交于
      * src/qemu/qemu_monitor_text.c: Add missing underscore in the
        migrate_cancel monitor command impl
      3fa3cff7