qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] which guest sent io request?!


From: Jakob Bohm
Subject: Re: [Qemu-discuss] which guest sent io request?!
Date: Wed, 27 Jan 2016 05:53:20 +0100
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

Every single variable and other state in the process
pertains only to this one Guest.

Some of the things that code could look at:

The Process ID of the qemu process, this is unique
even if two copies of the same guest is started at
the same time from the exact same virtual hard drive
etc. etc.  But it will change if a guest is "live
migrated" to another copy of qemu, usually on another
physical computer.

The "name" of the guest, as specified on the qemu
command line.  This is probably stored in some place
the code can read from, but the user of qemu is not
required to specify such a name at all.

The path and file name of the virtual hard drive (if
any).  Because this is usually mounted read/write,
only one guest can safely use the same file at any
one time.  However once again, live migrating can
change this (to a path and file name on the other
physical computer) and it is possible to run a guest
virtual machine that has no writable hard drive, and
thus no file name storing such a hard drive.

However in most cases the proper solution is to look
at parameters specific to whatever the code needs to
use that identifier for.  For example code that
emulates a network card would look at the virtual
hardware MAC address it is providing and the
parameters that connect that virtual network card to
something outside the virtual machine.  Similarly,
code that emulates a hard drive will look at
parameters that control its access to the virtual
hard drive.  Code that emulates some kind of machine
serial number hardware feature would read that virtual
serial number from a command line parameter or from a
file specified in a command line parameter.

Remember that virtual machines are not real,
everything is a simulation and can be set to whatever
the user wants to simulate.

On 26/01/2016 04:51, Ata Fatahi baarzi wrote:
thank you dear, so is there an identifier, something like guest_id in source code to find it each time which guest is getting service?

On Tue, Jan 26, 2016 at 1:11 AM, Jakob Bohm <address@hidden <mailto:address@hidden>> wrote:

    On 25/01/2016 19:38, Ata Fatahi baarzi wrote:
    hi all
    is there any way to find which guest(vm) sent a typicall io
    request in qemu source code?
    and does qemu care about which guest or vm sent io request or
    just process that io request?

    Because there is (at least) one qemu process per guest and
    each qemu process handles only one guest, all of the qemu
    source code knows which guest it is handling, because it
    is only handling one guest.


Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S.  http://www.wisemo.com
Transformervej 29, 2860 Soborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded




reply via email to

[Prev in Thread] Current Thread [Next in Thread]