1. 18 7月, 2013 10 次提交
    • D
      Enable FD passing when starting guests with virsh · afb50d79
      Daniel P. Berrange 提交于
      Add a "--pass-fds N,M,..." arg to the virsh start/create
      methods. This allows pre-opened file descriptors from the
      shell to be passed on into the guest
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      afb50d79
    • D
      LXC: Wire up the virDomainCreate{XML}WithFiles methods · 11693bc6
      Daniel P. Berrange 提交于
      Wire up the new virDomainCreate{XML}WithFiles methods in the
      LXC driver, so that FDs get passed down to the init process.
      
      The lxc_container code needs to do a little dance in order
      to renumber the file descriptors it receives into linear
      order, starting from STDERR_FILENO + 1.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      11693bc6
    • D
      Fix impl of virDomainCreateWithFlags remote client helper · ddaf15d7
      Daniel P. Berrange 提交于
      In the following commit:
      
        commit 03d813bb
        Author: Marek Marczykowski <marmarek@invisiblethingslab.com>
        Date:   Thu May 23 02:01:30 2013 +0200
      
          remote: fix dom->id after virDomainCreateWithFlags
      
      The virDomainCreateWithFlags remote client helper was made to
      invoke REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID to refresh the 'id'
      of the domain, following the pattern used in the previous
      virDomainCreate method impl.
      
      The remote protocol for virDomainCreateWithFlags though did
      actually fix the design flaw in virDomainCreate, by directly
      returning the new domain info. For some reason, this data was
      never used. So we can just use that data now instead.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      ddaf15d7
    • D
      Introduce remote protocol support for virDomainCreate{XML}WithFiles · bfd663ef
      Daniel P. Berrange 提交于
      Since they make use of file descriptor passing, the remote protocol
      methods for virDomainCreate{XML}WithFiles must be written by hand.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      bfd663ef
    • D
      Introduce new domain create APIs to pass pre-opened FDs to LXC · d76227be
      Daniel P. Berrange 提交于
      With container based virt, it is useful to be able to pass
      pre-opened file descriptors to the container init process.
      This allows for containers to be auto-activated from incoming
      socket connections, passing the active socket into the container.
      
      To do this, introduce a pair of new APIs, virDomainCreateXMLWithFiles
      and virDomainCreateWithFiles, which accept an array of file
      descriptors. For the LXC driver, UNIX file descriptor passing
      will be used to send them to libvirtd, which will them pass
      them down to libvirt_lxc, which will then pass them to the container
      init process.
      
      This will only be implemented for LXC right now, but the design
      is generic enough it could work with other hypervisors, hence
      I suggest adding this to libvirt.so, rather than libvirt-lxc.so
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d76227be
    • J
      maint: Make ctags work out of the box · d9301a9a
      Jiri Denemark 提交于
      The .ctags file specifies default options for ctags so that it does not
      ignore libvirt.h.in and ignores uninteresting files. As a result, you
      can just run "ctags" and navigating to a public API won't get you to a
      useless entry in api.html.
      d9301a9a
    • G
      esx: Support for disk-only and quiescing snapshots. · 6c8adeb4
      Geoff Hickey 提交于
      Add support for creating disk-only (no memory) snapshots in esx, and
      for quiescing the VM before taking the snapshot. The VMware API
      supports these operations directly, so adding support to libvirt is
      just a matter of setting the flags correctly when calling
      VMware. VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY and
      VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE are now valid flags for esx.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      6c8adeb4
    • D
      libxl: implement virDomainGetNumaParameters · 261c4f5f
      Dario Faggioli 提交于
      Although, having it depending on Xen >= 4.3 (by using the proper
      libxl feature flag).
      
      Xen currently implements a NUMA placement policy which is basically
      the same as the 'interleaved' policy of `numactl', although it can
      be applied on a subset of the available nodes. We therefore hardcode
      "interleave" as 'numa_mode', and we use the newly introduced libxl
      interface to figure out what nodes a domain spans ('numa_nodeset').
      
      With this change, it is now possible to query the NUMA node
      affinity of a running domain:
      
      [raistlin@Zhaman ~]$ sudo virsh --connect xen:/// list
       Id    Name                           State
      ----------------------------------------------------
       23    F18_x64                        running
      
      [raistlin@Zhaman ~]$ sudo virsh --connect xen:/// numatune 23
      numa_mode      : interleave
      numa_nodeset   : 1
      Signed-off-by: NDario Faggioli <dario.faggioli@citrix.com>
      261c4f5f
    • D
      libxl: advertise the support for VIR_TYPED_PARAM_STRING · 98984b71
      Dario Faggioli 提交于
      domainGetNumaParameters has a string typed parameter, hence it
      is necessary for the libxl driver to support this.
      
      This change implements the connectSupportsFeature hook for the
      libxl driver, advertising that VIR_DRV_FEATURE_TYPED_PARAM_STRING
      is supported.
      Signed-off-by: NDario Faggioli <dario.faggioli@citrix.com>
      Cc: Eric Blake <eblake@redhat.com>
      98984b71
    • S
      xen: Add interface versions for Xen 4.3 · fd2e3c4c
      Stefan Bader 提交于
      Xen 4.3 changes sysctl version to 10 and domctl version to 9. Update
      the hypervisor driver to work with those.
      Signed-off-by: NStefan Bader <stefan.bader@canonical.com>
      fd2e3c4c
  2. 17 7月, 2013 12 次提交
  3. 16 7月, 2013 18 次提交
    • G
      LXC: Change the owner of live attached host devices · 129d25dc
      Gao feng 提交于
      The owner of this host devices should be the root user of container.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      129d25dc
    • G
      LXC: Change the owner of host devices to the root of container · 7a8212aa
      Gao feng 提交于
      These host devices are created for container,
      the owner should be the root user of container.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      7a8212aa
    • G
      LXC: Create host devices for container on host side · f87be04f
      Gao feng 提交于
      Otherwise the container will fail to start if we
      enable user namespace, since there is no rights to
      do mknod in uninit user namespace.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      f87be04f
    • G
      LXC: Change the owner of live attached disk device · 4f41a8e5
      Gao feng 提交于
      The owner of this disk device should be the root user of container.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      4f41a8e5
    • G
      LXC: Move virLXCControllerChown to lxc_container.c · 14a0c408
      Gao feng 提交于
      lxc driver will use this function to change the owner
      of hot added devices.
      
      Move virLXCControllerChown to lxc_container.c and Rename
      it to lxcContainerChown.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      14a0c408
    • G
      LXC: controller: change the owner of disk to the root of container · ae4e916f
      Gao feng 提交于
      These disk devices are created for container,
      the owner should be the root user of container.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      ae4e916f
    • G
      LXC: Setup disks for container on host side · 7161f0a3
      Gao feng 提交于
      Since mknod in container is forbidden, we should setup disks
      on host side.
      Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
      7161f0a3
    • P
      qemu: Fix double free of returned JSON array in qemuAgentGetVCPUs() · dfc69235
      Peter Krempa 提交于
      A part of the returned monitor response was freed twice and caused
      crashes of the daemon when using guest agent cpu count retrieval.
      
       # virsh vcpucount dom --guest
      
      Introduced in v1.0.6-48-gc6afcb05
      dfc69235
    • W
      rbd: Do not free the secret if it is not set · d58c8478
      Wido den Hollander 提交于
      Not all RBD (Ceph) storage pools have cephx authentication turned on,
      so "secret" might not be initialized.
      
      It could also be that the secret couldn't be located.
      
      Only call virSecretFree() if "secret" is initialized earlier.
      Signed-off-by: NWido den Hollander <wido@widodh.nl>
      d58c8478
    • J
      Allow balloon driver collection to be adjusted dynamically · 57b65c58
      John Ferlan 提交于
      Use the virDomainSetMemoryStatsPeriodFlags() to pass a period defined by
      usage of a new --period option in order to set the collection period for the
      balloon driver. This may enable or disable the collection based on the value.
      
      Add the --current, --live, & --config options to dommemstat.
      57b65c58
    • J
      Implement the virDomainSetMemoryStatsPeriod for QEMU driver · 2431269b
      John Ferlan 提交于
      Implement the new API that will handle setting the balloon driver statistics
      collection period in order to enable or disable the collection dynamically.
      2431269b
    • J
      Specify remote protocol for virDomainSetMemoryStatsPeriod · ce2bdcbc
      John Ferlan 提交于
      Wire up the remote protocol
      ce2bdcbc
    • J
      Add new public API virDomainSetMemoryStatsPeriod · d5c67e7f
      John Ferlan 提交于
      Add new API in order to set the balloon memory driver statistics collection
      period in order to allow dynamic period adjustment for the virsh dommemstats to
      display balloon stats data
      d5c67e7f
    • J
      Add capability to fetch balloon stats · ab600621
      John Ferlan 提交于
      This patch will add the qemuMonitorJSONGetMemoryStats() to execute a
      "guest-stats" on the balloonpath using "get-qom" replacing the former
      mechanism which looked through the "query-ballon" returned data for
      the fields.  The "query-balloon" code only returns 'actual' memory.
      Rather than duplicating the existing code, have the JSON API use the
      GetBalloonInfo API.
      
      A check in the qemuMonitorGetMemoryStats() will be made to ensure the
      balloon driver path has been set.  Since the underlying JSON code can
      return data not associated with the balloon driver, we don't fail on
      a failure to get the balloonpath.  Of course since we've made the check,
      we can then set the ballooninit flag.  Getting the path here is primarily
      due to the process reconnect path which doesn't attempt to set the
      collection period.
      ab600621
    • J
      Determine whether to start balloon memory stats gathering. · ffdf82a9
      John Ferlan 提交于
      At vm startup and attach attempt to set the balloon driver statistics
      collection period based on the value found in the domain xml file. This
      is not done at reconnect since it's possible that a collection period
      was set on the live guest and making the set period call would reset to
      whatever value is stored in the config file.
      
      Setting the stats collection period has a side effect of searching through
      the qom-list output for the virtio balloon driver and making sure that it
      has the right properties in order to allow setting of a collection period
      and eventually fetching of statistics.
      
      The walk through the qom-list is expensive and thus the balloonpath will
      be saved in the monitor private structure as well as a flag indicating
      that the initialization has already been attempted (in the event that a
      path is not found, no sense to keep checking).
      
      This processing model conforms to the qom object model model which
      requires setting object properties after device startup. That is, it's
      not possible to pass the period along via the startup code as it won't
      be recognized.
      ffdf82a9
    • J
      Add 'period' for Memballoon statistics gathering capability · 9ed3a5ca
      John Ferlan 提交于
      Add a period in seconds to allow/enable statistics gathering from the
      Balloon driver for 'virsh dommemstat <domain>'.
      9ed3a5ca
    • A
      qemu: Prevent crash of libvirtd without guest agent configuration · 96518d43
      Alex Jia 提交于
      If users haven't configured guest agent then qemuAgentCommand() will
      dereference a NULL 'mon' pointer, which causes crash of libvirtd when
      using agent based cpu (un)plug.
      
      With the patch, when the qemu-ga service isn't running in the guest,
      a expected error "error: Guest agent is not responding: Guest agent
      not available for now" will be raised, and the error "error: argument
      unsupported: QEMU guest agent is not configured" is raised when the
      guest hasn't configured guest agent.
      
      GDB backtrace:
      
       (gdb) bt
       #0  virNetServerFatalSignal (sig=11, siginfo=<value optimized out>, context=<value optimized out>) at rpc/virnetserver.c:326
       #1  <signal handler called>
       #2  qemuAgentCommand (mon=0x0, cmd=0x7f39300017b0, reply=0x7f394b090910, seconds=-2) at qemu/qemu_agent.c:975
       #3  0x00007f39429507f6 in qemuAgentGetVCPUs (mon=0x0, info=0x7f394b0909b8) at qemu/qemu_agent.c:1475
       #4  0x00007f39429d9857 in qemuDomainGetVcpusFlags (dom=<value optimized out>, flags=9) at qemu/qemu_driver.c:4849
       #5  0x00007f3957dffd8d in virDomainGetVcpusFlags (domain=0x7f39300009c0, flags=8) at libvirt.c:9843
      
      How to reproduce?
      
       # To start a guest without guest agent configuration
       # then run the following cmdline
      
       # virsh vcpucount foobar --guest
       error: End of file while reading data: Input/output error
       error: One or more references were leaked after disconnect from the hypervisor
       error: Failed to reconnect to the hypervisor
      
      RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=984821Signed-off-by: NAlex Jia <ajia@redhat.com>
      Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
      96518d43
    • M
      Make logical pools independent on target path · efab27af
      Martin Kletzander 提交于
      When using logical pools, we had to trust the target->path provided.
      This parameter, however, can be completely ommited and we can use
      '/dev/<source.name>' safely and populate it to target.path.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=952973
      efab27af