1. 10 12月, 2010 10 次提交
  2. 09 12月, 2010 4 次提交
    • 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
    • A
      qemud: fix memory leak in io error events · 560ed3eb
      Anthony Liguori 提交于
      The extra data isn't being free()'d for IO error events that have a reason.
      Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
      560ed3eb
  3. 08 12月, 2010 17 次提交
  4. 07 12月, 2010 9 次提交
    • 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: allow () in smbios strings · a7666b9e
      Eric Blake 提交于
      * docs/schemas/domain.rng (sysinf-value): Expand pattern.
      * tests/qemuxml2argvdata/qemuxml2argv-smbios.xml: Prefer '' over
      "" for attribute values.  Copy real hardware values.
      * tests/qemuxml2argvdata/qemuxml2argv-smbios.args: Likewise.
      a7666b9e
    • 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
    • O
      virsh: Remove redundant commands in group domain · 8eb236c5
      Osier Yang 提交于
      "echo" is already in group "virsh", "freecell" and "hostname" are
      already in group "host", so remove them from group "domain"
      
      * tools/virsh.c
      8eb236c5
    • 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
    • L
      syntax error "Bad fd number" when stopping libvirt-guests · 68e5e467
      Laurent Léonard 提交于
      When libvirt-guests is being stopped, I get the following message:
      $Running guests on default URI: test-vm
      $Suspending guests on default URI...
      $Suspending test-vm: /etc/init.d/libvirt-guests: 340: Syntax error: Bad fd
      number
      68e5e467
    • E
      threads: add virThreadID for debugging use · e4bc372e
      Eric Blake 提交于
      * src/util/threads.h (virThreadID): New prototype.
      * src/util/threads-pthread.c (virThreadID): New function.
      * src/util/threads-win32.c (virThreadID): Likewise.
      * src/libvirt_private.syms (threads.h): Export it.
      * daemon/event.c (virEventInterruptLocked): Use it to avoid
      warning on BSD systems.
      e4bc372e
    • O
      util: Fix bug which will cause libvirtd crash · 85ccf42c
      Osier Yang 提交于
      "virCommandRun": if "cmd->outbuf" or "cmd->errbuf" is NULL,
      libvirtd will be crashed when trying to start a qemu domain
      (which invokes "virCommandRun"), it caused by we try to use
      "*cmd->outbuf" and "*cmd->errbuf" regardless of cmd->outbuf
      or cmd->errbuf is NULL.
      
      * src/util/command.c (virCommandRun)
      85ccf42c