From: "Halsey Pian" <halsey.pian@gmail.com>
To: qemu-devel@nongnu.org
Cc: halsey.pian@gmail.com
Subject: [Qemu-devel] Help: Convert HDD to QCOW2 img
Date: Thu, 27 Nov 2014 18:15:31 +0800 [thread overview]
Message-ID: <00b101d00a2b$1656c080$43044180$@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1641 bytes --]
Hi All,
Recently, I'm writing an interface of wrapper class for QCOW2 in order to
manage QCOW2 img files conveniently based on our requirements in my current
project , this wrapper includes functions such as QCOW2 creating, read/write
and snapshot relatives. Actually, these functions would finally call
functions in qemu-img.c, block.c, qcow2.c and others related.
With respect to validation of this wrapper, I installed one VM to generate a
fedora20.qcow2 file using qemu team's binary qemu-system_x86-64, and use my
wrapper to read this file and write to a new QCOW2 file from sector 0 to
total sectors the img includes, finally I can boot the VM using my
generated QCOW2 img file.
Unfortunately, I'm suffering issue below,
I connected the fedora20.qcow2 to /dev/nbd0 using support of qemu-nbd and
kernel nbd moduel, and fread this block node as file and also write the data
to a new QCOW2 file using bdrv_write implemented in block.c starting from
sector 0, but this img file doesn't work successfully, error report below
when starts up
Error: file 'grub2/i386-pc/normal.mod' not found
Grub rescue>
It seems the partition information is not wrote successfully into the img
file, what did I miss? What else should I do except writing the data? Could
you give help on it?
The reason why I did above is that I want to write a hard disk drive
including OS data (and can be started up normally as host) to qcow2 file,
and then boot it as VM under qemu kvm support. Any idea or suggestion?
Host: Fedora20
VM: Fedora20
Kernel: 3.12.32
QEMU: 2.1.2
Thanks a lot!
Best Regards
Halsey Pian
[-- Attachment #2: Type: text/html, Size: 5346 bytes --]
next reply other threads:[~2014-11-27 10:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-27 10:15 Halsey Pian [this message]
2014-11-27 16:31 ` [Qemu-devel] Help: Convert HDD to QCOW2 img Stefan Hajnoczi
[not found] ` <00c201d00d4a$e5ea1a50$b1be4ef0$@gmail.com>
2014-12-01 9:52 ` Stefan Hajnoczi
2014-12-01 14:25 ` Halsey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='00b101d00a2b$1656c080$43044180$@gmail.com' \
--to=halsey.pian@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).