1. 07 6月, 2018 2 次提交
    • D
      Don't use enums in TPM struct fields · ed29219f
      Daniel P. Berrangé 提交于
      When using an enum in a struct field, the compiler is free to decide to
      make it an unsigned type if it desires. This in turn leads to bugs when
      code does
      
          if ((def->foo = virDomainFooTypeFromString(str)) < 0)
             ...
      
      because 'def->foo' can't technically have an unsigned value from the
      compiler's POV. While it is possible to add (int) casts in the code
      example above, this is not desirable because it is easy to miss out
      such casts. eg the code fixed here caused an error with clang builds
      
      ../../src/conf/domain_conf.c:12838:73: error: comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-compare]
              if ((def->version = virDomainTPMVersionTypeFromString(version)) < 0) {
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      ed29219f
    • K
      storage: fix crash in luks encrypted volume creation · fab2e49d
      Katerina Koukiou 提交于
      Fix the case when creating a luks encrypted volume
      via an xml file without 'secret' element.
      libvirtd was receiving SIGSEGV, now proper error is reported for
      the missing element.
      
      Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1468422Signed-off-by: NKaterina Koukiou <kkoukiou@redhat.com>
      fab2e49d
  2. 06 6月, 2018 28 次提交
  3. 05 6月, 2018 10 次提交