code: def start_capture(self, adapter_number, output_file):
          
  
          try:
              adapter = self._ethernet_adapters[adapter_number]
          except IndexError:
              raise QemuError('Adapter {adapter_number} does not exist on QEMU VM "{name}"'.format(name=self._name,
                                                                                                   adapter_number=adapter_number))
  
          nio = adapter.get_nio(0)
  
          if not nio:
              raise QemuError("Adapter {} is not connected".format(adapter_number))
  
          if nio.capturing:
              raise QemuError("Packet capture is already activated on adapter {adapter_number}".format(adapter_number=adapter_number))
  
          nio.startPacketCapture(output_file)
  
          if self.ubridge:
              yield from self._ubridge_send('bridge start_capture {name} "{output_file}"'.format(name="QEMU-{}-{}".format(self._id, adapter_number),
                                                                                                 output_file=output_file))
  
          log.info("QEMU VM '{name}' [{id}]: starting packet capture on adapter {adapter_number}".format(name=self.name,
                                                                                                         id=self.id,
                                                                                                         adapter_number=adapter_number))
docs: Starts a packet capture.
  
          :param adapter_number: adapter number
          :param output_file: PCAP destination file for the capture