Skip to content

Commit

Permalink
Merge #2462
Browse files Browse the repository at this point in the history
2462: [qemu/platform] Add plumbing for getting networks r=Saviq a=townsend2010



Co-authored-by: Chris Townsend <[email protected]>
  • Loading branch information
bors[bot] and Chris Townsend authored Mar 31, 2022
2 parents 2bd4f0a + 852d547 commit cfea9a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/platform/backends/qemu/qemu_platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
#define MULTIPASS_QEMU_PLATFORM_H

#include <multipass/disabled_copy_move.h>
#include <multipass/exceptions/not_implemented_on_this_backend_exception.h>
#include <multipass/ip_address.h>
#include <multipass/network_interface_info.h>
#include <multipass/optional.h>
#include <multipass/path.h>
#include <multipass/singleton.h>
Expand Down Expand Up @@ -52,6 +54,10 @@ class QemuPlatform : private DisabledCopyMove
{
return {};
};
virtual std::vector<NetworkInterfaceInfo> networks() const
{
throw NotImplementedOnThisBackendException("networks");
};

protected:
explicit QemuPlatform() = default;
Expand Down
5 changes: 5 additions & 0 deletions src/platform/backends/qemu/qemu_virtual_machine_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,8 @@ QString mp::QemuVirtualMachineFactory::get_backend_directory_name()
{
return qemu_platform->get_directory_name();
}

auto mp::QemuVirtualMachineFactory::networks() const -> std::vector<NetworkInterfaceInfo>
{
return qemu_platform->networks();
}
1 change: 1 addition & 0 deletions src/platform/backends/qemu/qemu_virtual_machine_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class QemuVirtualMachineFactory final : public BaseVirtualMachineFactory
void hypervisor_health_check() override;
QString get_backend_version_string() override;
QString get_backend_directory_name() override;
std::vector<NetworkInterfaceInfo> networks() const override;

private:
QemuPlatform::UPtr qemu_platform;
Expand Down

0 comments on commit cfea9a4

Please sign in to comment.