aboutsummaryrefslogtreecommitdiff
path: root/qga/commands-bsd.c
diff options
context:
space:
mode:
authorAlexander Ivanov <alexander.ivanov@virtuozzo.com>2022-10-17 09:28:24 +0200
committerKonstantin Kostiuk <kkostiuk@redhat.com>2022-10-26 20:35:07 +0300
commita1241094223d69d72bebc5ed7a5f6f57cbc7986c (patch)
tree31538bb7cc9854627b5866c50b867380fce43953 /qga/commands-bsd.c
parent4fd0642e84e2dc25033090cad73f1ef1904e1600 (diff)
downloadqemu-a1241094223d69d72bebc5ed7a5f6f57cbc7986c.zip
qemu-a1241094223d69d72bebc5ed7a5f6f57cbc7986c.tar.gz
qemu-a1241094223d69d72bebc5ed7a5f6f57cbc7986c.tar.bz2
qga: Move HW address getting to a separate function
In the next patch FreeBSD support for guest-network-get-interfaces will be added. Previously move Linux-specific code of HW address getting to a separate functions and add a dumb function to commands-bsd.c. Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Diffstat (limited to 'qga/commands-bsd.c')
-rw-r--r--qga/commands-bsd.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/qga/commands-bsd.c b/qga/commands-bsd.c
index ca06692..ebf0fb8 100644
--- a/qga/commands-bsd.c
+++ b/qga/commands-bsd.c
@@ -167,3 +167,19 @@ GuestCpuStatsList *qmp_guest_get_cpustats(Error **errp)
return NULL;
}
#endif /* CONFIG_FSFREEZE */
+
+#ifdef HAVE_GETIFADDRS
+/*
+ * Fill "buf" with MAC address by ifaddrs. Pointer buf must point to a
+ * buffer with ETHER_ADDR_LEN length at least.
+ *
+ * Returns false in case of an error, otherwise true. "obtained" arguument
+ * is true if a MAC address was obtained successful, otherwise false.
+ */
+bool guest_get_hw_addr(struct ifaddrs *ifa, unsigned char *buf,
+ bool *obtained, Error **errp)
+{
+ *obtained = false;
+ return true;
+}
+#endif /* HAVE_GETIFADDRS */