1. 27 6月, 2011 5 次提交
  2. 25 6月, 2011 15 次提交
    • E
      build: avoid uninitialized variable · 2bebf938
      Eric Blake 提交于
      Caught by gcc -O2, during autobuild.sh.
      
      * src/qemu/qemu_driver.c (qemudDomainGetVcpupinInfo): Initialize vm.
      2bebf938
    • E
      build: fix VPATH builds · 481e4d79
      Eric Blake 提交于
      The build currently fails when trying to create virnetprotocol.c
      into $(builddir)/rpc, which doesn't exist.  But since the file
      is part of the tarball, it should be generated into $(srcdir).
      Caught by autobuild.sh.
      
      * src/Makefile.am (VIR_NET_RPC_GENERATED): Generate into srcdir.
      481e4d79
    • T
      vcpupin: implement the remote protocol to address the new API · 291162ab
      Taku Izumi 提交于
      This patch implements the remote protocol to address the new API
      (virDomainGetVcpupinInfo).
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      291162ab
    • T
      vcpupin: implement the code to support new API for the qemu driver · 96414c4e
      Taku Izumi 提交于
      This patch implements the code to address the new API (virDomainGetVcpupinInfo)
      in the qemu driver.
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      96414c4e
    • T
      vcpupin: introduce the new libvirt API (virDomainGetVcpupinInfo) · e261987c
      Taku Izumi 提交于
      This patch introduces a new libvirt API (virDomainGetVcpupinInfo),
      as a counterpart to virDomainPinVcpuFlags.
      
      We can use virDomainGetVcpus API to retrieve CPU affinity information,
      but can't use this API against inactive domains (at least in case of KVM),
      as it lacks a flags parameter.
      The usual thing is to add a new virDomainGetVcpusFlags, but that API name
      is already occupied by the counterpart to virDomainGetMaxVcpus, which
      has a completely different signature.
      
      The virDomainGetVcpupinInfo is the new API to retrieve CPU affinity
      information of active and inactive domains.  While the usual convention
      is to list an array before its length, this API violates that rule
      in order to be more like virDomainGetVcpus (where maxinfo was doing
      double-duty as the length of two different arrays).
      Signed-off-by: NTaku Izumi <izumi.taku@jp.fujitsu.com>
      e261987c
    • E
      buf: protect against integer overflow · 4a27eb13
      Eric Blake 提交于
      It's unlikely that we'll ever want to escape a string as long as
      INT_MAX/6, but adding this check can't hurt.
      
      * src/util/buf.c (virBufferEscapeSexpr, virBufferEscapeString):
      Check for (unlikely) overflow.
      4a27eb13
    • E
      remote: protect against integer overflow · 774b21c1
      Eric Blake 提交于
      Integer overflow and remote code are never a nice mix.
      
      This has existed since commit 56cd4140.
      
      * src/libvirt.c (virDomainGetVcpus): Reject overflow up front.
      * src/remote/remote_driver.c (remoteDomainGetVcpus): Avoid overflow
      on sending rpc.
      * daemon/remote.c (remoteDispatchDomainGetVcpus): Avoid overflow on
      receiving rpc.
      774b21c1
    • E
      build: update gnulib for intprops · 89d994ad
      Eric Blake 提交于
      Done as a separate commit to make backporting the next patch easier.
      We are already using "intprops.h", but this makes it explicit.
      
      * .gnulib: Update, for syntax-check fix.
      * bootstrap.conf (gnulib_modules): Make intprops use explicit.
      * src/locking/domain_lock.c (includes): Drop unused header.
      * src/nwfilter/nwfilter_learnipaddr.c (includes): Use "", not <>,
      for gnulib.
      89d994ad
    • M
    • M
      Fix typo in libvirt_private.syms · a800d66b
      Matthias Bolte 提交于
      Triggered a linker error on MinGW.
      a800d66b
    • M
      Network: Add support for DNS hosts definition to the network XML · 9d4e2845
      Michal Novotny 提交于
      This commit introduces names definition for the DNS hosts file using
      the following syntax:
      
        <dns>
          <host ip="192.168.1.1">
            <name>alias1</name>
            <name>alias2</name>
          </host>
        </dns>
      
      Some of the improvements and fixes were done by Laine Stump so
      I'm putting him into the SOB clause again ;-)
      Signed-off-by: NMichal Novotny <minovotn@redhat.com>
      Signed-off-by: NLaine Stump <laine@laine.org>
      9d4e2845
    • M
      91b7924e
    • M
      Network: modify dnsmasq commandline build function to allow testing · 89ae9849
      Michal Novotny 提交于
      The dnsmasq commandline was being built as a part of running
      dnsmasq. This patch puts the commandline build into a separate
      function (and exports it as a private API) making it possible to build
      a dnsmasq commandline without executing it, so that we can write a
      test program to verify that the proper commandlines are being created.
      Signed-off-by: NMichal Novotny <minovotn@redhat.com>
      89ae9849
    • M
      Add TXT record support for virtual DNS service · 5dd986db
      Michal Novotny 提交于
      This commit introduces the <dns> element and <txt> record for the
      virtual DNS network. The DNS TXT record can be defined using following
      syntax in the network XML file:
      
        <dns>
          <txt name="example" value="example value" />
        </dns>
      
      Also, the Relax-NG scheme has been altered to allow the texts without
      spaces only for the name element and some nitpicks about memory
      free'ing have been fixed by Laine so therefore I'm adding Laine to the
      SOB clause ;-)
      Signed-off-by: NMichal Novotny <minovotn@redhat.com>
      Signed-off-by: NLaine Stump <laine@laine.org>
      5dd986db
    • J
      Move load of AppArmor profile to GenLabel() · 0b501bd4
      Jamie Strandboge 提交于
      Commit 12317957 introduced an incompatible
      architectural change for the AppArmor security driver. Specifically,
      virSecurityManagerSetAllLabel() is now called much later in
      src/qemu/qemu_process.c:qemuProcessStart(). Previously, SetAllLabel() was
      called immediately after GenLabel() such that after the dynamic label (profile
      name) was generated, SetAllLabel() would be called to create and load the
      AppArmor profile into the kernel before qemuProcessHook() was executed. With
      12317957, qemuProcessHook() is now called
      before SetAllLabel(), such that aa_change_profile() ends up being called
      before the AppArmor profile is loaded into the kernel (via ProcessLabel() in
      qemuProcessHook()).
      
      This patch addresses the change by making GenLabel() load the AppArmor
      profile into the kernel after the label (profile name) is generated.
      SetAllLabel() is then adjusted to only reload_profile() and append stdin_fn to
      the profile when it is specified. This also makes the AppArmor driver work
      like its SELinux counterpart with regard to SetAllLabel() and stdin_fn.
      Bug-Ubuntu: https://launchpad.net/bugs/801569
      0b501bd4
  3. 24 6月, 2011 20 次提交
    • E
      docs: document correct flag name · db323e3b
      Eric Blake 提交于
      When adding virDomainGetVcpusFlags in commit ea3f5c68, I did
      enough rebasing that the doc comments in libvirt.c no longer
      matched the final chosen enum names in libvirt.h.
      
      And now we've gone ahead and deprecated the names
      VIR_DOMAIN_VCPU_{LIVE,CONFIG}.
      
      * src/libvirt.c (virDomainGetVcpusFlags): Fix comment.
      db323e3b
    • E
      Revert "Add new API virDomainBlockPull* to headers" · 1aa859d6
      Eric Blake 提交于
      This reverts commit 7d56a16d.
      
      Conflicts:
      
      	python/generator.py
      	src/libvirt_public.syms
      1aa859d6
    • E
      Revert "virDomainBlockPull: Implement the main entry points" · 6389bea9
      Eric Blake 提交于
      This reverts commit 6419f596.
      6389bea9
    • E
      Revert "Add virDomainBlockPull support to the remote driver" · 98723236
      Eric Blake 提交于
      This reverts commit d1693bb1.
      
      Conflicts:
      
      	daemon/remote.c
      	src/remote/remote_driver.c
      	src/remote/remote_protocol.x
      98723236
    • E
      Revert "Implement virDomainBlockPull for the qemu driver" · 3c2f0a17
      Eric Blake 提交于
      This reverts commit 784ee08d.
      3c2f0a17
    • E
      Revert "Asynchronous event for BlockPull completion" · c4c59e72
      Eric Blake 提交于
      This reverts commit 12cd77a0.
      
      Conflicts:
      
      	python/libvirt-override-virConnect.py
      	python/libvirt-override.c
      	src/remote/remote_protocol.x
      c4c59e72
    • E
      build: fix NUMA build on RHEL 5 · 98d83094
      Eric Blake 提交于
      Use NUMA's older nodemask_t (fixed-size map) rather than the newer
      'struct bitmask' (variable-size) in order to still compile on RHEL 5,
      with its numactl-devel-0.9.8.
      
      * src/qemu/qemu_process.c [HAVE_NUMA]: Prefer back-compat mode.
      (qemuProcessInitNumaMemoryPolicy): Use older nodemask_t.
      98d83094
    • M
      Add Memory Device Information to virSysinfoRead() from dmidecode type 17 · b4683297
      Minoru Usui 提交于
      * src/util/sysinfo.[ch]: also parse and save all the SMBIOS informations
        about memory modules
      b4683297
    • M
      Add Processor Information to virSysinfoRead() from dmidecode type 4 · 49156a7a
      Minoru Usui 提交于
      * src/util/sysinfo.c: add parsing and formatting of processor
        information data
      49156a7a
    • M
      Cleanup virSysinfoRead() · 532ce9c2
      Minoru Usui 提交于
      * src/util/sysinfo.c: Separate BIOSInfo and SystemInfo part from
                            virSysinfoRead()
      532ce9c2
    • D
      Make sure virnetprotocol.[ch] are in BUILT_SOURCES · 789ab2cc
      Daniel P. Berrange 提交于
      To ensure virnetprotocol.[ch] are generated before any other
      files, add them to BUILT_SOURCES and MAINTAINERCLEANFILES.
      At the same time, move ESX_DRIVER_GENERATED out of DISTCLEAN
      and into MAINTAINERCLEANFILES, since they are included in
      EXTRA_DIST
      
      * src/Makefile.am: Add virnetprotocol.[ch] to BUILT_SOURCES
      789ab2cc
    • E
      maint: typo fixes · acb31cf5
      Eric Blake 提交于
      * src/xenxs/xen_sxpr.c (xenParseSxprPCI): Comment fix.
      * tests/object-locking.ml (driverTables): Likewise.
      * tests/testutils.c (virtTestDifferenceBin): Likewise.
      acb31cf5
    • D
      Fix some bugs in RPC protocol make rules · d6bf7703
      Daniel P. Berrange 提交于
      The Makefile.am rules for generating RPC protocol had a couple
      of bugs
      
       - A instance of remote/rpcgen_fix.pl  was not changed
         to rpc/genprotocol.pl
       - A dep from rpc/virnetmessage.h on the generated
         rpc/virnetprotocol.h was missing
       - The generated rpc/virnetprotocol.[ch] were not listed
         in MAINTAINERCLEANFILES
      
      * Makefile.am: Fix RPC protocol generation
      d6bf7703
    • D
      Add missing translation of error message from QEMU reboot patch · c0cd2929
      Daniel P. Berrange 提交于
      * src/qemu/qemu_process.c: Add missing _(...)
      c0cd2929
    • D
      Fix job type set in qemuMigrationPrepareDirect/PrepareTunnel · 74798313
      Daniel P. Berrange 提交于
      The qemuMigrationPrepareDirect/PrepareTunnel methods accidentally
      set the domain job to  QEMU_JOB_MIGRATION_OUT when it should have
      been  QEMU_JOB_MIGRATION_IN. This didn't have any ill-effect, but
      it is none-the-less wrong.
      
      * src/qemu/qemu_migration.c: Fix job type
      74798313
    • D
      Avoid high privileges taint warning for QEMU session driver · bd180de5
      Daniel P. Berrange 提交于
      The code emitting taint warnings was mistakenly thinking
      that guests run from the QEMU session driver were tainted
      for having high privileges. This is of course nonsense
      since the session driver is always unprivileged
      
      * src/qemu/qemu_domain.c: Don't warn for high privileges in
        non-privileged QEMU
      bd180de5
    • D
      Allow automatic kill of guests when a connection is closed · 3ba937da
      Daniel P. Berrange 提交于
      If an application is using libvirt + KVM as a piece of its
      internal infrastructure to perform a specific task, it can
      be desirable to guarentee the VM dies when the virConnectPtr
      disconnects from libvirtd. This ensures the app can't leak
      any VMs it was using. Adding VIR_DOMAIN_START_AUTOKILL as
      a flag when starting guests enables this to be done.
      
      * include/libvirt/libvirt.h.in: All VIR_DOMAIN_START_AUTOKILL
      * src/qemu/qemu_driver.c: Support automatic killing of guests
        upon connection close
      * tools/virsh.c: Add --autokill flag to 'start' and 'create'
        commands
      3ba937da
    • D
      Automatically kill target QEMU if migration aborts abnormally · 2c2effa1
      Daniel P. Berrange 提交于
      Migration is a multi-step process
      
        1. Begin(src)
        2. Prepare(dst)
        3. Perform(src)
        4. Finish(dst)
        5. Confirm(src)
      
      At step 2, a QEMU process is lauched in the destination to
      accept the incoming migration. Occasionally the process
      that is controlling the migration workflow aborts, and fails
      to call step 4, Finish. This leaves a QEMU process running
      on the target (albeit with paused CPUs). Unfortunately because
      step 2 actives a job on the QEMU process, it is unkillable by
      normal means.
      
      By registering the VM for autokill against the src virConnectPtr
      in step 2, we can ensure that the guest is forcefully killed off
      if the connection is closed without step 4 being invoked
      
      * src/qemu/qemu_migration.c: Register autokill in PrepareDirect
        and PrepareTunnel. Unregister autokill on successful run
        of Finish
      * src/qemu/qemu_process.c: Unregister autokill when stopping a
        process
      2c2effa1
    • D
      Add infrastructure to automatically destroy guests when a connection closes · 558b7fd0
      Daniel P. Berrange 提交于
      Sometimes it is useful to be able to automatically destroy a guest when
      a connection is closed. For example, kill an incoming migration if
      the client managing the migration dies. This introduces a map between
      guest 'uuid' strings and virConnectPtr objects. When a connection is
      closed, any associated guests are killed off.
      
      * src/qemu/qemu_conf.h: Add autokill hash table to qemu driver
      * src/qemu/qemu_process.c, src/qemu/qemu_process.h: Add APIs
        for performing autokill of guests associated with a connection
      * src/qemu/qemu_driver.c: Initialize autodestroy map
      558b7fd0
    • D
      Support reboots with the QEMU driver · 42f43592
      Daniel P. Berrange 提交于
      For controlled shutdown we issue a 'system_powerdown' command
      to the QEMU monitor. This triggers an ACPI event which (most)
      guest OS wire up to a controlled shutdown. There is no equiv
      ACPI event to trigger a controlled reboot. This patch attempts
      to fake a reboot.
      
       - In qemuDomainObjPrivatePtr we have a bool fakeReboot
         flag.
       - The virDomainReboot method sets this flag and then
         triggers a normal 'system_powerdown'.
       - The QEMU process is started with '-no-shutdown'
         so that the guest CPUs pause when it powers off the
         guest
       - When we receive the 'POWEROFF' event from QEMU JSON
         monitor if fakeReboot is not set we invoke the
         qemuProcessKill command and shutdown continues
         normally
       - If fakeReboot was set, we spawn a background thread
         which issues 'system_reset' to perform a warm reboot
         of the guest hardware. Then it issues 'cont' to
         start the CPUs again
      
      * src/qemu/qemu_command.c: Add -no-shutdown flag if
        we have JSON support
      * src/qemu/qemu_domain.h: Add 'fakeReboot' flag to
        qemuDomainObjPrivate struct
      * src/qemu/qemu_driver.c: Fake reboot using the
        system_powerdown command if JSON support is available
      * 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: Add
        binding for system_reset command
      * src/qemu/qemu_process.c: Reset the guest & start CPUs if
        fakeReboot is set
      42f43592