qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Virtual FAT disk images error, can somebody help me , thank you !
@ 2012-03-08  6:11 Zhi Hui Li
  2012-03-08  8:30 ` Stefan Hajnoczi
  2012-03-08  8:57 ` Mark Wu
  0 siblings, 2 replies; 4+ messages in thread
From: Zhi Hui Li @ 2012-03-08  6:11 UTC (permalink / raw)
  To: QEMU-devel, Stefan Hajnoczi, pingfanl



when I use the command :

1: mkdir /my_directory

2: qemu linux.img -fda fat:floppy:/my_directory

when I write to the floppy(just "mkdir test.dir"  in the floppy), the 
error occur:

"FLOPPY ERROR: fdctrl_transfer_handler: writing sector 1"

and nothing is written to the /my_directory.

I don't know why?


can you help me, thank you very much!

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Virtual FAT disk images error, can somebody help me , thank you !
  2012-03-08  6:11 [Qemu-devel] Virtual FAT disk images error, can somebody help me , thank you ! Zhi Hui Li
@ 2012-03-08  8:30 ` Stefan Hajnoczi
  2012-03-08  8:57 ` Mark Wu
  1 sibling, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2012-03-08  8:30 UTC (permalink / raw)
  To: Zhi Hui Li; +Cc: QEMU-devel, pingfanl

On Thu, Mar 08, 2012 at 02:11:33PM +0800, Zhi Hui Li wrote:
> when I use the command :
> 
> 1: mkdir /my_directory
> 
> 2: qemu linux.img -fda fat:floppy:/my_directory
> 
> when I write to the floppy(just "mkdir test.dir"  in the floppy),
> the error occur:
> 
> "FLOPPY ERROR: fdctrl_transfer_handler: writing sector 1"
> 
> and nothing is written to the /my_directory.
> 
> I don't know why?

Although the error comes from hw/fdc.c code it's probably originates in
block/vvfat.c:vvfat_write(), because fdc.c is calling bdrv_write() and
reports an error if that function fails.

I suggest adding printfs or using gdb.  The only two returns that have
no fprintf(stderr, ...) are:

/* Check if we're operating in read-only mode */
if (s->qcow == NULL) {
    return -EACCES;
}

and

if (sector_num < s->first_sectors_number)
    return -1;

Perhaps one of these is failing?

Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Virtual FAT disk images error, can somebody help me , thank you !
  2012-03-08  6:11 [Qemu-devel] Virtual FAT disk images error, can somebody help me , thank you ! Zhi Hui Li
  2012-03-08  8:30 ` Stefan Hajnoczi
@ 2012-03-08  8:57 ` Mark Wu
  2012-03-08  9:42   ` Stefan Hajnoczi
  1 sibling, 1 reply; 4+ messages in thread
From: Mark Wu @ 2012-03-08  8:57 UTC (permalink / raw)
  To: Zhi Hui Li; +Cc: QEMU-devel, pingfanl, Stefan Hajnoczi

On 03/08/2012 02:11 PM, Zhi Hui Li wrote:
>
>
> when I use the command :
>
> 1: mkdir /my_directory
>
> 2: qemu linux.img -fda fat:floppy:/my_directory
>
> when I write to the floppy(just "mkdir test.dir"  in the floppy), the 
> error occur:
>
> "FLOPPY ERROR: fdctrl_transfer_handler: writing sector 1"
>
> and nothing is written to the /my_directory.
>
> I don't know why?
>
>
> can you help me, thank you very much!
>
>
>
Zhi Hui,
You could try:
      qemu linux.img -fda fat:floppy:rw:/my_directory

By default, it's only allow read-only access.

Mark

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] Virtual FAT disk images error, can somebody help me , thank you !
  2012-03-08  8:57 ` Mark Wu
@ 2012-03-08  9:42   ` Stefan Hajnoczi
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2012-03-08  9:42 UTC (permalink / raw)
  To: Mark Wu; +Cc: Zhi Hui Li, QEMU-devel, pingfanl

On Thu, Mar 08, 2012 at 04:57:34PM +0800, Mark Wu wrote:
> On 03/08/2012 02:11 PM, Zhi Hui Li wrote:
> >
> >
> >when I use the command :
> >
> >1: mkdir /my_directory
> >
> >2: qemu linux.img -fda fat:floppy:/my_directory
> >
> >when I write to the floppy(just "mkdir test.dir"  in the floppy),
> >the error occur:
> >
> >"FLOPPY ERROR: fdctrl_transfer_handler: writing sector 1"
> >
> >and nothing is written to the /my_directory.
> >
> >I don't know why?
> >
> >
> >can you help me, thank you very much!
> >
> >
> >
> Zhi Hui,
> You could try:
>      qemu linux.img -fda fat:floppy:rw:/my_directory
> 
> By default, it's only allow read-only access.

That explains it.  Thanks Mark!

Stefan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-08  9:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-08  6:11 [Qemu-devel] Virtual FAT disk images error, can somebody help me , thank you ! Zhi Hui Li
2012-03-08  8:30 ` Stefan Hajnoczi
2012-03-08  8:57 ` Mark Wu
2012-03-08  9:42   ` Stefan Hajnoczi

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).