Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
if [ -z "$XDG_CONFIG_HOME" ]; then
XDG_CONFIG_HOME="$HOME/.config"
fi
if [ -z "$XDG_DATA_HOME" ]; then
XDG_DATA_HOME="$HOME/.local/share"
fi
@elmarco
elmarco / deptrace.py
Created September 13, 2019 17:11
Generate depfile for python scripts
#! /usr/bin/python3
# coding: utf-8
# Author: Marc-André Lureau <[email protected]>
import sys
import os
import atexit
from importlib import invalidate_caches
from importlib.machinery import FileFinder, SourceFileLoader
@elmarco
elmarco / .clang-format
Created November 14, 2018 12:36
qemu clang format
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
@elmarco
elmarco / .clang-format
Created August 29, 2017 15:51
qemu .clang-format
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
@elmarco
elmarco / .clang-format
Created August 29, 2017 15:38
qemu .clang-format
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
---
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
@elmarco
elmarco / .clang-format
Created August 29, 2017 15:36
qemu .clang-format
---
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
---
Language: Cpp
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false # although we like it, it creates churn
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: false # churn
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
commit 6cba14958b198cd9b34d653cab633cdcbe471fbc
Author: Marc-André Lureau <[email protected]>
Date: Fri Sep 4 21:18:39 2015 +0200
Add object_class_property_add_link
Signed-off-by: Marc-André Lureau <[email protected]>
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index 1556c9c..c78c7fb 100644
#!/bin/bash
set -x
trap 'kill 0' EXIT
qemu_start() {
local port=$1
qemu-system-x86_64 -m 1024 -vga qxl -spice addr=0.0.0.0,tls-port=$port,disable-ticketing,x509-dir=. -monitor unix:qemu-$port,server,nowait
static gint msi_base64_decode(gint x)
{
if (x < 10)
return x + '0';
if (x < (10 + 26))
return x - 10 + 'A';
if (x < (10 + 26 + 26))
return x - 10 - 26 + 'a';
if (x == (10 + 26 + 26))
return '.';