1. 11 6月, 2014 1 次提交
  2. 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
  3. 05 6月, 2014 1 次提交
  4. 03 6月, 2014 1 次提交
    • P
      storage: Move virStorageFileGetMetadata to the storage driver · 713cc3b0
      Peter Krempa 提交于
      My future work will modify the metadata crawler function to use the
      storage driver file APIs to access the files instead of accessing them
      directly so that we will be able to request the metadata for remote
      files too. To avoid linking the storage driver to every helper file
      using the utils code, the backing chain traversal function needs to be
      moved to the storage driver source.
      
      Additionally the virt-aa-helper and virstoragetest programs need to be
      linked with the storage driver as a result of this change.
      713cc3b0
  5. 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
  6. 14 5月, 2014 2 次提交
    • 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
    • R
      qemu: extract PCI handling structs · c453f2d0
      Roman Bogorodskiy 提交于
      Introduce new files (domain_addr.[ch]) to provide
      an API for domain device handling that could be
      shared across the drivers.
      
      A list of data types were extracted and moved there:
      
       qemuDomainPCIAddressBus -> virDomainPCIAddressBus
       qemuDomainPCIAddressBusPtr -> virDomainPCIAddressBusPtr
       _qemuDomainPCIAddressSet -> virDomainPCIAddressSet
       qemuDomainPCIAddressSetPtr -> virDomainPCIAddressSetPtr
       qemuDomainPCIConnectFlags -> virDomainPCIConnectFlags
      
      Also, move the related definitions and macros.
      c453f2d0
  7. 27 4月, 2014 1 次提交
  8. 25 4月, 2014 4 次提交
    • D
      Convert nwfilter ebiptablesAllTeardown to virFirewall · 8d559864
      Daniel P. Berrange 提交于
      Convert the nwfilter ebiptablesAllTeardown method to use the
      virFirewall object APIs instead of creating shell scripts
      using virBuffer APIs. This provides a performance improvement
      through allowing direct use of firewalld dbus APIs and will
      facilitate automated testing.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8d559864
    • 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
    • D
      Move virNWFilterTechDriver struct out of nwfilter_conf.h · bc46c7fb
      Daniel P. Berrange 提交于
      The virNWFilterTechDriver struct is nothing to do with the nwfilter
      XML configuration. It stores data specific to the driver implementation
      so should be in a header in the driver directory instead.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      bc46c7fb
    • D
      Add helpers for resolving path to resources in build tree · 63a92e72
      Daniel P. Berrange 提交于
      Add virFileFindResource which will try to locate files
      in the local build tree if the calling binary (eg libvirtd or
      test suite) is being run from the build tree. The corresponding
      virFileActivateDirOverride should be called at startup passing
      in argv[0]. This will be examined for evidence of libtool magic
      binary prefix / sub-directory in order to activate the override.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      63a92e72
  9. 07 4月, 2014 1 次提交
  10. 02 4月, 2014 3 次提交
    • E
      util: don't support loopback and nbd when setuid · 885ac290
      Eric Blake 提交于
      The only remaining reason that virt-login-shell was trying to
      link against virstoragefile was because of a call to
      virStorageFileFormatTypeToString when spawning a qemu-nbd
      process - but setuid processes shouldn't be spawning qemu-nbd.
      
      * src/util/virfile.c (virFileLoopDeviceAssociate)
      (virFileNBDDeviceAssociate): Cripple in setuid builds.
      * src/Makefile.am (libvirt_setuid_rpc_client_la_SOURCES):
      Drop virstoragefile from the list.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      885ac290
    • 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
    • E
      conf: split security label structs to util/ · 3e929386
      Eric Blake 提交于
      In order to reuse the newly-created host-side disk struct in
      the virstoragefile backing chain code, I first have to move
      it to util/.  This starts the process, by first moving the
      security label structures.
      
      * src/conf/domain_conf.h (virDomainDefGenSecurityLabelDef)
      (virDomainDiskDefGenSecurityLabelDef, virSecurityLabelDefFree)
      (virSecurityDeviceLabelDefFree, virSecurityLabelDef)
      (virSecurityDeviceLabelDef): Move...
      * src/util/virseclabel.h: ...to new file.
      (virSecurityLabelDefNew, virSecurityDeviceLabelDefNew): Rename the
      GenSecurity functions.
      * src/qemu/qemu_process.c (qemuProcessAttach): Adjust callers.
      * src/security/security_manager.c (virSecurityManagerGenLabel):
      Likewise.
      * src/security/security_selinux.c
      (virSecuritySELinuxSetSecurityFileLabel): Likewise.
      * src/util/virseclabel.c: New file.
      * src/conf/domain_conf.c: Move security code, and fix fallout.
      * src/Makefile.am (UTIL_SOURCES): Build new file.
      * src/libvirt_private.syms (domain_conf.h): Move symbols...
      (virseclabel.h): ...to new section.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      3e929386
  11. 21 3月, 2014 1 次提交
  12. 19 3月, 2014 2 次提交
  13. 14 3月, 2014 1 次提交
  14. 12 3月, 2014 2 次提交
  15. 11 3月, 2014 2 次提交
  16. 04 3月, 2014 1 次提交
  17. 24 2月, 2014 1 次提交
    • M
      virNetServerRun: Notify systemd that we're accepting clients · 68954fb2
      Michal Privoznik 提交于
      Systemd does not forget about the cases, where client service needs to
      wait for daemon service to initialize and start accepting new clients.
      Setting a dependency in client is not enough as systemd doesn't know
      when the daemon has initialized itself and started accepting new
      clients. However, it offers a mechanism to solve this. The daemon needs
      to call a special systemd function by which the daemon tells "I'm ready
      to accept new clients". This is exactly what we need with
      libvirtd-guests (client) and libvirtd (daemon). So now, with this
      change, libvirt-guests.service is invoked not any sooner than
      libvirtd.service calls the systemd notify function.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      68954fb2
  18. 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
  19. 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
  20. 04 2月, 2014 1 次提交
    • J
      utils: Introduce functions for kernel module manipulation · 4a2179ea
      John Ferlan 提交于
      virKModConfig()        - Return a buffer containing kernel module configuration
      virKModLoad()          - Load a specific module into the kernel configuration
      virKModUnload()        - Unload a specific module from the kernel configuration
      virKModIsBlacklisted() - Determine whether a module is blacklisted within
                               the kernel configuration
      4a2179ea
  21. 31 1月, 2014 2 次提交
  22. 27 1月, 2014 1 次提交
  23. 23 1月, 2014 1 次提交
    • J
      vbox: add support for v4.2.20+ and v4.3.4+ · bb85da2c
      Jean-Baptiste Rouault 提交于
      Bugs have been found in the VirtualBox API C bindings. These bugs have
      been fixed in versions 4.2.20 and 4.3.4. However, the changes in the
      C bindings are incompatible with the vbox_CAPI_v4_2.h and vbox_CAPI_v4_3.h
      files which are bundled in libvirt source code.
      This is why the following patch adds vbox_CAPI_v4_2_20.h and
      vbox_CAPI_v4_3_4.h.
      
      The actual underlying problem here is that until now,
      libvirt assumed that VirtualBox API can only change between minor
      versions (4.2 -> 4.3), but we have a case here where it changed
      (or got fixed) between patch versions (4.2.18 -> 4.2.20).
      
      This patch makes the VBOX_API_VERSION represent the full API
      version number (i.e 4002 => 4002000) so there are specific version
      numbers for Vbox 4.2.20 (4002020) and 4.3.4 (4003004)
      bb85da2c
  24. 21 1月, 2014 1 次提交
    • L
      build: add $(prefix) to SYSTEMD_UNIT_DIR · 00e9d607
      Laine Stump 提交于
      I noticed this problem when adding systemd support to netcf, because I
      setup the configure.ac to automatically prefer using systemd over
      initscripts when possible - although I had copied the
      install-data-local target from the example of libvirt's
      "libvirt-guests" service more or less verbatim, "make distcheck" would
      fail because it was trying to install the service file directly into
      /lib/systemd/system rather than into
      /home/user/some/unimportant/name/lib/systemd/system.
      
      This is caused by the install/uninstall rules for the systemd unit
      files relying on $(DESTDIR) pointing the installed files to the right
      place, but in reality $(DESTDIR) is empty during this part of make
      distcheck - it instead sets $(prefix) with the toplevel directory used
      for its test build/install/uninstall cycle.
      
      (This problem hasn't been seen when running "make distcheck" in
      libvirt because libvirt will never build/install systemd support
      unless explicitly told to do so on the configure commandline, and
      "make distcheck" doesn't put the "--with-initscript=..." option on the
      configure commandline.)
      
      I verified that the same problem does exist in libvirt by modifying
      libvirt's configure.ac to set:
      
        init_systemd=yes
        with_init_script=systemd+redhat
      
      This forces a build/install of the systemd unit files during
      distcheck, which yields an error like this:
      
      /usr/bin/install -c -m 644 virtlockd.service \
        /lib/systemd/system/
      libtool: install: warning: relinking `libvirt-qemu.la'
      /usr/bin/install: cannot remove '/lib/systemd/system/virtlockd.service': Permission denied
      make[4]: *** [install-systemd] Error 1
      
      After adding $(prefix) to all the definitions of SYSTEMD_UNIT_DIR,
      make distcheck now completes successfully with the modified
      configure.ac, and the above lines change to something like this:
      
      /usr/bin/install -c -m 644 virtlockd.service \
        /home/laine/devel/libvirt/libvirt-1.2.1/_inst/lib/systemd/system/
      00e9d607
  25. 11 12月, 2013 1 次提交
    • C
      Added Network events API and virNetworkEventLifecycle. · 9ff38c54
      Cédric Bosdonnat 提交于
      Define the public API for (de-)registering network events
      and the callbacks for receiving lifecycle events. The lifecycle
      event includes a 'detail' parameter to match the domain lifecycle
      event data, but this is currently unused.
      
      The network events related code goes into its own set of internal
      files src/conf/network_event.[ch]
      9ff38c54
  26. 10 12月, 2013 1 次提交
  27. 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
  28. 25 11月, 2013 1 次提交
    • R
      vbox: add support for 4.3 APIs · c677ee85
      Ryota Ozaki 提交于
      Makefile.am, vbox_V4_3.c and vbox_driver.c do regular
      modifitions to support a new version of APIs.
      
      vbox_tmpl.c basically fixes incompatibilities since 4.2.
      
      The affected incompatibilities of 4.3 are:
      * IMachine::Delete() has been renamed to IMachine::deleteConfig()
      * IMedium::CreateBaseStorage() now accepts multiple variant values
      * IDisplay::GetScreenResolution() now returns the display position
        in the guest
      * IMachine now has multiple IUSBControllers and IUSBDeviceFilters
        handles USB device filters instead of (obsolete) IUSBController
      
      This patch is tested on Mac OS X 10.8.5 and Fedora 19.
      Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com>
      c677ee85
  29. 06 11月, 2013 1 次提交
    • G
      virt-login-shell: also build virAtomic.h · 12dc729a
      Guido Günther 提交于
      Needed for architectures that don't use gcc atomic ops but pthread. This
      fixes the armel build that otherwise breaks like:
      
       CCLD     virt-login-shell
       ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-virobject.o): In function `virClassNew':
       /«PKGBUILDDIR»/debian/build/src/../../../src/util/virobject.c:150: undefined reference to `virAtomicLock'
       ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-virobject.o): In function `virObjectNew':
       /«PKGBUILDDIR»/debian/build/src/../../../src/util/virobject.c:202: undefined reference to `virAtomicLock'
       ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-virobject.o): In function `virObjectUnref':
       /«PKGBUILDDIR»/debian/build/src/../../../src/util/virobject.c:274: undefined reference to `virAtomicLock'
       ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-virobject.o): In function `virObjectRef':
       /«PKGBUILDDIR»/debian/build/src/../../../src/util/virobject.c:295: undefined reference to `virAtomicLock'
       collect2: error: ld returned 1 exit status
      
      See https://buildd.debian.org/status/fetch.php?pkg=libvirt&arch=armel&ver=1.1.4-1&stamp=1383588268
      12dc729a
  30. 22 10月, 2013 1 次提交
    • J
      build: fix linking virt-login-shell · 5a0ea4b7
      Jim Fehlig 提交于
      After commit 3e2f27e1, I've noticed build failures of virt-login-shell
      when libapparmor-devel is installed on the build host
      
      CCLD     virt-login-shell
      ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o):
      In function `virExec':
      /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined
      reference to `aa_change_profile'
      collect2: error: ld returned 1 exit status
      
      I was about to commit an easy fix under the build-breaker rule
      (build-fix-1.patch), but thought to extend the notion of SECDRIVER_LIBS
      to SECDRIVER_CFLAGS, and use both throughout src/Makefile.am where it
      makes sense (build-fix-2.patch).
      
      Should I just stick with the simple fix, or is something along the lines
      of patch 2 preferred?
      
      Regards,
      Jim
      
      >From a0f35945f3127ab70d051101037e821b1759b4bb Mon Sep 17 00:00:00 2001
      From: Jim Fehlig <jfehlig@suse.com>
      Date: Mon, 21 Oct 2013 15:30:02 -0600
      Subject: [PATCH] build: fix virt-login-shell build with apparmor
      
      With libapparmor-devel installed, virt-login-shell fails to link
      
      CCLD     virt-login-shell
      ../src/.libs/libvirt-setuid-rpc-client.a(libvirt_setuid_rpc_client_la-vircommand.o): In function `virExec':
      /home/jfehlig/virt/upstream/libvirt/src/util/vircommand.c:653: undefined reference to `aa_change_profile'
      collect2: error: ld returned 1 exit status
      
      Fix by linking libvirt_setuid_rpc_client with previously determined
      SECDRIVER_LIBS in src/Makefile.am.  While at it, introduce SECDRIVER_CFLAGS
      and use both throughout src/Makefile.am where it makes sense.
      Signed-off-by: NJim Fehlig <jfehlig@suse.com>
      5a0ea4b7