Git Product home page Git Product logo

libvirt-add-new-api-demo's Introduction

libvirt-add-new-api-demo

ABOUT

This patch is an example to add new APIs in LibVirt, also add entries in virsh. I implement qemu driver only but others are the same.

USAGE

git clone https://github.com/Arondight/libvirt-add-new-api-demo.git
git clone https://github.com/libvirt/libvirt.git
git clone https://github.com/coreutils/gnulib.git
export LIBVIRT_PATCH=$(readlink -f ./libvirt-add-new-api-demo/LibVirt-add-new-API-demo.patch)
export GNULIB_SRCDIR=$(readlink -f ./gnulib)
cd libvirt
git checkout v2.5.0
git am $LIBVIRT_PATCH
./autogen.sh
make -j8
make check -j8

SYNOPSIS

There are 3 new commands in virsh:

  1. get-magic: Get magic file's content
  • set-magic: Set magic file's content
  • magic-status: Show if magic file can be read

You can run virsh via run to try these.

First start libvirtd in a new console with root privilege.

sudo ./run ./daemon/libvirtd

Then set or get magic file's content.

sudo ./run ./tools/virsh set-magic 'Hello World!'
sudo ./run ./tools/virsh get-magic

If you set magic file's content to 0xabadcafe, QEMU driver will refused to boot any VM.

sudo ./run ./tools/virsh -c qemu:///system set-magic '0xabadcafe'
sudo ./run ./tools/virsh -c qemu:///system start <domain>

COPYRIGHT

Copyright (c) 2016 秦凡东 (Qin Fandong)

LICENSE

Read LICENSE.

libvirt-add-new-api-demo's People

Contributors

arondight avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.