1. 15 3月, 2011 1 次提交
    • D
      Make LXC container startup/shutdown/I/O more robust · 4e3117ae
      Daniel P. Berrange 提交于
      The current LXC I/O controller looks for HUP to detect
      when a guest has quit. This isn't reliable as during
      initial bootup it is possible that 'init' will close
      the console and let mingetty re-open it. The shutdown
      of containers was also flakey because it only killed
      the libvirt I/O controller and expected container
      processes to gracefully follow.
      
      Change the I/O controller such that when it see HUP
      or an I/O error, it uses kill($PID, 0) to see if the
      process has really quit.
      
      Change the container shutdown sequence to use the
      virCgroupKillPainfully function to ensure every
      really goes away
      
      This change makes the use of the 'cpu', 'devices'
      and 'memory' cgroups controllers compulsory with
      LXC
      
      * docs/drvlxc.html.in: Document that certain cgroups
        controllers are now mandatory
      * src/lxc/lxc_controller.c: Check if PID is still
        alive before quitting on I/O error/HUP
      * src/lxc/lxc_driver.c: Use virCgroupKillPainfully
      4e3117ae
  2. 11 3月, 2011 2 次提交
  3. 25 2月, 2011 1 次提交
    • D
      Allow hash tables to use generic pointers as keys · 16ba2aaf
      Daniel P. Berrange 提交于
      Relax the restriction that the hash table key must be a string
      by allowing an arbitrary hash code generator + comparison func
      to be provided
      
      * util/hash.c, util/hash.h: Allow any pointer as a key
      * internal.h: Include stdbool.h as standard.
      * conf/domain_conf.c, conf/domain_conf.c,
        conf/nwfilter_params.c, nwfilter/nwfilter_gentech_driver.c,
        nwfilter/nwfilter_gentech_driver.h, nwfilter/nwfilter_learnipaddr.c,
        qemu/qemu_command.c, qemu/qemu_driver.c,
        qemu/qemu_process.c, uml/uml_driver.c,
        xen/xm_internal.c: s/char */void */ in hash callbacks
      16ba2aaf
  4. 24 2月, 2011 1 次提交
  5. 21 2月, 2011 1 次提交
    • E
      maint: kill all remaining uses of old DEBUG macro · 994e7567
      Eric Blake 提交于
      Done mechanically with:
      $ git grep -l '\bDEBUG0\? *(' | xargs -L1 sed -i 's/\bDEBUG0\? *(/VIR_&/'
      
      followed by manual deletion of qemudDebug in daemon/libvirtd.c, along
      with a single 'make syntax-check' fallout in the same file, and the
      actual deletion in src/util/logging.h.
      
      * src/util/logging.h (DEBUG, DEBUG0): Delete.
      * daemon/libvirtd.h (qemudDebug): Likewise.
      * global: Change remaining clients over to VIR_DEBUG counterpart.
      994e7567
  6. 09 2月, 2011 1 次提交
    • E
      sysinfo: define internal driver API · dec13a5a
      Eric Blake 提交于
      * src/driver.h (virDrvGetSysinfo): New typedef.
      (_virDriver): New callback member.
      * src/esx/esx_driver.c (esxDriver): Add stub for driver.
      * src/lxc/lxc_driver.c (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDriver): Likewise.
      * src/phyp/phyp_driver.c (phypDriver): Likewise.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/test/test_driver.c (testDriver): Likewise.
      * src/uml/uml_driver.c (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (Driver): Likewise.
      * src/vmware/vmware_driver.c (vmwareDriver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.
      dec13a5a
  7. 22 1月, 2011 1 次提交
  8. 19 1月, 2011 1 次提交
  9. 15 1月, 2011 2 次提交
    • N
      memtune: Let virsh know the unlimited value for memory tunables · d94a14f8
      Nikunj A. Dadhania 提交于
      Display or set unlimited values for memory parameters. Unlimited is
      represented by INT64_MAX in memory cgroup.
      Signed-off-by: NNikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
      Reported-by: NJustin Clift <jclift@redhat.com>
      d94a14f8
    • E
      domain_conf: split source data out from ChrDef · 98334e7c
      Eric Blake 提交于
      This opens up the possibility of reusing the smaller ChrSourceDef
      for both qemu monitor and a passthrough smartcard device.
      
      * src/conf/domain_conf.h (_virDomainChrDef): Factor host
      details...
      (_virDomainChrSourceDef): ...into new struct.
      (virDomainChrSourceDefFree): New prototype.
      * src/conf/domain_conf.c (virDomainChrDefFree)
      (virDomainChrDefParseXML, virDomainChrDefFormat): Split...
      (virDomainChrSourceDefClear, virDomainChrSourceDefFree)
      (virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
      ...into new functions.
      (virDomainChrDefParseTargetXML): Update clients to reflect type
      split.
      * src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
      (virVMXFormatSerial, virVMXFormatParallel): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
      * src/xen/xend_internal.c (xenDaemonParseSxprChar)
      (xenDaemonFormatSxprChr): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
      (vboxAttachParallel): Likewise.
      * src/security/security_dac.c (virSecurityDACSetChardevLabel)
      (virSecurityDACSetChardevCallback)
      (virSecurityDACRestoreChardevLabel)
      (virSecurityDACRestoreChardevCallback): Likewise.
      * src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
      (SELinuxSetSecurityChardevCallback)
      (SELinuxRestoreSecurityChardevLabel)
      (SELinuxSetSecurityChardevCallback): Likewise.
      * src/security/virt-aa-helper.c (get_files): Likewise.
      * src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
      Likewise.
      * src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
      * src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
      (umlDomainOpenConsole): Likewise.
      * src/qemu/qemu_command.c (qemuBuildChrChardevStr)
      (qemuBuildChrArgStr, qemuBuildCommandLine)
      (qemuParseCommandLineChr): Likewise.
      * src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
      (qemuDomainObjPrivateXMLParse): Likewise.
      * src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
      * src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
      * src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
      (qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
      (qemuPrepareMonitorChr, qemudShutdownVMDaemon)
      (qemuDomainOpenConsole): Likewise.
      * src/qemu/qemu_command.h (qemuBuildChrChardevStr)
      (qemuBuildChrArgStr): Delete, now that they are static.
      * src/libvirt_private.syms (domain_conf.h): New exports.
      * cfg.mk (useless_free_options): Update list.
      * tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
      tests.
      98334e7c
  10. 25 11月, 2010 1 次提交
    • O
      Implementations of virDomainIsUpdated for drivers except qemu · f3605b33
      Osier Yang 提交于
      Except LXC and UML driver, implementations of all other drivers
      simply return 0, because these drivers doesn't have config both
      in memory and on disk, no need to track if the domain of these
      drivers updated or not.
      
      Rename "xenUnifiedDomainisPersistent" to "xenUnifiedDomainIsPersistent"
      
      * esx/esx_driver.c
      * lxc/lxc_driver.c
      * opennebula/one_driver.c
      * openvz/openvz_driver.c
      * phyp/phyp_driver.c
      * test/test_driver.c
      * uml/uml_driver.c
      * vbox/vbox_tmpl.c
      * xen/xen_driver.c
      * xenapi/xenapi_driver.c
      f3605b33
  11. 24 11月, 2010 1 次提交
    • 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
  12. 23 11月, 2010 1 次提交
    • C
      Make state driver device hotplug/update actually transient · 45ec297d
      Cole Robinson 提交于
      The current semantics of non-persistent hotplug/update are confusing: the
      changes will persist as long as the in memory domain definition isn't
      overwritten. This means hotplug changes stay around until the domain is
      redefined or libvirtd is restarted.
      
      Call virDomainObjSetDefTransient at VM startup, so that we properly discard
      hotplug changes when the VM is shutdown.
      45ec297d
  13. 12 11月, 2010 2 次提交
    • D
      Wire up virDomainOpenConsole for LXC, Xen and UML · 5fb9db27
      Daniel P. Berrange 提交于
      Introduce implementations of the virDomainOpenConsole() API
      for LXC, Xen and UML drivers.
      
      * src/lxc/lxc_driver.c, src/lxc/lxc_driver.c,
        src/xen/xen_driver.c: Wire up virDomainOpenConsole
      5fb9db27
    • D
      Introduce a virDomainOpenConsole API · 88a9b382
      Daniel P. Berrange 提交于
      To enable virsh console (or equivalent) to be used remotely
      it is necessary to provide remote access to the /dev/pts/XXX
      pseudo-TTY associated with the console/serial/parallel device
      in the guest. The virStream API provide a bi-directional I/O
      stream capability that can be used for this purpose. This
      patch thus introduces a virDomainOpenConsole API that uses
      the stream APIs.
      
      * src/libvirt.c, src/libvirt_public.syms,
        include/libvirt/libvirt.h.in, src/driver.h: Define the
        new virDomainOpenConsole API
      * 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: Stub
        API entry point
      88a9b382
  14. 10 11月, 2010 1 次提交
    • S
      bye to close(), welcome to VIR_(FORCE_)CLOSE() · 60ae1c34
      Stefan Berger 提交于
      Using automated replacement with sed and editing I have now replaced all
      occurrences of close() with VIR_(FORCE_)CLOSE() except for one, of
      course. Some replacements were straight forward, others I needed to pay
      attention. I hope I payed attention in all the right places... Please
      have a look. This should have at least solved one more double-close
      error.
      60ae1c34
  15. 09 11月, 2010 1 次提交
  16. 21 10月, 2010 1 次提交
  17. 20 10月, 2010 2 次提交
    • G
      Don't fail lxc domain start when memory controller support is missing · 679b464b
      Guido Günther 提交于
      Debian stock kernel has CONFIG_CGROUP_MEM_RES_CTLR disabled due to the
      overhead [1]. Allow to start containers if the corresponding files in
      the cgroup filesystem are missing. This fixes Debian bug #566180 [2].
      
      [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=534964
      [2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=566180
      679b464b
    • E
      vcpu: define internal driver API · dd255d64
      Eric Blake 提交于
      * src/driver.h (virDrvDomainSetVcpusFlags)
      (virDrvDomainGetVcpusFlags): New typedefs.
      (_virDriver): New callback members.
      * src/esx/esx_driver.c (esxDriver): Add stub for driver.
      * src/lxc/lxc_driver.c (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDriver): Likewise.
      * src/phyp/phyp_driver.c (phypDriver): Likewise.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/test/test_driver.c (testDriver): Likewise.
      * src/uml/uml_driver.c (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (Driver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.
      dd255d64
  18. 13 10月, 2010 4 次提交
  19. 03 9月, 2010 1 次提交
    • E
      lxc: avoid large stacks with veth creation · f694036f
      Eric Blake 提交于
      * src/lxc/veth.h (vethCreate): Change prototype.
      * src/lxc/veth.c (vethCreate): Always malloc veth2, and allocate
      veth1 if needed.
      (getFreeVethName): Adjust signature, and use virAsprintf.
      * src/lxc/lxc_driver.c (lxcSetupInterfaces): Adjust caller.
      f694036f
  20. 30 7月, 2010 1 次提交
    • R
      lxc: Fix return values of veth.c functions · 938f2dbd
      Ryota Ozaki 提交于
      Previously, the functions in src/lxc/veth.c could sometimes return
      positive values on failure rather than -1. This made accurate error
      reporting difficult, and led to one failure to catch an error in a
      calling function.
      
      This patch makes all the functions in veth.c consistently return 0 on
      success, and -1 on failure. It also fixes up the callers to the veth.c
      functions where necessary.
      
      Note that this patch may be related to the bug:
      
        https://bugzilla.redhat.com/show_bug.cgi?id=607496.
      
      It will not fix the bug, but should unveil what happens.
      
      * po/POTFILES.in - add veth.c, which previously had no translatable strings
      * src/lxc/lxc_controller.c
      * src/lxc/lxc_container.c
      * src/lxc/lxc_driver.c    - fixup callers to veth.c, and remove error logs,
                                  as they are now done in veth.c
      * src/lxc/veth.c - make all functions consistently return -1 on error.
      * src/lxc/veth.h - use ATTRIBUTE_NONNULL to protect against NULL args.
      938f2dbd
  21. 29 7月, 2010 1 次提交
  22. 24 7月, 2010 1 次提交
    • C
      Qemu Monitor API entry point. · 21adf03c
      Chris Lalancette 提交于
      Add the library entry point for the new virDomainQemuMonitorCommand()
      entry point.  Because this is not part of the "normal" libvirt API,
      it gets its own header file, library file, and will eventually
      get its own over-the-wire protocol later in the series.
      
      Changes since v1:
       - Go back to using the virDriver table for qemuDomainMonitorCommand, due to
         linking issues
       - Added versioning information to the libvirt-qemu.so
      
      Changes since v2:
       - None
      
      Changes since v3:
       - Add LGPL header to libvirt-qemu.c
       - Make virLibConnError and virLibDomainError macros instead of function calls
      
      Changes since v4:
       - Move exported symbols to libvirt_qemu.syms
      Signed-off-by: NChris Lalancette <clalance@redhat.com>
      21adf03c
  23. 29 6月, 2010 1 次提交
    • R
      lxc: Fix virsh console doesn't work after restarting libvirtd · 1c46f4cc
      Ryota Ozaki 提交于
      Because tty path is unexpectedly not saved in the live configuration
      file of a domain, libvirtd cannot get the console of the domain back
      after restarting.
      
      The reason why the tty path isn't saved is that, to save the tty path,
      the save function, virDomainSaveConfig, requires that the target domain
      is running (pid != -1), however, lxc driver calls the function before
      starting the domain to pass the configuration to controller.
      
      To ensure to save the tty path, the patch lets lxc driver call the save
      function again after starting the domain.
      1c46f4cc
  24. 15 6月, 2010 2 次提交
    • E
      drivers: add virDomainCreateWithFlags if virDomainCreate exists · de3aadaa
      Eric Blake 提交于
      * src/esx/esx_driver.c (esxDomainCreate): Move guts...
      (esxDomainCreateWithFlags): ...to new function.
      (esxDriver): Trivially support the new API.
      * src/lxc/lxc_driver.c (lxcDomainStart, lxcDomainStartWithFlags)
      (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDomainStart)
      (oneDomainStartWithFlags, oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDomainCreate)
      (openvzDomainCreateWithFlags, openvzDriver): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainStart)
      (qemudDomainStartWithFlags, qemuDriver): Likewise.
      * src/test/test_driver.c (testDomainCreate)
      (testDomainCreateWithFlags, testDriver): Likewise.
      * src/uml/uml_driver.c (umlDomainStart, umlDomainStartWithFlags)
      (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainCreate)
      (vboxDomainCreateWithFlags, Driver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainCreate)
      (xenUnifiedDomainCreateWithFlags, xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDomainCreate)
      (xenapiDomainCreateWithFlags, xenapiDriver): Likewise.
      de3aadaa
    • E
      libvirt: introduce domainCreateWithFlags API · 460ca88b
      Eric Blake 提交于
      Persistent domain creation needs the same features as transient
      domains, but virDomainCreate lacks the flags argument present in
      virDomainCreateXML.  virDomainCreateFlags is already claimed as
      a public enum, so we have to break convention and expose
      virDomainCreateWithFlags.
      
      * include/libvirt/libvirt.h.in (virDomainCreateWithFlags): Add.
      * src/driver.h (virDrvDomainCreateWithFlags): Internal API.
      * src/libvirt.c (virDomainCreateWithFlags): Glue public API to
      driver API.
      * src/libvirt_public.syms (LIBVIRT_0.8.2): Expose public API.
      * src/esx/esx_driver.c (esxDriver): Add stub for driver.
      * src/lxc/lxc_driver.c (lxcDriver): Likewise.
      * src/opennebula/one_driver.c (oneDriver): Likewise.
      * src/openvz/openvz_driver.c (openvzDriver): Likewise.
      * src/phyp/phyp_driver.c (phypDriver): Likewise.
      * src/qemu/qemu_driver.c (qemuDriver): Likewise.
      * src/remote/remote_driver.c (remote_driver): Likewise.
      * src/test/test_driver.c (testDriver): Likewise.
      * src/uml/uml_driver.c (umlDriver): Likewise.
      * src/vbox/vbox_tmpl.c (Driver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDriver): Likewise.
      460ca88b
  25. 09 6月, 2010 1 次提交
    • E
      virDomainCreateXML: support new flag · 2502ebb3
      Eric Blake 提交于
      * include/libvirt/libvirt.h.in (virDomainCreateFlags): Add
      VIR_DOMAIN_START_PAUSED.
      * src/libvirt.c (virDomainCreateXML): Update documentation.
      * src/lxc/lxc_driver.c (lxcDomainCreateAndStart): Reject new flag
      as unimplemented.
      * src/opennebula/one_driver.c (oneDomainCreateAndStart):
      Likewise.
      * src/openvz/openvz_driver.c (openvzDomainCreateXML): Likewise.
      * src/phyp/phyp_driver.c (phypDomainCreateAndStart): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainCreate): Likewise.
      * src/test/test_driver.c (testDomainCreateXML): Likewise.
      * src/uml/uml_driver.c (umlDomainCreate): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainCreateXML): Likewise.
      * src/xen/xend_internal.c (xenDaemonCreateXML): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDomainCreateXML): Likewise.
      2502ebb3
  26. 25 5月, 2010 1 次提交
  27. 18 5月, 2010 1 次提交
  28. 04 5月, 2010 3 次提交
  29. 03 5月, 2010 1 次提交
    • R
      lxc: Fix failure on starting a domain with multiple interfaces · d2ac3c2f
      Ryota Ozaki 提交于
      [Error message]
      error: Failed to start domain lxc_test1
      error: internal error Failed to create veth device pair: 512
      
      The reason of the failure is that lxc driver unexpectedly re-uses
      an auto-assigned veth name and tries to create the created veth
      again. The failure will happen when a domain has multiple network
      interfaces and the names of those are not specified in XML.
      
      The patch fixes the problem by resetting buffers of veth names
      in every iteration of creating veth.
      
      * src/lxc/lxc_driver.c: prevent re-using auto-assigned veth name
        Reported by Kumar L Srikanth-B22348.
      d2ac3c2f
  30. 30 4月, 2010 1 次提交
    • D
      Internal driver API infrastructure for virDomainGetBlockInfo · 46bad512
      Daniel P. Berrange 提交于
      This defines the internal driver API and stubs out each driver
      
      * src/driver.h: Define virDrvDomainGetBlockInfo signature
      * src/libvirt.c, src/libvirt_public.syms: Glue public API to drivers
      * 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/test/test_driver.c, src/uml/uml_driver.c, src/vbox/vbox_tmpl.c,
        src/xen/xen_driver.c, src/xenapi/xenapi_driver.c: Stub out driver
      46bad512