Commits

John Carr  committed 380e4d3

More wrappers for libvirt API

Allows enumeration of libvirt VM's that are already running when
buildbot starts.

  • Participants
  • Parent commits 9b111f8

Comments (0)

Files changed (1)

File master/buildbot/libvirtbuildslave.py

         self.connection = connection
         self.domain = domain
 
+    def name(self):
+        return queue.executeInThread(self.domain.name)
+
     def create(self):
         return queue.executeInThread(self.domain.create)
 
         d.addCallback(_)
         return d
 
+    @defer.inlineCallbacks
+    def all(self):
+        domains = []
+        domain_ids = yield queue.executeInThread(self.connection.listDomainsID)
+
+        for did in domain_ids:
+            domain = yield queue.executeInThread(self.connection.lookupByID, did)
+            domains.append(self.DomainClass(self, domain))
+
+        defer.returnValue(domains)
+
 
 class LibVirtSlave(AbstractLatentBuildSlave):