Class: VagrantPlugins::QEMU::Network::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-qemu/network/base.rb

Direct Known Subclasses

Socket, SocketVmnet, Tap, Vmnet

Instance Method Summary collapse

Instance Method Details

#build_netdev_args(id, options) ⇒ Array<String>

Build -netdev arguments for the advanced network NIC

Parameters:

  • id (String)

    netdev id (e.g. "net1")

  • options (Hash)

    provider config options

Returns:

  • (Array<String>)

    QEMU command line arguments

Raises:

  • (NotImplementedError)


9
10
11
# File 'lib/vagrant-qemu/network/base.rb', line 9

def build_netdev_args(id, options)
  raise NotImplementedError
end

#launch_prefix(options) ⇒ Array<String>

Tokens to prepend to the QEMU launch command (a wrapper program). Empty by default; only socket_vmnet's wrapper route is non-empty. The driver applies this under the same gate as build_netdev_args.

Parameters:

  • options (Hash)

    provider config options

Returns:

  • (Array<String>)


24
25
26
# File 'lib/vagrant-qemu/network/base.rb', line 24

def launch_prefix(options)
  []
end

#preflight!(options, qemu_binary) ⇒ Object

Validate preconditions and resolve any backend-specific options before the command is built. No-op by default; the driver calls it under the same gate as build_netdev_args.

Parameters:

  • options (Hash)

    provider config options (may be mutated)

  • qemu_binary (String)

    the resolved qemu-system-* binary



33
34
# File 'lib/vagrant-qemu/network/base.rb', line 33

def preflight!(options, qemu_binary)
end

#requires_sudo?Boolean

Whether this backend requires sudo to run QEMU

Returns:

  • (Boolean)


15
16
17
# File 'lib/vagrant-qemu/network/base.rb', line 15

def requires_sudo?
  false
end