Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[qemu/platform] Add plumbing for getting networks #2462

Merged
merged 2 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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