1. 29 1月, 2015 12 次提交
    • M
      qemu: Allow UEFI paths to be specified at compile time · bc03a231
      Michal Privoznik 提交于
      Up until now there are just two ways how to specify UEFI paths to
      libvirt. The first one is editing qemu.conf, the other is editing
      qemu_conf.c and recompile which is not that fancy. So, new
      configure option is introduced: --with-loader-nvram which takes a
      list of pairs of UEFI firmware and NVRAM store. This way, the
      compiled in defaults can be passed during compile time without
      need to change the code itself.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      bc03a231
    • J
      Fix syntax-check · 9783c20c
      Ján Tomko 提交于
      My commit 08d1ae16 broke syntax-check by adding ATTRIBUTE_UNUSED
      to the flags parameter.
      
      Rename the parameter to unused_flags to bypass the check.
      9783c20c
    • J
      Remove flag checking in MacVLanCreate helper stub · 08d1ae16
      Ján Tomko 提交于
      When compiling without WITH_MACVTAP, we can get:
      'unsupported flags (0x1) in function
      virNetDevMacVLanCreateWithVPortProfile'
      on an attempt to start a domain.
      
      Remove the flag check to reach the more helpful error:
      Cannot create macvlan devices on this platform
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1186928
      08d1ae16
    • P
      virsh: man: Document behavior of some blkdeviotune's flags when querying · 00af2381
      Peter Krempa 提交于
      --live and --config can't be specified together when querying the
      configuration, but are valid when setting. The man page was hinting that
      they are valid always.
      00af2381
    • P
      util: bitmap: Tolerate NULL bitmaps in virBitmapEqual · 20448c2a
      Peter Krempa 提交于
      After virBitmapEqual is able to compare NULL bitmaps few bits of code
      can be cleaned up.
      20448c2a
    • J
      storage: Check the partition name against provided name · 9bbbb912
      John Ferlan 提交于
      https://bugzilla.redhat.com/show_bug.cgi?id=1138516
      
      If the provided volume name doesn't match what parted generated as the
      partition name, then return a failure.
      
      Update virsh.pod and formatstorage.html.in to describe the 'name' restriction
      for disk pools as well as the usage of the <target>'s <format type='value'>.
      9bbbb912
    • J
      storage: When delete extended partition, need to refresh pool · 471e1c4e
      John Ferlan 提交于
      When removing a volume that is the extended partition, all the logical
      volume partitions that exist within the extended partition will also be
      removed, so we need to refresh the pool to have the updated list
      471e1c4e
    • J
      storage: Adjust how to refresh extended partition disk data · bce671b7
      John Ferlan 提交于
      During virStorageBackendDiskMakeDataVol processing, if we find an extended
      partition, then handle it specially when updating the capacity/allocation
      rather than calling virStorageBackendUpdateVolInfo.
      
      As it turns out, once a logical partition exists, any attempt to refresh
      the pool or after libvirtd restart/reload will result in a failure to open
      the extended partition device resulting in the inability to start the pool.
      The downside to this is we will lose the <permissions> and <timestamps> for
      the extended partition upon subsequent restart, refresh, reload since the
      stat() in virStorageBackendUpdateVolTargetInfoFD will not be called. However,
      since it's really only a container and shouldn't directly be used for
      storage that seems reasonable.
      
      Therefore, only use the existing code that already had a comment about
      getting the allocation wrong for extended partitions for just the setting
      of the extended partition data.
      bce671b7
    • J
      storage: Fix check for partition type for disk backing volumes · a0d88ed4
      John Ferlan 提交于
      While checking the existing partitions in virStorageBackendDiskPartFormat,
      the code would erroneously compare the volume target format type (eg, the
      virStoragePartedFsType) rather than the source partition type (eg, the
      virStorageVolTypeDisk) which is set during virStorageBackendDiskReadPartitions.
      a0d88ed4
    • J
      storage: Attempt error recovery in virStorageBackendDiskCreateVol · 290ffcfb
      John Ferlan 提交于
      During virStorageBackendDiskCreateVol if virStorageBackendDiskReadPartitions
      fails, then we were leaving with an error and a partition on the disk for
      which there was no corresponding volume and used space on the disk which
      could be reclaimable through direct parted activity. On a subsequent restart,
      reload, or refresh the volume may magically appear too.
      290ffcfb
    • J
      storage: Move virStorageBackendDiskDeleteVol · 1e79ad6d
      John Ferlan 提交于
      Move the API to before virStorageBackendDiskCreateVol in order to be
      able to call the DeleteVol API when virStorageBackendDiskReadPartitions
      fails so that we don't by chance leave a partition on the disk.
      1e79ad6d
    • P
      libvirt.spec: remove vbox storage and network .so files · 259dfe24
      Pavel Hrdina 提交于
      Commit 55ea7be7 removed separated modules for vbox_network and
      vbox_storage drivers but forget to update libvirt.spec.in file. This
      patch will fix rpm build.
      Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
      259dfe24
  2. 28 1月, 2015 3 次提交
  3. 27 1月, 2015 25 次提交
    • D
      lxc: report veth device indexes to systemd · a2bdfa52
      Daniel P. Berrange 提交于
      Record the index of each host-side veth device created and report
      them to systemd, so they show up in machinectl status for the VM.
      
      lxc-shell(95449419f969d649d9962566ec42af7d)
           Since: Fri 2015-01-16 16:53:37 GMT; 3s ago
          Leader: 28085 (sh)
         Service: libvirt-lxc; class container
           Iface: vnet0
         Address: fe80::216:3eff:fe00:c317%124
              OS: Fedora 21 (Twenty One)
            Unit: machine-lxc\x2dshell.scope
                  └─28085 /bin/sh
      a2bdfa52
    • D
      lxc: more logging during startup paths · e4fc4f0c
      Daniel P. Berrange 提交于
      Add more logging to the lxc controller and container files to
      facilitate debugging startup problems. Also make it clear when
      the container is going to close stdout and thus no longer do
      any logging.
      e4fc4f0c
    • D
      lxc: delay setup of cgroup until we have the init pid · 4acb01e4
      Daniel P. Berrange 提交于
      Don't create the cgroups ahead of launching the container since
      there is no need for the limits to apply during initial bootstrap.
      Create the cgroup after the container PID is known and tell
      systemd the initpid is the leader, instead of the controller
      pid.
      4acb01e4
    • D
      lxc: only write XML once for lxc controller · 0a8addc1
      Daniel P. Berrange 提交于
      Currently when launching the LXC controller we first write out
      the plain, inactive XML configuration, then launch the controller,
      then replace the file with the live status XML configuration.
      By good fortune this hasn't caused any problems other than some
      misleading error messages during failure scenarios.
      
      This simplifies the code so it only writes out the XML once and
      always writes the live status XML. To do this we need to handshake
      with the child process, to make execution pause just before exec()
      so we can write the XML status with the child PID present.
      0a8addc1
    • D
      lxc: re-arrange startup synchronization sequence with controller · e1de5521
      Daniel P. Berrange 提交于
      Currently the lxc controller process itself is responsible for
      daemonizing itself into the background and writing out its pid
      file. The lxc driver would fork the controller and then attempt
      to connect to the lxc monitor. This connection would only
      succeed after the controller has backgrounded itself, setup
      cgroups and written its pid file, so startup was race free.
      
      The problem is that we need to delay create of the cgroups to
      much later, such that we can tell systemd the container init
      pid when we create the cgroups. If we delay cgroup creation
      though the current synchronization won't work.
      
      A second problem is that the controller needs the XML config
      of the guest. Currently we write out the plain virDomainDefPtr
      XML before starting the controller, and then later replace it
      with the full virDomainObjPtr status XML. This is kind of gross
      and also means that the controller doesn't get a record of the
      live XML config right away. This means it doesn't have a record
      of the veth device names either and so can't give that info
      to systemd when creating the cgroups.
      
      To address this we change the startup sequencing. The goal
      is that we want to get the PID as soon as possible, before
      the LXC controller even starts. So we stop letting the LXC
      controller daemonize itself, and instead use virCommand's
      built-in capabilities. This daemonizes and writes the PID
      before LXC controller is exec'd. So the driver can read
      the PID as soon as virCommandRun returns. It is no longer
      safe to connect to the monitor or detect the cgroups though.
      
      Fortunately the LXC controller already has a second point
      of synchronization. Immediately before its  event loop
      starts running, it performs a handshake with the driver.
      So we move the opening of the monitor connection and cgroup
      detection after this synchronization point.
      e1de5521
    • D
      lxc: don't build pidfile string multiple times · a5979e33
      Daniel P. Berrange 提交于
      Build the pidfile string once when starting a guest and then
      use the same string thereafter. This will benefit following
      patches which need the pidfile string in more situations.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      a5979e33
    • D
      systemd: don't report an error if the guest is already terminated · b3e4401d
      Daniel P. Berrange 提交于
      In many cases where we invoke virSystemdTerminateMachine the
      process(es) will have already gone away on their own accord.
      In these cases we log an error message that the machine does
      not exist. We should catch this particular error and simply
      ignore it, so we don't pollute the logs.
      b3e4401d
    • D
      qemu: report TAP device indexes to systemd · f7afeddc
      Daniel P. Berrange 提交于
      Record the index of each TAP device created and report them to
      systemd, so they show up in machinectl status for the VM.
      f7afeddc
    • J
      Fix shadowed variable warning · d0ab79e9
      Ján Tomko 提交于
      libvirtd.c: In function 'daemonSetupAccessManager':
      libvirtd.c:730:18: error: declaration of 'driver' shadows
        a global declaration [-Werror=shadow]
           const char **driver = (const char **)config->access_drivers;
                        ^
      In file included from libvirtd.c:95:0:
      ../src/node_device/node_device_driver.h:43:36: error: shadowed
        declaration is here [-Werror=shadow]
       extern virNodeDeviceDriverStatePtr driver;
                                          ^
      d0ab79e9
    • C
      storage: add a flag to clone files on btrfs · 95da1913
      Chen Hanxiao 提交于
      When creating a RAW file, we don't take advantage
      of clone of btrfs.
      
      Add a VIR_STORAGE_VOL_CREATE_REFLINK flag to request
      a reflink copy.
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      95da1913
    • C
      storage: introduce btrfsCloneFile() for COW copy · 466b29c8
      Chen Hanxiao 提交于
      Add a wrapper for BTRFS_IOC_CLONE ioctl.
      Signed-off-by: NChen Hanxiao <chenhanxiao@cn.fujitsu.com>
      Signed-off-by: NJán Tomko <jtomko@redhat.com>
      466b29c8
    • D
      Removing probing of secondary drivers · 55ea7be7
      Daniel P. Berrange 提交于
      For stateless, client side drivers, it is never correct to
      probe for secondary drivers. It is only ever appropriate to
      use the secondary driver that is associated with the
      hypervisor in question. As a result the ESX & HyperV drivers
      have both been forced to do hacks where they register no-op
      drivers for the ones they don't implement.
      
      For stateful, server side drivers, we always just want to
      use the same built-in shared driver. The exception is
      virtualbox which is really a stateless driver and so wants
      to use its own server side secondary drivers. To deal with
      this virtualbox has to be built as 3 separate loadable
      modules to allow registration to work in the right order.
      
      This can all be simplified by introducing a new struct
      recording the precise set of secondary drivers each
      hypervisor driver wants
      
      struct _virConnectDriver {
          virHypervisorDriverPtr hypervisorDriver;
          virInterfaceDriverPtr interfaceDriver;
          virNetworkDriverPtr networkDriver;
          virNodeDeviceDriverPtr nodeDeviceDriver;
          virNWFilterDriverPtr nwfilterDriver;
          virSecretDriverPtr secretDriver;
          virStorageDriverPtr storageDriver;
      };
      
      Instead of registering the hypervisor driver, we now
      just register a virConnectDriver instead. This allows
      us to remove all probing of secondary drivers. Once we
      have chosen the primary driver, we immediately know the
      correct secondary drivers to use.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      55ea7be7
    • D
      don't disable state driver when libvirtd is not built · 220c01aa
      Daniel P. Berrange 提交于
      A bunch of code is wrapped in #if WITH_LIBVIRTD in order to
      enable the virStateDriver to be disabled when libvirtd is not
      built. Disabling this code doesn't have any real functional
      benefit beyond removing 1 pointer from the virConnectPtr struct,
      while having a cost of many more conditionals.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      220c01aa
    • D
      Remove all secondary driver private data fields · f35fa0fd
      Daniel P. Berrange 提交于
      Now all drivers are converted to use their global state
      directly, there is no need for private data fields for
      the secondary drivers in virConnectPtr
      f35fa0fd
    • D
      Remove use of interfacePrivateData from udev driver · d85f9f1a
      Daniel P. Berrange 提交于
      The udev driver can be implemented using global state instead
      of the connect private data.
      d85f9f1a
    • D
      Remove use of nodeDevicePrivateData from nodeDev driver · 60b966b3
      Daniel P. Berrange 提交于
      The node device driver can rely on its global state instead
      of the connect private data.
      60b966b3
    • D
      Remove use of storagePrivateData/networkPrivateData from vbox · 47b7f661
      Daniel P. Berrange 提交于
      The vbox driver can use the main hypervisor private data and
      so does not need to use the storage/network private data fields.
      47b7f661
    • D
      Remove use of nwfilterPrivateData from nwfilter driver · 7b1ba956
      Daniel P. Berrange 提交于
      The nwfilter driver can rely on its global state instead
      of the connect private data.
      7b1ba956
    • D
      Remove use of secretPrivateData from secret driver · 04101f23
      Daniel P. Berrange 提交于
      The secret driver can rely on its global state instead
      of the connect private data.
      04101f23
    • P
      qemu: Fix job handling in qemuDomainSetMetadata · d13f56f0
      Peter Krempa 提交于
      The code modifies the domain configuration but doesn't take a MODIFY
      type job to do so.
      d13f56f0
    • P
      qemu: Fix job type in qemuDomainGetBlockIoTune · fb2ed975
      Peter Krempa 提交于
      The function just queries status so there's no need for a MODIFY type
      job.
      fb2ed975
    • P
      qemu: Fix job handling in qemuDomainSetSchedulerParametersFlags · c5ee5cfb
      Peter Krempa 提交于
      The code modifies the domain configuration but doesn't take a MODIFY
      type job to do so.
      c5ee5cfb
    • P
      qemu: Fix job handling in qemuDomainSetMemoryParameters · 4fd7a720
      Peter Krempa 提交于
      The code modifies the domain configuration but doesn't take a MODIFY
      type job to do so.
      4fd7a720
    • P
      qemu: Fix job handling in qemuDomainSetAutostart · e3e72743
      Peter Krempa 提交于
      The code modifies the domain configuration but doesn't take a MODIFY
      type job to do so.
      
      This patch also fixes a few very long lines of code around the touched
      parts.
      e3e72743
    • P
      qemu: Fix job handling in qemuDomainPinEmulator · 79e56033
      Peter Krempa 提交于
      The code modifies the domain configuration but doesn't take a MODIFY
      type job to do so.
      79e56033