* Making qemu images executable (and store command line arguments in them =P)
@ 2007-08-15 22:52 Jorge Lucángeli Obes
[not found] ` <59abf66e0708151552r6192f7e1he7ebe5bffd49525f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 8+ messages in thread
From: Jorge Lucángeli Obes @ 2007-08-15 22:52 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
qemu-devel-qX2TKyscuCcdnm+yROfE0A
I've been giving some thought to Anthony's idea:
http://kvm.qumranet.com/kvmwiki/Specs/StoringCommandLineInImage
However, maybe I'm just too much on vacations, but I don't seem to
come up with a nice way of doing this. Everything keeps coming back to
creating a new 'container' image format and then implementing block
layer functions that only add the number of sectors occupied by the
command-line to the read and write calls made by QEMU, and then just
relay those calls to the image-specific functions. That doesn't sound
very efficient.
The '#!' trick works nice with scripts, but I don't see it playing
very well with images. ¿Comments? ¿Pointers?
Cheers,
Jorge
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [Qemu-devel] Making qemu images executable (and store command line arguments in them =P)
@ 2007-08-16 17:05 Ben Taylor
2007-08-17 12:40 ` Avi Kivity
0 siblings, 1 reply; 8+ messages in thread
From: Ben Taylor @ 2007-08-16 17:05 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
qemu-devel-qX2TKyscuCcdnm+yROfE0A
---- "Jorge Lucángeli Obes" <t4m5yn@gmail.com> wrote:
> I've been giving some thought to Anthony's idea:
>
> http://kvm.qumranet.com/kvmwiki/Specs/StoringCommandLineInImage
>
> However, maybe I'm just too much on vacations, but I don't seem to
> come up with a nice way of doing this. Everything keeps coming back to
> creating a new 'container' image format and then implementing block
> layer functions that only add the number of sectors occupied by the
> command-line to the read and write calls made by QEMU, and then just
> relay those calls to the image-specific functions. That doesn't sound
> very efficient.
No, and it fundamentally breaks using a real disk with QEMU.
> The '#!' trick works nice with scripts, but I don't see it playing
> very well with images. ¿Comments? ¿Pointers?
Personally, I'm not sure why we wouldn't just write out the command line
data to a file tied to the primary image file, with some kind of time stamp
to correlate the data from the command line and the last updated time
of the primary image file. It's intuitive, and doesn't require a bucket of
programming to make work. The down side is if qemu crashes, the
time stamp between the parameter file and the image file may indicate
the potential for "difference", but this can just be a notice (just as snapshots
used to do with the image files in 0.7.x)
The only hard part here is when a real physical disk is used with
QEMU since it's harder to make sure the name is valid.
Thoughts?
Ben
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Making qemu images executable (and store command line arguments in them =P)
@ 2007-08-17 12:40 ` Avi Kivity
2007-08-17 13:09 ` [kvm-devel] " Christian Brunschen
0 siblings, 1 reply; 8+ messages in thread
From: Avi Kivity @ 2007-08-17 12:40 UTC (permalink / raw)
To: sol10x86-j9pdmedNgrk
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
qemu-devel-qX2TKyscuCcdnm+yROfE0A
Ben Taylor wrote:
> ---- "Jorge Lucángeli Obes" <t4m5yn@gmail.com> wrote:
>
>> I've been giving some thought to Anthony's idea:
>>
>> http://kvm.qumranet.com/kvmwiki/Specs/StoringCommandLineInImage
>>
>> However, maybe I'm just too much on vacations, but I don't seem to
>> come up with a nice way of doing this. Everything keeps coming back to
>> creating a new 'container' image format and then implementing block
>> layer functions that only add the number of sectors occupied by the
>> command-line to the read and write calls made by QEMU, and then just
>> relay those calls to the image-specific functions. That doesn't sound
>> very efficient.
>>
>
> No, and it fundamentally breaks using a real disk with QEMU.
>
>
Why? It's optional.
>> The '#!' trick works nice with scripts, but I don't see it playing
>> very well with images. ¿Comments? ¿Pointers?
>>
>
> Personally, I'm not sure why we wouldn't just write out the command line
> data to a file tied to the primary image file, with some kind of time stamp
> to correlate the data from the command line and the last updated time
> of the primary image file. It's intuitive, and doesn't require a bucket of
> programming to make work. The down side is if qemu crashes, the
> time stamp between the parameter file and the image file may indicate
> the potential for "difference", but this can just be a notice (just as snapshots
> used to do with the image files in 0.7.x)
>
It's not easy to use: if you move the image, you need to move the file.
I'd like to have exactly one entity to worry about when using a virtual
machine.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [kvm-devel] Making qemu images executable (and store command line arguments in them =P)
2007-08-17 12:40 ` Avi Kivity
@ 2007-08-17 13:09 ` Christian Brunschen
2007-08-19 10:35 ` [Qemu-devel] " Avi Kivity
0 siblings, 1 reply; 8+ messages in thread
From: Christian Brunschen @ 2007-08-17 13:09 UTC (permalink / raw)
To: qemu-devel; +Cc: kvm-devel
On 17 Aug 2007, at 13:40, Avi Kivity wrote:
> It's not easy to use: if you move the image, you need to move the
> file.
> I'd like to have exactly one entity to worry about when using a
> virtual
> machine.
As I wrote previously, there is already such a thing on every modern
operating system, one entity that can be used to wrap several others:
it's a directory. Putting things together into a directory, and then
treating that directory as a single entity, is a tried and tested
technique (in particular in NeXTStep and its successors, up to and
including Mac OS X).
Simply put, I think that it makes excellent sense to keep the data
(disk image) and the metadata (qemu configuration) separate, at least
in this particular case where keeping the data separate makes it more
easily reusable. Specifically, disk images that are simply disk
images are much more likely to be usable by more than one emulator /
virtual machine, than some other file format that combines a disk
image with some metadata that is going to be fundamentally non-
portable and indeed specific to one emulator or vm.
As I see it, the easiest and most portable thing to do is to define a
simple file format that qemu can use for its configuration. Place the
configuration file and the associated disk image(s) together in the
same directory, and you have created a single entity that includes
both the data and the metadata. Add a little bit of functionality to
the emulatir, such that if it is given as a suitable argument the
name of a directory, then look for the configuration file at a
specific name in that directory, and only allow references from that
config file to other files in that directory (thus enforcing the
encapsulation). Now you have a system where you can either keep
things completely manual (specify everything on the command line,
automated but separate (specify the configuration file and have it
explicitly reference full paths) or automated and encapsulated (data
and metadata all kept together in a single container). And all of
this without having to change the formats of any existing files, all
without introducing any backwards incompatibility.
One thing that would be useful would be if there were some portable
way of describing the machine you are trying to virtualize or
emulate. This could then be read by various different virtual
machines / emulators. Such a portable description might be possible
to embed in a disk image. However, it would take some doing to
construct such a standard and indeed get it accepted by a significant
fraction of the emulators / virtual machines in the marketplace today.
So to summarize, my preferred solution would be:
1) Define a configuration file format
2) Make the program allow specifying a directory as the virtual
machine, in which case the configuration is read from and data are
kept in that directory
Best wishes,
// Christian Brunschen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Qemu-devel] Making qemu images executable (and store command line arguments in them =P)
@ 2007-08-19 10:35 ` Avi Kivity
[not found] ` <99222E0B-B4B8-4D5A-A557-1A9CF113E9E7@jump-ing.de>
0 siblings, 1 reply; 8+ messages in thread
From: Avi Kivity @ 2007-08-19 10:35 UTC (permalink / raw)
To: qemu-devel-qX2TKyscuCcdnm+yROfE0A
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Christian Brunschen wrote:
>
> On 17 Aug 2007, at 13:40, Avi Kivity wrote:
>
>> It's not easy to use: if you move the image, you need to move the file.
>> I'd like to have exactly one entity to worry about when using a virtual
>> machine.
>
> As I wrote previously, there is already such a thing on every modern
> operating system, one entity that can be used to wrap several others:
> it's a directory. Putting things together into a directory, and then
> treating that directory as a single entity, is a tried and tested
> technique (in particular in NeXTStep and its successors, up to and
> including Mac OS X).
>
> Simply put, I think that it makes excellent sense to keep the data
> (disk image) and the metadata (qemu configuration) separate, at least
> in this particular case where keeping the data separate makes it more
> easily reusable. Specifically, disk images that are simply disk images
> are much more likely to be usable by more than one emulator / virtual
> machine, than some other file format that combines a disk image with
> some metadata that is going to be fundamentally non-portable and
> indeed specific to one emulator or vm.
>
> As I see it, the easiest and most portable thing to do is to define a
> simple file format that qemu can use for its configuration. Place the
> configuration file and the associated disk image(s) together in the
> same directory, and you have created a single entity that includes
> both the data and the metadata. Add a little bit of functionality to
> the emulatir, such that if it is given as a suitable argument the name
> of a directory, then look for the configuration file at a specific
> name in that directory, and only allow references from that config
> file to other files in that directory (thus enforcing the
> encapsulation). Now you have a system where you can either keep things
> completely manual (specify everything on the command line, automated
> but separate (specify the configuration file and have it explicitly
> reference full paths) or automated and encapsulated (data and metadata
> all kept together in a single container). And all of this without
> having to change the formats of any existing files, all without
> introducing any backwards incompatibility.
>
It does make a lot of sense. The only drawbacks I can find are:
- you can't directly execute the directory
- this deviates from standard Unix (and Windows) practice. Arguably the
OS X way is superior, but qemu is perhaps not the best vehicle to
introduce it to other OSes.
While this implementation won't be my first choice, I find it acceptable
and good enough for my use case.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-08-19 13:14 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-15 22:52 Making qemu images executable (and store command line arguments in them =P) Jorge Lucángeli Obes
[not found] ` <59abf66e0708151552r6192f7e1he7ebe5bffd49525f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-08-15 23:52 ` [Qemu-devel] " Mark Williamson
2007-08-16 5:21 ` [kvm-devel] " Avi Kivity
[not found] ` <200708160052.51858.mark.williamson-kDbDZe0LBGWFxr2TtlUqVg@public.gmane.org>
2007-08-16 16:11 ` [Qemu-devel] " Andreas Färber
2007-08-16 4:22 ` H. Peter Anvin
[not found] ` <46C3D109.3080807-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2007-08-16 5:23 ` [Qemu-devel] " Avi Kivity
-- strict thread matches above, loose matches on Subject: below --
2007-08-16 17:05 [Qemu-devel] " Ben Taylor
2007-08-17 12:40 ` Avi Kivity
2007-08-17 13:09 ` [kvm-devel] " Christian Brunschen
2007-08-19 10:35 ` [Qemu-devel] " Avi Kivity
[not found] ` <99222E0B-B4B8-4D5A-A557-1A9CF113E9E7@jump-ing.de>
[not found] ` <46C824B2.1040300@qumranet.com>
2007-08-19 13:14 ` [kvm-devel] " Christian Brunschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox