summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--builder/dnbd3-rootfs/scripts/build.sh6
-rw-r--r--dev-tools/qemuDebuggingPatch/qemu-nbd.c116
-rw-r--r--dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default2
3 files changed, 71 insertions, 53 deletions
diff --git a/builder/dnbd3-rootfs/scripts/build.sh b/builder/dnbd3-rootfs/scripts/build.sh
index dc804d4d..186bdef4 100644
--- a/builder/dnbd3-rootfs/scripts/build.sh
+++ b/builder/dnbd3-rootfs/scripts/build.sh
@@ -26,11 +26,13 @@ build_compile_qemu_nbd() {
[ ! -e qemu ] && git clone git://git.qemu.org/qemu.git qemu
cd qemu
# TODO check what other features can be disabled
- ./configure --static --target-list=x86_64-linux-user \
+ # --static
+ ./configure --target-list=x86_64-linux-user \
--python=$(which python2) --disable-docs --disable-gtk --disable-vnc \
--disable-kvm --disable-libssh2 --enable-user --disable-system \
--disable-fdt --disable-libnfs --disable-glusterfs --disable-libiscsi \
- --disable-gcrypt --disable-nettle && make qemu-nbd
+ --disable-gcrypt --disable-nettle
+ make qemu-nbd
local ret=$?
popd
return $ret
diff --git a/dev-tools/qemuDebuggingPatch/qemu-nbd.c b/dev-tools/qemuDebuggingPatch/qemu-nbd.c
index 3af28a07..ce0043d4 100644
--- a/dev-tools/qemuDebuggingPatch/qemu-nbd.c
+++ b/dev-tools/qemuDebuggingPatch/qemu-nbd.c
@@ -244,64 +244,80 @@ static void *nbd_client_thread(void *arg)
pthread_t show_parts_thread;
Error *local_error = NULL;
+ // changed
+ while(1) {
+ // --
+ sock = socket_connect(saddr, &local_error, NULL, NULL);
+ if (sock < 0) {
+ error_report_err(local_error);
+ goto out;
+ }
- sock = socket_connect(saddr, &local_error, NULL, NULL);
- if (sock < 0) {
- error_report_err(local_error);
- goto out;
- }
-
- ret = nbd_receive_negotiate(sock, NULL, &nbdflags,
- &size, &local_error);
- if (ret < 0) {
- if (local_error) {
- fprintf(stderr, "%s\n", error_get_pretty(local_error));
- error_free(local_error);
+ ret = nbd_receive_negotiate(sock, NULL, &nbdflags,
+ &size, &local_error);
+ if (ret < 0) {
+ if (local_error) {
+ fprintf(stderr, "%s\n", error_get_pretty(local_error));
+ error_free(local_error);
+ }
+ goto out_socket;
}
- goto out_socket;
- }
- fd = open(device, O_RDWR);
- if (fd < 0) {
- /* Linux-only, we can use %m in printf. */
- fprintf(stderr, "Failed to open %s: %m\n", device);
- goto out_socket;
- }
+ fd = open(device, O_RDWR);
+ if (fd < 0) {
+ /* Linux-only, we can use %m in printf. */
+ fprintf(stderr, "Failed to open %s: %m\n", device);
+ goto out_socket;
+ }
- ret = nbd_init(fd, sock, nbdflags, size);
- if (ret < 0) {
- fprintf(stderr, "------------------------\nJAU: nbd_client_thread -> trigger out_fd caused by nbd_init PID: %d\n-------------------\n", getpid());
- goto out_fd;
- }
+ ret = nbd_init(fd, sock, nbdflags, size);
+ if (ret < 0) {
+ fprintf(stderr, "------------------------\nJAU: nbd_client_thread -> trigger out_fd caused by nbd_init PID: %d\n-------------------\n", getpid());
+ goto out_fd;
+ }
- /* update partition table */
- pthread_create(&show_parts_thread, NULL, show_parts, device);
+ /* update partition table */
+ pthread_create(&show_parts_thread, NULL, show_parts, device);
- if (verbose) {
- fprintf(stderr, "NBD device %s is now connected to %s\n",
- device, srcpath);
- } else {
- /* Close stderr so that the qemu-nbd process exits. */
- dup2(STDOUT_FILENO, STDERR_FILENO);
- }
+ if (verbose) {
+ fprintf(stderr, "NBD device %s is now connected to %s\n",
+ device, srcpath);
+ } else {
+ /* Close stderr so that the qemu-nbd process exits. */
+ dup2(STDOUT_FILENO, STDERR_FILENO);
+ }
- // Changed
- pid_t pid;
- pid = fork();
- if (pid == 0) {
- fprintf(stderr, "------------------------\nJAU: nbd_client -> custom fork sleep started PID: %d\n-------------------\n", getpid());
- sleep(10);
- int a = chdir("/sysroot/");
- fprintf(stderr, "------------------------\nJAU: nbd_client -> custom fork sleep finished chdir returned %d PID: %d\n-------------------\n", a, getpid());
- exit(0);
- }
- // --
- ret = nbd_client(fd);
- if (ret) {
- fprintf(stderr, "------------------------\nJAU: nbd_client_thread -> trigger out_fd caused by nbd_client PID: %d\n-------------------\n", getpid());
- goto out_fd;
+ /* Changed
+ pid_t pid;
+ pid = fork();
+ if (pid == 0) {
+ fprintf(stderr, "------------------------\nJAU: nbd_client -> custom fork sleep started PID: %d\n-------------------\n", getpid());
+ sleep(10);
+ int a = chdir("/sysroot/");
+ fprintf(stderr, "------------------------\nJAU: nbd_client -> custom fork sleep finished chdir returned %d PID: %d\n-------------------\n", a, getpid());
+ exit(0);
+ }
+ */
+ ret = nbd_client(fd);
+ // changed
+ if (errno == ETIMEDOUT) {
+ fprintf(stderr, "------------------------\nJAU: nbd_client_thread -> trigger out_fd caused by nbd_client -> BUT Ignored and starting reconnect! PID: %d\n-------------------\n", getpid());
+ close(fd);
+ continue;
+ }
+ //
+ if (ret) {
+ goto out_fd;
+ // changed
+ } else {
+ close(fd);
+ break;
+ }
+ //
+ close(fd);
+ // changed
}
- close(fd);
+ //--
kill(getpid(), SIGTERM);
fprintf(stderr, "------------------------\nJAU: nbd_client_thread -> STOP PID: %d\n-------------------\n", getpid());
return (void *) EXIT_SUCCESS;
diff --git a/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default b/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
index da0f4f5d..698a7c48 100644
--- a/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
+++ b/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
@@ -8,7 +8,7 @@ MENU TITLE Janosch und Torbens Bastelspassmenu
LABEL arch
MENU LABEL ^arch network boot
KERNEL /archLinux-vmlinuz-linux
-APPEND initrd=/archLinux-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=archLinux/ systemd.journald.forward_to_console=1
+APPEND initrd=/archLinux-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=archLinux/ systemd.journald.forward_to_console=1
SYSAPPEND 2
LABEL ubuntu