1. 27 4月, 2010 3 次提交
    • C
      Fix up the locking in the snapshot code. · b69bbebb
      Chris Lalancette 提交于
      In particular I was forgetting to take the qemuMonitorPrivatePtr
      lock (via qemuDomainObjBeginJob), which would cause problems
      if two users tried to access the same domain at the same time.
      This patch also fixes a problem where I was forgetting to remove
      a transient domain from the list of domains.
      
      Thanks to Stephen Shaw for pointing out the problem and testing
      out the initial patch.
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      b69bbebb
    • J
      Ignore qemu STOP event when stopping CPUs · 35b61376
      Jiri Denemark 提交于
      With JSON qemu monitor, we get a STOP event from qemu whenever qemu
      stops guests CPUs. The downside of it is that vm->state is changed to
      PAUSED and a new generic paused event is send to applications. However,
      when we ask qemu to stop the CPUs we are not really interested in qemu
      event and we usually want to issue a more specific event.
      
      By setting vm->status to PAUSED before actually sending the request to
      qemu (and resetting it back if the request fails) we can ignore the
      event since the event handler does nothing when the guest is already
      paused. This solution is quite hacky but unfortunately it's the best
      solution which I was able to come up with and it doesn't introduce a
      race condition.
      35b61376
    • J
      Fix build with DEBUG_RAW_IO=1 · 29bca037
      Jiri Denemark 提交于
      29bca037
  2. 24 4月, 2010 3 次提交
  3. 23 4月, 2010 5 次提交
    • S
      qemu: fix security context references in DAC code · c85c9b3a
      Spencer Shimko 提交于
      * The error messages coming from qemu's DAC support contain strings
        from the original SELinux security driver code.  This just removes
        references to "security context" and other SELinux-isms from the DAC
        code.
      Signed-off-by: NSpencer Shimko <sshimko@tresys.com>
      Signed-off-by: NEric Blake <eblake@redhat.com>
      c85c9b3a
    • J
      Fix locking in qemudDomainCoreDump · 96ac1859
      Jiri Denemark 提交于
      The hang fix in d376b7d6 was incomplete
      since it left quite a few {Enter,Exit}Monitor calls which require driver
      to be unlocked. Since the driver is locked throughout the whole
      function, {Enter,Exit}MonitorWithDriver need to be used instead to
      ensure driver is not locked when issuing monitor commands.
      96ac1859
    • J
      Poll for migration end every 50ms instead of 50us · e2c05948
      Jiri Denemark 提交于
      The comment in qemuDomainWaitForMigrationComplete says we are polling
      every 50ms but the code sleeps only for 50us. This was already discussed
      during review but apparently forgotten when the series was pushed.
      e2c05948
    • D
      Fix QEMU text monitor command error checking · 9772beba
      Daniel P. Berrange 提交于
      The text monitor code was checking for a '\n' prefix on several
      places. Previously this would work, but since the monitor code
      re-write the '\n' is already stripped off, so mustn't be checked
      for.
      
      * src/qemu/qemu_monitor_text.c: Fix monitor error checking
      9772beba
    • 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
  4. 22 4月, 2010 5 次提交
    • J
      Use configured CPU model if possible · b9a2552d
      Jiri Denemark 提交于
      Adds ability to provide a preferred CPU model for CPUID data decoding.
      Such model would be considered as the best possible model (if it's
      supported by hypervisor) regardless on number of features which have to
      be added or removed for describing required CPU.
      b9a2552d
    • J
      Support removing features when converting data to CPU · 53c4f9fa
      Jiri Denemark 提交于
      So far, when CPUID data were converted into CPU model and features, the
      features can only be added to the model. As a result, when a guest asked
      for something like "qemu64,-svm" it would get a qemu32 plus a bunch of
      additional features instead.
      
      This patch adds support for removing feature from the base model.
      Selection algorithm remains the same: the best CPU model is the model
      which requires lowest number of features to be added/removed from it.
      53c4f9fa
    • J
      Deal with CPU models in [] · e07314f4
      Jiri Denemark 提交于
      Qemu committed a patch which list some CPU names in [] when asked for
      supported CPUs (qemu -cpu ?). Yet, it needs such CPUs to be passed
      without those square braces. When probing for supported CPU models, we
      can just strip the square braces and pretend we have never seen them.
      e07314f4
    • J
      Fix initial VCPU pinning in qemu driver · 9fbb810c
      Jiri Denemark 提交于
      First, inital VCPU pinning is set correctly but then it is reset by
      assigning qemu process to a new cgroup (which contains all CPUs). It's
      easily fixed by swapping these two actions.
      9fbb810c
    • G
  5. 19 4月, 2010 3 次提交
    • D
      Fix network hotplug to use device_add in QEMU · f3e098f3
      Daniel P. Berrange 提交于
      The initial boot of VMs uses -device for NICs where available. The
      corresponding monitor command is device_add, but the network hotplug
      code was still using device_del by mistake.
      
      * src/qemu/qemu_driver.c: Use device_add for NIC hotplug where
        available
      f3e098f3
    • D
      Fix error reporting for getfd + host_net_add in QEMU · 9417eb03
      Daniel P. Berrange 提交于
      If either of the getfd or host_net_add monitor commands return
      any text, this indicates an error condition. Don't ignore this!
      
      * src/qemu/qemu_monitor_text.c: Report errors for getfd and
        host_net_add
      9417eb03
    • D
      Fix device_del in JSON mode for QEMU · e699a824
      Daniel P. Berrange 提交于
      The 'device_del' command expects a parameter called 'id' but we
      were passing 'config'.
      
      * src/qemu/qemu_monitor_json.c: Fix device_del command parameter
      e699a824
  6. 16 4月, 2010 7 次提交
    • J
      Use virCheckFlags for APIs added in 0.8.0 · 7a2c6222
      Jiri Denemark 提交于
      7a2c6222
    • D
      Fix CDROM media change for QEMU when using -device syntax · c4896d37
      Daniel P. Berrange 提交于
      Disk devices in QEMU have two parts, the guest device and the host
      backend driver. Historically these two parts have had the same
      "unique" name. With the switch to using -device though, they now
      have separate names. Thus when changing CDROM media, for guests
      using -device syntax, we need to prepend the QEMU_DRIVE_HOST_PREFIX
      constant
      
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Add helper function
        qemuDeviceDriveHostAlias() for building a host backend alias
      * src/qemu/qemu_driver.c: Use qemuDeviceDriveHostAlias() to determine
        the host backend alias for performing eject/change commands in the
        monitor
      c4896d37
    • D
      Update QEMU device_add command in JSON mode · db336caa
      Daniel P. Berrange 提交于
      The device_add command was added in JSON mode in a way I didn't
      expect. Instead of passing the normal device string to the JSON
      command:
      
          { "execute": "device_add", "arguments": { "device": "ne2k_pci,id=nic.1,netdev=net.1" } }
      
      We need to split up the device string into a full JSON object
      
          { "execute": "device_add", "arguments": { "driver": "ne2k_pci", "id": "nic.1", "netdev": "net.1" } }
      
      * src/qemu/qemu_conf.h, src/qemu/qemu_conf.c: Rename the
        qemuCommandLineParseKeywords method to qemuParseKeywords
        and export it to monitor
      * src/qemu/qemu_monitor_json.c: Split up device string into
        a JSON object for device_add command
      db336caa
    • 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
    • D
      Remove code from JSON monitor for commands that won't be ported · efd4ee78
      Daniel P. Berrange 提交于
      The QEMU developers have stated that they will not be porting
      the commands 'pci_add', 'pci_del', 'usb_add', 'usb_del' to the
      JSON mode monitor, since they're obsoleted by 'device_add'
      and 'device_del'. libvirt has (untested) code that would have
      supported those commands in theory, but since we already use
      device_add/del where available, there's no need to keep the
      legacy stuff anymore.
      
      The text mode monitor keeps support for all commands for sake
      of historical compatability.
      
      * src/qemu/qemu_monitor_json.c: Remove 'pci_add', 'pci_del',
        'usb_add', 'usb_del' commands
      efd4ee78
    • D
      Fix QEMU memory stats JSON mode · 4f81919a
      Daniel P. Berrange 提交于
      The QEMU driver is mistakenly calling directly into the text
      mode monitor for the domain memory stats query.
      
      * src/qemu/qemu_driver.c: Replace qemuMonitorTextGetMemoryStats with
        qemuMonitorGetMemoryStats
      * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h: Add the new
        wrapper for qemuMonitorGetMemoryStats
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Add
        qemuMonitorJSONGetMemoryStats implementation
      4f81919a
    • D
      Fix QEMU command building errors to reflect unsupported configuration · 3fb992c6
      Daniel P. Berrange 提交于
      Instead of reporting VIR_ERR_INTERNAL_ERROR use the more specific
      VIR_ERR_CONFIG_UNSUPPORTED
      
      * src/qemu/qemu_conf.c: Report VIR_ERR_CONFIG_UNSUPPORTED for
        unsupported video adapters
      3fb992c6
  7. 15 4月, 2010 2 次提交
    • S
      nwfilter: fix tear down order and consolidate functions · 41b08719
      Stefan Berger 提交于
      To avoid race-conditions, the tear down of a filter has to happen before
      the tap interface disappears and another tap interface with the same
      name can re-appear. This patch tries to fix this. In one place, where
      communication with the qemu monitor may fail, I am only tearing the
      filters down after knowing that the function did not fail.
      
      I am also moving the tear down functions into an include file for other
      drivers to reuse.
      41b08719
    • J
      qemudDomainAttachSCSIDisk: avoid FP NULL-ptr-deref from clang · a0dc4521
      Jim Meyering 提交于
      * src/qemu/qemu_driver.c (qemudDomainAttachSCSIDisk):
      Initialize "cont" to NULL, so clang knows it's set.
      Add an sa_assert so it knows it's non-NULL when dereferenced.
      a0dc4521
  8. 09 4月, 2010 3 次提交
    • D
      Add enospace option to qemu disk error policy · cddd3ac8
      David Allan 提交于
      * Dan Kenigsberg requested explicit support for the qemu default disk error policy which is enospace
      cddd3ac8
    • D
      More event callback fixes · 631c4ce8
      Daniel P. Berrange 提交于
      In a couple of cases typos meant we were firing the wrong type
      of event. In the python code my previous commit accidentally
      missed some chunks of the code.
      
      * python/libvirt-override-virConnect.py: Add missing python glue
        accidentally left out of previous commit
      * src/conf/domain_event.c, src/qemu/qemu_monitor_json.c: Fix typos
        in event name / method name to invoke
      631c4ce8
    • 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
  9. 08 4月, 2010 4 次提交
  10. 07 4月, 2010 2 次提交
  11. 06 4月, 2010 3 次提交