1. 12 8月, 2014 1 次提交
    • R
      storage: ZFS support · 0257d06b
      Roman Bogorodskiy 提交于
      Implement ZFS storage backend driver. Currently supported
      only on FreeBSD because of ZFS limitations on Linux.
      
      Features supported:
      
       - pool-start, pool-stop
       - pool-info
       - vol-list
       - vol-create / vol-delete
      
      Pool definition looks like that:
      
       <pool type='zfs'>
        <name>myzfspool</name>
        <source>
          <name>actualpoolname</name>
        </source>
       </pool>
      
      The 'actualpoolname' value is a name of the pool on the system,
      such as shown by 'zpool list' command. Target makes no sense
      here because volumes path is always /dev/zvol/$poolname/$volname.
      
      User has to create a pool on his own, this driver doesn't
      support pool creation currently.
      
      A volume could be used with Qemu by adding an entry like this:
      
          <disk type='volume' device='disk'>
            <driver name='qemu' type='raw'/>
            <source pool='myzfspool' volume='vol5'/>
            <target dev='hdc' bus='ide'/>
          </disk>
      0257d06b
  2. 17 7月, 2014 1 次提交
  3. 16 7月, 2014 1 次提交
    • R
      util: virstatslinux: make more generic · 5559a8b8
      Roman Bogorodskiy 提交于
      Rename linuxDomainInterfaceStats to virNetInterfaceStats in order
      to allow adding platform specific implementations without
      making consumer worrying about specific implementation to be used.
      
      Also, rename util/virstatslinux.c to util/virstats.c so placing
      other platform specific implementations into this file don't
      look unexpected from the file name.
      5559a8b8
  4. 03 7月, 2014 2 次提交
    • M
      Introduce domain_capabilities · 614581f3
      Michal Privoznik 提交于
      This new module holds and formats capabilities for emulator. If you
      are about to create a new domain, you may want to know what is the
      host or hypervisor capable of. To make sure we don't regress on the
      XML, the formatting is not something left for each driver to
      implement, rather there's general format function.
      
      The domain capabilities is a lockable object (even though the locking
      is not necessary yet) which uses reference counter.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      614581f3
    • J
      Introduce virBufferCheckError · 058d89b9
      Ján Tomko 提交于
      Check if the buffer is in error state and report an error if it is.
      
      This replaces the pattern:
      if (virBufferError(buf)) {
          virReportOOMError();
          goto cleanup;
      }
      with:
      
      if (virBufferCheckError(buf) < 0)
          goto cleanup;
      
      Document typical buffer usage to favor this.
      Also remove the redundant FreeAndReset - if an error has
      been set via virBufferSetError, the content is already freed.
      058d89b9
  5. 13 6月, 2014 1 次提交
    • R
      bhyve: implement PCI address allocation · aad479dc
      Roman Bogorodskiy 提交于
      Automatically allocate PCI addresses for devices instead
      of hardcoding them in the driver code. The current
      allocation schema is to dedicate an entire slot for each devices.
      
      Also, allow having arbitrary number of devices.
      aad479dc
  6. 10 6月, 2014 1 次提交
    • Y
      Add vbox_snapshot_conf struct · 4dc5d8f1
      Yohan BELLEGUIC 提交于
      This structure contains the data to be saved in the VirtualBox XML file
      and can be manipulated with severals exposed functions.
      The structure is created by vboxSnapshotLoadVboxFile taking the
      machine XML file.
      It also can rewrite the XML by using vboxSnapshotSaveVboxFile.
      4dc5d8f1
  7. 05 6月, 2014 1 次提交
  8. 02 6月, 2014 1 次提交
    • N
      Add helper program to create custom leases · baafe668
      Nehal J Wani 提交于
      Introduce helper program to catch events from dnsmasq and maintain a custom
      lease file per network. It supports dhcpv4 and dhcpv6. The file is saved as
      "<interface-name>.status".
      
      Each lease contains the following info:
      <expiry-time (epoch time)> <mac> <iaid> <ip-address> <hostname> <clientid>
      
      Example of custom leases file content:
      [
          {
              "iaid": "1221229",
              "ip-address": "2001:db8:ca2:2:1::95",
              "mac-address": "52:54:00:12:a2:6d",
              "hostname": "Fedora20",
              "client-id": "00:04:1a:c1:d9:6b:5a:0a:e2:bc:f8:4b:1e:37:2e:38:22:55",
              "expiry-time": 1393244216
          },
          {
              "ip-address": "192.168.150.208",
              "mac-address": "52:54:00:11:56:b3",
              "hostname": "Wani-PC",
              "client-id": "01:52:54:00:11:56:b3",
              "expiry-time": 1393244248
          }
      ]
      
      src/Makefile.am:
         * Add options to compile the helper program
      
      src/network/bridge_driver.c:
         * Introduce networkDnsmasqLeaseFileNameCustom()
         * Invoke helper program along with dnsmasq
         * Delete the .status file when corresponding n/w is destroyed.
      
      src/network/leaseshelper.c
         * Helper program to create the custom lease file
      baafe668
  9. 14 5月, 2014 1 次提交
    • R
      qemu: extract common PCI handling functions · 353cf370
      Roman Bogorodskiy 提交于
      Move sharable PCI handling functions to domain_addr.[ch], and
      change theirs prefix from 'qemu' to 'vir':
      
       - virDomainPCIAddressAsString;
       - virDomainPCIAddressBusSetModel;
       - virDomainPCIAddressEnsureAddr;
       - virDomainPCIAddressFlagsCompatible;
       - virDomainPCIAddressGetNextSlot;
       - virDomainPCIAddressReleaseSlot;
       - virDomainPCIAddressReserveAddr;
       - virDomainPCIAddressReserveNextSlot;
       - virDomainPCIAddressReserveSlot;
       - virDomainPCIAddressSetFree;
       - virDomainPCIAddressSetGrow;
       - virDomainPCIAddressSlotInUse;
       - virDomainPCIAddressValidate;
      
      The only change here is function names, the implementation itself
      stays untouched.
      
      Extract common allocation code from DomainPCIAddressSetCreate
      into virDomainPCIAddressSetAlloc.
      353cf370
  10. 25 4月, 2014 1 次提交
    • D
      Introduce an object for managing firewall rulesets · 3a0ca7de
      Daniel P. Berrange 提交于
      The network and nwfilter drivers both have a need to update
      firewall rules. The currently share no code for interacting
      with iptables / firewalld. The nwfilter driver is fairly
      tied to the concept of creating shell scripts to execute
      which makes it very hard to port to talk to firewalld via
      DBus APIs.
      
      This patch introduces a virFirewallPtr object which is able
      to represent a complete sequence of rule changes, with the
      ability to have multiple transactional checkpoints with
      rollbacks. By formally separating the definition of the rules
      to be applied from the mechanism used to apply them, it is
      also possible to write a firewall engine that uses firewalld
      DBus APIs natively instead of via the slow firewalld-cmd.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      3a0ca7de
  11. 02 4月, 2014 1 次提交
    • E
      conf: move storage encryption type to util/ · 8fc32859
      Eric Blake 提交于
      Encryption keys can be associated with each source file in a
      backing chain; as such, this file belongs more in util/ where
      it can be used by virstoragefile.h.
      
      * src/conf/storage_encryption_conf.h: Rename...
      * src/util/virstorageencryption.h: ...to this.
      * src/conf/storage_encryption_conf.c: Rename...
      * src/util/virstorageencryption.c: ...to this.
      * src/Makefile.am (ENCRYPTION_CONF_SOURCES, CONF_SOURCES)
      (UTIL_SOURCES): Update to new file names.
      * src/libvirt_private.syms: Likewise.
      * src/conf/domain_conf.h: Update client.
      * src/conf/storage_conf.h: Likewise.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      8fc32859
  12. 21 3月, 2014 1 次提交
  13. 11 3月, 2014 2 次提交
  14. 04 3月, 2014 1 次提交
  15. 24 2月, 2014 1 次提交
  16. 19 2月, 2014 1 次提交
    • R
      bhyve: add a basic driver · 0eb4a5f4
      Roman Bogorodskiy 提交于
      At this point it has a limited functionality and is highly
      experimental. Supported domain operations are:
      
        * define
        * start
        * destroy
        * dumpxml
        * dominfo
      
      It's only possible to have only one disk device and only one
      network, which should be of type bridge.
      0eb4a5f4
  17. 13 2月, 2014 1 次提交
    • C
      LXC driver: started implementing connectDomainXMLFromNative · 7195c807
      Cédric Bosdonnat 提交于
      This function aims at converting LXC configuration into a libvirt
      domain XML description to help users migrate from LXC to libvirt.
      
      Here is an example of how the lxc configuration works:
      virsh -c lxc:/// domxml-from-native lxc-tools /var/lib/lxc/migrate_test/config
      
      It is possible that some parts couldn't be properly mapped into a
      domain XML fragment, so users should carefully review the result
      before creating the domain.
      
      fstab files in lxc.mount lines will need to be merged into the
      configuration file as lxc.mount.entry.
      
      As we can't know the amount of memory of the host, we have to set a
      default value for max_balloon that users will probably want to adjust.
      7195c807
  18. 08 1月, 2014 1 次提交
    • E
      maint: improve VIR_ERR_INVALID_DOMAIN usage · 6e130ddc
      Eric Blake 提交于
      In datatype.c, virGetDomainSnapshot could result in the message:
      
      error: invalid domain pointer in bad domain
      
      Furthermore, while there are a few functions in libvirt.c that
      only care about a virDomainPtr without regards to the connection
      (such as virDomainGetName), most functions also require a valid
      connection.  Yet several functions were blindly dereferencing
      the conn member without checking it for validity first (such as
      virDomainOpenConsole).  Rather than try and correct all usage
      of VIR_IS_DOMAIN vs. VIR_IS_CONNECTED_DOMAIN, it is easier to
      just blindly require that a valid domain object always has a
      valid connection object (which should be true anyways, since
      every domain object holds a reference to its connection, so the
      connection will not be closed until all domain objects have
      also been closed to release their reference).
      
      After this patch, all places that validate a domain consistently
      report:
      
      error: invalid domain pointer in someFunc
      
      * src/datatypes.h (virCheckDomainReturn, virCheckDomainGoto): New
      macros.
      * src/datatypes.c (virGetDomainSnapshot): Use new macro.
      (virLibConnError): Delete unused macro.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6e130ddc
  19. 10 12月, 2013 1 次提交
  20. 26 11月, 2013 1 次提交
    • E
      storage: initial support for linking with libgfapi · 318ea3cb
      Eric Blake 提交于
      We support gluster volumes in domain XML, so we also ought to
      support them as a storage pool.  Besides, a future patch will
      want to take advantage of libgfapi to handle the case of a
      gluster device holding qcow2 rather than raw storage, and for
      that to work, we need a storage backend that can read gluster
      storage volume contents.  This sets up the framework.
      
      Note that the new pool is named 'gluster' to match a
      <disk type='network'><source protocol='gluster'> image source
      already supported in a <domain>; it does NOT match the
      <pool type='netfs'><source><target type='glusterfs'>,
      since that uses a FUSE mount to a local file name rather than
      a network name.
      
      This and subsequent patches have been tested against glusterfs
      3.4.1 (available on Fedora 19); there are likely bugs in older
      versions that may prevent decent use of gfapi, so this patch
      enforces the minimum version tested.  A future patch may lower
      the minimum.  On the other hand, I hit at least two bugs in
      3.4.1 that will be fixed in 3.5/3.4.2, where it might be worth
      raising the minimum: glfs_readdir is nicer to use than
      glfs_readdir_r [1], and glfs_fini should only return failure on
      an actual failure [2].
      
      [1] http://lists.gnu.org/archive/html/gluster-devel/2013-10/msg00085.html
      [2] http://lists.gnu.org/archive/html/gluster-devel/2013-10/msg00086.html
      
      * configure.ac (WITH_STORAGE_GLUSTER): New conditional.
      * m4/virt-gluster.m4: new file.
      * libvirt.spec.in (BuildRequires): Support gluster in spec file.
      * src/conf/storage_conf.h (VIR_STORAGE_POOL_GLUSTER): New pool
      type.
      * src/conf/storage_conf.c (poolTypeInfo): Treat similar to
      sheepdog and rbd.
      (virStoragePoolDefFormat): Don't output target for gluster.
      * src/storage/storage_backend_gluster.h: New file.
      * src/storage/storage_backend_gluster.c: Likewise.
      * po/POTFILES.in: Add new file.
      * src/storage/storage_backend.c (backends): Register new type.
      * src/Makefile.am (STORAGE_DRIVER_GLUSTER_SOURCES): Build new files.
      * src/storage/storage_backend.h (_virStorageBackend): Documet
      assumption.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      318ea3cb
  21. 03 10月, 2013 1 次提交
  22. 04 9月, 2013 1 次提交
    • J
      libxl: Introduce libxl_domain.[ch] · 12315cd7
      Jim Fehlig 提交于
      Create libxl_domain.[ch] and move all functions operating on
      libxlDomainObjPrivate to these files.  This will be useful for
      future patches that e.g. add job support for libxlDomainObjPrivate.
      12315cd7
  23. 03 9月, 2013 1 次提交
  24. 22 8月, 2013 1 次提交
  25. 08 8月, 2013 1 次提交
  26. 02 8月, 2013 1 次提交
    • R
      bridge driver: extract platform specifics · 4ac708f2
      Roman Bogorodskiy 提交于
      * Move platform specific things (e.g. firewalling and route
        collision checks) into bridge_driver_platform
      * Create two platform specific implementations:
          - bridge_driver_linux: Linux implementation using iptables,
            it's actually the code moved from bridge_driver.c
          - bridge_driver_nop: dumb implementation that does nothing
      Signed-off-by: NEric Blake <eblake@redhat.com>
      4ac708f2
  27. 18 7月, 2013 2 次提交
  28. 10 7月, 2013 1 次提交
  29. 24 6月, 2013 2 次提交
    • D
      Add a policy kit access control driver · b904bba7
      Daniel P. Berrange 提交于
      Add an access control driver that uses the pkcheck command
      to check authorization requests. This is fairly inefficient,
      particularly for cases where an API returns a list of objects
      and needs to check permission for each object.
      
      It would be desirable to use the polkit API but this links
      to glib with abort-on-OOM behaviour, so can't be used. The
      other alternative is to speak to dbus directly
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      b904bba7
    • D
      Define basic internal API for access control · a93cd08f
      Daniel P. Berrange 提交于
      This patch introduces the virAccessManagerPtr class as the
      interface between virtualization drivers and the access
      control drivers. The viraccessperm.h file defines the
      various permissions that will be used for each type of object
      libvirt manages
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a93cd08f
  30. 13 5月, 2013 1 次提交
  31. 13 4月, 2013 1 次提交
  32. 21 3月, 2013 1 次提交
    • P
      virsh: Introduce macros to reject mutually exclusive arguments · 7e437ee7
      Peter Krempa 提交于
      This patch adds three macros to the virsh source tree that help to
      easily check for mutually exclusive parameters.
      
      VSH_EXCLUSIVE_OPTIONS_EXPR has four arguments, two expressions to check
      and two names of the parameters to print in the message.
      
      VSH_EXCLUSIVE_OPTIONS is more specific and check the command structure
      for the parameters using vshCommandOptBool.
      
      VSH_EXCLUSIVE_OPTIONS_VAR is meant to check boolean variables with the
      same name as the parameters.
      7e437ee7
  33. 20 3月, 2013 1 次提交
  34. 19 3月, 2013 1 次提交
  35. 13 3月, 2013 1 次提交
    • D
      Apply security label when entering LXC namespaces · e4e69e89
      Daniel P. Berrange 提交于
      Add a new virDomainLxcEnterSecurityLabel() function as a
      counterpart to virDomainLxcEnterNamespaces(), which can
      change the current calling process to have a new security
      context. This call runs client side, not in libvirtd
      so we can't use the security driver infrastructure.
      
      When entering a namespace, the process spawned from virsh
      will default to running with the security label of virsh.
      The actual desired behaviour is to run with the security
      label of the container most of the time. So this changes
      virsh lxc-enter-namespace command to invoke the
      virDomainLxcEnterSecurityLabel method.
      
      The current behaviour is:
      
      LABEL                             PID TTY          TIME CMD
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 1 pts/0 00:00:00 systemd
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 3 pts/1 00:00:00 sh
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 24 ? 00:00:00 systemd-journal
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 29 ? 00:00:00 dhclient
      staff_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 47 ? 00:00:00 ps
      
      Note the ps command is running as unconfined_t,  After this patch,
      
      The new behaviour is this:
      
      virsh -c lxc:/// lxc-enter-namespace dan -- /bin/ps -eZ
      LABEL                             PID TTY          TIME CMD
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 1 pts/0 00:00:00 systemd
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 3 pts/1 00:00:00 sh
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 24 ? 00:00:00 systemd-journal
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 32 ? 00:00:00 dhclient
      system_u:system_r:svirt_lxc_net_t:s0:c0.c1023 38 ? 00:00:00 ps
      
      The '--noseclabel' flag can be used to skip security labelling.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      e4e69e89
  36. 16 1月, 2013 1 次提交