1. 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
  2. 09 11月, 2010 10 次提交
    • D
      Support SPICE channel security options · b0ef5c53
      Daniel P. Berrange 提交于
      This extends the SPICE XML to allow channel security options
      
          <graphics type='spice' port='-1' tlsPort='-1' autoport='yes'>
            <channel name='main' mode='secure'/>
            <channel name='record' mode='insecure'/>
          </graphics>
      
      Any non-specified channel uses the default, which allows both
      secure & insecure usage
      
      * src/conf/domain_conf.c, src/conf/domain_conf.h,
        src/libvirt_private.syms: Add XML syntax for specifying per
        channel security options for spice.
      * src/qemu/qemu_conf.c: Configure channel security with spice
      b0ef5c53
    • D
      Support multiple QXL video cards · 6794a44b
      Daniel P. Berrange 提交于
      QEMU crashes & burns if you try multiple Cirrus video cards, but
      QXL copes fine. Adapt QEMU config code to allow multiple QXL
      video cards
      
      * src/qemu/qemu_conf.c: Support multiple QXL video cards
      6794a44b
    • D
      Define XML syntax for password expiry · 7a696678
      Daniel P. Berrange 提交于
      This extends the XML syntax for <graphics> to allow a password
      expiry time to be set
      
      eg
      
        <graphics type='vnc' port='5900' autoport='yes' keymap='en-us' passwd='12345' passwdValidTo='2010-04-09T15:51:00'/>
      
      The timestamp is in UTC.
      
      * src/conf/domain_conf.h: Pull passwd out into separate struct
        virDomainGraphicsAuthDef to allow sharing between VNC & SPICE
      * src/conf/domain_conf.c: Add parsing/formatting of new passwdValidTo
        argument
      * src/opennebula/one_conf.c, src/qemu/qemu_conf.c, src/qemu/qemu_driver.c,
        src/xen/xend_internal.c, src/xen/xm_internal.c: Update for changed
        struct containing VNC password
      7a696678
    • D
      Add SPICE support for QEMU driver configuration file · b5c99209
      Daniel P. Berrange 提交于
      In common with VNC, the QEMU driver configuration file is used
      specify the host level TLS certificate location and a default
      password / listen address
      
      * src/qemu/qemu.conf: Add spice_listen, spice_tls,
        spice_tls_x509_cert_dir & spice_password config params
      * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Parsing of
        spice config parameters and updating -spice arg generation
        to use them
      * tests/qemuxml2argvdata/qemuxml2argv-graphics-spice-rhel6.args,
        tests/qemuxml2argvtest.c: Expand test case to cover driver
        level configuration
      b5c99209
    • D
      Support automatic port number allocation for SPICE · ed0d9f6c
      Daniel P. Berrange 提交于
      * src/qemu/qemu_driver.c: Allocate the TCP ports for SPICE
        before starting guest
      ed0d9f6c
    • D
      Implement QEMU/KVM support for SPICE graphics · 9b57fa65
      Daniel P. Berrange 提交于
      This supports the -spice argument posted for review against
      the latest upstream QEMU/KVM. This supports the bare minimum
      config with port, TLS port & listen address. The x509 bits are
      added in a later patch.
      
      * src/qemu_conf.c, src/qemu_conf.h: Add SPICE flag. Check for
        -spice availability. Format -spice arg for command line
      * qemuhelptest.c: Add SPICE flag
      * qemuxml2argvdata/qemuxml2argv-graphics-spice.args: Add <graphics>
        for spice
      * qemuxml2argvdata/qemuxml2argv-graphics-spice.xml: Add -spice arg
      * qemuxml2argvtest.c: Add SPICE flag
      9b57fa65
    • D
      Implement QEMU/KVM QXL video card support in QEMU driver · 635f9ca1
      Daniel P. Berrange 提交于
      This supports the '-vga qxl' parameter in upstream QEMU/KVM
      which has SPICE support added. This isn't particularly useful
      until you get the next patch for -spice support. Also note that
      while the libvirt XML supports multiple video devices, this
      patch only supports a single one. A later patch can add support
      for 2nd, 3rd, etc PCI devices for QXL
      
      * src/qemu/qemu_conf.h: Flag for QXL support
      * src/qemu/qemu_conf.c: Probe for '-vga qxl' support and implement it
      * tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c,
        tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.args,
        tests/qemuxml2argvdata/qemuxml2argv-graphics-spice.xml: Test
        case for generating spice args with RHEL6 kvm
      635f9ca1
    • D
      Add a <graphics> type for SPICE protocol · c909091b
      Daniel P. Berrange 提交于
      This adds an element
      
       <graphics type='spice' port='5903' tlsPort='5904' autoport='yes' listen='127.0.0.1'/>
      
      This is the bare minimum that should be exposed in the guest
      config for SPICE. Other parameters are better handled as per
      host level configuration tunables
      
      * docs/schemas/domain.rng: Define the SPICE <graphics> schema
      * src/domain_conf.h, src/domain_conf.c: Add parsing and formatting
        for SPICE graphics config
      * src/qemu_conf.c: Complain about unsupported graphics types
      c909091b
    • D
      Add a QXL graphics card type to domain XML schema · 3cf5b6f7
      Daniel P. Berrange 提交于
      * src/qemu_conf.c: Add dummy entry in enumeration
      * docs/schemas/domain.rng: Add 'qxl' as a type for the <video> tag
      * src/domain_conf.c, src/domain_conf.h: Add QXL to video type
        enumerations
      3cf5b6f7
    • J
      qemu: Fix non-literal format string · 0011e917
      Jiri Denemark 提交于
      0011e917
  3. 08 11月, 2010 2 次提交
    • D
      Add sysinfo/smbios support to the QEmu driver · 54c0237c
      Daniel Veillard 提交于
      The patch is based on the possiblity in the QEmu command line to
      add -smbios options allowing to override the default values picked
      by QEmu. We need to detect this first from QEmu help output.
      If the domain is defined with smbios to be inherited from host
      then we pass the values coming from the Host own SMBIOS, but
      if the domain is defined with smbios to come from sysinfo, we
      use the ones coming from the domain definition.
      
      * src/qemu/qemu_conf.h: add the QEMUD_CMD_FLAG_SMBIOS_TYPE enum
        value
      * src/qemu/qemu_conf.c: scan the help output for the smbios support,
        and if available add support based on the domain definitions,
        and host data
      * tests/qemuhelptest.c: add the new enum in the outputs
      54c0237c
    • D
      Read the host sysinfo for the QEmu driver · 1e4c4599
      Daniel Veillard 提交于
      Read and store the data when initializing the driver.
      1e4c4599
  4. 06 11月, 2010 1 次提交
  5. 02 11月, 2010 3 次提交
    • D
      Misc error handling fixes in text mode monitor commands · a1de6ba0
      Daniel P. Berrange 提交于
      A couple of places in the text monitor were overwriting the
      'ret' variable with a >= 0 value before success was actually
      determined. So later error paths would not correctly return
      the -1 value. The drive_add code was not checking for errors
      like missing command
      
      * src/qemu/qemu_monitor_text.c: Misc error handling fixes
      a1de6ba0
    • D
      Revert commit 06f81c63 · a51ccaf8
      Daniel P. Berrange 提交于
      Commit 06f81c63 attempted to make
      QEMU driver ignore the failure to relabel 'stdin_path' if it was
      on NFS. The actual result was that it ignores *all* failures to
      label any aspect of the VM, unless stdin_path is non-NULL and
      is not on NFS.
      
      * src/qemu/qemu_driver.c: Treat all relabel failures as terminal
      a51ccaf8
    • D
      qemu: add the USB devices to the cgroup whitelist · 5919afe3
      Diego Elio Pettenò 提交于
      Make sure that the QEmu process within the cgroup can access the device
      file for the USB device that has to be connected to the virtual domain.
      5919afe3
  6. 30 10月, 2010 2 次提交
    • K
    • K
      add compression support for "virsh dump" · 95a17abd
      KAMEZAWA Hiroyuki 提交于
      Add dump_image_format[] to qemu.conf and support compressed dump
      at virsh dump. coredump compression is important for saving disk space
      in an environment where multiple guests run.
      
      In general, "disk space for dump" is specially allocated and will be
      a dead space in the system. It's used only at emergency. So, it's better
      to have both of save_image_format and dump_image_format. "save" is done
      in scheduled manner with enough calculated disk space for it.
      
      This code reuses some of save_image_format[] and supports the same format.
      
      Changelog:
       - modified libvirtd_qemu.aug
       - modified test_libvirtd_qemu.aug
       - fixed error handling of qemudSaveCompressionTypeFromString()
      95a17abd
  7. 29 10月, 2010 1 次提交
    • L
      qemu_driver: add virCgroupMounted · 41b2cee2
      Lai Jiangshan 提交于
      When we mount any cgroup without "-o devices", we will fail to start vms:
      
      error: Failed to start domain vm1
      error: Unable to deny all devices for vm1: No such file or directory
      
      When we mount any cgroup without "-o cpu", we will fail to get schedinfo:
      Scheduler      : posix
      error: unable to get cpu shares tunable: No such file or directory
      
      We should only use the cgroup controllers which are mounted on host.
      So I add virCgroupMounted() for qemuCgroupControllerActive()
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      41b2cee2
  8. 28 10月, 2010 5 次提交
  9. 27 10月, 2010 1 次提交
  10. 26 10月, 2010 2 次提交
    • E
      qemu: work around dash 0.5.5 bug in managed save · f22e670b
      Eric Blake 提交于
      Older dash mistakenly truncates regular files when using <> redirection;
      this kills our use of double dd to reduce storage overhead when
      saving qemu images.  But qemu insists on running a command through
      /bin/sh, so we work around it by having qemu run $sh -c 'real command'
      when we have a replacement $sh in mind.
      
      * configure.ac (VIR_WRAPPER_SHELL): Define to a replacement shell,
      if /bin/sh is broken on <> redirection.
      * src/qemu/qemu_monitor.h (VIR_WRAPPER_SHELL_PREFIX)
      (VIR_WRAPPER_SHELL_SUFFIX): New macros.
      * src/qemu/qemu_monitor_text.c (qemuMonitorTextMigrateToFile): Use
      them.
      * src/qemu/qemu_monitor_json.c (qemuMonitorJSONMigrateToFile):
      Likewise.
      f22e670b
    • J
      qemu: Fix detection of drive readonly option · 69b75521
      Jiri Denemark 提交于
      So far, readonly=on option is used when qemu supports -device. However,
      there are qemu versions which support readonly option with -drive
      although they don't have support for -device.
      69b75521
  11. 22 10月, 2010 1 次提交
    • D
      Expand virSocketFormat to be more flexible · 497adba2
      Daniel P. Berrange 提交于
      The getnameinfo() function is more flexible than inet_ntop()
      avoiding the need to if/else the code based on socket family.
      Also make it support UNIX socket addrs and allow inclusion
      of a port (service) address. Finally do proper error reporting
      via normal APIs.
      
      * src/conf/domain_conf.c, src/nwfilter/nwfilter_ebiptables_driver.c,
        src/qemu/qemu_conf.c: Fix error handling with virSocketFormat
      * src/util/network.c: Rewrite virSocketFormat to use getnameinfo
        and cope with UNIX socket addrs.
      497adba2
  12. 21 10月, 2010 3 次提交
  13. 20 10月, 2010 7 次提交
    • J
      Add process= support for 'qemu-kvm -name' · c08c7b01
      John Morrissey 提交于
      This sets the process name to the same value as the Windows title,
      but since the name is limited to 16 chars only this is kept as a
      configuration option and turned off by default
      * src/qemu/qemu.conf src/qemu/qemu_conf.[ch]: hceck for support in the
        QEmu help output, add the option in qemu conf file and augment
        qemudBuildCommandLine to add it if switched on
      * src/qemu/libvirtd_qemu.aug src/qemu/test_libvirtd_qemu.aug: augment
        the augeas lenses accordingly
      * tests/qemuhelptest.c: cope with the extra flag being detected now
      c08c7b01
    • M
      Audit VM start/stop/suspend/resume · a8b5f9bd
      Miloslav Trmač 提交于
      Most operations are audited at the libvirtd level; auditing in
      src/libvirt.c would result in two audit entries per operation (one in
      the client, one in libvirtd).
      
      The only exception is a domain stopping of its own will (e.g. because
      the user clicks on "shutdown" inside the interface).  There can often be
      no client connected at the time the domain stops, so libvirtd does not
      have any virConnectPtr object on which to attach an event watch.  This
      patch therefore adds auditing directly inside the qemu driver (other
      drivers are not supported).
      a8b5f9bd
    • E
      vcpu: complete vcpu support in qemu driver · 28a36059
      Eric Blake 提交于
      * src/qemu/qemu_driver.c (qemudDomainSetVcpusFlags)
      (qemudDomainGetVcpusFlags): Support all feasible flag
      combinations.
      28a36059
    • E
      vcpu: improve vcpu support in qemu command line · d67c189e
      Eric Blake 提交于
      * src/qemu/qemu_conf.c (qemuParseCommandLineSmp): Distinguish
      between vcpus and maxvcpus, for new enough qemu.
      * tests/qemuargv2xmltest.c (mymain): Add new test.
      * tests/qemuxml2argvtest.c (mymain): Likewise.
      * tests/qemuxml2xmltest.c (mymain): Likewise.
      * tests/qemuxml2argvdata/qemuxml2argv-smp.args: New file.
      d67c189e
    • E
      vcpu: support maxvcpu in domain_conf · 4617eedf
      Eric Blake 提交于
      Although this patch adds a distinction between maximum vcpus and
      current vcpus in the XML, the values should be identical for all
      drivers at this point.  Only in subsequent per-driver patches will
      a distinction be made.
      
      In general, virDomainGetInfo should prefer the current vcpus.
      
      * src/conf/domain_conf.h (_virDomainDef): Adjust vcpus to unsigned
      short, to match virDomainGetInfo limit.  Add maxvcpus member.
      * src/conf/domain_conf.c (virDomainDefParseXML)
      (virDomainDefFormat): parse and print out vcpu details.
      * src/xen/xend_internal.c (xenDaemonParseSxpr)
      (xenDaemonFormatSxpr): Manage both vcpu numbers, and require them
      to be equal for now.
      * src/xen/xm_internal.c (xenXMDomainConfigParse)
      (xenXMDomainConfigFormat): Likewise.
      * src/phyp/phyp_driver.c (phypDomainDumpXML): Likewise.
      * src/openvz/openvz_conf.c (openvzLoadDomains): Likewise.
      * src/openvz/openvz_driver.c (openvzDomainDefineXML)
      (openvzDomainCreateXML, openvzDomainSetVcpusInternal): Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxDomainDefineXML):
      Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDomainDumpXML): Likewise.
      * src/xenapi/xenapi_utils.c (createVMRecordFromXml): Likewise.
      * src/esx/esx_vmx.c (esxVMX_ParseConfig, esxVMX_FormatConfig):
      Likewise.
      * src/qemu/qemu_conf.c (qemuBuildSmpArgStr)
      (qemuParseCommandLineSmp, qemuParseCommandLine): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainHotplugVcpus): Likewise.
      * src/opennebula/one_conf.c (xmlOneTemplate): Likewise.
      4617eedf
    • E
      vcpu: make old API trivially wrap to new API · 50c51f13
      Eric Blake 提交于
      Note - this wrapping is completely mechanical; the old API will
      function identically, since the new API validates that the exact
      same flags are provided by the old API.  On a per-driver basis,
      it may make sense to have the old API pass a different set of flags,
      but that should be done in the per-driver patch that implements
      the full range of flag support in the new API.
      
      * src/esx/esx_driver.c (esxDomainSetVcpus, escDomainGetMaxVpcus):
      Move guts...
      (esxDomainSetVcpusFlags, esxDomainGetVcpusFlags): ...to new
      functions.
      (esxDriver): Trivially support the new API.
      * src/openvz/openvz_driver.c (openvzDomainSetVcpus)
      (openvzDomainSetVcpusFlags, openvzDomainGetMaxVcpus)
      (openvzDomainGetVcpusFlags, openvzDriver): Likewise.
      * src/phyp/phyp_driver.c (phypDomainSetCPU)
      (phypDomainSetVcpusFlags, phypGetLparCPUMAX)
      (phypDomainGetVcpusFlags, phypDriver): Likewise.
      * src/qemu/qemu_driver.c (qemudDomainSetVcpus)
      (qemudDomainSetVcpusFlags, qemudDomainGetMaxVcpus)
      (qemudDomainGetVcpusFlags, qemuDriver): Likewise.
      * src/test/test_driver.c (testSetVcpus, testDomainSetVcpusFlags)
      (testDomainGetMaxVcpus, testDomainGetVcpusFlags, testDriver):
      Likewise.
      * src/vbox/vbox_tmpl.c (vboxDomainSetVcpus)
      (vboxDomainSetVcpusFlags, virDomainGetMaxVcpus)
      (virDomainGetVcpusFlags, virDriver): Likewise.
      * src/xen/xen_driver.c (xenUnifiedDomainSetVcpus)
      (xenUnifiedDomainSetVcpusFlags, xenUnifiedDomainGetMaxVcpus)
      (xenUnifiedDomainGetVcpusFlags, xenUnifiedDriver): Likewise.
      * src/xenapi/xenapi_driver.c (xenapiDomainSetVcpus)
      (xenapiDomainSetVcpusFlags, xenapiDomainGetMaxVcpus)
      (xenapiDomainGetVcpusFlags, xenapiDriver): Likewise.
      (xenapiError): New helper macro.
      50c51f13
    • 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
  14. 19 10月, 2010 1 次提交
    • D
      root_squash: virFileOperation may fail with EPERM too · b2c9a879
      Dan Kenigsberg 提交于
      Over root-squashing nfs, when virFileOperation() is called as uid==0,
      it may fail with EACCES, but also with EPERM, due to
      virFileOperationNoFork()'s failed attemp to chown a writable file.
      
      qemudDomainSaveFlag() should expect this case, too.
      b2c9a879