1. 13 2月, 2014 19 次提交
    • C
      LXC from native: map lxc.cgroup.cpuset.* · 281e2990
      Cédric Bosdonnat 提交于
      281e2990
    • C
      LXC from native: map lxc.cgroup.cpu.* · 4f3f7aea
      Cédric Bosdonnat 提交于
      4f3f7aea
    • C
      LXC from native: migrate memory tuning · 13b9946e
      Cédric Bosdonnat 提交于
      13b9946e
    • C
      99d8cddf
    • C
      8e45b887
    • C
      f01fe54e
    • C
    • C
      LXC from native: migrate veth network configuration · b73c029d
      Cédric Bosdonnat 提交于
      Some of the LXC configuration properties aren't migrated since they
      would only cause problems in libvirt-lxc:
        * lxc.network.ipv[46]: LXC driver doesn't setup IP address of guests,
          see rhbz#1059624
        * lxc.network.name, see rhbz#1059630
      b73c029d
    • C
      LXC from native: implement no network conversion · 7bfd6e97
      Cédric Bosdonnat 提交于
      If no network configuration is provided, LXC only provides the loopback
      interface. To match this, we need to use the privnet feature. LXC will
      also define a 'none' network type in its 1.0.0 version that fits
      libvirt LXC driver's default.
      7bfd6e97
    • C
      LXC from native: migrate fstab and lxc.mount.entry · a41680f8
      Cédric Bosdonnat 提交于
      Tmpfs relative size and default 50% size values aren't supported as
      we have no idea of the available memory at the conversion time.
      a41680f8
    • C
      LXC from native: import rootfs · 197b13e5
      Cédric Bosdonnat 提交于
      LXC rootfs can be either a directory or a block device or an image
      file. The first two types have been implemented, but the image file is
      still to be done since LXC auto-guesses the file format at mount time
      and the LXC driver doesn't support the 'auto' format.
      197b13e5
    • 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
    • C
      Improve virConf parse to handle LXC config format · 3daa1483
      Cédric Bosdonnat 提交于
      virConf now honours a VIR_CONF_FLAG_LXC_FORMAT flag to handle LXC
      configuration files. The differences are that property names can
      contain '.' character and values are all strings without any bounding
      quotes.
      
      Provide a new virConfWalk function calling a handler on all non-comment
      values. This function will be used by the LXC conversion code to loop
      over LXC configuration lines.
      3daa1483
    • E
      event: pass reason for PM events · 6831c1d3
      Eric Blake 提交于
      Commit 57ddcc23 (v0.9.11) introduced the pmwakeup event, with
      an optional 'reason' field reserved for possible future expansion.
      But it failed to wire the field through RPC, so even if we do
      add a reason in the future, we will be unable to get it back
      to the user.
      
      Worse, commit 7ba5defb (v1.0.0) repeated the same mistake with
      the pmsuspend_disk event.
      
      As long as we are adding new RPC calls, we might as well fix
      the events to actually match the signature so that we don't have
      to add yet another RPC in the future if we do decide to start
      using the reason field.
      
      * src/remote/remote_protocol.x
      (remote_domain_event_callback_pmwakeup_msg)
      (remote_domain_event_callback_pmsuspend_msg)
      (remote_domain_event_callback_pmsuspend_disk_msg): Add reason
      field.
      * daemon/remote.c (remoteRelayDomainEventPMWakeup)
      (remoteRelayDomainEventPMSuspend)
      (remoteRelayDomainEventPMSuspendDisk): Pass reason to client.
      * src/conf/domain_event.h (virDomainEventPMWakeupNewFromDom)
      (virDomainEventPMSuspendNewFromDom)
      (virDomainEventPMSuspendDiskNewFromDom): Require additional
      parameter.
      * src/conf/domain_event.c (virDomainEventPMClass): New class.
      (virDomainEventPMDispose): New function.
      (virDomainEventPMWakeupNew*, virDomainEventPMSuspendNew*)
      (virDomainEventPMSuspendDiskNew*)
      (virDomainEventDispatchDefaultFunc): Use new class.
      * src/remote/remote_driver.c (remoteDomainBuildEvent*PM*): Pass
      reason through.
      * src/remote_protocol-structs: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6831c1d3
    • E
      event: convert remaining domain events to new style · 158795d2
      Eric Blake 提交于
      Following the patterns established by lifecycle events, this
      creates all the new RPC calls needed to pass callback IDs
      for every domain event, and changes the limits in client and
      server codes to use modern style when possible.
      
      I've tested all combinations: both 'old client and new server'
      and 'new client and old server' continue to work with the old
      RPCs, and 'new client and new server' benefit from server-side
      filtering with the new RPCs.
      
      * src/remote/remote_protocol.x (REMOTE_PROC_DOMAIN_EVENT_*): Add
      REMOTE_PROC_DOMAIN_EVENT_CALLBACK_* counterparts.
      * daemon/remote.c (remoteRelayDomainEvent*): Send callbackID via
      newer RPC when used with new-style registration.
      (remoteDispatchConnectDomainEventCallbackRegisterAny): Extend to
      cover all domain events.
      * src/remote/remote_driver.c (remoteDomainBuildEvent*): Add new
      Callback and Helper functions.
      (remoteEvents): Match order of RPC numbers, register new handlers.
      (remoteConnectDomainEventRegisterAny)
      (remoteConnectDomainEventDeregisterAny): Extend to cover all
      domain events.
      * src/remote_protocol-structs: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      158795d2
    • E
      event: client RPC protocol tweaks for domain lifecycle events · 355ea626
      Eric Blake 提交于
      The counterpart to the server RPC additions; here, a single
      function can serve both old and new calls, while incoming
      events must be serviced by two different functions.  Again,
      some wise choices in our XDR made it easier to share code
      managing similar events.
      
      While this only supports lifecycle events, it covers the
      harder part of how Register and RegisterAny interact; the
      remaining 15 events will be a mechanical change in a later
      patch.  For Register, we now have a callbackID locally for
      more efficient cleanup if the RPC fails; we also prefer to
      use the newer RPC where we know it is supported (the older
      RPC must be used if we don't know if RegisterAny is
      supported).
      
      * src/remote/remote_driver.c (remoteEvents): Register new RPC
      event handler.
      (remoteDomainBuildEventLifecycle): Move guts...
      (remoteDomainBuildEventLifecycleHelper): ...here.
      (remoteDomainBuildEventCallbackLifecycle): New function.
      (remoteConnectDomainEventRegister)
      (remoteConnectDomainEventDeregister)
      (remoteConnectDomainEventRegisterAny)
      (remoteConnectDomainEventDeregisterAny): Use new RPC when supported.
      355ea626
    • E
      event: prepare client to track domain callbackID · caaf6ba1
      Eric Blake 提交于
      We want to convert over to server-side events, even for older
      APIs.  To do that, the client side of the remote driver wants
      to distinguish between legacy virConnectDomainEventRegister and
      normal virConnectDomainEventRegisterAny, while knowing the
      client callbackID and the server's serverID for both types of
      registration.  The client also needs to probe whether the
      server supports server-side filtering.  However, for ease of
      review, we don't actually use the new RPCs until a later patch.
      
      * src/conf/object_event_private.h (virObjectEventStateCallbackID):
      Add parameter.
      * src/conf/object_event.c (virObjectEventCallbackListAddID)
      (virObjectEventStateRegisterID): Separate legacy from callbackID.
      (virObjectEventStateCallbackID): Pass through parameter.
      (virObjectEventCallbackLookup): Let legacy and global domain
      lifecycle events share a common remoteID.
      * src/conf/network_event.c (virNetworkEventStateRegisterID):
      Update caller.
      * src/conf/domain_event.c (virDomainEventStateRegister)
      (virDomainEventStateRegisterID, virDomainEventStateDeregister):
      Likewise.
      (virDomainEventStateRegisterClient)
      (virDomainEventStateCallbackID): Implement new functions.
      * src/conf/domain_event.h (virDomainEventStateRegisterClient)
      (virDomainEventStateCallbackID): New prototypes.
      * src/remote/remote_driver.c (private_data): Add field.
      (doRemoteOpen): Probe server feature.
      (remoteConnectDomainEventRegister)
      (remoteConnectDomainEventRegisterAny): Use new function.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      caaf6ba1
    • E
      event: server RPC protocol tweaks for domain lifecycle events · 03722957
      Eric Blake 提交于
      This patch adds some new RPC call numbers, but for ease of review,
      they sit idle until a later patch adds the client counterpart to
      drive the new RPCs.  Also for ease of review, I limited this patch
      to just the lifecycle event; although converting the remaining
      15 domain events will be quite mechanical.  On the server side,
      we have to have a function per RPC call, largely with duplicated
      bodies (the key difference being that we store in our callback
      opaque pointer whether events should be fired with old or new
      style); meanwhile, a single function can drive multiple RPC
      messages.  With a strategic choice of XDR struct layout, we can
      make the event generation code for both styles fairly compact.
      
      I debated about adding a tri-state witness variable per
      connection (values 'unknown', 'legacy', 'modern').  It would start
      as 'unknown', move to 'legacy' if any RPC call is made to a legacy
      event call, and move to 'modern' if the feature probe is made;
      then the event code could issue an error if the witness state is
      incorrect (a legacy RPC call while in 'modern', a modern RPC call
      while in 'unknown' or 'legacy', and a feature probe while in
      'legacy' or 'modern').  But while it might prevent odd behavior
      caused by protocol fuzzing, I don't see that it would prevent
      any security holes, so I considered it bloat.
      
      Note that sticking @acl markers on the new RPCs generates unused
      functions in access/viraccessapicheck.c, because there is no new
      API call that needs to use the new checks; however, having a
      consistent .x file is worth the dead code.
      
      * src/libvirt_internal.h (VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK):
      New feature.
      * src/remote/remote_protocol.x
      (REMOTE_PROC_CONNECT_DOMAIN_EVENT_CALLBACK_REGISTER_ANY)
      (REMOTE_PROC_CONNECT_DOMAIN_EVENT_CALLBACK_DEREGISTER_ANY)
      (REMOTE_PROC_DOMAIN_EVENT_CALLBACK_LIFECYCLE): New RPCs.
      * daemon/remote.c (daemonClientCallback): Add field.
      (remoteDispatchConnectDomainEventCallbackRegisterAny)
      (remoteDispatchConnectDomainEventCallbackDeregisterAny): New
      functions.
      (remoteDispatchConnectDomainEventRegisterAny)
      (remoteDispatchConnectDomainEventDeregisterAny): Mark legacy use.
      (remoteRelayDomainEventLifecycle): Change message based on legacy
      or new use.
      (remoteDispatchConnectSupportsFeature): Advertise new feature.
      * src/remote_protocol-structs: Regenerate.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      03722957
    • E
      event: dynamically manage server-side RPC domain events · 047fd2e8
      Eric Blake 提交于
      This patch continues the earlier conversion made for network
      events, with a goal of introducing server-side event filtering
      in a later patch.  Actual behavior is unchanged without
      further RPC changes.
      
      * daemon/libvirtd.h (daemonClientPrivate): Alter the tracking of
      domain events.
      * daemon/remote.c (remoteClientInitHook, remoteClientFreeFunc)
      (remoteRelayDomainEvent*)
      (remoteDispatchConnectDomainEventRegister)
      (remoteDispatchConnectDomainEventRegisterAny): Track domain
      callbacks dynamically.
      047fd2e8
  2. 12 2月, 2014 10 次提交
  3. 11 2月, 2014 11 次提交
    • J
      Rename 'index' in virCapabilitiesGetCpusForNode · 47fa97a7
      Ján Tomko 提交于
      This shadows the index function on some systems (RHEL-6.4, FreeBSD 9):
      ../../src/conf/capabilities.c: In function 'virCapabilitiesGetCpusForNode':
      ../../src/conf/capabilities.c:1005: warning: declaration of'index'
            shadows a global declaration [-Wshadow]
      /usr/include/strings.h:57: warning: shadowed declaration is here [-Wshadow]
      47fa97a7
    • P
      vircapstest: Introduce virCapabilitiesGetCpusForNodemask test · eb64e875
      Pradipta Kr. Banerjee 提交于
      This test creates a Fake NUMA topology with non-sequential cell ids
      to check if libvirt properly handles the same
      Signed-off-by: NShivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
      Signed-off-by: NPradipta Kr. Banerjee <bpradip@in.ibm.com>
      eb64e875
    • P
      Handle non-sequential NUMA node numbers · cd921cf0
      Pradipta Kr. Banerjee 提交于
      On some platforms like IBM PowerNV the NUMA node numbers can be
      non-sequential. For eg. numactl --hardware o/p from such a machine looks
      as given below
      
      node distances:
         node   0   1  16  17
           0:  10  40  40  40
           1:  40  10  40  40
          16:  40  40  10  40
          17:  40  40  40  10
      
      The NUMA nodes are 0,1,16,17
      
      Libvirt uses sequential index as NUMA node numbers and this can
      result in crash or incorrect results.
      Signed-off-by: NShivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
      Signed-off-by: NPradipta Kr. Banerjee <bpradip@in.ibm.com>
      cd921cf0
    • P
      storage: gluster: Set volume metadata in a separate function · 037ffda3
      Peter Krempa 提交于
      Extract the metadata setting code into a separate function for future
      use.
      037ffda3
    • M
      qemu: introduce spiceport chardev backend · d27e6bc4
      Martin Kletzander 提交于
      Add a new backend for any character device.  This backend uses channel
      in spice connection.  This channel is similar to spicevmc, but
      all-purpose in contrast to spicevmc.
      
      Apart from spicevmc, spiceport-backed chardev will not be formatted
      into the command-line if there is no spice to use (with test for that
      as well).  For this I moved the def->graphics counting to the start
      of the function so its results can be used in rest of the code even in
      the future.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      d27e6bc4
    • M
      qemu: remove pointless condition · 296a4791
      Martin Kletzander 提交于
      This patch is here just to ease the code review and make related
      changes look more sensible.  Apart from removing the condition this is
      merely a whitespace (indentation) change.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      296a4791
    • M
      qemu: rework '-serial none' · a53e5040
      Martin Kletzander 提交于
      Limiting ourselves to qemu without QEMU_CAPS_DEVICE capability, we
      used '-serial none' only if there was no serial device defined in the
      domain XML.  This means that if we want to have a possibility of the
      device being defined in XML, but not used in the command-line
      (e.g. when it's pointless), we'll fail to attach '-serial none' to the
      command-line (when skipping the device's command-line building and the
      device being the only one).
      
      Since there is no such device, this patch doesn't actually do
      anything, but enables easier future additions in this manner.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      a53e5040
    • M
      conf: introduce spiceport chardev backend · 5b189541
      Martin Kletzander 提交于
      Add a new character device backend called 'spiceport' that uses
      spice's channel for communications and apart from spicevmc can be used
      as a backend for any character device from libvirt's point of view.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      5b189541
    • W
      rbd: Use rbd_create3 to create RBD format 2 images by default · 0227889a
      Wido den Hollander 提交于
      This new RBD format supports snapshotting and cloning. By having
      libvirt create images in format 2 end-users of the created images
      can benefit from the new RBD format.
      
      Older versions of libvirt can work with this new RBD format as long
      as librbd supports format 2. RBD format is supported by librbd since
      version 0.56 (Ceph Bobtail).
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      0227889a
    • J
      Libvirt lose sheepdogs volumes on pool refresh or restart. · 97410063
      Joel SIMOES 提交于
      When restarting sheepdog pool, all volumes are missing.
      This patch add automatically all volume from the added pool.
      
      Adding last Daniel P. Berrange's syntaxes correction.
      Adding vol on separeted function 'inspired' from parallels_storage :
      parallelsAddDiskVolume
      97410063
    • L
      build: correctly check for SOICGIFVLAN GET_VLAN_VID_CMD command · 0144d729
      Laine Stump 提交于
      In order to make a client-only build successful on RHEL4 (yes, you
      read that correctly!), commit 3ed2e545 modified src/util/virnetdev.c so
      that the functional version of virNetDevGetVLanID() was only compiled
      if GET_VLAN_VID_CMD was defined. However, it is *never* defined, but
      is only an enum value, so the proper version was no longer compiled
      even on platforms that support it. This resulted in the vlan tag not
      being properly set for guest traffic on VEPA mode guest macvtap
      interfaces that were bound to a vlan interface (that's the only place
      that libvirt currently uses virNetDevGetVLanID)
      
      Since there is no way to compile conditionally based on the presence
      of an enum value, this patch modifies configure.ac to check for said
      enum value with AC_CHECK_DECLS(), which #defines
      HAVE_DECL_GET_VLAN_VID_CMD to 1 if it's successful compiling a test
      program that uses GET_VLAN_VID_CMD (and still #defines it, but to 0,
      if it's not successful).  We can then make the compilation of
      virNetDevGetVLanID() conditional on the value of
      HAVE_DECL_GET_VLAN_VID_CMD.
      0144d729