Commit fb805b5a authored by SIMONIN Matthieu's avatar SIMONIN Matthieu
Browse files

Updates for qemu/tantap support

- [qemu] create /etc/hosts at boottime for easy ping tests
- some docs
parent 3ee5aa1b
Pipeline #173306 failed with stages
in 5 minutes and 26 seconds
# Copyright (C) 2018. The SimGrid Team. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero Licence (see in file LICENCE).
# Compile and install the various par of the project:
# For now (09/20):
# - make DESTDIR=/opt/tansiv
# - fake-vm: implements the client side of the vsg protocol (rust)
# + installed in /opt/fake-vm
# - vsg: implements the simgrid side of the vsg protocol (c/c++)
# + installed in $DESTDIR
# - tansiv: simgrid simulation
# + installed in $DESTDIR
cmake_minimum_required(VERSION 2.8.10)
project (Tansiv C CXX)
......@@ -66,4 +71,4 @@ install(TARGETS tansiv DESTINATION bin)
install(TARGETS vsg DESTINATION lib)
install(FILES src/vsg/vsg.h DESTINATION include)
install(CODE "MESSAGE(\"-- Installing libfake_vm\")")
install(CODE "execute_process(COMMAND make install WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/fake-vm )")
\ No newline at end of file
install(CODE "execute_process(COMMAND make PREFIX=/opt/fake-vm RELEASE=0 install WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/fake-vm )")
\ No newline at end of file
......@@ -109,3 +109,16 @@
+ TODO: understand how/when the packet is actually read by the guest driver (when the interruption handler is called ?)
- réponse: cpu_get_tb_cpu_state dans target/i386/cpu.h il positionne le pc en fonction de env->eip qui est positionné par do_interrupt64,
ce qui veut dire que lorsque la traduction/exécution des tb suivant reprend elle reprendra au handler d'interruption en question (youpi !)
* Gestion du temps / icount mode
- Dans ce mode l'horloge virtuelle s'incrémente à chaque instruction (virtuelle) executée.
- Par défaut une instruction = 1 nanoseconde (1 instruction par cycle sur un processeur à 1GHz)
- l'option ~shift~ permet de cadencer le proc à des diviseurs de 1GHz.
(~shift=2~ chaque opération compte pour ~2^2~ nanoseconde soit un proc émuler
de ~1/2^2~ 250MHz)
- en pratique
+ Lorsque ~icount~ est utilisé TCG passe en mode mono-threadé:
+ Anatomie de la boucle d'évaluation des instructions lorsque icount est actif:
-
......@@ -22,6 +22,10 @@ Environment Variables:
from third party (examples)
SLIRP_DEBUG="all": activate all debug message from slirp
G_MESSAGES_DEBUG="Slirp": glib debug filter
NOTE:
- create tuntap /a priori/:
e.g: sudo ip tuntap add tap11 mode tap user $USER && sudo ip link set tap11 master virbr0 && sudo ip link set tap11 up
EOF
}
......@@ -64,6 +68,8 @@ disable_root: false
bootcmd:
- echo "-----> START of MY CLOUD INIT <---------- \n"
- echo "-----> END of MY CLOUD INIT <---------- \n"
- echo "192.168.122.10 m10" >> /etc/hosts
- echo "192.168.122.11 m11" >> /etc/hosts
EOF
genisoimage -output $CLOUD_INIT_ISO -volid cidata -joliet -rock $CLOUD_INIT_DIR/user-data $CLOUD_INIT_DIR/meta-data
......@@ -80,6 +86,7 @@ VM_IMAGE=$VM_NAME.qcow2
TAP_NAME=tap${MAC:(-2)}
$QEMU \
--vsg mynet0,src=$IP \
-m 1g \
-drive file=$VM_IMAGE \
-cdrom $CLOUD_INIT_ISO \
......
......@@ -3,16 +3,16 @@
<platform version="4.1">
<actor host="nova-1.lyon.grid5000.fr" function="vsg_vm">
<argument value="192.168.0.10"/> <!-- how simgrid knows me-->
<argument value="192.168.122.10"/> <!-- how simgrid knows me-->
<argument value="./examples/qemus/boot_and_log.sh"/>
<argument value="192.168.0.10"/> <!-- how vsg knows me-->
<argument value="192.168.122.10"/> <!-- how vsg knows me-->
<argument value="52:54:00:00:00:10"/> <!-- my mac address so that the dhcp give the above IP -->
</actor>
<actor host="nova-2.lyon.grid5000.fr" function="vsg_vm">
<argument value="192.168.0.11"/> <!-- how simgrid knows me-->
<argument value="192.168.122.11"/> <!-- how simgrid knows me-->
<argument value="./examples/qemus/boot_and_log.sh"/>
<argument value="192.168.0.11"/> <!-- how vsg knows me-->
<argument value="192.168.122.11"/> <!-- how vsg knows me-->
<argument value="52:54:00:00:00:11"/> <!-- my mac address so that the dhcp give the above IP -->
</actor>
......
......@@ -4,11 +4,14 @@
#include <stdint.h>
#include <sys/time.h>
#define MAX_PACKET_SIZE 2048
struct vsg_context;
typedef void (*vsg_recv_cb)(uintptr_t recv_cb_arg);
struct vsg_context* vsg_init(int argc, const char* const argv[], int* next_arg_p, vsg_recv_cb recv_cb, uintptr_t recv_cb_arg);
struct vsg_context* vsg_init(int argc, const char* const argv[], int* next_arg_p, vsg_recv_cb recv_cb,
uintptr_t recv_cb_arg);
void vsg_cleanup(struct vsg_context* context);
int vsg_start(const struct vsg_context* context);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment