Skip to contentSkip to conversation

Integration of qemu-img

DISCUSSION Markus Armbruster 4 participants 5 messages Apr 16, 2020 – Apr 23, 2020 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Cc qemu-block
Quoted 21 lines · <[email protected]> writes:

Dear Sir or Madam,

I am a PhD student at the Friedrich-Alexander-University Erlangen-Nürnberg in Bavaria Germany and I am currently working on an open-source forensic analysis tool. I would like to use qemu-img for converting virtual discs to raw files and to get virtual disc information. By now I tried to create a qemu-img DLL with the qemu source code you provide on your website, but I am unable to compile it properly. Therefore, I would like to ask you if there is a simple solution to integrate qemu-img to other C++ projects? Or is there a precompiled qemu-img DLL which I could use? Thank you very much for your support.

Best,

Janine Schneider

#2 lore raw
Quoted 17 lines · Markus Armbruster
Cc qemu-block
Quoted 13 lines · <[email protected]> writes:

Dear Sir or Madam,

I am a PhD student at the Friedrich-Alexander-University Erlangen-Nürnberg in Bavaria Germany and I am currently working on an open-source forensic analysis tool. I would like to use qemu-img for converting virtual discs to raw files and to get virtual disc information. By now I tried to create a qemu-img DLL with the qemu source code you provide on your website, but I am unable to compile it properly. Therefore, I would like to ask you if there is a simple solution to integrate qemu-img to other C++ projects? Or is there a precompiled qemu-img DLL which I could use? Thank you very much for your support.

Can you simply spawn a qemu-img process from your application? That would be much easier than trying to build it as a library and link it into your application.

qemu-img has --output=json exactly for this case. It will let you parse the output as JSON.

Stefan

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 3 lines · On Thu, Apr 23, 2020 at 11:20 AM <[email protected]> wrote:

this requires the user of the application to install qemu first right? If this is the case then this is unfortunately not an option. The user shall not be bothered with installing anything else then the tool.

Hi Janine,
Please use Reply-All to keep the email CC list in tact. That way [email protected] will receive our replies and the discussion will stay on the mailing list. Thanks!

It's common for applications to consist of more than a single executable file. They could have shared libraries, data files, or other executables like qemu-img.exe. You can distribute qemu-img.exe together with your application as part of a zip file or installer.

Regardless of whether you ship qemu-img.exe or build a library, please check QEMU's software license so that you can follow the terms of the GPL open source license.

Stefan

#5 lore raw

Hy again,

okay so now we have an easy way out just in case.
But I still want to build an DLL and/or a shared library for integration into the tool. I want the tool to be platform independent and I was already able to build qemu-img as cross build with mingw64. Does anybody have experience in building a qemu library or tried it already? The tool I want to integrate qemu in is published under GPL itself. And if I am able to build qemu as library I will share it with the community and everybody interested in having it.

Best,
Janine

-----Ursprüngliche Nachricht-----
Von: Stefan Hajnoczi <[email protected]>
Gesendet: Donnerstag, 23. April 2020 12:41
An: [email protected]
Cc: qemu-devel <[email protected]>; qemu block <[email protected]>
Betreff: Re: Integration of qemu-img

Quoted 3 lines · On Thu, Apr 23, 2020 at 11:20 AM <[email protected]> wrote:

this requires the user of the application to install qemu first right? If this is the case then this is unfortunately not an option. The user shall not be bothered with installing anything else then the tool.

Hi Janine,
Please use Reply-All to keep the email CC list in tact. That way [email protected] will receive our replies and the discussion will stay on the mailing list. Thanks!

It's common for applications to consist of more than a single executable file. They could have shared libraries, data files, or other executables like qemu-img.exe. You can distribute qemu-img.exe together with your application as part of a zip file or installer.

Regardless of whether you ship qemu-img.exe or build a library, please check QEMU's software license so that you can follow the terms of the GPL open source license.

Stefan

#6 lore raw
Quoted 7 lines · On Thu, Apr 23, 2020 at 12:53:48PM +0200, [email protected] wrote:

Hy again,

okay so now we have an easy way out just in case.
But I still want to build an DLL and/or a shared library for integration into the tool. I want the tool to be platform independent and I was already able to build qemu-img as cross build with mingw64. Does anybody have experience in building a qemu library or tried it already?

It has been discussed in the past, but general wasn't considered a viable, because any apps using it would have to be strictly licensed as GPLv2-only. This would prevent the library being used by anything that includes GPLv3 code, or obviously from closed source apps. This would seriously restrict how useful any library was.

I would also note that QEMU disk code is not robust against malicously created disk images. It is possible to create images that inflict a denial of service in terms of memory and CPU usage. Thus if an application is handling disk images obtained from untrusted users, it is desirable for qemu-img to be a separate process, such that you can put strict resource limits on it as protection against DoS.

Quoted 3 lines

The tool I want to integrate qemu in is published under GPL itself. And if I am able to build qemu as library I will share it with the community and everybody interested in having it.

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|