1. 17 12月, 2010 3 次提交
    • D
      Move QEMU private data & namespace code into separate file · df4aabaf
      Daniel P. Berrange 提交于
      Move the code for handling the QEMU virDomainObjPtr private
      data, and custom XML namespace into a separate file
      
      * src/qemu/qemu_domain.c, src/qemu/qemu_domain.h: New file
        for private data & namespace code
      * src/qemu/qemu_driver.c, src/qemu/qemu_driver.h: Remove
        private data & namespace code
      * src/qemu/qemu_driver.h, src/qemu/qemu_command.h: Update
        includes
      * src/Makefile.am: Add src/qemu/qemu_domain.c
      df4aabaf
    • D
      Move QEMU command line management into a separate file · 0f2e4b9c
      Daniel P. Berrange 提交于
      The qemu_conf.c code is doing three jobs, driver config file
      loading, QEMU capabilities management and QEMU command line
      management. Move the command line code into its own file
      
      * src/qemu/qemu_command.c, src/qemu/qemu_command.h: New
        command line management code
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Delete command
        line code
      * src/qemu/qemu_conf.h, src/qemu_conf.c: Adapt for API renames
      * src/Makefile.am: add src/qemu/qemu_command.c
      * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_text.c: Add
        import of qemu_command.h
      0f2e4b9c
    • D
      Move QEMU capabilities management into a separate file · d8ae147d
      Daniel P. Berrange 提交于
      The qemu_conf.c code is doing three jobs, driver config file
      loading, QEMU capabilities management and QEMU command line
      management. Move the capabilities code into its own file
      
      * src/qemu/qemu_capabilities.c, src/qemu/qemu_capabilities.h: New
        capabilities management code
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Delete capabilities
        code
      * src/qemu/qemu_conf.h: Adapt for API renames
      * src/Makefile.am: add src/qemu/qemu_capabilities.c
      d8ae147d
  2. 14 12月, 2010 4 次提交
    • H
      Add a new function doStartCPUs · 226f4054
      Hu Tao 提交于
      226f4054
    • H
      Add a new function doStopCPUs · fa139130
      Hu Tao 提交于
      fa139130
    • H
      54c68333
    • O
      qemu: Introduce two new job types · 5faf88fe
      Osier Yang 提交于
      Currently, all of domain "save/dump/managed save/migration"
      use the same function "qemudDomainWaitForMigrationComplete"
      to wait the job finished, but the error messages are all
      about "migration", e.g. when a domain saving job is canceled
      by user, "migration was cancled by client" will be throwed as
      an error message, which will be confused for user.
      
      As a solution, intoduce two new job types(QEMU_JOB_SAVE,
      QEMU_JOB_DUMP), and set "priv->jobActive" to "QEMU_JOB_SAVE"
      before saving, to "QEMU_JOB_DUMP" before dumping, so that we
      could get the real job type in
      "qemudDomainWaitForMigrationComplete", and give more clear
      message further.
      
      And as It's not important to figure out what's the exact job
      is in the DEBUG and WARN log, also we don't need translated
      string in logs, simply repace "migration" with "job" in some
      statements.
      
      * src/qemu/qemu_driver.c
      5faf88fe
  3. 11 12月, 2010 1 次提交
    • E
      command: ease use with virBuffer, and fix qemu leak · e8d05c97
      Eric Blake 提交于
      * src/util/command.h (virCommandAddArgBuffer)
      (virCommandAddEnvBuffer): New prototypes.
      * src/util/command.c (virCommandAddArgBuffer)
      (virCommandAddEnvBuffer): Implement them.
      * src/libvirt_private.syms (command.h): Export them.
      * src/qemu/qemu_conf.c (qemudBuildCommandLine): Use them, plugging
      a memory leak on rbd_hosts in the process.
      e8d05c97
  4. 10 12月, 2010 4 次提交
    • J
      qemu: Add RBD support and some network disk fixes · 85400fb9
      Josh Durgin 提交于
      Changes common to all network disks:
      -Make source name optional in the domain schema, since NBD doesn't use it
      -Add a hostName type to the domain schema, and use it instead of genericName, which doesn't include .
      -Don't leak host names or ports
      -Set the source protocol in qemuParseCommandline
      Signed-off-by: NJosh Durgin <joshd@hq.newdream.net>
      85400fb9
    • M
      add network disk support · 036ad505
      MORITA Kazutaka 提交于
      This patch adds network disk support to libvirt/QEMU.  The currently
      supported protocols are nbd, rbd, and sheepdog.  The XML syntax is like
      this:
      
          <disk type="network" device="disk">
            <driver name="qemu" type="raw" />
            <source protocol='rbd|sheepdog|nbd' name="...some image identifier...">
              <host name="mon1.example.org" port="6000">
              <host name="mon2.example.org" port="6000">
              <host name="mon3.example.org" port="6000">
            </source>
            <target dev="vda" bus="virtio" />
          </disk>
      Signed-off-by: NMORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
      036ad505
    • H
      Add a watchdog action `dump' · e19cdbfc
      Hu Tao 提交于
      `dump' watchdog action lets libvirtd to dump the guest when receives a
      watchdog event (which probably means a guest crash)
      
      Currently only qemu is supported.
      e19cdbfc
    • H
      Add a new function doCoreDump · b4560bf2
      Hu Tao 提交于
      This patch prepares for the next patch.
      b4560bf2
  5. 09 12月, 2010 3 次提交
    • J
      qemu: Distinguish between domain shutdown and crash · c778fe96
      Jiri Denemark 提交于
      When we get an EOF event on monitor connection, it may be a result of
      either crash or graceful shutdown. QEMU which supports async events
      (i.e., we are talking to it using JSON monitor) emits SHUTDOWN event on
      graceful shutdown. In case we don't get this event by the time monitor
      connection is closed, we assume the associated domain crashed.
      c778fe96
    • R
      qemu: call drive_del in DetachPciDiskDevice · aefaeb3d
      Ryan Harper 提交于
      Currently libvirt doesn't confirm whether the guest has responded to the
      disk removal request.  In some cases this can leave the guest with
      continued access to the device while the mgmt layer believes that it has
      been removed.  With a recent qemu monitor command[1] we can
      deterministically revoke a guests access to the disk (on the QEMU side)
      to ensure no futher access is permitted.
      
      This patch adds support for the drive_del() command and introduces it
      in the disk removal paths.  If the guest is running in a QEMU without this
      command we currently explicitly check for unknown command/CommandNotFound
      and log the issue.
      
      If QEMU supports the command we issue the drive_del command after we attempt
      to remove the device.  The guest may respond and remove the block device
      before we get to attempt to call drive_del.  In that case, we explicitly check
      for 'Device not found' from the monitor indicating that the target drive
      was auto-deleted upon guest responds to the device removal notification.
      
      1. http://thread.gmane.org/gmane.comp.emulators.qemu/84745Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      aefaeb3d
    • R
      qemu: call drive_unplug in DetachPciDiskDevice · 0cdc9829
      Ryan Harper 提交于
      Currently libvirt doesn't confirm whether the guest has responded to the
      disk removal request.  In some cases this can leave the guest with
      continued access to the device while the mgmt layer believes that it has
      been removed.  With a recent qemu monitor command[1] we can
      deterministically revoke a guests access to the disk (on the QEMU side)
      to ensure no futher access is permitted.
      
      This patch adds support for the drive_unplug() command and introduces it
      in the disk removal paths.  There is some discussion to be had about how
      to handle the case where the guest is running in a QEMU without this
      command (and the fact that we currently don't have a way of detecting
      what monitor commands are available).
      
      Changes since v2:
       - use VIR_ERROR to report when unplug command not found
      Changes since v1:
       - return > 0 when command isn't present, < 0 on command failure
       - detect when drive_unplug command isn't present and log error
         instead of failing entire command
      Signed-off-by: NRyan Harper <ryanh@us.ibm.com>
      0cdc9829
  6. 08 12月, 2010 3 次提交
  7. 07 12月, 2010 4 次提交
    • E
      uuid: require smbios uuid and domain uuid to match · 4117672e
      Eric Blake 提交于
      * src/conf/domain_conf.c (virDomainDefParseXML): Prefer sysinfo
      uuid over generating one, and if both uuids are present, require
      them to be identical.
      * src/qemu/qemu_conf.c (qemuBuildSmbiosSystemStr): Allow skipping
      the uuid.
      (qemudBuildCommandLine): Adjust caller; <smbios mode=host/> must
      not use host uuid in place of guest uuid.
      4117672e
    • E
      smbios: support system family · 8cad5603
      Eric Blake 提交于
      * docs/schemas/domain.rng (sysinfo-system-name): Also allow
      family.
      * src/util/sysinfo.h (struct _virSysinfoDef): Add system_family.
      * src/conf/domain_conf.c (virSysinfoParseXML)
      (virDomainSysinfoDefFormat): Support it.
      * src/util/sysinfo.c (virSysinfoDefFree, virSysinfoRead): Likewise.
      * src/qemu/qemu_conf.c (qemuBuildSmbiosSystemStr): Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-smbios.xml: Adjust test.
      * tests/qemuxml2argvdata/qemuxml2argv-smbios.args: Likewise.
      8cad5603
    • E
      qemu: avoid adding "" in smbios arguments · 575914cf
      Eric Blake 提交于
      The log lists things like -smbios type=1,vendor="Red Hat", which
      is great for shell parsing, but not so great when you realize that
      execve() then passes those literal "" on as part of the command
      line argument, such that qemu sets SMBIOS with extra literal quotes.
      
      The eventual addition of virCommand is needed before we have the API
      to shell-quote a string representation of a command line, so that the
      log can still be pasted into a shell, but without inserting extra
      bytes into the execve() arguments.
      
      * src/qemu/qemu_conf.c (qemuBuildSmbiosBiosStr)
      (qemuBuildSmbiosSystemStr): Qemu doesn't like quotes around uuid
      arguments, and the remaining quotes are passed literally to
      smbios, making <smbios mode='host'/> inaccurate.  Removing the
      quotes makes the log harder to parse, but that can be fixed later
      with virCommand improvements.
      * tests/qemuxml2argvdata/qemuxml2argv-smbios.args: 'Fix' test; it
      will need fixing again once virCommand learns how to shell-quote a
      potential command line.
      575914cf
    • D
      Fix funny off-by-one error in clock-variable · e37ff200
      Dan Kenigsberg 提交于
      Humans consider January as month #1, while gmtime_r(3) calls it month #0.
      
      While fixing it, render qemu's rtc parameter with leading zeros, as is more
      commonplace.
      
      Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=660194
      e37ff200
  8. 06 12月, 2010 1 次提交
    • J
      qemu: Fix a possible deadlock in p2p migration · 584c13f3
      Jiri Denemark 提交于
      Two more calls to remote libvirtd have to be surrounded by
      qemuDomainObjEnterRemoteWithDriver() and
      qemuDomainObjExitRemoteWithDriver() to prevent possible deadlock between
      two communicating libvirt daemons.
      
      See commit f0c8e1cb for further details.
      584c13f3
  9. 05 12月, 2010 1 次提交
  10. 03 12月, 2010 1 次提交
    • E
      qemu: convert to virCommand · 6a7e7c4f
      Eric Blake 提交于
      * src/qemu/qemu_conf.c (qemudExtractVersionInfo): Check for file
      before executing it here, rather than in callers.
      (qemudBuildCommandLine): Rewrite with virCommand.
      * src/qemu/qemu_conf.h (qemudBuildCommandLine): Update signature.
      * src/qemu/qemu_driver.c (qemuAssignPCIAddresses)
      (qemudStartVMDaemon, qemuDomainXMLToNative): Adjust callers.
      6a7e7c4f
  11. 02 12月, 2010 4 次提交
    • O
      qemu: Use macro for max and min vnc port instead of number · 401979a4
      Osier Yang 提交于
      * src/qemu/qemu_driver.c (though MACROS QEMU_VNC_PORT_MAX, and
      QEMU_VNC_PORT_MIN are defined at the beginning, numbers (65535, 5900)
      are still used, replace them)
      401979a4
    • O
      qemu: Fix typo in qemuTeardownDiskPathDeny · ead3c434
      Osier Yang 提交于
      typo in error message, it should be by copy-a-paste
      from "qemuSetupDiskPathAllow".
      
      * src/qemu/qemu_driver.c (qemuTeardownDiskPathDeny)
      ead3c434
    • E
      qemu: plug memory leak · 428ea3a6
      Eric Blake 提交于
      * src/qemu/qemu_driver.c (qemudShutdown): Free all strings and the
      ebtables structure.
      * src/libvirt_private.syms (ebtablesContextFree): Export missing
      symbol.
      * src/util/ebtables.c (ebtablesContextFree): Allow early exit.
      428ea3a6
    • M
      Fix undefined symbol errors when macvtap support is disabled · 474b1c14
      Matthias Bolte 提交于
      Use macvtap specific functions depending on WITH_MACVTAP.
      
      Use #if instead of #ifdef to check for WITH_MACVTAP, because
      WITH_MACVTAP is always defined with value 0 or 1.
      
      Also export virVMOperationType{To|From}String unconditional,
      because they are used unconditional in the domain config code.
      474b1c14
  12. 01 12月, 2010 3 次提交
    • J
      Fix warning when macvtap support is disabled · 45147ca3
      Jean-Baptiste Rouault 提交于
      45147ca3
    • H
      Fall back to QEMUD_SAVE_FORMAT_RAW if compression method fails. · 1b6f13bb
      Hu Tao 提交于
      When dumping a domain, it's reasonable to save dump-file in raw format
      if dump format is misconfigured or the corresponding compress program
      is not available rather then fail dumping.
      1b6f13bb
    • S
      802.1Qbg: use pre-associate state at beginning of inc. migr · c2b38277
      Stefan Berger 提交于
      This patch introduces the usage of the pre-associate state of the IEEE 802.1Qbg standard on incoming VM migration on the target host. It is in response to bugzilla entry 632750.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=632750
      
      For being able to differentiate the exact reason as to why a macvtap device is being created, either due to a VM creation or an incoming VM migration, I needed to pass that reason as a parameter from wherever qemudStartVMDaemon is being called in order to determine whether to send an ASSOCIATE (VM creation) or a PRE-ASSOCIATE (incoming VM migration) towards lldpad.
      
      I am also fixing a problem with the virsh domainxml-to-native call on the way.
      
      Gerhard successfully tested the patch with a recent blade network 802.1Qbg-compliant switch.
      
      The patch should not have any side-effects on the 802.1Qbh support in libvirt, but Roopa (cc'ed) may want to verify this.
      c2b38277
  13. 30 11月, 2010 1 次提交
    • W
      correct the arguments of migrate_speed · 4f7162d1
      Wen Congyang 提交于
      When we set migrate_speed by json, we receive the following
      error message:
      libvirtError: internal error unable to execute QEMU command
      'migrate_set_speed': Invalid parameter type, expected: number
      
      The reason is that: the arguments of migrate_set_speed
      by json is json number, not json string.
      Signed-off-by: NWen Congyang <wency@cn.fujitsu.com>
      4f7162d1
  14. 25 11月, 2010 1 次提交
  15. 24 11月, 2010 2 次提交
    • O
      implement callback function for qemu driver · c1fb9166
      Osier Yang 提交于
      * src/qemu/qemu_driver.c (add function qemuDomainIsUpdated)
      c1fb9166
    • O
      define internal driver API · 37a02efd
      Osier Yang 提交于
      * src/driver.h (new typedef, new callback member for "_virDriver")
      * src/esx/esx_driver.c
      * src/lxc/lxc_driver.c
      * src/opennebula/one_driver.c
      * src/openvz/openvz_driver.c
      * src/phyp/phyp_driver.c
      * src/qemu/qemu_driver.c
      * src/remote/remote_driver.c
      * src/test/test_driver.c
      * src/uml/uml_driver.c
      * src/vbox/vbox_tmpl.c
      * src/xen/xen_driver.c
      * src/xenapi/xenapi_driver.c
      37a02efd
  16. 23 11月, 2010 4 次提交
    • D
      Ensure logfile isn't truncated by shutdown message. · 7f9cebc0
      Daniel P. Berrange 提交于
      When running non-root, the QEMU log file is usually opened with
      truncation, since there is no logrotate for non-root usage.
      This means that when libvirt logs the shutdown timestamp, the
      log is accidentally truncated
      
      * src/qemu/qemu_driver.c: Never truncate log file with shutdown
        message
      7f9cebc0
    • C
      qemu: setvcpus: Save config changes to disk · 388fa625
      Cole Robinson 提交于
      Currently changes to the persistent config aren't flushed to disk, meaning
      they are lost if the domain is redefined or libvirtd is restarted.
      388fa625
    • C
      qemu: setvcpus: Simplify altering the persistent config · 39b62654
      Cole Robinson 提交于
      Do this by adding a helper function to get the persistent domain config. This
      should be useful for other functions that may eventually want to alter
      the persistent domain config (attach/detach device). Also make similar changes
      to the test drivers setvcpus command.
      
      A caveat is that the function will return the running config for a transient
      domain, rather than error. This simplifies callers, as long as they use
      other methods to ensure the guest is persistent.
      39b62654
    • C
      qemu: setvcpus: Fix maxvcpus check · d7520291
      Cole Robinson 提交于
      Doing 'virsh setvcpus $vm --config 10' doesn't check the value against the
      domains maxvcpus value. A larger value for example will prevent the guest
      from starting.
      
      Also make a similar change to the test driver.
      d7520291