1. 19 9月, 2016 3 次提交
    • M
      qemu: Introduce qemuGetHupageMemPath · eef8b263
      Michal Privoznik 提交于
      Now that we have two same implementations for getting path for
      huge pages backed guest memory, lets merge them into one function.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      eef8b263
    • M
      qemuBuildMemoryBackendStr: Don't crash if no hugetlbfs is mounted · 647db05e
      Michal Privoznik 提交于
      When trying to migrate a huge page enabled guest, I've noticed
      the following crash. Apparently, if no specific hugepages are
      requested:
      
        <memoryBacking>
          <hugepages/>
        </memoryBacking>
      
      and there are no hugepages configured on the destination, we try
      to dereference a NULL pointer.
      
      Program received signal SIGSEGV, Segmentation fault.
      0x00007fcc907fb20e in qemuGetHugepagePath (hugepage=0x0) at qemu/qemu_conf.c:1447
      1447        if (virAsprintf(&ret, "%s/libvirt/qemu", hugepage->mnt_dir) < 0)
      (gdb) bt
      #0  0x00007fcc907fb20e in qemuGetHugepagePath (hugepage=0x0) at qemu/qemu_conf.c:1447
      #1  0x00007fcc907fb2f5 in qemuGetDefaultHugepath (hugetlbfs=0x0, nhugetlbfs=0) at qemu/qemu_conf.c:1466
      #2  0x00007fcc907b4afa in qemuBuildMemoryBackendStr (size=4194304, pagesize=0, guestNode=0, userNodeset=0x0, autoNodeset=0x0, def=0x7fcc70019070, qemuCaps=0x7fcc70004000, cfg=0x7fcc5c011800, backendType=0x7fcc95087228, backendProps=0x7fcc95087218,
          force=false) at qemu/qemu_command.c:3297
      #3  0x00007fcc907b4f91 in qemuBuildMemoryCellBackendStr (def=0x7fcc70019070, qemuCaps=0x7fcc70004000, cfg=0x7fcc5c011800, cell=0, auto_nodeset=0x0, backendStr=0x7fcc70020360) at qemu/qemu_command.c:3413
      #4  0x00007fcc907c0406 in qemuBuildNumaArgStr (cfg=0x7fcc5c011800, def=0x7fcc70019070, cmd=0x7fcc700040c0, qemuCaps=0x7fcc70004000, auto_nodeset=0x0) at qemu/qemu_command.c:7470
      #5  0x00007fcc907c5fdf in qemuBuildCommandLine (driver=0x7fcc5c07b8a0, logManager=0x7fcc70003c00, def=0x7fcc70019070, monitor_chr=0x7fcc70004bb0, monitor_json=true, qemuCaps=0x7fcc70004000, migrateURI=0x7fcc700199c0 "defer", snapshot=0x0,
          vmop=VIR_NETDEV_VPORT_PROFILE_OP_MIGRATE_IN_START, standalone=false, enableFips=false, nodeset=0x0, nnicindexes=0x7fcc95087498, nicindexes=0x7fcc950874a0, domainLibDir=0x7fcc700047c0 "/var/lib/libvirt/qemu/domain-1-fedora") at qemu/qemu_command.c:9547
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      647db05e
    • C
      qemu_agent|monitor: use different log on hangup event · 4c886408
      Chen Hanxiao 提交于
      Both qemu monitor and agent print the same
      log on HUANGUP event, which would be confusing
      when reading libvirtd log.
      
      This patch will give a different log message to them.
      Signed-off-by: NChen Hanxiao <chenhanxiao@gmail.com>
      Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
      4c886408
  2. 16 9月, 2016 3 次提交
    • M
      conf: Allow copying of shmem defs · 921ec15f
      Martin Kletzander 提交于
      This way we'll be able to hotplug with both --live and --config in one
      API call.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      921ec15f
    • L
      qemu: map "virtio" video model to "virt" machtype correctly (arm/aarch64) · 706b5b62
      Laszlo Ersek 提交于
      Most of QEMU's PCI display device models, such as:
      
        libvirt video/model/@type  QEMU -device
        -------------------------  ------------
        cirrus                     cirrus-vga
        vga                        VGA
        qxl                        qxl-vga
        virtio                     virtio-vga
      
      come with a linear framebuffer (sometimes called "VGA compatibility
      framebuffer"). This linear framebuffer lives in one of the PCI device's
      MMIO BARs, and allows guest code (primarily: firmware drivers, and
      non-accelerated OS drivers) to display graphics with direct memory access.
      
      Due to architectural reasons on aarch64/KVM hosts, this kind of
      framebuffer doesn't / can't work in
      
        qemu-system-(arm|aarch64) -M virt
      
      machines. Cache coherency issues guarantee a corrupted / unusable display.
      The problem has been researched by several people, including kvm-arm
      maintainers, and it's been decided that the best way (practically the only
      way) to have boot time graphics for such guests is to consolidate on
      QEMU's "virtio-gpu-pci" device.
      
      >From <https://bugzilla.redhat.com/show_bug.cgi?id=1195176>, libvirt
      supports
      
        <devices>
          <video>
            <model type='virtio'/>
          </video>
        </devices>
      
      but libvirt unconditionally maps @type='virtio' to QEMU's "virtio-vga"
      device model. (See the qemuBuildDeviceVideoStr() function and the
      "qemuDeviceVideo" enum impl.)
      
      According to the above, this is not right for the "virt" machine type; the
      qemu-system-(arm|aarch64) binaries don't even recognize the "virtio-vga"
      device model (justifiedly). Whereas "virtio-gpu-pci", which is a pure
      virtio device without a compatibility framebuffer, is available, and works
      fine.
      
      (The ArmVirtQemu ("AAVMF") platform of edk2 -- that is, the UEFI firmware
      for "virt" -- supports "virtio-gpu-pci", as of upstream commit
      3ef3209d3028. See
      <https://tianocore.acgmultimedia.com/show_bug.cgi?id=66>.)
      
      Override the default mapping of "virtio", from "virtio-vga" to
      "virtio-gpu-pci", if qemuDomainMachineIsVirt() evaluates to true.
      
      Cc: Andrea Bolognani <abologna@redhat.com>
      Cc: Drew Jones <drjones@redhat.com>
      Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
      Cc: Martin Kletzander <mkletzan@redhat.com>
      Suggested-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1372901Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Acked-by: NMartin Kletzander <mkletzan@redhat.com>
      706b5b62
    • M
      util: Expose virHostCPUStatsAssign on non-Linux · b51e26f7
      Martin Kletzander 提交于
      There is nothing Linux-specific in that function.  Also since commit
      8c3b5bf4 mingw build is broken due to
      the fact that this function is not compiled in the library.
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      b51e26f7
  3. 15 9月, 2016 9 次提交
  4. 14 9月, 2016 8 次提交
  5. 13 9月, 2016 5 次提交
  6. 12 9月, 2016 12 次提交
    • D
      qemu: avoid parameter named 'listen' · 92513bc2
      Daniel P. Berrange 提交于
      previous commit:
      
        commit 2c322378
        Author: John Ferlan <jferlan@redhat.com>
        Date:   Mon Jun 13 12:30:34 2016 -0400
      
          qemu: Add the ability to hotplug the TLS X.509 environment
      
      added a parameter "bool listen" in some methods. This
      unfortunately clashes with the listen() method, causing
      compile failures on certain platforms (RHEL-6 for example)
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      92513bc2
    • J
      storage: Need to properly read the crypt offset value · 2f6b750e
      John Ferlan 提交于
      Commit id 'a48c7141' altered how to determine if a volume was encrypted
      by adding a peek at an offset into the file at a specific buffer location.
      Unfortunately, all that was compared was the first "char" of the buffer
      against the expect "int" value.
      
      Restore the virReadBufInt32BE to get the complete field in order to
      compare against the expected value from the qcow2EncryptionInfo or
      qcow1EncryptionInfo "modeValue" field.
      
      This restores the capability to create a volume with encryption, then
      refresh the pool, and still find the encryption for the volume.
      2f6b750e
    • J
      storage: Need to refresh secret for luks volume after volume refresh · b68487c9
      John Ferlan 提交于
      A LUKS volume uses the volume secret type just like the QCOW2 secret, so
      adjust the loading of the default secrets to handle any volume that the
      virStorageFileGetMetadataFromBuf code has deemed to be an encrypted volume
      to search for the volume's secret. This lookup is done by volume usage
      where the usage is expected to be the path to volume.
      b68487c9
    • N
      log: Fix reporting OOM error incorrectly when defining a logging filter · b6daacf6
      Nikolay Shirokovskiy 提交于
      When a new filter is being defined, the return code is not handled properly,
      thus triggering OOM error reporting routine (bug introduced by 51b2606f).
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      b6daacf6
    • J
      qemu: Don't use query-migrate on destination · 56258a38
      Jiri Denemark 提交于
      When migration fails, we need to poke QEMU monitor to check for a reason
      of the failure. We did this using query-migrate QMP command, which is
      not supposed to return any meaningful result on the destination side.
      Thus if the monitor was still functional when we detected the migration
      failure, parsing the answer from query-migrate always failed with the
      following error message:
      
          "info migration reply was missing return status"
      
      This irrelevant message was then used as the reason for the migration
      failure replacing any message we might have had.
      
      Let's use harmless query-status for poking the monitor to make sure we
      only get an error if the monitor connection is broken.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1374613Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
      56258a38
    • J
      util: Quiet the logging if perf file doesn't exist · c8b8bbc3
      John Ferlan 提交于
      Commit id 'b00d7f29' shifted the opening of the /sys/devices/intel_cqm/type
      file from event enable to perf event initialization. If the file did not
      exist, then an error would be written to the domain log:
      
      2016-09-06 20:51:21.677+0000: 7310: error : virFileReadAll:1360 : Failed to open file '/sys/devices/intel_cqm/type': No such file or directory
      
      Since the error is now handled in virPerfEventEnable by checking if the
      event_attr->attrType == 0 for CMT, MBML, and MBMT events - we can just
      use the Quiet API in order to not log the error we're going to throw away.
      
      Additionally, rather than using virReportSystemError, use virReportError
      and VIR_ERR_ARGUMENT_UNSUPPORTED in order to signify that support isn't there
      for that type of perf event - adjust the error message as well.
      c8b8bbc3
    • J
      libxl: implement virConnectBaselineCPU · 69f4030a
      Joao Martins 提交于
      Akin to previous commit but for "virsh cpu-baseline" which
      computes a baseline CPU for a set of host cpu elements.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      69f4030a
    • J
      libxl: implement virConnectCompareCPU · 5822b740
      Joao Martins 提交于
      Implement support for "virsh cpu-compare" so that we can calculate
      common cpu element between a pool of hosts, which had a requirement
      of providing host cpu description.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      5822b740
    • J
      libxl: describe host cpu features based on hwcaps · 17322e55
      Joao Martins 提交于
      Parse libxl_hwcap accounting for versions since Xen 4.4 - Xen 4.7.
      libxl_hwcaps is a set of cpuid leaves output that is described in [0] or
      [1] in Xen 4.7. This is a collection of CPUID leaves that we version
      in libvirt whenever feature words are reordered or added. Thus we keep the
      common ones in one struct and others for each version. Since
      libxl_hwcaps doesn't appear to have a stable format across all supported
      versions thus we need to keep track of changes as a compromise until it's
      exported in xen libxl API. We don't fail in initializing the driver in case
      parsing of hwcaps failed for that reason. In addition, change the notation
      on PAE feature such that is easier to read which bit it corresponds.
      
      [0] xen/include/asm-x86/cpufeature.h
      [1] xen/include/public/arch-x86/cpufeatureset.h
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      17322e55
    • J
      libxl: describe host topology in capabilities · 3d54305e
      Joao Martins 提交于
      Add support for describing cpu topology in host cpu element.  In doing
      so, refactor hwcaps part to its own helper namely libxlCapsInitCPU to
      handle all host cpu related operations, including topology.
      Signed-off-by: NJoao Martins <joao.m.martins@oracle.com>
      3d54305e
    • P
      qemu: hotplug: Don't wait if cdrom tray is opened forcibly · 85c82612
      Peter Krempa 提交于
      Qemu always opens the tray if forced to. Skip the waiting step in such
      case.
      
      This also helps if qemu does not report the tray change event when
      opening the cdrom forcibly (the documentation says that the event will
      not be sent although qemu in fact does trigger it even if @force is
      selceted).
      
      This is a workaround for a qemu issue where qemu does not send the tray
      change event in some cases (after migration with empty closed locked
      drive) and thus renders the cdrom useless from libvirt's point of view.
      
      Partially resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1368368
      85c82612
    • P
      qemu: domain: Clear startup policy for dropped removable media · 6e19cc59
      Peter Krempa 提交于
      When a source image is dropped when missing due to startup policy the
      policy needs to be cleared since it was relevant only for the given
      storage source. New sources need to update it if needed.
      6e19cc59