1. 23 8月, 2011 6 次提交
  2. 22 8月, 2011 2 次提交
    • K
      send-key: fix scan keycode map · 9f5afc73
      KAMEZAWA Hiroyuki 提交于
      Now, bad key-code in send-key can cause segmentation fault in libvirt.
      (example)
       % virsh send-key --codeset win32 12
         error: End of file while reading data: Input/output error
      
      This is caused by overrun at scanning keycode array.
      
      Fix it.
      Signed-off-by: NKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      9f5afc73
    • E
      build: work around older systemtap header · 6611d9eb
      Eric Blake 提交于
      Systemtap 1.2 <sys/sdt.h> tried to expand STAP_PROBE3 into an
      initialization:
        volatile __typeof__(arg) foo = arg;
      but that fails if arg was declared as 'char arg[100]'.
      Rather than make all callers to PROBE deal with the stupidity
      of <sys/sdt.h>, we instead make PROBE cast away the problem.
      Some of this preprocessor abuse copies ideas in src/libvirt.c.
      
      * daemon/libvirtd.h (PROBE): Add casts to all arguments, using...
      (VIR_ADD_CASTS, VIR_ADD_CAST, VIR_ADD_CAST2, VIR_ADD_CAST3)
      (VIR_ADD_CAST_EXPAND, VIR_ADD_CAST_PASTE, VIR_COUNT_ARGS)
      (VIR_ARG5, PROBE_EXPAND): New macros.
      Reported by Wen Congyang.
      6611d9eb
  3. 19 8月, 2011 21 次提交
    • E
      virsh: properly interleave shared stdout and stderr · baac9c37
      Eric Blake 提交于
      Without this patch, invoking 'virsh >file 2>&1' results in
      error messages appearing before normal output, even if they
      occurred later in time than the normal output (since stderr
      is unbuffered, but stdout waits until a full buffer).
      
      * tools/virsh.c (print_job_progress, vshError): Flush between
      stream transitions.
      * tests/undefine: Test it.
      baac9c37
    • E
      maint: simplify lots of libxml2 clients · d89dd42d
      Eric Blake 提交于
      Repetitive patterns should be factored.  The sign of a good
      factorization is a change that kills 5x more lines than it adds :)
      
      * src/conf/domain_conf.c (virDomainDeviceDefParse)
      (virDomainSnapshotDefParseString): Use new convenience macros.
      * src/conf/storage_conf.c (virStoragePoolDefParseSourceString):
      Likewise.
      * src/cpu/cpu.c (cpuCompareXML, cpuBaselineXML): Likewise.
      * src/esx/esx_vi.c (esxVI_Context_Execute): Likewise.
      * src/qemu/qemu_migration.c (qemuMigrationCookieXMLParseStr):
      Likewise.
      * src/security/virt-aa-helper.c (caps_mockup): Likewise.
      * src/test/test_driver.c (testOpenFromFile): Likewise.
      * tests/cputest.c (cpuTestLoadXML, cpuTestLoadMultiXML):
      Likewise.
      * tools/virsh.c (cmdFreecell, makeCloneXML, cmdVNCDisplay)
      (cmdTTYConsole, cmdDetachInterface, cmdDetachDisk)
      (cmdSnapshotCreate, cmdSnapshotCreateAs, cmdSnapshotCurrent)
      (cmdSnapshotList, cmdSnapshotParent): Likewise.
      d89dd42d
    • E
      xml: add another convenience function · 751304e3
      Eric Blake 提交于
      Often, we want to use XPath functions on the just-parsed document;
      fold this into the parser function for convenience.
      
      * src/util/xml.h (virXMLParseHelper): Add argument.
      (virXMLParseStrHelper, virXMLParseFileHelper): Delete.
      (virXMLParseCtxt, virXMLParseStringCtxt, virXMLParseFileCtxt): New
      macros.
      * src/libvirt_private.syms (xml.h): Remove deleted functions.
      * src/util/xml.c (virXMLParseHelper): Add argument.
      (virXMLParseStrHelper, virXMLParseFileHelper): Delete.
      751304e3
    • E
      maint: treat more libxml2 functions as free-like · e472fe25
      Eric Blake 提交于
      * cfg.mk (useless_free_options): Add xmlFreeDoc, xmlBufferFree.
      * src/esx/esx_vi.c (ESX_VI__TEMPLATE__FREE): Fix offenders.
      * tools/virsh.c (cmdFreecell, cmdVNCDisplay, cmdTTYConsole)
      (cmdDetachInterface, cmdDetachDisk, cmdSnapshotCreate)
      (cmdSnapshotCreateAs, cmdSnapshotList, cmdSnapshotParent):
      Likewise.
      e472fe25
    • E
      test: rewrite test to match change in behavior · 5f98c437
      Eric Blake 提交于
      Test failure exposed in commit 7d3390f8.
      
      * tests/undefine: Fix to match updated test driver semantics.
      5f98c437
    • E
      build: fix typo in recent test patch · 04682e69
      Eric Blake 提交于
      * src/test/test_driver.c (testDomainUndefineFlags): Use right
      variable name.
      04682e69
    • E
      Revert "xen: Allow to undefine a running domain (xm_internal)" · ecc27354
      Eric Blake 提交于
      ACK was given too soon.  According to the code, the xm driver is
      only used for inactive domains, and has no notion of an active
      domain, thus, it cannot support undefine of a running domain.
      The real fix for xen needs to be in the unified driver and/or
      the xend level.
      
      This reverts commit 49186ded.
      ecc27354
    • O
      xen: Allow to undefine a running domain (xm_internal) · 49186ded
      Osier Yang 提交于
      49186ded
    • O
      vmware: Allow to undefine a running domain · b9736d5b
      Osier Yang 提交于
      b9736d5b
    • O
      uml: Allow to undefine a running domain · b3b4aba5
      Osier Yang 提交于
      b3b4aba5
    • O
      test: Allow to undefine a running domain · 7d3390f8
      Osier Yang 提交于
      7d3390f8
    • O
      qemu: Allow to undefine a running domain · aaa93ab6
      Osier Yang 提交于
      aaa93ab6
    • O
      openvz: Allow to undefine a running domain · ea92a34d
      Osier Yang 提交于
      ea92a34d
    • O
      lxc: Allow to undefine a running domain · b375fc01
      Osier Yang 提交于
      b375fc01
    • O
      libxl: Allow to undefine a running domain. · 0f407570
      Osier Yang 提交于
      Undefining a running domain will convert it to trasient, but keep
      the domain still running.
      0f407570
    • O
      qemu: Get memory balloon info correctly for text monitor · 4ffa7530
      Osier Yang 提交于
      * src/qemu/qemu_monitor_text.c: BALLOON_PREFIX was defined as
      "balloon: actual=", which cause "actual=" is stripped early before
      the real parsing. This patch changes BALLOON_PREFIX into "balloon: ",
      and modifies related functions, also renames
      "qemuMonitorParseExtraBalloonInfo" to "qemuMonitorParseBalloonInfo",
      as after the changing, it parses all the info returned by "info balloon".
      4ffa7530
    • E
      build: fix compilation on mingw64 · b14df8be
      Eric Blake 提交于
      * .gnulib: Update to latest, for getcwd fixes.
      * bootstrap: Resync to gnulib.
      b14df8be
    • M
      storage: Flush host cache after write · b32f8b19
      Michal Privoznik 提交于
      Although we are flushing cache after some critical writes (e.g.
      volume creation), after some others we do not (e.g. volume cloning).
      This patch fix this issue. That is for volume cloning, writing
      header of logical volume, and storage wipe.
      b32f8b19
    • M
      daemon: initialize GnuTLS · 74c75671
      Michal Privoznik 提交于
      When spice_tls is set but listen_tls is not, we don't initialize
      GnuTLS library. So any later gnutls call (e.g. during migration,
      where we initialize a certificate) will access uninitialized GnuTLS
      internal structs and throws an error.
      
      Although, we might now initialize GnuTLS twice, it is safe according
      to the documentation:
      
          This function can be called many times,
          but will only do something the first time.
      
      This patch creates 2 functions: virNetTLSInit and virNetTLSDeinit
      with respect to written above.
      74c75671
    • T
      schedinfo: add missing documentation · 4dec4d41
      Taku Izumi 提交于
      This patch adds the missing documentation about the scheduler parameter
      "vcpu_period" and "vcpu_quota".
      4dec4d41
    • E
      maint: ignore generated file · 322d1cfc
      Eric Blake 提交于
      I did 'git add .' while in the middle of 'make syntax-check', and
      it picked up a temporary file that should not be committed.
      
      * .gitignore: Ignore sc_* from syntax check.
      322d1cfc
  4. 18 8月, 2011 4 次提交
    • E
      build: fix virnetsocket on mingw · 310b09ec
      Eric Blake 提交于
      Regression introduced in commit 5d30db09.
      
      * src/rpc/virnetsocket.c (virNetSocketNewListenUNIX) [WIN32]: Use
      correct signature.
      310b09ec
    • E
      build: fix virpidfile on mingw · c811de8f
      Eric Blake 提交于
      Regression introduced in commit b7e5ca48.
      
      Mingw lacks kill(), but we were only using it for a sanity check;
      so we can go with one less check.
      
      Also, on OOM error, this function should outright fail rather than
      claim that the pid file was successfully read.
      
      * src/util/virpidfile.c (virPidFileReadPathIfAlive): Skip kill
      call where unsupported, and report error on OOM.
      c811de8f
    • D
      Ensure async packets never get marked for sync replies · 984840a2
      Daniel P. Berrange 提交于
      If a client had initiated a stream abort, it will have a call
      waiting for a reply in the queue. If more data continues to
      arrive on the stream, the abort command could mistakenly get
      signalled as complete. Remove the code from async data processing
      that looked for waiting calls. Add a sanity check to ensure no
      async call can ever be marked as needing a reply
      
      * src/rpc/virnetclient.c: Ensure async data packets can't
        trigger a reply
      984840a2
    • D
      Don't attempt to read from a stream if it is closed · dbf04dac
      Daniel P. Berrange 提交于
      The I/O event callback processes incoming packets first, and then
      does outgoing packets. If the incoming packet caused the stream to
      close, then the attempt to process outgoing data resulted in an
      error. This caused libvirt to then send an error back to the client,
      but the stream had already been stopped. This confused the client
      since it sees 2 error events.
      
      * daemon/stream.c: Don't attempt read if stream is closed
      dbf04dac
  5. 17 8月, 2011 7 次提交
    • T
      qemu: disk migration verbose progress · 108ca333
      Tom Vijlbrief 提交于
      A virsh command like:
      
      migrate --live --copy-storage-all Guest qemu+ssh://user@host/system
      --persistent --verbose
      
      shows
      
      Migration: [  0 %]
      
      during the storage copy and does not start counting
      until the ram transfer starts
      
      Fix this by scraping optional disk transfer status, and adding it
      into the progress meter.
      108ca333
    • E
      virsh: concatenate qemu-monitor-command arguments · 531c8581
      Eric Blake 提交于
      Call me lazy, but:
      
      virsh qemu-monitor-command dom --hmp info status
      
      is nicer than:
      
      virsh qemu-monitor-command dom --hmp 'info status'
      
      * tools/virsh.c (cmdQemuMonitorCommand): Allow multiple arguments,
      for convenience.
      531c8581
    • O
      qemu: Init reattaching related members of pciDevice before reattach · 2ce90ea2
      Osier Yang 提交于
      Otherwise the device will still be bound to pci-stub driver even
      it's set as "managed=yes" when do detaching. Of course, it won't
      triger any driver reprobing too.
      2ce90ea2
    • E
      virsh: tweak misleading wording · cfbccb38
      Eric Blake 提交于
      Fixes confusing docs introduced in commit 98369d31.
      
      * tools/virsh.c (cmdSnapshotParent): Operates on named snapshot,
      not current.
      cfbccb38
    • D
      Tweak debugging message in RPC client code · d48a0597
      Daniel P. Berrange 提交于
      Make it clearer that a log message is for an outgoing message
      d48a0597
    • D
      Fix race condition in abort of stream · b4633113
      Daniel P. Berrange 提交于
      If a stream gets a server initiated abort, the client may still
      send an abort request before it receives the server side abort.
      This causes the server to send back another abort for the
      stream. Since the protocol defines that abort is the last thing
      to be sent, the client gets confused by this second abort from
      the server. If the stream is already shutdown, just drop any
      client requested abort, rather than sending back another message.
      This fixes the regression from previous versions.
      
      Tested as follows
      
      In one virsh session
      
        virsh # start foo
        virsh # console foo
      
      In other virsh session
      
        virsh # destroy foo
      
      The first virsh session should be able to continue issuing
      commands without error. Prior to this patch it saw
      
        virsh # list
        error: Failed to list active domains
        error: An error occurred, but the cause is unknown
      
        virsh # list
        error: Failed to list active domains
        error: no call waiting for reply with prog 536903814 vers 1 serial 9
      
      * src/rpc/virnetserverprogram.c: Drop abort requests
        for streams which no longer exist
      b4633113
    • D
      Ensure client streams are closed when marking a client for close · f682c253
      Daniel P. Berrange 提交于
      Every active stream results in a reference being held on the
      virNetServerClientPtr object. This meant that if a client quit
      with any streams active, although all I/O was stopped the
      virNetServerClientPtr object would leak. This causes libvirtd
      to leak any file handles associated with open streams when a
      client quit
      
      To fix this, when we call virNetServerClientClose there is a
      callback invoked which lets the daemon release the streams
      and thus the extra references
      
      * daemon/remote.c: Add a hook to close all streams
      * daemon/stream.c, daemon/stream.h: Add API for releasing
        all streams
      * src/rpc/virnetserverclient.c, src/rpc/virnetserverclient.h:
        Allow registration of a hook to trigger when closing client
      f682c253