1. 12 7月, 2011 14 次提交
    • D
      Add a new 'virsh qemu-attach' command. · eb7be6a6
      Daniel P. Berrange 提交于
      This command allows libvirt to attach to an existing QEMU
      instance.
      
       $ qemu-kvm -cdrom ~/demo.iso \
           -monitor unix:/tmp/demo,server,nowait \
           -name foo \
           -uuid cece4f9f-dff0-575d-0e8e-01fe380f12ea  &
       $ QEMUPID=$!
       $ virsh qemu-attach $QEMUPID
      eb7be6a6
    • D
      Define remote wire protocol & impls for virDomainQemuAttach · 44036460
      Daniel P. Berrange 提交于
      This tweaks the RPC generator to cope with some naming
      conventions used for the QEMU specific APIs
      
      * daemon/remote.c: Server side dispatcher
      * src/remote/remote_driver.c: Client side dispatcher
      * src/remote/qemu_protocol.x: Wire protocol definition
      * src/rpc/gendispatch.pl: Use '$structprefix' in method
        names, fix QEMU flags and fix dispatcher method names
      44036460
    • D
      Define a QEMU specific API to attach to a running QEMU process · 639f8413
      Daniel P. Berrange 提交于
      Introduce a new API in libvirt-qemu.so
      
       virDomainPtr virDomainQemuAttach(virConnectPtr domain,
                                        unsigned long long pid,
                                        unsigned int flags);
      
      This allows libvirtd to attach to an existing, externally
      launched QEMU process. This is useful for QEMU developers who
      prefer to launch QEMU themselves for debugging/devel reasons,
      but still want the benefit of libvirt based tools like
      virt-top, virt-viewer, etc
      
      * include/libvirt/libvirt-qemu.h: Define virDomainQemuAttach
      * src/driver.h, src/libvirt-qemu.c, src/libvirt_qemu.syms:
        Driver glue for virDomainQemuAttach
      639f8413
    • A
      qemu: update configuration file · 9c5b1900
      Alex Jia 提交于
      * src/qemu/qemu.conf: Add blkio controller into qemu.conf.
      9c5b1900
    • E
      qemu: avoid fd leak on core dump failure · f532bfa2
      Eric Blake 提交于
      * src/qemu/qemu_driver.c (doCoreDump): Guarantee fd is closed.
      f532bfa2
    • E
      maint: rename virtaudit to match file contents · 2ceb35e1
      Eric Blake 提交于
      * src/util/virtaudit.[ch]: Rename...
      * src/util/viraudit.[ch]: ...to match virAudit* API.
      * src/Makefile.am (UTIL_SOURCES): Reflect rename.
      * daemon/libvirtd.c: Likewise.
      * po/POTFILES.in: Likewise.
      * src/libvirt_private.syms: Likewise.
      * src/qemu/qemu_audit.c: Likewise.
      2ceb35e1
    • O
      remote/ssh: support for no_verify. · 9a0e6a8f
      Oskari Saarenmaa 提交于
      Set StrictHostKeyChecking=no to auto-accept new ssh host keys if the
      no_verify extra parameter was specified.  This won't disable host key
      checking for already known hosts.  Includes a test and documentation.
      9a0e6a8f
    • K
      Fix virsh inject-nmi man page · 2851d378
      KAMEZAWA Hiroyuki 提交于
      * tools/virsh.pod: move the description which was misplaced
      2851d378
    • M
      domain_conf: Free temporary variable · d50bb45b
      Michal Privoznik 提交于
      * src/conf/domain_conf.c: caller must free returned value of
        virXPathString in useserial
      d50bb45b
    • O
      esx: Fix a potential crash · 6ddb83ef
      Osier Yang 提交于
      Initialize ptr data.datastorePathWithoutFileName as NULL, otherwise
      it might cause crash when trying to free it in cleanup.
      6ddb83ef
    • E
      build: also check qemu_protocol for on-the-wire stability · 62dee6fa
      Eric Blake 提交于
      Since we are going to add some libvirt-qemu.so entry points in
      0.9.4, we might as well start checking for RPC stability, just
      as for libvirt.so.
      
      * src/Makefile.am (PROTOCOL_STRUCTS): New variable.
      (remote_protocol-structs): Rename...
      (%_protocol-structs): ...and make more generic.
      * src/qemu_protocol-structs: New file.
      62dee6fa
    • E
      build: avoid requiring -lm · df94811f
      Eric Blake 提交于
      log2() is heavy when ffs() can do the same thing.  But ffs()
      requires gnulib support for mingw.
      
      This patch solves this linker error on Fedora 14.
      
      /usr/bin/ld: libvirt_lxc-domain_conf.o: undefined reference to symbol 'log2@@GLIBC_2.2.5'
      /usr/bin/ld: note: 'log2@@GLIBC_2.2.5' is defined in DSO /lib64/libm.so.6 so try adding it to the linker command line
      /lib64/libm.so.6: could not read symbols: Invalid operation
      collect2: ld returned 1 exit status
      
      * .gnulib: Update to latest, for ffs.
      * bootstrap.conf (gnulib_modules): Import ffs.
      * src/conf/domain_conf.c (virDomainDefParseXML): Use ffs instead
      of log2.
      Reported by Dave Allan.
      df94811f
    • J
      Remove code no longer used after commit df0b57a9 · 00d3c5a6
      Jim Fehlig 提交于
      00d3c5a6
    • M
      Add domain type checking · aa14709a
      Matthias Bolte 提交于
      The drivers were accepting domain configs without checking if those
      were actually meant for them. For example the LXC driver happily
      accepts configs with type QEMU.
      
      Add a check for the expected domain types to the virDomainDefParse*
      functions.
      aa14709a
  2. 11 7月, 2011 8 次提交
    • A
      remote: Fix memory leak · 7518ad75
      Alex Jia 提交于
      Detected in valgrind run:
      
      ==9184== 1 bytes in 1 blocks are definitely lost in loss record 1 of 19
      ==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
      ==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
      ==9184==    by 0x4CF97C9: xdr_remote_domain_get_security_label_ret (remote_protocol.c:1696)
      ==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
      ==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
      ==9184==    by 0x4CE3887: call (remote_driver.c:3933)
      ==9184==    by 0x4CF71C6: remoteDomainGetSecurityLabel (remote_driver.c:1580)
      ==9184==    by 0x4CCA480: virDomainGetSecurityLabel (libvirt.c:7340)
      ==9184==    by 0x41993A: cmdDominfo (virsh.c:2414)
      ==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
      ==9184==    by 0x4211ED: main (virsh.c:14076)
      ==9184==
      ==9184== 2 bytes in 1 blocks are definitely lost in loss record 2 of 19
      ==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
      ==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
      ==9184==    by 0x4CF974F: xdr_remote_node_get_security_model_ret (remote_protocol.c:1713)
      ==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
      ==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
      ==9184==    by 0x4CE3887: call (remote_driver.c:3933)
      ==9184==    by 0x4CF6F96: remoteNodeGetSecurityModel (remote_driver.c:1648)
      ==9184==    by 0x4CBF799: virNodeGetSecurityModel (libvirt.c:7382)
      ==9184==    by 0x4197D7: cmdDominfo (virsh.c:2394)
      ==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
      ==9184==    by 0x4211ED: main (virsh.c:14076)
      ==9184==
      ==9184== 8 bytes in 1 blocks are definitely lost in loss record 3 of 19
      ==9184==    at 0x4A04A28: calloc (vg_replace_malloc.c:467)
      ==9184==    by 0x3073715F78: xdr_array (xdr_array.c:97)
      ==9184==    by 0x4CF9729: xdr_remote_node_get_security_model_ret (remote_protocol.c:1710)
      ==9184==    by 0x4D08741: virNetMessageDecodePayload (virnetmessage.c:286)
      ==9184==    by 0x4D00F78: virNetClientProgramCall (virnetclientprogram.c:318)
      ==9184==    by 0x4CE3887: call (remote_driver.c:3933)
      ==9184==    by 0x4CF6F96: remoteNodeGetSecurityModel (remote_driver.c:1648)
      ==9184==    by 0x4CBF799: virNodeGetSecurityModel (libvirt.c:7382)
      ==9184==    by 0x4197D7: cmdDominfo (virsh.c:2394)
      ==9184==    by 0x411E92: vshCommandRun (virsh.c:12730)
      ==9184==    by 0x4211ED: main (virsh.c:14076)
      ==9184==
      ==9184== LEAK SUMMARY:
      ==9184==    definitely lost: 11 bytes in 3 blocks
      
      * src/remote/remote_driver.c: Avoid leak on remoteDomainGetSecurityLabel
        and remoteNodeGetSecurityModel.
      7518ad75
    • E
      tests: simplify formatting · 9693e293
      Eric Blake 提交于
      The shell version would output 40 extra spaces for a test with
      a multiple of 40 sub-tests, and the C version can use the same
      printf optimization for avoiding a loop over single space output
      as the shell version.
      
      * tests/testutils.c (virtTestMain): Avoid loop for alignment.
      * tests/test-lib.sh: Fix formatting when counter is multiple of 40.
      9693e293
    • J
      Do not drop kernel cmdline for xen pv domains · eb314315
      Jim Fehlig 提交于
      Kernel cmdline args can be passed to xen pv domains even when a
      bootloader is specified.  The current config-to-sxpr mapping
      ignores cmdline when bootloader is present.
      
      Since the xend sub-driver is used with many xen toolstack versions,
      this patch takes conservative approach of adding an else block to
      existing !def->os.bootloader, and only appends sxpr if def->os.cmdline
      is non-NULL.
      
      V2: Fix existing testcase broken by this patch and add new testcases
      eb314315
    • W
      kill vm if saving config failed in v3 protocol · 8a8b45b8
      Wen Congyang 提交于
      If virDomainSaveConfig() failed, we will return NULL to source,
      and the vm is still available to restart during confirm() step in
      v3 protocol. So we should kill it off in qemuMigrationFinish().
      
      In v2 protocol, we should not set vm to NULL, because we hold
      a reference of vm and should unrefernce it.
      8a8b45b8
    • W
      RPC: fix argument's name · 586765fb
      Wen Congyang 提交于
      586765fb
    • W
      fix typo error · ecde731c
      Wen Congyang 提交于
      ecde731c
    • M
      bios: Add support for SGA · 874e65aa
      Michal Privoznik 提交于
      This patch creates new <bios> element which, at this time has only the
      attribute useserial='yes|no'. This attribute allow users to use
      Serial Graphics Adapter and see BIOS messages from the very first moment
      domain boots up. Therefore, users can choose boot medium, set PXE, etc.
      874e65aa
    • D
      Fix rpm build with sanlock and without QEmu · 920ffe1b
      Daniel Veillard 提交于
      The qemu-sanlock.conf file is not installed in this case
      920ffe1b
  3. 09 7月, 2011 7 次提交
  4. 08 7月, 2011 11 次提交
    • M
      qemu: clean up OOM checks · b0b85c45
      Michael Santos 提交于
      b0b85c45
    • D
      Don't exit if the libvirtd config does not exist · 8e2e4780
      Daniel P. Berrange 提交于
      It is common for the $HOME/.libvirt/libvirtd.conf file to not
      exist. Treat this situation as non-fatal since we can carry
      on with our default settings just fine.
      
      * daemon/libvirtd.c: Treat ENOENT as non-fatal when loading
        config
      8e2e4780
    • D
      Fix sending of reply to final RPC message · 3cfdc57b
      Daniel P. Berrange 提交于
      The dispatch for the CLOSE RPC call was invoking the method
      virNetServerClientClose(). This caused the client connection
      to be immediately terminated. This meant the reply to the
      final RPC message was never sent. Prior to the RPC rewrite
      we merely flagged the connection for closing, and actually
      closed it when the next RPC call dispatch had completed.
      
      * daemon/remote.c: Flag connection for a delayed close
      * daemon/stream.c: Update to use new API for closing
        failed connection
      * src/rpc/virnetserverclient.c, src/rpc/virnetserverclient.h:
        Add support for a delayed connection close. Rename the
        virNetServerClientMarkClose method to virNetServerClientImmediateClose
        to clarify its semantics
      3cfdc57b
    • D
      Fix leak of remote driver if final 'CLOSE' RPC call fails · afe8839f
      Daniel P. Berrange 提交于
      When closing a remote connection we issue a (fairly pointless)
      'CLOSE' RPC call to the daemon. If this fails we skip all the
      cleanup of private data, but the virConnectPtr object still
      gets released as normal. This causes a memory leak. Since the
      CLOSE RPC call is pretty pointless, just carry on freeing the
      remote driver if it fails.
      
      * src/remote/remote_driver.c: Ignore failure to issue CLOSE
        RPC call
      afe8839f
    • D
      Fix release of outgoing stream confirmation/abort message · 2c85644b
      Daniel P. Berrange 提交于
      When sending back the final OK or ERROR message on completion
      of a stream, we were not decrementing the 'nrequests' tracker
      on the client. With the default requests limit of '5', this
      meant once a client had created 5 streams, they are unable to
      process any further RPC calls.  There was also a bug when
      handling an error from decoding a message length header, which
      meant a client connection would not immediately be closed.
      
      * src/rpc/virnetserverclient.c: Fix release of request after
        stream completion & mark client for close on error
      2c85644b
    • D
      Fix leak of 'msg' object in client stream code · 927dfcf6
      Daniel P. Berrange 提交于
      In one exit path we forgot to free the virNetMessage object causing
      a large memory leak for streams which send a lot of data. Some other
      paths were calling VIR_FREE directly instead of virNetMessageFree
      although this was (currently) harmless.
      
      * src/rpc/virnetclientstream.c: Fix leak of msg object
      * src/rpc/virnetclientprogram.c: Call virNetMessageFree instead
        of VIR_FREE
      927dfcf6
    • D
      Fix potential crash in libvirtd with active streams · 3e5d48ef
      Daniel P. Berrange 提交于
      If a client disconnects while it has a stream active, there is
      a race condition which could see libvirtd crash. This is because
      the client struct may be freed before the last stream event has
      triggered. This is trivially solved by holding an extra reference
      on the client for the stream callbak
      
      * daemon/stream.c: Acquire reference on client when adding the
        stream callback
      3e5d48ef
    • D
      Fix mistaken order of server cert/key parameters in constructor · c2ddd536
      Daniel P. Berrange 提交于
      The virNetTLSContextNew was being passed key/cert parameters in
      the wrong order. This wasn't immediately visible because if
      virNetTLSContextNewPath was used, a second bug reversed the order
      of those parameters again.
      
      Only if the paths were manually specified in /etc/libvirt/libvirtd.conf
      did the bug appear
      
      * src/rpc/virnettlscontext.c: Fix order of params passed to
        virNetTLSContextNew
      c2ddd536
    • M
      graphics: add support for action_if_connected in qemu · 30c43afd
      Michal Privoznik 提交于
      This option accepts 3 values:
      -keep, to keep current client connected (Spice+VNC)
      -disconnect, to disconnect client (Spice)
      -fail, to fail setting password if there is a client connected (Spice)
      30c43afd
    • J
      util: Don't try to fchown files opened as non-root · 2f4d2496
      Jiri Denemark 提交于
      When virFileOpenAs is called with VIR_FILE_OPEN_AS_UID flag and uid/gid
      different from root/root while libvirtd is running as root, we fork a
      new child, change its effective UID/GID to uid/gid and run
      virFileOpenAsNoFork. It doesn't make any sense to fchown() the opened
      file in this case since we already know that uid/gid can access the file
      when open succeeds and one of the following situations may happen:
      
      - the file is already owned by uid/gid and we skip fchown even before
        this patch
      - the file is owned by uid but not gid because it was created in a
        directory with SETGID set, in which case it is desirable not to change
        the group
      - the file may be owned by a completely different user and/or group
        because it was created on a root-squashed or even all-squashed NFS
        filesystem, in which case fchown would most likely fail anyway
      2f4d2496
    • M
      qemu: Don't chown files on NFS share if dynamic_ownership is off · 724819a1
      Michal Privoznik 提交于
      When dynamic ownership is disabled we don't want to chown any files,
      not just local.
      724819a1