1. 20 10月, 2010 17 次提交
    • D
      Basic framework for auditing integration · 8f680ad3
      Daniel P. Berrange 提交于
      Integrate with libaudit.so for auditing of important operations.
      libvirtd gains a couple of config entries for auditing. By
      default it will enable auditing, if its enabled on the host.
      It can be configured to force exit if auditing is disabled
      on the host. It will can also send audit messages via libvirt
      internal logging API
      
      Places requiring audit reporting can use the VIR_AUDIT
      macro to report data. This is a no-op unless auditing is
      enabled
      
      * autobuild.sh, mingw32-libvirt.spec.in: Disable audit
        on mingw
      * configure.ac: Add check for libaudit
      * daemon/libvirtd.aug, daemon/libvirtd.conf,
        daemon/test_libvirtd.aug, daemon/libvirtd.c: Add config
        options to enable auditing
      * include/libvirt/virterror.h, src/util/virterror.c: Add
        VIR_FROM_AUDIT source
      * libvirt.spec.in: Enable audit
      * src/util/virtaudit.h, src/util/virtaudit.c: Simple internal
        API for auditing messages
      8f680ad3
    • D
      Fix statstest when driver modules are enabled · ba5c9aff
      Daniel P. Berrange 提交于
      The statstest is xen specific. Instead of filling the code with
      a huge number of #ifdef WITH_XEN, just make its entire compilation
      conditional in the Makefile.am. Also ensure it links to the Xen
      driver so that it builds when driver modules are enabled
      
      * tests/Makefile.am: Make statstest xen conditional. Link to
        xen driver
      * tests/Makefile.am: Remove all conditionals
      ba5c9aff
    • E
      virsh: consolidate memtune docs · 9b372562
      Eric Blake 提交于
      * tools/virsh.pod (memtune): Drop second copy, fill to 80 columns,
      enhance wording.
      9b372562
    • E
      vcpu: remove dead xen code · b0137887
      Eric Blake 提交于
      * src/xen/xen_driver.h (xenUnifiedDriver): Remove now-unused
      domainGetMaxVcpus, domainSetVcpus.
      * src/xen/proxy_internal.c (xenProxyDriver): Likewise.
      * src/xen/xen_hypervisor.c (xenHypervisorDriver): Likewise.
      * src/xen/xen_inotify.c (xenInotifyDriver): Likewise.
      * src/xen/xend_internal.c (xenDaemonDriver)
      (xenDaemonDomainSetVcpus): Likewise.
      * src/xen/xm_internal.c (xenXMDriver, xenXMDomainSetVcpus):
      Likewise.
      * src/xen/xs_internal.c (xenStoreDriver): Likewise.
      b0137887
    • E
      vcpu: improve support for setting xen vcpu counts · e443a003
      Eric Blake 提交于
      Tested with RHEL 5.6 (xendConfigVersion 2, where xend_internal
      controls live domains and xm_internal controls inactive domains).
      Hopefully this works with xendConfigVersion 3 (where xend_internal
      controls everything).
      
      * src/xen/xen_driver.c (xenUnifiedDomainSetVcpusFlags): Support
      more flags.
      (xenUnifiedGetMaxVcpus): Export.
      * src/xen/xm_internal.h (xenXMDomainSetVcpusFlags): New prototype.
      * src/xen/xend_internal.h (xenDaemonDomainSetVcpusFlags): Likewise.
      * src/xen/xen_driver.h (xenUnifiedGetMaxVcpus): Likewise.
      * src/xen/xm_internal.c (xenXMDomainSetVcpusFlags): New function.
      * src/xen/xend_internal.c (xenDaemonDomainSetVcpusFlags): Likewise.
      e443a003
    • E
      vcpu: improve support for getting xen vcpu counts · 290ea331
      Eric Blake 提交于
      * src/xen/xen_driver.c (xenUnifiedDomainGetVcpusFlags): Support
      more flags.
      * src/xen/xend_internal.h (xenDaemonDomainGetVcpusFlags): New
      prototype.
      * src/xen/xm_internal.h (xenXMDomainGetVcpusFlags): Likewise.
      * src/xen/xend_internal.c (virDomainGetVcpusFlags): New function.
      * src/xen/xm_internal.c (xenXMDomainGetVcpusFlags): Likewise.
      290ea331
    • E
      vcpu: improve vcpu support in xen command line · 0fab10e5
      Eric Blake 提交于
      This patch series focuses on xendConfigVersion 2 (xm_internal) and 3
      (xend_internal), but leaves out changes for xenapi drivers.
      
      See this link for more details about vcpu_avail for xm usage.
      http://lists.xensource.com/archives/html/xen-devel/2009-11/msg01061.html
      
      This relies on the fact that def->maxvcpus can be at most 32 with xen.
      
      * src/xen/xend_internal.c (xenDaemonParseSxpr)
      (sexpr_to_xend_domain_info, xenDaemonFormatSxpr): Use vcpu_avail
      when current vcpus is less than maximum.
      * src/xen/xm_internal.c (xenXMDomainConfigParse)
      (xenXMDomainConfigFormat): Likewise.
      * tests/xml2sexprdata/xml2sexpr-pv-vcpus.sexpr: New file.
      * tests/sexpr2xmldata/sexpr2xml-pv-vcpus.sexpr: Likewise.
      * tests/sexpr2xmldata/sexpr2xml-pv-vcpus.xml: Likewise.
      * tests/xmconfigdata/test-paravirt-vcpu.cfg: Likewise.
      * tests/xmconfigdata/test-paravirt-vcpu.xml: Likewise.
      * tests/xml2sexprtest.c (mymain): New test.
      * tests/sexpr2xmltest.c (mymain): Likewise.
      * tests/xmconfigtest.c (mymain): Likewise.
      0fab10e5
    • 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 all flags in test driver · 6c9e6b95
      Eric Blake 提交于
      * src/test/test_driver.c (testDomainGetVcpusFlags)
      (testDomainSetVcpusFlags): Support all flags.
      (testDomainUpdateVCPUs): Update cpu count here.
      6c9e6b95
    • E
      vcpu: add virsh support · bf945ee9
      Eric Blake 提交于
      * tools/virsh.c (cmdSetvcpus): Add new flags.  Let invalid
      commands through to driver, to ease testing of hypervisor argument
      validation.
      (cmdMaxvcpus, cmdVcpucount): New commands.
      (commands): Add new commands.
      * tools/virsh.pod (setvcpus, vcpucount, maxvcpus): Document new
      behavior.
      bf945ee9
    • 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: implement the remote protocol · eb826444
      Eric Blake 提交于
      Done by editing the first three files, then running
      'make -C src rpcgen', then editing src/remote_protocol-structs
      to match.
      
      * daemon/remote.c (remoteDispatchDomainSetVcpusFlags)
      (remoteDispatchDomainGetVcpusFlags): New functions.
      * src/remote/remote_driver.c (remoteDomainSetVcpusFlags)
      (remoteDomainGetVcpusFlags, remote_driver): Client side
      serialization.
      * src/remote/remote_protocol.x
      (remote_domain_set_vcpus_flags_args)
      (remote_domain_get_vcpus_flags_args)
      (remote_domain_get_vcpus_flags_ret)
      (REMOTE_PROC_DOMAIN_SET_VCPUS_FLAGS)
      (REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS): Define wire format.
      * daemon/remote_dispatch_args.h: Regenerate.
      * daemon/remote_dispatch_prototypes.h: Likewise.
      * daemon/remote_dispatch_table.h: Likewise.
      * src/remote/remote_protocol.c: Likewise.
      * src/remote/remote_protocol.h: Likewise.
      * src/remote_protocol-structs: Likewise.
      eb826444
    • E
      vcpu: implement the public APIs · 9d2c6079
      Eric Blake 提交于
      Factors common checks (such as nonzero vcpu count) up front, but
      drivers will still need to do additional flag checks.
      
      * src/libvirt.c (virDomainSetVcpusFlags, virDomainGetVcpusFlags):
      New functions.
      (virDomainSetVcpus, virDomainGetMaxVcpus): Refer to new API.
      9d2c6079
    • 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
    • E
      vcpu: add new public API · ea3f5c68
      Eric Blake 提交于
      API agreed on in
      https://www.redhat.com/archives/libvir-list/2010-September/msg00456.html,
      but modified for enum names to be consistent with virDomainDeviceModifyFlags.
      
      * include/libvirt/libvirt.h.in (virDomainVcpuFlags)
      (virDomainSetVcpusFlags, virDomainGetVcpusFlags): New
      declarations.
      * src/libvirt_public.syms: Export new symbols.
      ea3f5c68
  2. 19 10月, 2010 11 次提交
    • E
      vcpu: add current attribute to <vcpu> element · a74f4e44
      Eric Blake 提交于
      Syntax agreed on in
      https://www.redhat.com/archives/libvir-list/2010-September/msg00476.html
      
      <domain ...>
        <vcpu current='x'>y</vcpu>
      ...
      
      can now be used to specify 1 <= x <= y current vcpus, in relation
      to the boot-time max of y vcpus.  If current is omitted, then
      current and max are assumed to be the same value.
      
      * docs/schemas/domain.rng: Add new attribute.
      * docs/formatdomain.html.in: Document it.
      * tests/qemuxml2argvdata/qemuxml2argv-smp.xml: Add to
      domainschematest.
      * tests/xml2sexprdata/xml2sexpr-pv-vcpus.xml: Likewise.
      a74f4e44
    • S
      nwfilter: changes to rules in VM->host table · 7d79da24
      Stefan Berger 提交于
      In the table built for traffic coming from the VM going to the host make the following changes:
      
      - don't ACCEPT the packets but do a 'RETURN' and let the host-specific firewall rules in subsequent rules evaluate whether the traffic is allowed to enter
      
      - use the '-m state' in the rules as everywhere else
      7d79da24
    • E
      build: avoid false positive syntax-check failure · 6dcd9c0d
      Eric Blake 提交于
      * .x-sc_po_check: Exclude docs directory.
      6dcd9c0d
    • M
      proxy: Fix undefined reference to virClose · 77a81b8a
      Matthias Bolte 提交于
      Add src/util/files.c to libvirt_proxy_SOURCES.
      77a81b8a
    • M
      esx: Handle non-UTF-8 encoded VMX files · 1c616489
      Matthias Bolte 提交于
      ESX(i) uses UTF-8, but a Windows based GSX server writes
      Windows-1252 encoded VMX files.
      
      Add a test case to ensure that libxml2 provides Windows-1252
      to UTF-8 conversion.
      1c616489
    • S
      Introduce VIR_CLOSE to be used rather than close() · f04de501
      Stefan Berger 提交于
      Since bugs due to double-closed file descriptors are difficult to track down in a multi-threaded system, I am introducing the VIR_CLOSE(fd) macro to help avoid mistakes here.
      
      There are lots of places where close() is being used. In this patch I am only cleaning up usage of close() in src/conf where the problems were.
      
      I also dare to declare close() as being deprecated in libvirt code base (HACKING).
      f04de501
    • 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
    • D
      Run initgroups() in qemudOpenAsUID() · b7bd75c4
      Dan Kenigsberg 提交于
      qemudOpenAsUID is intended to open a file with the credentials of a
      specified uid. Current implementation fails if the file is accessible to
      one of uid's groups but not owned by uid.
      
      This patch replaces the supplementary group list that the child process
      inherited from libvirtd with the default group list of uid.
      b7bd75c4
    • N
      memtune: Add min_guarantee to the virsh memtune command · 0a22f542
      Nikunj A. Dadhania 提交于
      * tools/virsh.c: Add new memory tunable "min_guarantee", currently only
        ESX can use this
      * tools/virsh.pod: Update the manpage
      0a22f542
    • N
      Update docs for memory parameters and memtune command · 61dfbf8c
      Nikunj A. Dadhania 提交于
      * docs/formatdomain.html.in: Add memtune element details, added min_guarantee
      * src/libvirt.c: Update virDomainGetMemoryParameters api description, make
        it more clear that the user first needs to call the api to get the number
        of parameters supported and then call again to get the values.
      * tools/virsh.pod: Add usage of new command memtune in virsh manpage
      61dfbf8c
    • D
      qemu: let qemu group look below /var/lib/libvirt/qemu/ · 0df552cd
      Dan Kenigsberg 提交于
      Vdsm needs to communicate with its guest agent via unix domain socket,
      which qemu creates due to the following domain xml device:
      
          <channel type='unix'>
            <target type='virtio' name='com.redhat.rhevm.vdsm'/>
            <source mode='bind' path='/var/lib/libvirt/qemu/channels/fcp-xp-1.com.redhat.rhevm.vdsm'/>
          </channel>
      
      The location of the socket below /var/lib/libvirt/qemu/channels makes
      sense, to humans and selinux policy alike. However, that socket should
      be accessible to vdsm, too.
      
      Due to other (storage) reasons, vdsm is to join the "qemu" group. With
      this patch, vdsm can look below /var/lib/libvirt/qemu and connect to the
      socket.
      
      The socket itself should be chmod'ed to allow qemu group read/write, but
      that's for another project.
      
      BZ#643407
      0df552cd
  3. 16 10月, 2010 6 次提交
  4. 15 10月, 2010 4 次提交
  5. 14 10月, 2010 2 次提交