Skip to contentSkip to conversation

raw-posix: add Linux native AIO support

Qemu-devel Riku Voipio 2 participants 2 messages Aug 28, 2009 3 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]

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

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

#3 lore raw

Review

Quoted 10 lines · malc
(quoted diff) +7 -2
-        } else if (s->use_aio) {
+        }
+        else if (s->use_aio) {
+#ifdef CONFIG_LINUX_AIO
             return laio_submit(bs, s->aio_ctx, s->fd, sector_num, qiov,
-	                       nb_sectors, cb, opaque, type);
+                               nb_sectors, cb, opaque, type);
+#else
+            abort();
+#endif

use_aio is only ever set in CONFIG_LINUX_AIO protected section, so the #else section is not needed. Even if that were not the case, falling back to paio_submit() feels like a better idea than aborting emulation.

fwiw, s->use_aio is a bad name as well, as it refers to linux aio, while the file also supports posix aio...

#4 lore raw
Quoted 6 lines · Riku Voipio

use_aio is only ever set in CONFIG_LINUX_AIO protected section, so the #else section is not needed. Even if that were not the case, falling back to paio_submit() feels like a better idea than aborting emulation.

fwiw, s->use_aio is a bad name as well, as it refers to linux aio, while the file also supports posix aio...

Yes. it was more of a quick hack. I just wanted to get a working patch out ASAP as I expect a long discussion about how to correctly set the flag to use and other bikesheds. I can send a version that just stores the bdrv_ flags in the raw state and we can check that.