1. 24 7月, 2017 12 次提交
    • M
      virobject: Introduce virObjectRWLockable · 77f4593b
      Michal Privoznik 提交于
      Up until now we only had virObjectLockable which uses mutexes for
      mutually excluding each other in critical section. Well, this is
      not enough. Future work will require RW locks so we might as well
      have virObjectRWLockable which is introduced here.
      
      Moreover, polymorphism is introduced to our code for the first
      time. Yay! More specifically, virObjectLock will grab a write
      lock, virObjectLockRead will grab a read lock then (what a
      surprise right?). This has great advantage that an object can be
      made derived from virObjectRWLockable in a single line and still
      continue functioning properly (mutexes can be viewed as grabbing
      write locks only). Then just those critical sections that can
      grab a read lock need fixing. Therefore the resulting change is
      going to be way smaller.
      
      In order to avoid writer starvation, the object initializes RW
      lock that prefers writers.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
      77f4593b
    • M
      virthread: Introduce virRWLockInitPreferWriter · 328bd244
      Michal Privoznik 提交于
      We already have virRWLockInit. But this uses pthread defaults
      which prefer reader to initialize the RW lock. This may lead to
      writer starvation. Therefore we need to have the counterpart that
      prefers writers. Now, according to the
      pthread_rwlockattr_setkind_np() man page setting
      PTHREAD_RWLOCK_PREFER_WRITER_NP attribute is no-op. Therefore we
      need to use PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP
      attribute. So much for good enum value names.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
      328bd244
    • M
      testutils: Remove unneeded variable · 64bebb2b
      Martin Kletzander 提交于
      virDomainXMLOptionNew() gladly accepts NULL and it is used in some
      drivers.  There is no need for additional variable with no members set
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      64bebb2b
    • S
      qemu_capabilities: Fix the formatting with a space · 1cb188de
      Shivaprasad G Bhat 提交于
      It was observed while adding new property that there should be a space
      before closing a curly brace in intel-iommu object property definition.
      Fixing it as a separate patch.
      Signed-off-by: NShivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
      1cb188de
    • M
      docs: Span cells if there's not doc text for enum val · 099a5ef8
      Michal Privoznik 提交于
      When generating HTML documentation we put enum values into a
      table so that we can display the value's name, numerical value
      and description (if it has one). Now the last part is problem. If
      the value doesn't have description the table row has just two
      cells and if it has one the row counts three cells. This makes
      HTML engines render the description into very little space - for
      instance see:
      
        html/libvirt-libvirt-domain.html#virDomainMemoryStatTags
      
      We can avoid this problem if we let the cell that corresponds to
      numerical value span over two cells if there's no description.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
      099a5ef8
    • M
      apibuild.py: Handle enum comments properly · 6efdd94d
      Michal Privoznik 提交于
      After f4cb85c6 we only have two options for placing enum
      values descriptions. It's either:
      
          typedef enum {
              /* Some long description. Therefore it's placed before
               * the value. */
              VIR_ENUM_A_VAL = 1,
          } virEnumA;
      
      or:
      
          typedef enum {
              VIR_ENUM_B_VAL = 1, /* Some short description */
          } virEnumB;
      
      However, our apibuild.py script is not able to deal with the
      former one. It messes up comments. To fix this couple of things
      needs to be done:
      
      a) DO NOT reset self.comment in parseEnumBlock(). This is a
      result from our tokenizer. Upon calling token() if it finds a
      comment block it stores it in self.comment and returns the next
      token (which is not comment). Therefore, if we reset self.comment
      we might lose the first comment in the enum block.
      
      b) we need a variable to track if the current enum block uses
      value descriptions before or after values. That is if it's type
      virEnumA or virEnumB. Depending on that, it we're dealing with
      virEnumA type and the current token is a comma ',' we can add the
      value into the list as we already have everything needed:
      comment, name and value.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Reviewed-by: NMartin Kletzander <mkletzan@redhat.com>
      6efdd94d
    • P
      virStorageNetHostDef: Turn @port into integer · 97ea8da1
      Peter Krempa 提交于
      Currently, @port is type of string. Well, that's overkill and
      waste of memory. Port is always an integer. Use it as such.
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      97ea8da1
    • P
      conf: domain: Split up virDomainStorageHostParse and rename it · a7828886
      Peter Krempa 提交于
      Split out parsing of one host into a separate function and add a new
      function to loop through all the host XML nodes.
      
      This change removes multiple levels of nesting due to the old XML
      parsing approach used.
      a7828886
    • P
      util: storage: fill in default ports when parsing backing chain · 8444419f
      Peter Krempa 提交于
      Similarly to when parsing XML we need to fill in default ports for the
      backing chain. This was missed in commit 5bda8354
      8444419f
    • P
      qemu: command: Remove condition to use default sheepdog port · 615e34a7
      Peter Krempa 提交于
      Since we now set the default ports when parsing disks, it's not
      necessary to have default port numbers encoded in the command line
      generator.
      615e34a7
    • P
      util: uri: Convert port number to unsigned integer · 1f920b9f
      Peter Krempa 提交于
      Negative ports don't make sense so use a unsigned integer.
      1f920b9f
    • P
      qemu: command: Rename and move qemuNetworkDriveGetPort · e8b69016
      Peter Krempa 提交于
      Move it to virstring.c and improve it to parse and validate ports. New
      name is virStringParsePort.
      e8b69016
  2. 22 7月, 2017 14 次提交
  3. 21 7月, 2017 8 次提交
  4. 20 7月, 2017 6 次提交