All of lore.kernel.org
 help / color / mirror / Atom feed
* Help
@ 2003-06-06  5:55 madalin mihailescu
  2003-06-11  1:14 ` Help Lucas Correia Villa Real
  0 siblings, 1 reply; 278+ messages in thread
From: madalin mihailescu @ 2003-06-06  5:55 UTC (permalink / raw)
  To: linux-kernel

I have a project: implementing four page-out
alghorythms. I want to be able to select one of them
at reboot as the first thing I do.

I’m thinking of using a variable, but I don’t know
where to put it.

10x

Madalin


__________________________________________________
Yahoo! Plus - For a better Internet experience
http://uk.promotions.yahoo.com/yplus/yoffer.html

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2023-06-12  9:33 stanzgy
  2023-06-12  9:36 ` help stanzgy
  0 siblings, 1 reply; 278+ messages in thread
From: stanzgy @ 2023-06-12  9:33 UTC (permalink / raw)
  To: netfilter-devel

-- 
Best regards

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2022-11-29 21:01 hinxx
  0 siblings, 0 replies; 278+ messages in thread
From: hinxx @ 2022-11-29 21:01 UTC (permalink / raw)
  To: stable

help


Sent with Proton Mail secure email.

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2022-11-15  4:35 jovial umwari
  2022-11-15 13:59 ` Help Julia Lawall
  0 siblings, 1 reply; 278+ messages in thread
From: jovial umwari @ 2022-11-15  4:35 UTC (permalink / raw)
  To: Alison Schofield, Outreachy Linux, kumarpraveen, Saurabh Sengar

Greetings to everyone
Hope you are doing well
i  am Umwari jovial  an outreach applicant
in these past days i faced  a challenge  when i was configuring the kernel
i went ahead and changed the kernel version in .config  then i had to
do make j4(i have 4 cores) and all was well but when i restarted the
computer  i was not able to access my normal  operating system and i
had to use  the recovery mode to access it  up to now  i am not able
Note: i am using Ubuntu ,
Running  Linux natively on my own machine.
other setups are working well

Seeking for help on to resolve the issue any advice or help i will appreciate
Thank you

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2022-06-16  5:26 Andreas Radke
  0 siblings, 0 replies; 278+ messages in thread
From: Andreas Radke @ 2022-06-16  5:26 UTC (permalink / raw)
  To: ell



^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2022-06-03 23:04 Thomas Green
  0 siblings, 0 replies; 278+ messages in thread
From: Thomas Green @ 2022-06-03 23:04 UTC (permalink / raw)
  To: linux-bluetooth

A couple of weeks ago, I posted this question, and haven't heard anything back.  Is there someone out there that can help me?


Hi.... I have problem when removing a device from use.  I have two identical devices connected to my host.  For each of them I disconnect the device, then remove it.  Sometimes it works just fine, and sometimes it seems something doesn't finish, and a timeout error is returned.  When it doesn't finish, I can't do anything any more.  A scan doesn't do anything, and if I try to turn off the scan I get an InProgress error.  Here is a log produced by running 

bluetoothd -experimanal -debug -n

bluetoothd[3432]: ../bluez-5.50/src/device.c:btd_device_set_temporary() temporary 1
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0bead0: device C4:33:13:80:17:20 profile gap-profile state changed: connected -> disconnecting (0)
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0bead0: device C4:33:13:80:17:20 profile gap-profile state changed: disconnecting -> disconnected (0)
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:dev_disconnected() Device C4:33:13:80:17:20 disconnected, reason 2
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:adapter_remove_connection() 
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:adapter_remove_connection() Removing temporary device /org/bluez/hci0/dev_C4_33_13_80_17_20
bluetoothd[3432]: ../bluez-5.50/src/device.c:device_remove() Removing device /org/bluez/hci0/dev_C4_33_13_80_17_20
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0bead0: device C4:33:13:80:17:20 profile gap-profile state changed: disconnected -> unavailable (0)
bluetoothd[3432]: ../bluez-5.50/profiles/gap/gas.c:gap_remove() GAP profile remove (C4:33:13:80:17:20)
bluetoothd[3432]: ../bluez-5.50/src/service.c:btd_service_unref() 0x55fffe0bead0: ref=0
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0b4dc0: device C4:33:13:80:17:20 profile :1.70/ntouch/app/6e400001-b5a3-f393-e0a9-e50e24dcca9e state changed: connecting -> disconnected (-103)
bluetoothd[3432]: ../bluez-5.50/src/device.c:device_profile_connected() :1.70/ntouch/app/6e400001-b5a3-f393-e0a9-e50e24dcca9e Software caused connection abort (103)
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0b4dc0: device C4:33:13:80:17:20 profile :1.70/ntouch/app/6e400001-b5a3-f393-e0a9-e50e24dcca9e state changed: disconnected -> unavailable (0)
bluetoothd[3432]: ../bluez-5.50/src/gatt-database.c:profile_device_remove() :1.70/ntouch/app/6e400001-b5a3-f393-e0a9-e50e24dcca9e removed
bluetoothd[3432]: ../bluez-5.50/src/service.c:btd_service_unref() 0x55fffe0b4dc0: ref=0
bluetoothd[3432]: ../bluez-5.50/src/device.c:btd_device_unref() Freeing device /org/bluez/hci0/dev_C4_33_13_80_17_20
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_service() Removing GATT service: /org/bluez/hci0/dev_C4_33_13_80_17_20/service000a
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_service() Removing GATT service: /org/bluez/hci0/dev_C4_33_13_80_17_20/service000b
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_characteristic() Removing GATT characteristic: /org/bluez/hci0/dev_C4_33_13_80_17_20/service000b/char000c
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_descriptor() Removing GATT descriptor: /org/bluez/hci0/dev_C4_33_13_80_17_20/service000b/char000c/desc000e
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_service() Removing GATT service: /org/bluez/hci0/dev_C4_33_13_80_17_20/service000f
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_characteristic() Removing GATT characteristic: /org/bluez/hci0/dev_C4_33_13_80_17_20/service000f/char0010
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_characteristic() Removing GATT characteristic: /org/bluez/hci0/dev_C4_33_13_80_17_20/service000f/char0012
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:notify_client_unref() owner :1.70
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:notify_client_free() owner :1.70
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_descriptor() Removing GATT descriptor: /org/bluez/hci0/dev_C4_33_13_80_17_20/service000f/char0012/desc0014
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_characteristic() Removing GATT characteristic: /org/bluez/hci0/dev_C4_33_13_80_17_20/service000f/char0015
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:notify_client_unref() owner :1.70
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:notify_client_free() owner :1.70
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_descriptor() Removing GATT descriptor: /org/bluez/hci0/dev_C4_33_13_80_17_20/service000f/char0015/desc0017
bluetoothd[3432]: ../bluez-5.50/attrib/gattrib.c:g_attrib_unref() 0x55fffe0c3bf0: g_attrib_unref=0 
bluetoothd[3432]: ../bluez-5.50/src/device.c:device_free() 0x55fffe0b99d0
bluetoothd[3432]: ../bluez-5.50/plugins/policy.c:disconnect_cb() reason 2
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:bonding_attempt_complete() hci0 bdaddr C4:33:13:80:17:20 type 2 status 0xe
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:resume_discovery() 
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:connected_callback() hci0 device C4:33:13:80:17:20 connected eir_len 23
bluetoothd[3432]: ../bluez-5.50/src/device.c:device_create() dst C4:33:13:80:17:20
bluetoothd[3432]: ../bluez-5.50/src/device.c:device_new() address C4:33:13:80:17:20
bluetoothd[3432]: ../bluez-5.50/src/device.c:device_new() Creating device /org/bluez/hci0/dev_C4_33_13_80_17_20
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:dev_disconnected() Device C4:33:13:80:17:20 disconnected, reason 2
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:adapter_remove_connection() 
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:adapter_remove_connection() Removing temporary device /org/bluez/hci0/dev_C4_33_13_80_17_20
bluetoothd[3432]: ../bluez-5.50/src/device.c:device_remove() Removing device /org/bluez/hci0/dev_C4_33_13_80_17_20
bluetoothd[3432]: ../bluez-5.50/src/device.c:btd_device_unref() Freeing device /org/bluez/hci0/dev_C4_33_13_80_17_20
bluetoothd[3432]: ../bluez-5.50/src/device.c:device_free() 0x55fffe0d5640
bluetoothd[3432]: ../bluez-5.50/plugins/policy.c:disconnect_cb() reason 2
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:bonding_attempt_complete() hci0 bdaddr C4:33:13:80:17:20 type 2 status 0xe
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:resume_discovery() 
bluetoothd[3432]: ../bluez-5.50/src/device.c:btd_device_set_temporary() temporary 1
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0bcbe0: device C4:53:23:00:38:10 profile gap-profile state changed: connected -> disconnecting (0)
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0bcbe0: device C4:53:23:00:38:10 profile gap-profile state changed: disconnecting -> disconnected (0)
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:dev_disconnected() Device C4:53:23:00:38:10 disconnected, reason 2
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:adapter_remove_connection() 
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:adapter_remove_connection() Removing temporary device /org/bluez/hci0/dev_C4_53_23_00_38_10
bluetoothd[3432]: ../bluez-5.50/src/device.c:device_remove() Removing device /org/bluez/hci0/dev_C4_53_23_00_38_10
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0bcbe0: device C4:53:23:00:38:10 profile gap-profile state changed: disconnected -> unavailable (0)
bluetoothd[3432]: ../bluez-5.50/profiles/gap/gas.c:gap_remove() GAP profile remove (C4:53:23:00:38:10)
bluetoothd[3432]: ../bluez-5.50/src/service.c:btd_service_unref() 0x55fffe0bcbe0: ref=0
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0b3770: device C4:53:23:00:38:10 profile :1.70/ntouch/app/6e400001-b5a3-f393-e0a9-e50e24dcca9e state changed: connecting -> disconnected (-103)
bluetoothd[3432]: ../bluez-5.50/src/device.c:device_profile_connected() :1.70/ntouch/app/6e400001-b5a3-f393-e0a9-e50e24dcca9e Software caused connection abort (103)
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0b3770: device C4:53:23:00:38:10 profile :1.70/ntouch/app/6e400001-b5a3-f393-e0a9-e50e24dcca9e state changed: disconnected -> unavailable (0)
bluetoothd[3432]: ../bluez-5.50/src/gatt-database.c:profile_device_remove() :1.70/ntouch/app/6e400001-b5a3-f393-e0a9-e50e24dcca9e removed
bluetoothd[3432]: ../bluez-5.50/src/service.c:btd_service_unref() 0x55fffe0b3770: ref=0
bluetoothd[3432]: ../bluez-5.50/src/device.c:btd_device_unref() Freeing device /org/bluez/hci0/dev_C4_53_23_00_38_10
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_service() Removing GATT service: /org/bluez/hci0/dev_C4_53_23_00_38_10/service000a
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_service() Removing GATT service: /org/bluez/hci0/dev_C4_53_23_00_38_10/service000b
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_characteristic() Removing GATT characteristic: /org/bluez/hci0/dev_C4_53_23_00_38_10/service000b/char000c
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_descriptor() Removing GATT descriptor: /org/bluez/hci0/dev_C4_53_23_00_38_10/service000b/char000c/desc000e
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_service() Removing GATT service: /org/bluez/hci0/dev_C4_53_23_00_38_10/service000f
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_characteristic() Removing GATT characteristic: /org/bluez/hci0/dev_C4_53_23_00_38_10/service000f/char0010
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_characteristic() Removing GATT characteristic: /org/bluez/hci0/dev_C4_53_23_00_38_10/service000f/char0012
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:notify_client_unref() owner :1.70
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:notify_client_free() owner :1.70
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_descriptor() Removing GATT descriptor: /org/bluez/hci0/dev_C4_53_23_00_38_10/service000f/char0012/desc0014
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_characteristic() Removing GATT characteristic: /org/bluez/hci0/dev_C4_53_23_00_38_10/service000f/char0015
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:notify_client_unref() owner :1.70
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:notify_client_free() owner :1.70
bluetoothd[3432]: ../bluez-5.50/src/gatt-client.c:unregister_descriptor() Removing GATT descriptor: /org/bluez/hci0/dev_C4_53_23_00_38_10/service000f/char0015/desc0017
bluetoothd[3432]: ../bluez-5.50/attrib/gattrib.c:g_attrib_unref() 0x55fffe0ab990: g_attrib_unref=0 
bluetoothd[3432]: ../bluez-5.50/src/device.c:device_free() 0x55fffe0bc500
bluetoothd[3432]: ../bluez-5.50/plugins/policy.c:disconnect_cb() reason 2
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:bonding_attempt_complete() hci0 bdaddr C4:53:23:00:38:10 type 2 status 0xe
bluetoothd[3432]: ../bluez-5.50/src/adapter.c:resume_discovery() 
bluetoothd[3432]: ../bluez-5.50/src/device.c:btd_device_set_temporary() temporary 1
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0b9880: device C4:53:23:00:56:A0 profile gap-profile state changed: connected -> disconnecting (0)
bluetoothd[3432]: ../bluez-5.50/src/service.c:change_state() 0x55fffe0b9880: device C4:53:23:00:56:A0 profile gap-profile state changed: disconnecting -> disconnected (0)


If you could help me figure out why it works in once instance and not the second, I would very much appreciate it.

Tom Green


^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2022-02-25  0:04 张健
  0 siblings, 0 replies; 278+ messages in thread
From: 张健 @ 2022-02-25  0:04 UTC (permalink / raw)
  To: openbmc

[-- Attachment #1: Type: text/plain, Size: 10385 bytes --]

From: openbmc-request@lists.ozlabs.org
Date: 2月25日 (周五) 05:00
Subject: [External] openbmc Digest, Vol 78, Issue 123
To: <openbmc@lists.ozlabs.org>
Send openbmc mailing list submissions toopenbmc@lists.ozlabs.orgTo
subscribe or unsubscribe via the World Wide Web, visit
https://lists.ozlabs.org/listinfo/openbmcor, via email, send a message with
subject or body 'help' toopenbmc-request@lists.ozlabs.orgYou can reach the
person managing the list atopenbmc-owner@lists.ozlabs.orgWhen replying,
please edit your Subject line so it is more specificthan "Re: Contents of
openbmc digest..."Today's Topics: 1. [u-boot, v2019.04-aspeed-openbmc 1/1]
fix compiling warnings for AST2600 A1 SPL (Jamin Lin) 2. [u-boot,
v2019.04-aspeed-openbmc 0/1] fix compiling warnings for AST2600 A1 SPL
(Jamin Lin) 3. Re: I3C Binding DSP0233 (Matt Johnston) 4. Re: New
u-boot-aspeed-sdk runs slow and cause wdt2 timeout on ast2500 (Joel
Stanley) 5. Re: [u-boot,v2019.04-aspeed-openbmc 1/1] fix compiling warnings
for AST2600 A1 SPL (Joel Stanley) 6. Re: Checking for network online
(Patrick Williams) 7. Re: [PATCH 1/2] pinctrl: aspeed: Enable pass-through
on GPIOE1 and GPIOE3 free (Bills, Jason
M)----------------------------------------------------------------------Message:
1Date: Thu, 24 Feb 2022 16:11:21 +0800From: Jamin Lin To: , , Cc: ,
Subject: [u-boot, v2019.04-aspeed-openbmc 1/1] fix compiling warningsfor
AST2600 A1 SPLMessage-ID:
<20220224081121.10389-2-jamin_lin@aspeedtech.com>Content-Type:
text/plainremove duplicated defineSigned-off-by: Jamin Lin ---
include/configs/evb_ast2600a1_spl.h | 7 ------- 1 file changed, 7
deletions(-)diff --git a/include/configs/evb_ast2600a1_spl.h
b/include/configs/evb_ast2600a1_spl.hindex 655896b237..006cc4345b 100644---
a/include/configs/evb_ast2600a1_spl.h+++
b/include/configs/evb_ast2600a1_spl.h@@ -42,13 +42,6 @@ #endif #endif -/*
SPL */-#define CONFIG_SPL_TEXT_BASE0x00000000-#define
CONFIG_SPL_MAX_SIZE0x0000E800-#define CONFIG_SPL_STACK0x10010000-#define
CONFIG_SPL_BSS_START_ADDR0x90000000-#define
CONFIG_SPL_BSS_MAX_SIZE0x00100000- #define CONFIG_SUPPORT_EMMC_BOOT
#endif/* __CONFIG_H */-- 2.17.1------------------------------Message:
2Date: Thu, 24 Feb 2022 16:11:20 +0800From: Jamin Lin To: , , Cc: ,
Subject: [u-boot, v2019.04-aspeed-openbmc 0/1] fix compiling warningsfor
AST2600 A1 SPLMessage-ID:
<20220224081121.10389-1-jamin_lin@aspeedtech.com>Content-Type:
text/plainremove duplicated defineJamin Lin (1): fix compiling warnings for
AST2600 A1 SPL include/configs/evb_ast2600a1_spl.h | 7 ------- 1 file
changed, 7 deletions(-)-- 2.17.1------------------------------Message:
3Date: Thu, 24 Feb 2022 11:06:39 +0800From: Matt Johnston To: Rahul Kapoor
,"openbmc@lists.ozlabs.org" Subject: Re: I3C Binding DSP0233Message-ID:<
73c46f0b8b609edddad0e314ead38c9b9d72517e.camel@codeconstruct.com.au>Content-Type:
text/plain; charset="UTF-8"On Wed, 2022-02-23 at 16:45 +0000, Rahul Kapoor
wrote:> Hi,> ?> I would like to understand if OpenBMC project currently
supports MCTP over> I3C>
https://www.dmtf.org/sites/default/files/standards/documents/DSP0233_1.0.0.pdf>
? If not, are there plans to support it going forward? We are currently>
using Intel-BMC/libmctp for SMBus binding and plan to transition to in->
kernel MCTP in future.Hi Rahul,I'm not aware of any current work on
MCTP-over-I3C for OpenBMC or in-kernel.It could be added as another
in-kernel MCTP transport alongside the currentI2C net driver.I'm not sure
what the current status is for I3C drivers on BMC hardware.Kernel I3C will
only support Linux as an I3C Controller not Target, thoughthat would suit
many setups.Cheers,Matt------------------------------Message: 4Date: Thu,
24 Feb 2022 03:45:48 +0000From: Joel Stanley To: Lei Yu Cc: ChiaWei Wang ,
Troy Lee, Ryan Chen ,openbmc , tangyiwei.2022@bytedance.comSubject: Re: New
u-boot-aspeed-sdk runs slow and cause wdt2 timeout
onast2500Message-ID:Content-Type: text/plain; charset="UTF-8"On Wed, 23 Feb
2022 at 10:02, Lei Yu wrote:>> > > > > Could you share us the boot log with
timestamps?> > > > > It would be nice to know the time elapsed at each
stage.> > > >> > > > Pasted to https://pastebin.com/emseqW6c> > > > It
contains two logs, the first one is good, and the second has the issue.> >>
> Working:> > [2022-02-23 02:47:03] U-Boot 2019.04 (Jan 24 2022 - 10:18:18
+0000)> > [2022-02-23 02:47:06] ## Loading kernel from FIT Image at
20100000 ...> > [2022-02-23 02:47:12] Starting kernel ...> >> > 3 + 6
seconds.> >> > broken:> > [2022-02-23 02:58:07] U-Boot 2019.04 (Feb 15 2022
- 07:22:14 +0000)> > [2022-02-23 02:58:12] ## Loading kernel from FIT Image
at 20100000 ...> > [2022-02-23 02:58:22] Starting kernel ...> >> > 5 + 10
seconds.> >> > Interesting that the pre-hashing part is also slower.> >> >
The old branch was based on v00.04.03. The new branch is based on
v00.04.09.> >> > I wonder if this is the cause:> >> > $ git diff
v00.04.03..v00.04.09 -- configs/evb-ast2500_defconfig> > diff --git
a/configs/evb-ast2500_defconfig b/configs/evb-ast2500_defconfig> > index
9fcf55b05ebb..000ed3f90bdd 100644> > --- a/configs/evb-ast2500_defconfig> >
+++ b/configs/evb-ast2500_defconfig> > @@ -1,4 +1,5 @@> > CONFIG_ARM=y> >
+CONFIG_SYS_DCACHE_OFF=y> > CONFIG_ARCH_ASPEED=y> >
CONFIG_SYS_TEXT_BASE=0x0> > CONFIG_SYS_MALLOC_F_LEN=0x2000> >> > Lei, can
you re-test with CONFIG_SYS_DCACHE_OFF=n ?> >>> Yiwei helped to test with
CONFIG_SYS_DCACHE_OFF=n, and it works fine now.> So it seems we get the
root cause!I'm glad this worked. The bill is in the mail :)I would suggest
this is not the root cause. This is a workaround thatspeeds up booting
enough that you make it to linux, but if your kernelimage got a bit larger
(for example), it would take longer and theissue would show up again.To
properly fix the issue, we need to ensure the watchdog is serviced,as I
mentioned in my previous
email.Cheers,Joel------------------------------Message: 5Date: Thu, 24 Feb
2022 11:43:32 +0000From: Joel Stanley To: Jamin Lin Cc: OpenBMC Maillist ,
Andrew Jeffery, Troy Lee , Steven LeeSubject: Re:
[u-boot,v2019.04-aspeed-openbmc 1/1] fix compilingwarnings for AST2600 A1
SPLMessage-ID:Content-Type: text/plain; charset="UTF-8"On Thu, 24 Feb 2022
at 08:11, Jamin Lin wrote:>> remove duplicated define>> Signed-off-by:
Jamin Lin > ---> include/configs/evb_ast2600a1_spl.h | 7 -------> 1 file
changed, 7 deletions(-)>> diff --git a/include/configs/evb_ast2600a1_spl.h
b/include/configs/evb_ast2600a1_spl.h> index 655896b237..006cc4345b 100644>
--- a/include/configs/evb_ast2600a1_spl.h> +++
b/include/configs/evb_ast2600a1_spl.h> @@ -42,13 +42,6 @@> #endif> #endif>>
-/* SPL */> -#define CONFIG_SPL_TEXT_BASE 0x00000000> -#define
CONFIG_SPL_MAX_SIZE 0x0000E800> -#define CONFIG_SPL_STACK 0x10010000>
-#define CONFIG_SPL_BSS_START_ADDR 0x90000000> -#define
CONFIG_SPL_BSS_MAX_SIZE 0x00100000A good cleanup. While we're here, can we
clean up the various ast2600config headers?There is a large diff between
the a0 and the a1 spl header. I know theA0 has a smaller SRAM. Are there
any other differences required?> -> #define CONFIG_SUPPORT_EMMC_BOOT>>
#endif /* __CONFIG_H */> --> 2.17.1>------------------------------Message:
6Date: Thu, 24 Feb 2022 14:09:11 -0600From: Patrick Williams To: Johnathan
Mantey Cc: Jiaqing Zhao , Lei Yu, Jeremy Kerr ,OpenBMC Maillist Subject:
Re: Checking for network onlineMessage-ID: Content-Type: text/plain;
charset="us-ascii"On Wed, Feb 23, 2022 at 12:04:12PM -0800, Johnathan
Mantey wrote:> On 2/23/22 09:44, Jiaqing Zhao wrote:> > On 2022-02-23
21:48, Patrick Williams wrote:> >> On Wed, Feb 23, 2022 at 10:09:19AM
+0800, Jiaqing Zhao wrote:> There may be openbmc powered servers that do
use the distributed logging > provided by rsyslogd. If there are then
globally removing network-online > from the rsyslog service file is
undesirable. I consider the same to be > true of assigning a default
RequiredForOnline=false.> > Based on the above, it's my opinion this is a
vendor based decision for > how to configure
rsyslog/systemd-networkd-wait-online.I agree we shouldn't enable this
globally, but that doesn't mean we can't adda simple PKGCONFIG that allows
it to be enabled/disabled as needed. That waywe only have the single
`PKGCONFIG:append` line in vendor layers and vendorsthat have a problem
with it can leave it same as upstream.-- Patrick Williams--------------
next part --------------A non-text attachment was scrubbed...Name:
signature.ascType: application/pgp-signatureSize: 833 bytesDesc: not
availableURL: ------------------------------Message: 7Date: Thu, 24 Feb
2022 14:03:48 -0700From: "Bills, Jason M" To: Joel Stanley , Andrew Jeffery
Cc: "openbmc@lists.ozlabs.org" Subject: Re: [PATCH 1/2] pinctrl: aspeed:
Enable pass-through onGPIOE1 and GPIOE3 freeMessage-ID: <
7d792cb4-9eaf-cbdc-d39c-72217d5ebcf8@linux.intel.com>Content-Type:
text/plain; charset=UTF-8; format=flowedOn 2/6/2022 11:45 PM, Joel Stanley
wrote:> On Wed, 2 Feb 2022 at 22:49, Andrew Jeffery wrote:>>>>>>>> On Thu,
3 Feb 2022, at 06:29, Bills, Jason M wrote:>>> This change adds a
gpio_disable_free() implementation that checks>>> if the GPIO being freed
is GPIOE1 (33) or GPIOE3 (35) and will>>> re-enable the pass-through
mux.>>>> Okay. So trying to pull back from the implementation for a
moment:>>>> Perhaps we can view pass-through as a property on a pair of
GPIOs, rather than a mux state? I think it would be better if we could, for
instance, annotate this in the devicetree?>>>> If we did that I don't think
we're require this awkward and pin-specific implementation of the free
callback for GPIOs.>>>> If pass-through is enabled it puts constraints on
how the pins are used if they're requested as GPIOs, but we can add those
dynamic checks in the GPIO driver.>>>> Let me think about it some more.>>>>
Thanks for surfacing the patch.> > This is for the kernel, I assume.> >
Jason, you should send the patch to the upstream lists (use>
get_maintainers.pl) for review.Sorry for the delay. I found the right lists
with get_maintainers.pl. Should I send these patches to the upstream lists
as they are, or do they need to be tweaked?Thanks!-Jason> > Cheers,> >
JoelEnd of openbmc Digest, Vol 78, Issue
123****************************************

[-- Attachment #2: Type: text/html, Size: 13502 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2020-11-28 14:32 Rroach
  0 siblings, 0 replies; 278+ messages in thread
From: Rroach @ 2020-11-28 14:32 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1520 bytes --]

Hi, I'm attempting to use address sanitizer in locating bugs in Xen 4-13, while use address sanitizer in tools modules, while I ran some basic instructions like xl, Xen report such bug:
=================================================================
==2863==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 296 byte(s) in 11 object(s) allocated from:
&nbsp; &nbsp; #0 0x7f5b91aefd28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28)
&nbsp; &nbsp; #1 0x467997&nbsp; (/usr/bin/x86_64-linux-gnu-gcc-6+0x467997)

Indirect leak of 10 byte(s) in 1 object(s) allocated from:
&nbsp; &nbsp; #0 0x7f5b91aefd28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28)
&nbsp; &nbsp; #1 0x467997&nbsp; (/usr/bin/x86_64-linux-gnu-gcc-6+0x467997)

SUMMARY: AddressSanitizer: 306 byte(s) leaked in 12 allocation(s).
/root/faultxen/tools/libs/toolcore/../../../tools/Rules.mk:224: recipe for target 'headers.chk' failed
make[5]: *** [headers.chk] Error 1

==7520==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 10 byte(s) in 1 object(s) allocated from:
&nbsp; &nbsp; #0 0x7fd1028c8d28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28)
&nbsp; &nbsp; #1 0x7fd1022e43b9 in __strdup (/lib/x86_64-linux-gnu/libc.so.6+0x803b9)

SUMMARY: AddressSanitizer: 10 byte(s) leaked in 1 allocation(s).
=================================================================
It seems this bug is very low-level, and affects many basic operations, do you have any idea what cause such bugs?

[-- Attachment #2: Type: text/html, Size: 1667 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2020-09-16 16:33 Dan Jakubiec
  0 siblings, 0 replies; 278+ messages in thread
From: Dan Jakubiec @ 2020-09-16 16:33 UTC (permalink / raw)
  To: ceph-devel



^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2020-04-07  5:06 number201724
  0 siblings, 0 replies; 278+ messages in thread
From: number201724 @ 2020-04-07  5:06 UTC (permalink / raw)
  To: git

help


^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2020-03-24 10:13 Chained Up
  2020-03-25 15:34 ` Help Philippe Mathieu-Daudé
  0 siblings, 1 reply; 278+ messages in thread
From: Chained Up @ 2020-03-24 10:13 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 501 bytes --]

Please can some explain what should i do here?
 Prepare import-libraries using Borland's implib program.  The ".lib"
    files that it uses are a different format than the import libraries
    distributed with GnuWin2.  From Lynx's source directory run bcblibs

Environment:
    At this point, the bin-directory for the compiler and for the GnuWin32
    libraries should be in your path.

Building:
    From Lynx's source directory
cd src\chrtrans
makew32 clean
makew32
cd ..\..
makew32 clean
makew32

[-- Attachment #2: Type: text/html, Size: 623 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2020-03-21 19:26 don fisher
  0 siblings, 0 replies; 278+ messages in thread
From: don fisher @ 2020-03-21 19:26 UTC (permalink / raw)
  To: linux-kernel

I want to change my subscription. How do I do it?

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2020-02-07  5:26 Frank Esposito
  0 siblings, 0 replies; 278+ messages in thread
From: Frank Esposito @ 2020-02-07  5:26 UTC (permalink / raw)
  To: fio

help


^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2020-01-17 19:31 Fairouz Fakhfakh
  0 siblings, 0 replies; 278+ messages in thread
From: Fairouz Fakhfakh @ 2020-01-17 19:31 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

Hello,
I would like to use qemu to install a virtual machine (VM) in Ubuntu.
I need a minimal VM  which contains only jdk (openjdk).

Can someone help me, please.
Thank you in advance.

[-- Attachment #2: Type: text/html, Size: 443 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <20191121140040.GB9271.ref@pc1lin.fred.org>]
* help
@ 2019-03-14  6:39 Yubin
  0 siblings, 0 replies; 278+ messages in thread
From: Yubin @ 2019-03-14  6:39 UTC (permalink / raw)
  To: dev


-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有新华三集团的保密信息,仅限于发送给上面地址中列出
的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
邮件!
This e-mail and its attachments contain confidential information from New H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2019-02-06  5:26 John Klug
  0 siblings, 0 replies; 278+ messages in thread
From: John Klug @ 2019-02-06  5:26 UTC (permalink / raw)
  To: linux-media

help

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2018-11-21 13:32 _
  0 siblings, 0 replies; 278+ messages in thread
From: _ @ 2018-11-21 13:32 UTC (permalink / raw)
  To: lkml

help

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2018-10-17  8:33 Lorenzo Chelini
  2018-10-17  9:28 ` help Madhavan Srinivasan
  0 siblings, 1 reply; 278+ messages in thread
From: Lorenzo Chelini @ 2018-10-17  8:33 UTC (permalink / raw)
  To: linuxppc-dev


Hi All,

I am a PhD at IBM Zurich. I am playing around with the new POWER9 servers.
I am interested in plotting a roofline model for a given application, but I
need
to measure the traffic to and from the memory.
Ideally, what I would like to measure is the traffic at the memory
controller level.

Do you know if this is possible using perf? If yes, which performance
counters I should
query to have an estimate on the memory traffic?

Thanks for your time.
Looking forward to hearing from you.
Best regards,
Lorenzo Chelini


^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2018-08-07 13:01 Marcel J.E. Mol
  0 siblings, 0 replies; 278+ messages in thread
From: Marcel J.E. Mol @ 2018-08-07 13:01 UTC (permalink / raw)
  To: linux-kernel

help

-- 
     ======--------         Marcel J.E. Mol                MESA Consulting B.V.
    =======---------        ph. +31-(0)6-54724868
    =======---------        marcel@mesa.nl                 Nootdorp
__==== www.mesa.nl ---____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
 They couldn't think of a number,     Linux user 1148  --  www linuxcounter net
    so they gave me a name!  -- Rupert Hine  --  www ruperthine com --

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2018-05-06 19:28 Richard Lee
  0 siblings, 0 replies; 278+ messages in thread
From: Richard Lee @ 2018-05-06 19:28 UTC (permalink / raw)
  To: linux-media



^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2018-01-06 16:44 Farouk Maâboudallah
  2018-01-06 22:40 ` Help Ozgur
                   ` (2 more replies)
  0 siblings, 3 replies; 278+ messages in thread
From: Farouk Maâboudallah @ 2018-01-06 16:44 UTC (permalink / raw)
  To: kernelnewbies

Good evening everyone :)

I'm new here with you guys. I have been using Linux for 6 months ... And
now I'm looking forward to develop and improve my skills.
I'm a student in digital mechanics which means developing, programming and
simulating in mechanical engineering. I have C, Matlab and Python as a
background (another code for simulation like ansys, abaqus, ...). Now, I
want to learn how to develop linux kernel or something like that ... Any
helps, any suggestion are welcome :)

Thanks,

Linuxely
For GNU/UNIX
For free software,

-- 
*P* Pour pr?server notre environnement, merci de n'imprimer cet Email que
si n?cessaire  !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20180106/126d4112/attachment.html>

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2017-09-28  1:21 Nityananda
  2017-09-28  3:06 ` Help Christian Couder
  0 siblings, 1 reply; 278+ messages in thread
From: Nityananda @ 2017-09-28  1:21 UTC (permalink / raw)
  To: git

Hello,
I am new to this community. I am facing a problem while using the
"make" command inside the "t/" folder.

The error is 


"1..31
Makefile:49: recipe for target 't5551-http-fetch-smart.sh' failed
make[1]: *** [t5551-http-fetch-smart.sh] Error 1
make[1]: Leaving directory '/home/nitya/projects/git/t'
Makefile:36: recipe for target 'test' failed
make: *** [test] Error 2"

It will really be an act of kindness if you help me out.

Regards,
Nityananda Gohain

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2017-05-17 14:26 James Okken
  0 siblings, 0 replies; 278+ messages in thread
From: James Okken @ 2017-05-17 14:26 UTC (permalink / raw)
  To: kvm list

help

^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <mailman.63189.1489153806.15860.yocto@yoctoproject.org>]
* help
@ 2017-01-28 16:59 Micah Crochet
  0 siblings, 0 replies; 278+ messages in thread
From: Micah Crochet @ 2017-01-28 16:59 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 330 bytes --]





MICAH J. CROCHET

INSTRUMENTAL MUSIC INSTRUCTOR
micahcrochet@cccneb.edu<mailto:micahcrochet@cccneb.edu> |



[cid:image8866a7.PNG@482b7df2.4ab65159]

www.cccneb.edu<http://www.cccneb.edu>

 | PO BOX 1027 | ,
TOLL FREE 1.877.222.0780



Central Community College maximizes student and community success.


[-- Attachment #2: image8866a7.PNG --]
[-- Type: image/png, Size: 14893 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2017-01-17 17:35 Jay Miller
  0 siblings, 0 replies; 278+ messages in thread
From: Jay Miller @ 2017-01-17 17:35 UTC (permalink / raw)
  To: dev


-- 
Jay Miller | Software Manager | Mobile: +1.781.258.7446
Oracle Communications Global Business Unit
100 Crosby Drive | Bedford, MA 01730

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2016-08-19 13:11 jayachandran.subramanian
  2016-08-19 18:09 ` help Stephen Hemminger
  2016-08-20  0:26 ` help harshavardhan Reddy
  0 siblings, 2 replies; 278+ messages in thread
From: jayachandran.subramanian @ 2016-08-19 13:11 UTC (permalink / raw)
  To: dev

Hi ,

I needs to enable SMP(symmetrical multiprocessing) in DPDK PMD NIC Port .

Please let me know the command to get the same

Thanks
jayachandran
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2016-05-13  7:25 Chandrakanth Sherkhane (IC Nexus)
  2016-05-13  7:34 ` help Chris Z.
  2016-05-13  9:26 ` help Burton, Ross
  0 siblings, 2 replies; 278+ messages in thread
From: Chandrakanth Sherkhane (IC Nexus) @ 2016-05-13  7:25 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

Dear Yocto mailing list,

 

We are IC Nexus Co. Ltd. in Taipei City - Taiwan, a developer and
manufacturer of ARM-based Embedded Single Board Computers and Smart LCD
Display products (on Android / Linux / Yocto Project). We are currently
selling our products with Yocto O.S. to our worldwide customers.

 

Could anyone help to provide more details for,

1. Yocto Virtual Keyboard in French language - is it available now?

2. If not available, when will it be available?

3. Is the Yocto Virtual Keyboard available in any other languages?

 

We will appreciate your quick reply - Thank you very much!

 

Kind Regards,

Chandrakanth Sherkhane

IC Nexus Co. Ltd.

Tel: +886-2-2789-1200 ext. 114

Email: chan@icnexus.com.tw

Web: http://www.icnexus.com.tw

 


[-- Attachment #2: Type: text/html, Size: 4634 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2016-03-23 10:23 Marwa Hamza
  0 siblings, 0 replies; 278+ messages in thread
From: Marwa Hamza @ 2016-03-23 10:23 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 971 bytes --]

ello
i'm trying to learn more about xen hypervisor .. i install xen in my host
with alpine as domu
and now i'm trying to build xen from source with linux dom0 for an arm
board .. i have a little bit confusion about building xen from the source
here's what i did
i build xen from the source
git clone git://xenbits.xen.org/xen.git

make dist-xen XEN_TARGET_ARCH=arm32 CROSS_COMPILE=arm-linux-gnueabihf-
CONFIG_EARLY_PRINTK=omap5432

then i download the linux kernel from
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

i configured and compiled successfully

i have in my sd card the u-boot.img and MLO and zimage xenuimage and the
file system ubuntu .. it worked fine after some problems .. now i'm trynig
to install linux as domu ..

when i wrote xl list ..the output is no command found ... it looks like i
need to install xen but i don't know how .. i'm really confused . where
should i install it and how
does any body can help me
Regards

[-- Attachment #1.2: Type: text/html, Size: 7780 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2016-03-10 20:04 Safa Hamza
  2016-03-11 14:49 ` help Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 278+ messages in thread
From: Safa Hamza @ 2016-03-10 20:04 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 6600 bytes --]

hello
i'm trying to run xen on omap5 following
this
http://wiki.xenproject.org/wiki/Xen_ARM_with_Virtualization_Extensions/OMAP5432_uEVM

the execution stops at this point

**********************************************************************************************
U-Boot SPL 2013.10-rc2 (Mar 08 2016 - 14:23:51)
OMAP5432 ES2.0
SPL: Please implement spl_start_uboot() for your board
SPL: Direct Linux boot not active!
reading u-boot.img
reading u-boot.img


U-Boot 2013.10-rc2 (Mar 08 2016 - 14:23:51)

CPU  : OMAP5432 ES2.0
Board: OMAP5432 uEVM
I2C:   ready
DRAM:  2 GiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

Net:   No ethernet found.
Hit any key to stop autoboot:  0
mmc0 is current device
reading boot.scr
** Unable to read file boot.scr **
reading uEnv.txt
** Unable to read file uEnv.txt **
** File not found /boot/zImage **
U-Boot# setenv dtb_addr_r 0x825f0000
U-Boot# setenv xen_addr_r 0x90000000
U-Boot# setenv kernel_addr_r 0xa0000000
U-Boot# setenv xen_bootargs 'sync_console console=dtuart dtuart=serial2'
U-Boot# setenv dom0_bootargs 'console=hvc0,115200n8 earlyprintk=xen debug
ignore_loglevel root=/dev/mmcblk0p2 rw rootwait fixrtc'
U-Boot# fatload mmc 0:1 $dtb_addr_r omap5-uevm.dtb
reading omap5-uevm.dtb
44836 bytes read in 7 ms (6.1 MiB/s)
U-Boot# fatload mmc 0:1 $xen_addr_r xen-uImage
reading xen-uImage
787372 bytes read in 43 ms (17.5 MiB/s)
U-Boot# fatload mmc 0:1 $kernel_addr_r zImage
reading zImage
4284248 bytes read in 213 ms (19.2 MiB/s)
U-Boot# fdt addr $dtb_addr_r
U-Boot# fdt resize
U-Boot# fdt set /chosen xen,xen-bootargs \"$xen_bootargs\"
U-Boot# fdt resize
U-Boot# fdt set /chosen xen,dom0-bootargs \"$dom0_bootargs\"
U-Boot# fdt resize
U-Boot# fdt mknode /chosen modules
U-Boot# fdt set /chosen/modules '#address-cells' <1>
U-Boot# fdt set /chosen/modules '#size-cells' <1>
U-Boot# fdt mknode /chosen/modules module@0
U-Boot# fdt set /chosen/modules/module@0 compatible xen,linux-zimage
xen,multiboot-module
U-Boot# fdt set /chosen/modules/module@0 reg <$kernel_addr_r 0xa00000>
U-Boot# bootm $xen_addr_r - $dtb_addr_r
## Booting kernel from Legacy Image at 90000000 ...
   Image Name:
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    787308 Bytes = 768.9 KiB
   Load Address: 80200000
   Entry Point:  80200000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 825f0000
   Booting using the fdt blob at 0x825f0000
   Loading Kernel Image ... OK
   reserving fdt memory region: addr=825f0000 size=c000
   Using Device Tree in place at 825f0000, end 825fefff

Starting kernel ...

- UART enabled -
- CPU 00000000 booting -
- Xen starting in Hyp mode -
- Zero BSS -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) Checking for initrd in /chosen
(XEN) RAM: 0000000080000000 - 00000000feffffff
(XEN)
(XEN) MODULE[0]: 00000000825f0000 - 00000000825fc000 Device Tree
(XEN) MODULE[1]: 00000000a0000000 - 00000000a0a00000 Kernel
(XEN)  RESVD[0]: 00000000825f0000 - 00000000825fc000
(XEN)
(XEN) Command line: sync_console console=dtuart dtuart=serial2
(XEN) Placing Xen at 0x00000000fee00000-0x00000000ff000000
(XEN) Update BOOTMOD_XEN from 0000000080200000-0000000080305701 =>
00000000fee00000-00000000fef05701
(XEN) Xen heap: 00000000fa000000-00000000fe000000 (16384 pages)
(XEN) Dom heap: 503808 pages
(XEN) Domain heap initialised
(XEN) Platform: TI OMAP5
(XEN) Looking for dtuart at "serial2", options ""
 Xen 4.7-unstable
(XEN) Xen version 4.7-unstable (root@) (arm-linux-gnueabihf-gcc (Linaro GCC
2014.11) 4.9.3 20141031 (prerelease)) debug=y Tue Mar  1 15:02:30 CET 2016
(XEN) Latest ChangeSet: Sun Feb 28 16:03:51 2016 -0500 git:42391c6
(XEN) Console output is synchronous.
(XEN) Processor: 412fc0f2: "ARM Limited", variant: 0x2, part 0xc0f, rev 0x2
(XEN) 32-bit Execution:
(XEN)   Processor Features: 00001131:00011011
(XEN)     Instruction Sets: AArch32 A32 Thumb Thumb-2 ThumbEE Jazelle
(XEN)     Extensions: GenericTimer Security
(XEN)   Debug Features: 02010555
(XEN)   Auxiliary Features: 00000000
(XEN)   Memory Model Features: 10201105 20000000 01240000 02102211
(XEN)  ISA Features: 02101110 13112111 21232041 11112131 10011142 00000000
(XEN) Set AuxCoreBoot1 to 00000000fee0004c (0020004c)
(XEN) Set AuxCoreBoot0 to 0x20
(XEN) Generic Timer IRQ: phys=30 hyp=26 virt=27 Freq: 6144 KHz
(XEN) GICv2: WARNING: The GICC size is too small: 0x1000 expected 0x2000
(XEN) GICv2 initialization:
(XEN)         gic_dist_addr=0000000048211000
(XEN)         gic_cpu_addr=0000000048212000
(XEN)         gic_hyp_addr=0000000048214000
(XEN)         gic_vcpu_addr=0000000048216000
(XEN)         gic_maintenance_irq=25
(XEN) GICv2: 192 lines, 2 cpus, secure (IID 0000043b).
(XEN) Using scheduler: SMP Credit Scheduler (credit)
(XEN) Allocated console ring of 16 KiB.
(XEN) VFP implementer 0x41 architecture 4 part 0x30 variant 0xf rev 0x0
(XEN) Bringing up CPU1
- CPU 00000001 booting -
- Xen starting in Hyp mode -
- Setting up control registers -
- Turning on paging -
- Ready -
(XEN) CPU 1 booted.
(XEN) Brought up 2 CPUs
(XEN) P2M: 40-bit IPA
(XEN) P2M: 3 levels with order-1 root, VTCR 0x80003558
(XEN) I/O virtualisation disabled
(XEN) *** LOADING DOMAIN 0 ***
(XEN) Loading kernel from boot module @ 00000000a0000000
(XEN) Allocating 1:1 mappings totalling 128MB for dom0:
(XEN) BANK[0] 0x000000a8000000-0x000000b0000000 (128MB)
(XEN) Grant table range: 0x000000fee00000-0x000000fee63000
(XEN) Loading zImage from 00000000a0000000 to
00000000afa00000-00000000afe15f58
(XEN) Allocating PPI 16 for event channel interrupt
(XEN) Loading dom0 DTB to 0x00000000af800000-0x00000000af80aece
(XEN) Scrubbing Free RAM on 1 nodes using 2 CPUs
(XEN) ........done.
(XEN) Initial low memory virq threshold set at 0x4000 pages.
(XEN) Std. Loglevel: All
(XEN) Guest Loglevel: All
(XEN) **********************************************
(XEN) ******* WARNING: CONSOLE OUTPUT IS SYNCHRONOUS
(XEN) ******* This option is intended to aid debugging of Xen by ensuring
(XEN) ******* that all output is synchronously delivered on the serial line.
(XEN) ******* However it can introduce SIGNIFICANT latencies and affect
(XEN) ******* timekeeping. It is NOT recommended for production use!
(XEN) **********************************************
(XEN) 3... 2... 1...
(XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input
to Xen)
(XEN) Freed 280kB init memory.


**********************************************************************************************
nothing appears after    (XEN) Freed 280kB init memory.  .. i don't know
where is the problem

. i'll appreciate your help
thanks

[-- Attachment #1.2: Type: text/html, Size: 16177 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Re: Help
@ 2015-11-24 14:40 Almeida, Gabriel
  0 siblings, 0 replies; 278+ messages in thread
From: Almeida, Gabriel @ 2015-11-24 14:40 UTC (permalink / raw)
  To: Almeida, Gabriel, bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 2146 bytes --]



From: Almeida, Gabriel
Sent: Montag, 2. November 2015 09:23
To: 'bitbake-devel@lists.openembedded.org'
Subject: Help

Hello there,

I want to setup toaster on my VM and I have followed the steps up to (3.1.1 - Step 5):
https://www.yoctoproject.org/docs/1.9/toaster-manual/toaster-manual.html#setting-up-locally-and-running-in-analysis-mode

Where I got the following error...

Toaster is already running and I am able to access it over the web (localhost:8000), however while bitbaking, I am getting the following error:

```
(venv)yoctoadm@kickseed:~/poky/build (fido)*$ bitbake core-image-minimal
Traceback (most recent call last):
  File "/home/yoctoadm/poky/bitbake/bin/bitbake", line 41, in <module>
    cookerdata.CookerConfiguration())
  File "/home/yoctoadm/poky/bitbake/lib/bb/main.py", line 383, in bitbake_main
    return ui_module.main(server_connection.connection, server_connection.events, configParams)
  File "/home/yoctoadm/poky/bitbake/lib/bb/ui/knotty.py", line 287, in main
    params.updateToServer(server, os.environ.copy())
  File "/home/yoctoadm/poky/bitbake/lib/bb/cookerdata.py", line 79, in updateToServer
    ret, error = server.runCommand(["updateConfig", options, environment])
  File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1587, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1306, in single_request
    return self.parse_response(response)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1482, in parse_response
    return u.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 794, in close
    raise Fault(**self._stack[0])
Fault: <Fault 1: "<class 'xml.parsers.expat.ExpatError'>:not well-formed (invalid token): line 115, column 120">
```

```
(venv)yoctoadm@kickseed:~/poky/build (fido)*$

BitBake Build Tool Core version 1.26.0, bitbake version 1.26.0
```

BR
Gabriel




[-- Attachment #2: Type: text/html, Size: 8608 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2015-11-23 18:31 Carlos Palminha
  0 siblings, 0 replies; 278+ messages in thread
From: Carlos Palminha @ 2015-11-23 18:31 UTC (permalink / raw)
  To: linux-snps-arc



^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2015-11-02  8:22 Almeida, Gabriel
  2015-11-02 17:38 ` Help Michael Wood
  2015-11-30  7:31 ` Help Almeida, Gabriel
  0 siblings, 2 replies; 278+ messages in thread
From: Almeida, Gabriel @ 2015-11-02  8:22 UTC (permalink / raw)
  To: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 2019 bytes --]

Hello there,

I want to setup toaster on my VM and I have followed the steps up to (3.1.1 - Step 5):
https://www.yoctoproject.org/docs/1.9/toaster-manual/toaster-manual.html#setting-up-locally-and-running-in-analysis-mode

Where I got the following error...

Toaster is already running and I am able to access it over the web (localhost:8000), however while bitbaking, I am getting the following error:

```
(venv)yoctoadm@kickseed:~/poky/build (fido)*$ bitbake core-image-minimal
Traceback (most recent call last):
  File "/home/yoctoadm/poky/bitbake/bin/bitbake", line 41, in <module>
    cookerdata.CookerConfiguration())
  File "/home/yoctoadm/poky/bitbake/lib/bb/main.py", line 383, in bitbake_main
    return ui_module.main(server_connection.connection, server_connection.events, configParams)
  File "/home/yoctoadm/poky/bitbake/lib/bb/ui/knotty.py", line 287, in main
    params.updateToServer(server, os.environ.copy())
  File "/home/yoctoadm/poky/bitbake/lib/bb/cookerdata.py", line 79, in updateToServer
    ret, error = server.runCommand(["updateConfig", options, environment])
  File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1587, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1306, in single_request
    return self.parse_response(response)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1482, in parse_response
    return u.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 794, in close
    raise Fault(**self._stack[0])
Fault: <Fault 1: "<class 'xml.parsers.expat.ExpatError'>:not well-formed (invalid token): line 115, column 120">
```

```
(venv)yoctoadm@kickseed:~/poky/build (fido)*$

BitBake Build Tool Core version 1.26.0, bitbake version 1.26.0
```

BR
Gabriel




[-- Attachment #2: Type: text/html, Size: 7583 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <CAD-PXq+fMXjH3r==9wDBRn0U37HLmkfWPT7JPh+82OWQEqph-w@mail.gmail.com>]
* Help
@ 2015-07-23 15:05 Akash Talole
  2015-07-24  7:46 ` Help Wei Liu
  0 siblings, 1 reply; 278+ messages in thread
From: Akash Talole @ 2015-07-23 15:05 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 468 bytes --]

Hello,

Issue in tapdisk-vbd.c

Why td_queue_write(parent,treq); is called in  static void
__tapdisk_vbd_reissue_td_request(td_vbd_t *vbd,td_image_t *image,
td_request_t treq) function as we can't write in parent vhd because it is
read only.

I have attached the code of tapdisk-vbd.c and block-vhd.c.

And please tell me about how to write into child vhd after reading from
parent vhd in block-vhd.c in case of VHD_BM_BIT_CLEAR in function
vhd_queue_read().

Thanks.

[-- Attachment #1.2: Type: text/html, Size: 627 bytes --]

[-- Attachment #2: tapdisk-vbd.c --]
[-- Type: text/x-csrc, Size: 39857 bytes --]

/*
 * Copyright (C) Citrix Systems Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2.1 only
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <regex.h>
#include <unistd.h>
#include <stdlib.h>
#include <libgen.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/types.h>

#include "debug.h"
#include "libvhd.h"
#include "tapdisk-blktap.h"
#include "tapdisk-image.h"
#include "tapdisk-driver.h"
#include "tapdisk-server.h"
#include "tapdisk-vbd.h"
#include "tapdisk-disktype.h"
#include "tapdisk-interface.h"
#include "tapdisk-stats.h"
#include "tapdisk-storage.h"
#include "tapdisk-nbdserver.h"
#include "td-stats.h"
#include "tapdisk-utils.h"
#include "md5.h"

#define DBG(_level, _f, _a...) tlog_write(_level, _f, ##_a)
#define ERR(_err, _f, _a...) tlog_error(_err, _f, ##_a)

#define INFO(_f, _a...)            tlog_syslog(TLOG_INFO, "vbd: " _f, ##_a)
#define ERROR(_f, _a...)           tlog_syslog(TLOG_WARN, "vbd: " _f, ##_a)

#define TD_VBD_EIO_RETRIES          10
#define TD_VBD_EIO_SLEEP            1
#define TD_VBD_WATCHDOG_TIMEOUT     10

static void tapdisk_vbd_complete_vbd_request(td_vbd_t *, td_vbd_request_t *);
static int  tapdisk_vbd_queue_ready(td_vbd_t *);
static void tapdisk_vbd_check_queue_state(td_vbd_t *);

/*
 * initialization
 */

static void
tapdisk_vbd_mark_progress(td_vbd_t *vbd)
{
	gettimeofday(&vbd->ts, NULL);
}

td_vbd_t*
tapdisk_vbd_create(uint16_t uuid)
{
	td_vbd_t *vbd;

	vbd = calloc(1, sizeof(td_vbd_t));
	if (!vbd) {
		EPRINTF("failed to allocate tapdisk state\n");
		return NULL;
	}

    shm_init(&vbd->rrd.shm);

	vbd->uuid        = uuid;
	vbd->req_timeout = TD_VBD_REQUEST_TIMEOUT;

	INIT_LIST_HEAD(&vbd->images);
	INIT_LIST_HEAD(&vbd->new_requests);
	INIT_LIST_HEAD(&vbd->pending_requests);
	INIT_LIST_HEAD(&vbd->failed_requests);
	INIT_LIST_HEAD(&vbd->completed_requests);
	INIT_LIST_HEAD(&vbd->next);
    INIT_LIST_HEAD(&vbd->rings);
    INIT_LIST_HEAD(&vbd->dead_rings);
	tapdisk_vbd_mark_progress(vbd);

	return vbd;
}

int
tapdisk_vbd_initialize(int rfd, int wfd, uint16_t uuid)
{
	td_vbd_t *vbd;

	vbd = tapdisk_server_get_vbd(uuid);
	if (vbd) {
		EPRINTF("duplicate vbds! %u\n", uuid);
		return -EEXIST;
	}

	vbd = tapdisk_vbd_create(uuid);

	tapdisk_server_add_vbd(vbd);

	return 0;
}

static inline void
tapdisk_vbd_add_image(td_vbd_t *vbd, td_image_t *image)
{
	list_add_tail(&image->next, &vbd->images);
}

static inline int
tapdisk_vbd_is_last_image(td_vbd_t *vbd, td_image_t *image)
{
	return list_is_last(&image->next, &vbd->images);
}

static inline td_image_t *
tapdisk_vbd_first_image(td_vbd_t *vbd)
{
	td_image_t *image = NULL;
	if (!list_empty(&vbd->images))
		image = list_entry(vbd->images.next, td_image_t, next);
	return image;
}

static inline td_image_t *
tapdisk_vbd_last_image(td_vbd_t *vbd)
{
	td_image_t *image = NULL;
	if (!list_empty(&vbd->images))
		image = list_entry(vbd->images.prev, td_image_t, next);
	return image;
}

static inline td_image_t *
tapdisk_vbd_next_image(td_image_t *image)
{
	return list_entry(image->next.next, td_image_t, next);
}

static int
tapdisk_vbd_validate_chain(td_vbd_t *vbd)
{
	return tapdisk_image_validate_chain(&vbd->images);
}

static int
vbd_stats_destroy(td_vbd_t *vbd) {

    int err = 0;

    ASSERT(vbd);

    err = shm_destroy(&vbd->rrd.shm);
    if (unlikely(err)) {
        EPRINTF("failed to destroy RRD file: %s\n", strerror(err));
        goto out;
    }

    free(vbd->rrd.shm.path);
    vbd->rrd.shm.path = NULL;

out:
    return -err;
}

static int
vbd_stats_create(td_vbd_t *vbd) {

    int err;

    ASSERT(vbd);

	err = mkdir("/dev/shm/metrics", S_IRUSR | S_IWUSR);
	if (likely(err)) {
        err = errno;
        if (unlikely(err != EEXIST))
    		goto out;
        else
            err = 0;
    }

    /*
     * FIXME Rename this to something like "vbd3-domid-devid". Consider
     * consolidating this with the io_ring shared memory file. Check if blkback
     * exports the same information in some sysfs file and if so move this to
     * the ring location.
     */
    err = asprintf(&vbd->rrd.shm.path, "/dev/shm/metrics/tap-%d-%d", getpid(),
            vbd->uuid);
    if (err == -1) {
        err = errno;
        vbd->rrd.shm.path = NULL;
        EPRINTF("failed to create metric file: %s\n", strerror(err));
        goto out;
    }
    err = 0;

    vbd->rrd.shm.size = PAGE_SIZE;
    err = shm_create(&vbd->rrd.shm);
    if (err)
        EPRINTF("failed to create RRD: %s\n", strerror(err));

out:
    if (err) {
        int err2 = vbd_stats_destroy(vbd);
        if (err2)
            EPRINTF("failed to clean up failed RRD shared memory creation: "
                    "%s (error ignored)\n", strerror(-err2));
    }
    return -err;
}

void
tapdisk_vbd_close_vdi(td_vbd_t *vbd)
{
    int err;

    err = vbd_stats_destroy(vbd);
    if (err) {
        EPRINTF("failed to destroy RRD stats file: %s (error ignored)\n",
                strerror(-err));
    }

	tapdisk_image_close_chain(&vbd->images);

	if (vbd->secondary &&
	    vbd->secondary_mode != TD_VBD_SECONDARY_MIRROR) {
		tapdisk_image_close(vbd->secondary);
		vbd->secondary = NULL;
	}

	if (vbd->retired) {
		tapdisk_image_close(vbd->retired);
		vbd->retired = NULL;
	}

	td_flag_set(vbd->state, TD_VBD_CLOSED);
}

static int
tapdisk_vbd_add_block_cache(td_vbd_t *vbd)
{
	td_image_t *cache, *image, *target, *tmp;
	int err;

	target = NULL;

	tapdisk_vbd_for_each_image(vbd, image, tmp)
		if (td_flag_test(image->flags, TD_OPEN_RDONLY) &&
		    td_flag_test(image->flags, TD_OPEN_SHAREABLE)) {
			target = image;
			break;
		}

	if (!target)
		return 0;

	cache = tapdisk_image_allocate(target->name,
				       DISK_TYPE_BLOCK_CACHE,
				       target->flags);
	if (!cache)
		return -ENOMEM;

	/* try to load existing cache */
	err = td_load(cache);
	if (!err)
		goto done;

	/* hack driver to send open() correct image size */
	if (!target->driver) {
		err = -ENODEV;
		goto fail;
	}

	cache->driver = tapdisk_driver_allocate(cache->type,
						cache->name,
						cache->flags);
	if (!cache->driver) {
		err = -ENOMEM;
		goto fail;
	}

	cache->driver->info = target->driver->info;

	/* try to open new cache */
	err = td_open(cache);
	if (!err)
		goto done;

fail:
	/* give up */
	tapdisk_image_free(target);
	return err;

done:
	/* insert cache before image */
	list_add(&cache->next, target->next.prev);
	return 0;
}

static int
tapdisk_vbd_add_local_cache(td_vbd_t *vbd)
{
	td_image_t *cache, *parent;
	int err;

	parent = tapdisk_vbd_first_image(vbd);
	if (tapdisk_vbd_is_last_image(vbd, parent)) {
		DPRINTF("Single-image chain, nothing to cache");
		return 0;
	}

	cache = tapdisk_image_allocate(parent->name,
				       DISK_TYPE_LCACHE,
				       parent->flags);

	if (!cache)
		return -ENOMEM;

	/* try to load existing cache */
	err = td_load(cache);
	if (!err)
		goto done;

	cache->driver = tapdisk_driver_allocate(cache->type,
						cache->name,
						cache->flags);
	if (!cache->driver) {
		err = -ENOMEM;
		goto fail;
	}

	cache->driver->info = parent->driver->info;

	/* try to open new cache */
	err = td_open(cache);
	if (!err)
		goto done;

fail:
	tapdisk_image_free(cache);
	return err;

done:
	/* insert cache right above leaf image */
	list_add(&cache->next, &parent->next);

	DPRINTF("Added local_cache driver\n");
	return 0;
}

int
tapdisk_vbd_add_secondary(td_vbd_t *vbd)
{
	td_image_t *leaf, *second = NULL;
	const char *path;
	int type, err;

	if (strcmp(vbd->secondary_name, "null") == 0) {
		DPRINTF("Removing secondary image\n");
		vbd->secondary_mode = TD_VBD_SECONDARY_DISABLED;
		vbd->secondary = NULL;
		vbd->nbd_mirror_failed = 0;
		return 0;
	}

	DPRINTF("Adding secondary image: %s\n", vbd->secondary_name);

	type = tapdisk_disktype_parse_params(vbd->secondary_name, &path);
	if (type < 0)
		return type;

	leaf = tapdisk_vbd_first_image(vbd);
	if (!leaf) {
		err = -EINVAL;
		goto fail;
	}

	err = tapdisk_image_open(type, path, leaf->flags, &second);
	if (err) {
		if (type == DISK_TYPE_NBD)
			vbd->nbd_mirror_failed = 1;

		vbd->secondary=NULL;
		vbd->secondary_mode=TD_VBD_SECONDARY_DISABLED;
		
		goto fail;
	}

	if (second->info.size != leaf->info.size) {
		EPRINTF("Secondary image size %"PRIu64" != image size %"PRIu64"\n",
			second->info.size, leaf->info.size);
		err = -EINVAL;
		goto fail;
	}

	vbd->secondary = second;
	leaf->flags |= TD_IGNORE_ENOSPC;
	if (td_flag_test(vbd->flags, TD_OPEN_STANDBY)) {
		DPRINTF("In standby mode\n");
		vbd->secondary_mode = TD_VBD_SECONDARY_STANDBY;
	} else {
		DPRINTF("In mirror mode\n");
		vbd->secondary_mode = TD_VBD_SECONDARY_MIRROR;
		/*
		 * we actually need this image to also be part of the chain, 
		 * since it may already contain data
		 */
		list_add(&second->next, &leaf->next);
	}

	DPRINTF("Added secondary image\n");
	return 0;

fail:
	if (second)
		tapdisk_image_close(second);
	return err;
}

static void signal_enospc(td_vbd_t *vbd)
{
	int fd, err;
	char *fn;

	err = asprintf(&fn, BLKTAP2_ENOSPC_SIGNAL_FILE"%d", vbd->tap->minor);
	if (err == -1) {
		EPRINTF("Failed to signal ENOSPC condition\n");
		return;
	}

	fd = open(fn, O_WRONLY | O_CREAT | O_NONBLOCK, 0666);
	if (fd == -1)
		EPRINTF("Failed to open file to signal ENOSPC condition\n");
	else
		close(fd);

	free(fn);
}

#if 0
static int
tapdisk_vbd_open_index(td_vbd_t *vbd)
{
	int err;
	char *path;
	td_flag_t flags;
	td_image_t *last, *image;

	last = tapdisk_vbd_last_image(vbd);
	err  = asprintf(&path, "%s.bat", last->name);
	if (err == -1)
		return -errno;

	err = access(path, R_OK);
	if (err == -1) {
		free(path);
		return -errno;
	}

	flags = vbd->flags | TD_OPEN_RDONLY | TD_OPEN_SHAREABLE;
	image = tapdisk_image_allocate(path, DISK_TYPE_VINDEX, flags);
	if (!image) {
		err = -ENOMEM;
		goto fail;
	}

	err = td_open(image);
	if (err)
		goto fail;

	tapdisk_vbd_add_image(vbd, image);
	return 0;

fail:
	if (image)
		tapdisk_image_free(image);
	free(path);
	return err;
}
#endif

static int
tapdisk_vbd_add_dirty_log(td_vbd_t *vbd)
{
	int err;
	td_driver_t *driver;
	td_image_t *log, *parent;

	driver = NULL;
	log    = NULL;

	parent = tapdisk_vbd_first_image(vbd);

	log    = tapdisk_image_allocate(parent->name,
					DISK_TYPE_LOG,
					parent->flags);
	if (!log)
		return -ENOMEM;

	driver = tapdisk_driver_allocate(log->type,
					 log->name,
					 log->flags);
	if (!driver) {
		err = -ENOMEM;
		goto fail;
	}

	driver->info = parent->driver->info;
	log->driver  = driver;

	err = td_open(log);
	if (err)
		goto fail;

	tapdisk_vbd_add_image(vbd, log);
	return 0;

fail:
	tapdisk_image_free(log);
	return err;
}

int
tapdisk_vbd_open_vdi(td_vbd_t *vbd, const char *name, td_flag_t flags, int prt_devnum)
{
	char *tmp = vbd->name;
	int err;

	if (!list_empty(&vbd->images)) {
		err = -EBUSY;
		goto fail;
	}

	if (!name && !vbd->name) {
		err = -EINVAL;
		goto fail;
	}

	if (name) {
		vbd->name = strdup(name);
		if (!vbd->name) {
			err = -errno;
			goto fail;
		}
	}

	err = tapdisk_image_open_chain(vbd->name, flags, prt_devnum, &vbd->images);
	if (err)
		goto fail;

	td_flag_clear(vbd->state, TD_VBD_CLOSED);
	vbd->flags = flags;

	if (td_flag_test(vbd->flags, TD_OPEN_LOG_DIRTY)) {
		err = tapdisk_vbd_add_dirty_log(vbd);
		if (err)
			goto fail;
	}

	if (td_flag_test(vbd->flags, TD_OPEN_ADD_CACHE)) {
		err = tapdisk_vbd_add_block_cache(vbd);
		if (err)
			goto fail;
	}

	if (td_flag_test(vbd->flags, TD_OPEN_LOCAL_CACHE)) {
		err = tapdisk_vbd_add_local_cache(vbd);
		if (err)
			goto fail;
	}

	err = tapdisk_vbd_validate_chain(vbd);
	if (err)
		goto fail;

	if (td_flag_test(vbd->flags, TD_OPEN_SECONDARY)) {
		err = tapdisk_vbd_add_secondary(vbd);
		if (err) {
			if (vbd->nbd_mirror_failed != 1)
				goto fail;
			INFO("Ignoring failed NBD secondary attach\n");
			err = 0;
		}
	}

    err = vbd_stats_create(vbd);
    if (err)
        goto fail;

	if (tmp != vbd->name)
		free(tmp);

	return err;

fail:
	if (vbd->name != tmp) {
		free(vbd->name);
		vbd->name = tmp;
	}

	if (!list_empty(&vbd->images))
		tapdisk_image_close_chain(&vbd->images);

	vbd->flags = 0;

	return err;
}

void
tapdisk_vbd_detach(td_vbd_t *vbd)
{
	td_blktap_t *tap = vbd->tap;

	if (tap) {
		tapdisk_blktap_close(tap);
		vbd->tap = NULL;
	}
}

int
tapdisk_vbd_attach(td_vbd_t *vbd, const char *devname, int minor)
{

	if (vbd->tap)
		return -EALREADY;

	return tapdisk_blktap_open(devname, vbd, &vbd->tap);
}

/*
int
tapdisk_vbd_open(td_vbd_t *vbd, const char *name,
		 int minor, const char *ring, td_flag_t flags)
{
	int err;

	err = tapdisk_vbd_open_vdi(vbd, name, flags, -1);
	if (err)
		goto out;

	err = tapdisk_vbd_attach(vbd, ring, minor);
	if (err)
		goto out;

	return 0;

out:
	tapdisk_vbd_detach(vbd);
	tapdisk_vbd_close_vdi(vbd);
	free(vbd->name);
	vbd->name = NULL;
	return err;
}
*/

static void
tapdisk_vbd_queue_count(td_vbd_t *vbd, int *new,
			int *pending, int *failed, int *completed)
{
	int n, p, f, c;
	td_vbd_request_t *vreq, *tvreq;

	n = 0;
	p = 0;
	f = 0;
	c = 0;

	tapdisk_vbd_for_each_request(vreq, tvreq, &vbd->new_requests)
		n++;

	tapdisk_vbd_for_each_request(vreq, tvreq, &vbd->pending_requests)
		p++;

	tapdisk_vbd_for_each_request(vreq, tvreq, &vbd->failed_requests)
		f++;

	tapdisk_vbd_for_each_request(vreq, tvreq, &vbd->completed_requests)
		c++;

	*new       = n;
	*pending   = p;
	*failed    = f;
	*completed = c;
}

static int
tapdisk_vbd_shutdown(td_vbd_t *vbd)
{
	int new, pending, failed, completed;

	if (!list_empty(&vbd->pending_requests))
		return -EAGAIN;

	tapdisk_vbd_queue_count(vbd, &new, &pending, &failed, &completed);

	DPRINTF("%s: state: 0x%08x, new: 0x%02x, pending: 0x%02x, "
		"failed: 0x%02x, completed: 0x%02x\n", 
		vbd->name, vbd->state, new, pending, failed, completed);
	DPRINTF("last activity: %010ld.%06ld, errors: 0x%04"PRIx64", "
		"retries: 0x%04"PRIx64", received: 0x%08"PRIx64", "
		"returned: 0x%08"PRIx64", kicked: 0x%08"PRIx64"\n",
		vbd->ts.tv_sec, vbd->ts.tv_usec,
		vbd->errors, vbd->retries, vbd->received, vbd->returned,
		vbd->kicked);

	tapdisk_vbd_close_vdi(vbd);
	tapdisk_vbd_detach(vbd);
	tapdisk_server_remove_vbd(vbd);
	free(vbd->name);
	free(vbd);

	return 0;
}

int
tapdisk_vbd_close(td_vbd_t *vbd)
{
	/*
	 * don't close if any requests are pending in the aio layer
	 */
	if (!list_empty(&vbd->pending_requests))
		goto fail;

	/* 
	 * if the queue is still active and we have more
	 * requests, try to complete them before closing.
	 */
	if (tapdisk_vbd_queue_ready(vbd) &&
	    (!list_empty(&vbd->new_requests) ||
	     !list_empty(&vbd->failed_requests) ||
	     !list_empty(&vbd->completed_requests)))
		goto fail;

	return tapdisk_vbd_shutdown(vbd);

fail:
	td_flag_set(vbd->state, TD_VBD_SHUTDOWN_REQUESTED);
	DBG(TLOG_WARN, "%s: requests pending\n", vbd->name);
	return -EAGAIN;
}

/*
 * control operations
 */

void
tapdisk_vbd_debug(td_vbd_t *vbd)
{
	td_image_t *image, *tmp;
	int new, pending, failed, completed;

	tapdisk_vbd_queue_count(vbd, &new, &pending, &failed, &completed);

	DBG(TLOG_WARN, "%s: state: 0x%08x, new: 0x%02x, pending: 0x%02x, "
	    "failed: 0x%02x, completed: 0x%02x, last activity: %010ld.%06ld, "
	    "errors: 0x%04"PRIx64", retries: 0x%04"PRIx64", "
	    "received: 0x%08"PRIx64", returned: 0x%08"PRIx64", "
	    "kicked: 0x%08"PRIx64"\n",
	    vbd->name, vbd->state, new, pending, failed, completed,
	    vbd->ts.tv_sec, vbd->ts.tv_usec, vbd->errors, vbd->retries,
	    vbd->received, vbd->returned, vbd->kicked);

	tapdisk_vbd_for_each_image(vbd, image, tmp)
		td_debug(image);
}

static void
tapdisk_vbd_drop_log(td_vbd_t *vbd)
{
	if (td_flag_test(vbd->state, TD_VBD_LOG_DROPPED))
		return;

	tapdisk_vbd_debug(vbd);
	tlog_precious(0);
	td_flag_set(vbd->state, TD_VBD_LOG_DROPPED);
}

int
tapdisk_vbd_get_disk_info(td_vbd_t *vbd, td_disk_info_t *info)
{
	if (list_empty(&vbd->images))
		return -EINVAL;

	*info = tapdisk_vbd_first_image(vbd)->info;
	return 0;
}

static int
tapdisk_vbd_queue_ready(td_vbd_t *vbd)
{
	return (!td_flag_test(vbd->state, TD_VBD_DEAD) &&
		!td_flag_test(vbd->state, TD_VBD_CLOSED) &&
		!td_flag_test(vbd->state, TD_VBD_QUIESCED) &&
		!td_flag_test(vbd->state, TD_VBD_QUIESCE_REQUESTED));
}

int
tapdisk_vbd_retry_needed(td_vbd_t *vbd)
{
	return !(list_empty(&vbd->failed_requests) &&
		 list_empty(&vbd->new_requests));
}

int
tapdisk_vbd_lock(td_vbd_t *vbd)
{
	return 0;
}

int
tapdisk_vbd_quiesce_queue(td_vbd_t *vbd)
{
	if (!list_empty(&vbd->pending_requests)) {
		td_flag_set(vbd->state, TD_VBD_QUIESCE_REQUESTED);
		return -EAGAIN;
	}

	td_flag_clear(vbd->state, TD_VBD_QUIESCE_REQUESTED);
	td_flag_set(vbd->state, TD_VBD_QUIESCED);
	return 0;
}

int
tapdisk_vbd_start_queue(td_vbd_t *vbd)
{
	td_flag_clear(vbd->state, TD_VBD_QUIESCED);
	td_flag_clear(vbd->state, TD_VBD_QUIESCE_REQUESTED);
	tapdisk_vbd_mark_progress(vbd);
	return 0;
}

int
tapdisk_vbd_kill_queue(td_vbd_t *vbd)
{
	tapdisk_vbd_quiesce_queue(vbd);
	td_flag_set(vbd->state, TD_VBD_DEAD);
	return 0;
}

#if 0
static int
tapdisk_vbd_open_image(td_vbd_t *vbd, td_image_t *image)
{
	int err;
	td_image_t *parent;

	err = td_open(image);
	if (err)
		return err;

	if (!tapdisk_vbd_is_last_image(vbd, image)) {
		parent = tapdisk_vbd_next_image(image);
		err    = td_validate_parent(image, parent);
		if (err) {
			td_close(image);
			return err;
		}
	}

	return 0;
}
#endif

int
tapdisk_vbd_pause(td_vbd_t *vbd)
{
	int err;
    struct td_xenblkif *blkif;

	INFO("pause requested\n");

	td_flag_set(vbd->state, TD_VBD_PAUSE_REQUESTED);

	if (vbd->nbdserver)
		tapdisk_nbdserver_pause(vbd->nbdserver);

	err = tapdisk_vbd_quiesce_queue(vbd);
	if (err)
		return err;

    list_for_each_entry(blkif, &vbd->rings, entry)
		tapdisk_xenblkif_suspend(blkif);

	tapdisk_vbd_close_vdi(vbd);

	INFO("pause completed\n");

	if (!list_empty(&vbd->failed_requests))
		INFO("warning: failed requests pending\n");

	td_flag_clear(vbd->state, TD_VBD_PAUSE_REQUESTED);
	td_flag_set(vbd->state, TD_VBD_PAUSED);

	return 0;
}

int
tapdisk_vbd_resume(td_vbd_t *vbd, const char *name)
{
	int i, err;
    struct td_xenblkif *blkif;

	DBG(TLOG_DBG, "resume requested\n");

	if (!td_flag_test(vbd->state, TD_VBD_PAUSED)) {
		EPRINTF("resume request for unpaused vbd %s\n", vbd->name);
		return -EINVAL;
	}

	for (i = 0; i < TD_VBD_EIO_RETRIES; i++) {
		err = tapdisk_vbd_open_vdi(vbd, name, vbd->flags | TD_OPEN_STRICT, -1);
		if (!err)
			break;

		sleep(TD_VBD_EIO_SLEEP);
	}

	if (!err) {
		td_disk_info_t disk_info;
		err = tapdisk_vbd_get_disk_info(vbd, &disk_info);
		if (err) {
			EPRINTF("VBD %d failed to get disk info: %s\n", vbd->uuid,
					strerror(-err));
			goto resume_failed;
		}
		if (vbd->disk_info.size != disk_info.size
				|| vbd->disk_info.sector_size != disk_info.sector_size
				|| vbd->disk_info.info != disk_info.info) {
			EPRINTF("VBD %d cannot change disk info\n", vbd->uuid);
			err = -EMEDIUMTYPE;
			goto resume_failed;
		}
	}
resume_failed:
	if (err) {
		td_flag_set(vbd->state, TD_VBD_RESUME_FAILED);
		tapdisk_vbd_close_vdi(vbd);
		return err;
	}
	td_flag_clear(vbd->state, TD_VBD_RESUME_FAILED);

	DBG(TLOG_DBG, "resume completed\n");

	tapdisk_vbd_start_queue(vbd);
	td_flag_clear(vbd->state, TD_VBD_PAUSED);
	td_flag_clear(vbd->state, TD_VBD_PAUSE_REQUESTED);
	tapdisk_vbd_check_state(vbd);

	if (vbd->nbdserver)
		tapdisk_nbdserver_unpause(vbd->nbdserver);

    list_for_each_entry(blkif, &vbd->rings, entry)
		tapdisk_xenblkif_resume(blkif);


	DBG(TLOG_DBG, "state checked\n");

	return 0;
}

static int
tapdisk_vbd_request_ttl(td_vbd_request_t *vreq,
			const struct timeval *now)
{
	struct timeval delta;
	timersub(now, &vreq->ts, &delta);
	return vreq->vbd->req_timeout - delta.tv_sec;
}

static int
__tapdisk_vbd_request_timeout(td_vbd_request_t *vreq,
			      const struct timeval *now)
{
	int timeout;

	timeout = tapdisk_vbd_request_ttl(vreq, now) < 0;
	if (timeout)
		ERR(vreq->error,
		    "req %s timed out, retried %d times\n",
		    vreq->name, vreq->num_retries);

	return timeout;
}

static int
tapdisk_vbd_request_timeout(td_vbd_request_t *vreq)
{
	struct timeval now;
	gettimeofday(&now, NULL);
	return __tapdisk_vbd_request_timeout(vreq, &now);
}

static void
tapdisk_vbd_check_queue_state(td_vbd_t *vbd)
{
	td_vbd_request_t *vreq, *tmp;
	struct timeval now;

	gettimeofday(&now, NULL);
	tapdisk_vbd_for_each_request(vreq, tmp, &vbd->failed_requests)
		if (__tapdisk_vbd_request_timeout(vreq, &now))
			tapdisk_vbd_complete_vbd_request(vbd, vreq);

	if (!list_empty(&vbd->new_requests) ||
	    !list_empty(&vbd->failed_requests))
		tapdisk_vbd_issue_requests(vbd);

}

static inline int
tapdisk_vbd_produce_rrds(td_vbd_t *vbd) {

	td_image_t *leaf;
	int off = 0, size = 0;
	int err;
	int i, j;
	char *buf;
	int json_str_len_off, md5sum_str_len_off, json_data_off, json_data_len;
	const int json_str_len = 8 + 1, md5sum_str_len = 32 + 1;
	char tmp[md5sum_str_len + 1];
	time_t t;
	MD5_CTX md5_ctx;
	unsigned char md5_out[MD5_DIGEST_LENGTH];

	ASSERT(vbd);

	buf = vbd->rrd.shm.mem;

	/*
	 * If no VDI has been opened yet there's nothing to report.
	 */
	if (!buf)
		return 0;

	/*
	 * Produce RRDs every five seconds.
	 */
	t = time(NULL);
	if (t - vbd->rrd.last < 5)
		return 0;
	vbd->rrd.last = t;

	size = vbd->rrd.shm.size - off;
	err = tapdisk_snprintf(buf, &off, &size, 0, "DATASOURCES\n");
	if (err)
		return err;

	/*
	 * reserve space for JSON string length
	 */
	json_str_len_off = off;
	off += json_str_len, size -= json_str_len;

	/*
	 * reserve space for MD5 sum of JSON string
	 */
	md5sum_str_len_off = off;
	off += md5sum_str_len, size -= md5sum_str_len;

	json_data_off = off;
	err = tapdisk_snprintf(buf, &off, &size, 0,	"{\n");
	err += tapdisk_snprintf(buf, &off, &size, 1, "\"timestamp\": %lu,\n",
			time(NULL));
	err += tapdisk_snprintf(buf, &off, &size, 1, "\"datasources\": {\n");
	if (err)
		return err;

	leaf = tapdisk_vbd_first_image(vbd);

	/*
	 * XXX We're only reporting RRDs for leaves. We could traverse the list
	 * of parent and report RRDs for each one of them, if there is something
	 * to report. However, for internal VHD files there's nothing to report
	 * so that would end up in a useless traverse of the list. We could address
	 * this issue by keeping a list of images that do have an RRD callback.
	 */
	if (leaf && leaf->driver->ops->td_rrd) {
		err = leaf->driver->ops->td_rrd(leaf->driver, buf, &off, &size);
		if (err)
			return err;
		err = tapdisk_snprintf(buf, &off, &size, 0, ",\n");
		if (err)
			return err;
	}

	err += tapdisk_snprintf(buf, &off, &size, 2, "\"io_errors\": {\n");
	err += tapdisk_snprintf(buf, &off, &size, 3,
			"\"description\": \"Number of I/O errors\",\n");
	err += tapdisk_snprintf(buf, &off, &size, 3, "\"owner\": \"host\",\n");
	err += tapdisk_snprintf(buf, &off, &size, 3,  "\"type\": "
			"\"absolute\",\n");
	err += tapdisk_snprintf(buf, &off, &size, 3, "\"units\": \"units\",\n");
	err += tapdisk_snprintf(buf, &off, &size, 3, "\"min\": \"0.00\",\n");
	err += tapdisk_snprintf(buf, &off, &size, 3, "\"max\": \"inf\",\n");
	err += tapdisk_snprintf(buf, &off, &size, 3, "\"value\": \"%llu\",\n",
			vbd->errors);
	err += tapdisk_snprintf(buf, &off, &size, 3, "\"value_type\": \"float\"\n");
	err += tapdisk_snprintf(buf, &off, &size, 2, "}\n");
	err += tapdisk_snprintf(buf, &off, &size, 1, "}\n");
	err += tapdisk_snprintf(buf, &off, &size, 0, "}\n");
	if (err)
		return err;

	json_data_len = off - json_str_len;
	sprintf(tmp, "%08x\n", json_data_len);
	strncpy(buf + json_str_len_off, tmp, json_str_len);

	MD5_Init(&md5_ctx);
	MD5_Update(&md5_ctx, buf + json_data_off, json_data_len);
	MD5_Final(md5_out, &md5_ctx);
	for (i = 0, j = 0; i < MD5_DIGEST_LENGTH; i++)
		j += sprintf(buf + md5sum_str_len_off + j, "%02x", md5_out[i]);
	buf[(md5sum_str_len_off + j)] = '\n';

	memset(buf + off, '\0', size - off);
	return msync(buf, vbd->rrd.shm.size, MS_ASYNC);
}

void
tapdisk_vbd_check_state(td_vbd_t *vbd)
{
    struct td_xenblkif *blkif;

	tapdisk_vbd_produce_rrds(vbd);

    /*
     * TODO don't ignore return value
     */
    list_for_each_entry(blkif, &vbd->rings, entry)
		tapdisk_xenblkif_ring_stats_update(blkif);

	tapdisk_vbd_check_queue_state(vbd);

	if (td_flag_test(vbd->state, TD_VBD_QUIESCE_REQUESTED))
		tapdisk_vbd_quiesce_queue(vbd);

	if (td_flag_test(vbd->state, TD_VBD_PAUSE_REQUESTED))
		tapdisk_vbd_pause(vbd);

	if (td_flag_test(vbd->state, TD_VBD_SHUTDOWN_REQUESTED))
		tapdisk_vbd_close(vbd);
}

void
tapdisk_vbd_check_progress(td_vbd_t *vbd)
{
	time_t diff;
	struct timeval now, delta;

	if (list_empty(&vbd->pending_requests))
		return;

	gettimeofday(&now, NULL);
	timersub(&now, &vbd->ts, &delta);
	diff = delta.tv_sec;

	if (diff >= TD_VBD_WATCHDOG_TIMEOUT && tapdisk_vbd_queue_ready(vbd)) {
		DBG(TLOG_WARN, "%s: watchdog timeout: pending requests "
		    "idle for %ld seconds\n", vbd->name, diff);
		tapdisk_vbd_drop_log(vbd);
		return;
	}

	tapdisk_server_set_max_timeout(TD_VBD_WATCHDOG_TIMEOUT - diff);
}

/*
 * request submission 
 */

static int
tapdisk_vbd_check_queue(td_vbd_t *vbd)
{
	if (list_empty(&vbd->images))
		return -ENOSYS;

	if (!tapdisk_vbd_queue_ready(vbd))
		return -EAGAIN;

	return 0;
}

static int
tapdisk_vbd_request_should_retry(td_vbd_t *vbd, td_vbd_request_t *vreq)
{
	if (td_flag_test(vbd->state, TD_VBD_DEAD) ||
	    td_flag_test(vbd->state, TD_VBD_SHUTDOWN_REQUESTED))
		return 0;

	switch (abs(vreq->error)) {
	case EPERM:
	case ENOSYS:
	case ESTALE:
	case ENOSPC:
	case EFAULT:
		return 0;
	}

	if (tapdisk_vbd_request_timeout(vreq))
		return 0;

	return 1;
}

static void
tapdisk_vbd_complete_vbd_request(td_vbd_t *vbd, td_vbd_request_t *vreq)
{
	if (!vreq->submitting && !vreq->secs_pending) {
		if (vreq->error &&
		    tapdisk_vbd_request_should_retry(vbd, vreq))
			tapdisk_vbd_move_request(vreq, &vbd->failed_requests);
		else
			tapdisk_vbd_move_request(vreq, &vbd->completed_requests);
	}
}

static void
FIXME_maybe_count_enospc_redirect(td_vbd_t *vbd, td_request_t treq)
{
	int write = treq.op == TD_OP_WRITE;
	if (write &&
	    treq.image == tapdisk_vbd_first_image(vbd) &&
	    vbd->FIXME_enospc_redirect_count_enabled)
		vbd->FIXME_enospc_redirect_count += treq.secs;
}

static void
__tapdisk_vbd_complete_td_request(td_vbd_t *vbd, td_vbd_request_t *vreq,
				  td_request_t treq, int res)
{
	td_image_t *image = treq.image;
	int err;

	err = (res <= 0 ? res : -res);
	vbd->secs_pending  -= treq.secs;
	vreq->secs_pending -= treq.secs;

	if (err != -EBUSY) {
		int write = treq.op == TD_OP_WRITE;
		td_sector_count_add(&image->stats.hits, treq.secs, write);
		if (err)
			td_sector_count_add(&image->stats.fail,
					    treq.secs, write);

		FIXME_maybe_count_enospc_redirect(vbd, treq);
	}

	if (err) {
		if (err != -EBUSY) {
			if (!vreq->error &&
			    err != vreq->prev_error)
				tlog_drv_error(image->driver, err,
					       "req %s: %s 0x%04x secs @ 0x%08"PRIx64" - %s",
					       vreq->name,
					       (treq.op == TD_OP_WRITE ? "write" : "read"),
					       treq.secs, treq.sec, strerror(abs(err)));
			vbd->errors++;
		}
		vreq->error = (vreq->error ? : err);
	}

	tapdisk_vbd_complete_vbd_request(vbd, vreq);
}

static void
__tapdisk_vbd_reissue_td_request(td_vbd_t *vbd,
				 td_image_t *image, td_request_t treq)
{
	td_image_t *parent;
	td_vbd_request_t *vreq;

	vreq = treq.vreq;
	gettimeofday(&vreq->last_try, NULL);

	vreq->submitting++;

	if (tapdisk_vbd_is_last_image(vbd, image)) {
		memset(treq.buf, 0, treq.secs << SECTOR_SHIFT);
		td_complete_request(treq, 0);
		goto done;
	}

	parent     = tapdisk_vbd_next_image(image);
	treq.image = parent;

	/* return zeros for requests that extend beyond end of parent image */
	if (treq.sec + treq.secs > parent->info.size) {
		td_request_t clone  = treq;

		if (parent->info.size > treq.sec) {
			int secs    = parent->info.size - treq.sec;
			clone.sec  += secs;
			clone.secs -= secs;
			clone.buf  += (secs << SECTOR_SHIFT);
			treq.secs   = secs;
		} else
			treq.secs   = 0;

		memset(clone.buf, 0, clone.secs << SECTOR_SHIFT);
		td_complete_request(clone, 0);

		if (!treq.secs)
			goto done;
	}

	switch (treq.op) {
	case TD_OP_WRITE:
		td_queue_write(parent, treq);
		break;

	case TD_OP_READ:
		td_queue_read(parent, treq);
		break;
	}

done:
	vreq->submitting--;
	if (!vreq->secs_pending)
		tapdisk_vbd_complete_vbd_request(vbd, vreq);
}

void
tapdisk_vbd_forward_request(td_request_t treq)
{
	td_vbd_t *vbd;
	td_image_t *image;
	td_vbd_request_t *vreq;

	image = treq.image;
	vreq  = treq.vreq;
	vbd   = vreq->vbd;

	tapdisk_vbd_mark_progress(vbd);

	if (tapdisk_vbd_queue_ready(vbd))
		__tapdisk_vbd_reissue_td_request(vbd, image, treq);
	else
		__tapdisk_vbd_complete_td_request(vbd, vreq, treq, -EBUSY);
}

void
tapdisk_vbd_complete_td_request(td_request_t treq, int res)
{
	td_vbd_t *vbd;
	td_image_t *image, *leaf;
	td_vbd_request_t *vreq;

	image = treq.image;
	vreq  = treq.vreq;
	vbd   = vreq->vbd;

	tapdisk_vbd_mark_progress(vbd);

	if (abs(res) == ENOSPC && td_flag_test(image->flags,
				TD_IGNORE_ENOSPC)) {
		res = 0;
		leaf = tapdisk_vbd_first_image(vbd);
		if (vbd->secondary_mode == TD_VBD_SECONDARY_MIRROR) {
			DPRINTF("ENOSPC: disabling mirroring\n");
			list_del_init(&leaf->next);
			vbd->retired = leaf;
		} else if (vbd->secondary_mode == TD_VBD_SECONDARY_STANDBY) {
			DPRINTF("ENOSPC: failing over to secondary image\n");
			list_add(&vbd->secondary->next, leaf->next.prev);
			vbd->FIXME_enospc_redirect_count_enabled = 1;
		}
		if (vbd->secondary_mode != TD_VBD_SECONDARY_DISABLED) {
			vbd->secondary = NULL;
			vbd->secondary_mode = TD_VBD_SECONDARY_DISABLED;
			signal_enospc(vbd);
		}
	}

	if (res != 0 && image->type == DISK_TYPE_NBD && 
			((image == vbd->secondary) || 
			 (image == vbd->retired))) {
		ERROR("Got non-zero res for NBD secondary - disabling "
				"mirroring: %s",vreq->name);
		vbd->nbd_mirror_failed = 1;
		res = 0; /* Pretend the writes have completed successfully */

		/* It was the secondary that timed out - disable secondary */
		list_del_init(&image->next);
		vbd->retired = image;
		if (vbd->secondary_mode != TD_VBD_SECONDARY_DISABLED) {
			vbd->secondary = NULL;
			vbd->secondary_mode = TD_VBD_SECONDARY_DISABLED;
		}
	}

	DBG(TLOG_DBG, "%s: req %s seg %d sec 0x%08"PRIx64
	    " secs 0x%04x buf %p op %d res %d\n", image->name,
	    vreq->name, treq.sidx, treq.sec, treq.secs,
	    treq.buf, vreq->op, res);

	__tapdisk_vbd_complete_td_request(vbd, vreq, treq, res);
}

static inline void
queue_mirror_req(td_vbd_t *vbd, td_request_t clone)
{
	clone.image = vbd->secondary;
	td_queue_write(vbd->secondary, clone);
}

static int
tapdisk_vbd_issue_request(td_vbd_t *vbd, td_vbd_request_t *vreq)
{
	td_image_t *image;
	td_request_t treq;
	td_sector_t sec;
	int i, err;

	sec    = vreq->sec;
	image  = tapdisk_vbd_first_image(vbd);

	vreq->submitting = 1;

	tapdisk_vbd_mark_progress(vbd);
	vreq->last_try = vbd->ts;

	tapdisk_vbd_move_request(vreq, &vbd->pending_requests);

	err = tapdisk_vbd_check_queue(vbd);
	if (err) {
		vreq->error = err;
		goto fail;
	}

	err = tapdisk_image_check_request(image, vreq);
	if (err) {
		vreq->error = err;
		goto fail;
	}

	for (i = 0; i < vreq->iovcnt; i++) {
		struct td_iovec *iov = &vreq->iov[i];

		treq.sidx           = i;
		treq.buf            = iov->base;
		treq.sec            = sec;
		treq.secs           = iov->secs;
		treq.image          = image;
		treq.cb             = tapdisk_vbd_complete_td_request;
		treq.cb_data        = NULL;
		treq.vreq           = vreq;


		vreq->secs_pending += iov->secs;
		vbd->secs_pending  += iov->secs;
		if (vbd->secondary_mode == TD_VBD_SECONDARY_MIRROR &&
		    vreq->op == TD_OP_WRITE) {
			vreq->secs_pending += iov->secs;
			vbd->secs_pending  += iov->secs;
		}

		switch (vreq->op) {
		case TD_OP_WRITE:
			treq.op = TD_OP_WRITE;
			/*
			 * it's important to queue the mirror request before 
			 * queuing the main one. If the main image runs into 
			 * ENOSPC, the mirroring could be disabled before 
			 * td_queue_write returns, so if the mirror request was 
			 * queued after (which would then not happen), we'd 
			 * lose that write and cause the process to hang with 
			 * unacknowledged writes
			 */
			if (vbd->secondary_mode == TD_VBD_SECONDARY_MIRROR)
				queue_mirror_req(vbd, treq);
			td_queue_write(treq.image, treq);
			break;

		case TD_OP_READ:
			treq.op = TD_OP_READ;
			td_queue_read(treq.image, treq);
			break;
		}

		DBG(TLOG_DBG, "%s: req %s seg %d sec 0x%08"PRIx64" secs 0x%04x "
		    "buf %p op %d\n", image->name, vreq->name, i, treq.sec, treq.secs,
		    treq.buf, vreq->op);
		sec += iov->secs;
	}

	err = 0;

out:
	vreq->submitting--;
	if (!vreq->secs_pending) {
		err = (err ? : vreq->error);
		tapdisk_vbd_complete_vbd_request(vbd, vreq);
	}

	return err;

fail:
	vreq->error = err;
	goto out;
}

static int
tapdisk_vbd_request_completed(td_vbd_t *vbd, td_vbd_request_t *vreq)
{
	return vreq->list_head == &vbd->completed_requests;
}

static int
tapdisk_vbd_reissue_failed_requests(td_vbd_t *vbd)
{
	int err;
	struct timeval now;
	td_vbd_request_t *vreq, *tmp;

	err = 0;
	gettimeofday(&now, NULL);

	tapdisk_vbd_for_each_request(vreq, tmp, &vbd->failed_requests) {
		if (vreq->secs_pending)
			continue;

		if (td_flag_test(vbd->state, TD_VBD_SHUTDOWN_REQUESTED)) {
			tapdisk_vbd_complete_vbd_request(vbd, vreq);
			continue;
		}

		if (vreq->error != -EBUSY &&
		    now.tv_sec - vreq->last_try.tv_sec < TD_VBD_RETRY_INTERVAL)
			continue;

		vbd->retries++;
		vreq->num_retries++;

		vreq->prev_error = vreq->error;
		vreq->error      = 0;

		DBG(TLOG_DBG, "retry #%d of req %s, "
		    "sec 0x%08"PRIx64", iovcnt: %d\n", vreq->num_retries,
		    vreq->name, vreq->sec, vreq->iovcnt);

		err = tapdisk_vbd_issue_request(vbd, vreq);
		/*
		 * if this request failed, but was not completed,
		 * we'll back off for a while.
		 */
		if (err && !tapdisk_vbd_request_completed(vbd, vreq))
			break;
	}

	return 0;
}

static void
tapdisk_vbd_count_new_request(td_vbd_t *vbd, td_vbd_request_t *vreq)
{
	struct td_iovec *iov;
	int write;

	write = vreq->op == TD_OP_WRITE;

	for (iov = &vreq->iov[0]; iov < &vreq->iov[vreq->iovcnt]; iov++)
		td_sector_count_add(&vbd->secs, iov->secs, write);
}

static int
tapdisk_vbd_issue_new_requests(td_vbd_t *vbd)
{
	int err;
	td_vbd_request_t *vreq, *tmp;

	tapdisk_vbd_for_each_request(vreq, tmp, &vbd->new_requests) {
		err = tapdisk_vbd_issue_request(vbd, vreq);
		/*
		 * if this request failed, but was not completed,
		 * we'll back off for a while.
		 */
		if (err && !tapdisk_vbd_request_completed(vbd, vreq))
			return err;

		tapdisk_vbd_count_new_request(vbd, vreq);
	}

	return 0;
}

int
tapdisk_vbd_recheck_state(td_vbd_t *vbd)
{
	if (list_empty(&vbd->new_requests))
		return 0;

	if (td_flag_test(vbd->state, TD_VBD_QUIESCED) ||
	    td_flag_test(vbd->state, TD_VBD_QUIESCE_REQUESTED))
		return 0;

	tapdisk_vbd_issue_new_requests(vbd);

	return 1;
}

static int
tapdisk_vbd_kill_requests(td_vbd_t *vbd)
{
	td_vbd_request_t *vreq, *tmp;

	tapdisk_vbd_for_each_request(vreq, tmp, &vbd->new_requests) {
		vreq->error = -ESHUTDOWN;
		tapdisk_vbd_move_request(vreq, &vbd->completed_requests);
	}

	tapdisk_vbd_for_each_request(vreq, tmp, &vbd->failed_requests) {
		vreq->error = -ESHUTDOWN;
		tapdisk_vbd_move_request(vreq, &vbd->completed_requests);
	}

	return 0;
}

int
tapdisk_vbd_issue_requests(td_vbd_t *vbd)
{
	int err;

	if (td_flag_test(vbd->state, TD_VBD_DEAD))
		return tapdisk_vbd_kill_requests(vbd);

	if (td_flag_test(vbd->state, TD_VBD_QUIESCED) ||
	    td_flag_test(vbd->state, TD_VBD_QUIESCE_REQUESTED)) {

		if (td_flag_test(vbd->state, TD_VBD_RESUME_FAILED))
			return tapdisk_vbd_kill_requests(vbd);
		else
			return -EAGAIN;
	}

	err = tapdisk_vbd_reissue_failed_requests(vbd);
	if (err)
		return err;

	return tapdisk_vbd_issue_new_requests(vbd);
}

int
tapdisk_vbd_queue_request(td_vbd_t *vbd, td_vbd_request_t *vreq)
{
	gettimeofday(&vreq->ts, NULL);
	vreq->vbd = vbd;

	list_add_tail(&vreq->next, &vbd->new_requests);
	vbd->received++;

	return 0;
}

void
tapdisk_vbd_kick(td_vbd_t *vbd)
{
	const struct list_head *list = &vbd->completed_requests;
	td_vbd_request_t *vreq, *prev, *next;

	vbd->kicked++;

	while (!list_empty(list)) {

		/*
		 * Take one request off the completed requests list, and then look for
		 * other requests in the same list that have the same token and
		 * complete them. This way we complete requests against the same token
		 * in one go before we proceed to completing requests with other
		 * tokens. The token is usually used to point back to some other
		 * structure, e.g. a blktap or a tapdisk3 connexion. Once all requests
		 * with a specific token have been completed, proceed to the next one
		 * until the list is empty.
		 */
		prev = list_entry(list->next, td_vbd_request_t, next);
		list_del(&prev->next);

		tapdisk_vbd_for_each_request(vreq, next, list) {
			if (vreq->token == prev->token) {

				prev->cb(prev, prev->error, prev->token, 0);
				vbd->returned++;

				list_del(&vreq->next);
				prev = vreq;
			}
		}

		prev->cb(prev, prev->error, prev->token, 1);
		vbd->returned++;
	}
}

int
tapdisk_vbd_start_nbdserver(td_vbd_t *vbd)
{
	td_disk_info_t info;
	int err;

	err = tapdisk_vbd_get_disk_info(vbd, &info);

	if (err)
		return err;

	vbd->nbdserver = tapdisk_nbdserver_alloc(vbd, info);

	if (!vbd->nbdserver) {
		EPRINTF("Error starting nbd server");
		return -1;
	}

	err = tapdisk_nbdserver_listen_unix(vbd->nbdserver);
	if (err) {
		tapdisk_nbdserver_free(vbd->nbdserver);
		EPRINTF("failed to listen on the UNIX domain socket: %s\n",
				strerror(-err));
		return err;
	}

	return 0;
}


static int
tapdisk_vbd_reqs_outstanding(td_vbd_t *vbd)
{
	int new, pending, failed, completed;

	ASSERT(vbd);

	tapdisk_vbd_queue_count(vbd, &new, &pending, &failed, &completed);

	return new + pending + failed + completed;
}


void
tapdisk_vbd_stats(td_vbd_t *vbd, td_stats_t *st)
{
	td_image_t *image, *next;
    struct td_xenblkif *blkif;
	const bool read_caching =
		TD_OPEN_NO_O_DIRECT == (vbd->flags & TD_OPEN_NO_O_DIRECT);

	tapdisk_stats_enter(st, '{');
	tapdisk_stats_field(st, "name", "s", vbd->name);

	tapdisk_stats_field(st, "secs", "[");
	tapdisk_stats_val(st, "llu", vbd->secs.rd);
	tapdisk_stats_val(st, "llu", vbd->secs.wr);
	tapdisk_stats_leave(st, ']');

	tapdisk_stats_field(st, "images", "[");
	tapdisk_vbd_for_each_image(vbd, image, next)
		tapdisk_image_stats(image, st);
	tapdisk_stats_leave(st, ']');

	if (vbd->tap) {
		tapdisk_stats_field(st, "tap", "{");
		tapdisk_blktap_stats(vbd->tap, st);
		tapdisk_stats_leave(st, '}');
	}

    /*
     * TODO Is this used by any one?
     */
    if (!list_empty(&vbd->rings)) {
	    tapdisk_stats_field(st, "xenbus", "{");
        list_for_each_entry(blkif, &vbd->rings, entry)
		    tapdisk_xenblkif_stats(blkif, st);
    	tapdisk_stats_leave(st, '}');
    }

	tapdisk_stats_field(st,
			"FIXME_enospc_redirect_count",
			"llu", vbd->FIXME_enospc_redirect_count);

	tapdisk_stats_field(st,
			"nbd_mirror_failed",
			"d", vbd->nbd_mirror_failed);

	tapdisk_stats_field(st,
			"reqs_outstanding",
			"d", tapdisk_vbd_reqs_outstanding(vbd));

	tapdisk_stats_field(st,
			"read_caching",
			"s",  read_caching ? "true": "false");

	tapdisk_stats_leave(st, '}');
}


bool inline
tapdisk_vbd_contains_dead_rings(td_vbd_t * vbd)
{
    return !list_empty(&vbd->dead_rings);
}

[-- Attachment #3: block-vhd.c --]
[-- Type: text/x-csrc, Size: 58429 bytes --]

//* 
 * Copyright (C) Citrix Systems Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2.1 only
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

/*
 * block-vhd.c: asynchronous vhd implementation.
 *
 * A note on write transactions:
 * Writes that require updating the BAT or bitmaps cannot be signaled
 * as complete until all updates have reached disk.  Transactions are
 * used to ensure proper ordering in these cases.  The two types of
 * transactions are as follows:
 *   - Bitmap updates only: data writes that require updates to the same
 *     bitmap are grouped in a transaction.  Only after all data writes
 *     in a transaction complete does the bitmap write commence.  Only
 *     after the bitmap write finishes are the data writes signalled as
 *     complete.
 *   - BAT and bitmap updates: data writes are grouped in transactions
 *     as above, but a special extra write is included in the transaction,
 *     which zeros out the newly allocated bitmap on disk.  When the data
 *     writes and the zero-bitmap write complete, the BAT and bitmap writes
 *     are started in parallel.  The transaction is completed only after both
 *     the BAT and bitmap writes successfully return.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <uuid/uuid.h> /* For whatever reason, Linux packages this in */
                       /* e2fsprogs-devel.                            */
#include <string.h>    /* for memset.                                 */
#include <libaio.h>
#include <sys/mman.h>
#include <limits.h>

#include "debug.h"
#include "libvhd.h"
#include "tapdisk.h"
#include "tapdisk-driver.h"
#include "tapdisk-interface.h"
#include "tapdisk-disktype.h"
#include "tapdisk-storage.h"

unsigned int SPB;

#define DEBUGGING   2
#define MICROSOFT_COMPAT

#define VHD_BATMAP_MAX_RETRIES 10

#define __TRACE(s)							\
	do {								\
		DBG(TLOG_DBG, "%s: QUEUED: %" PRIu64 ", COMPLETED: %"	\
		    PRIu64", RETURNED: %" PRIu64 ", DATA_ALLOCATED: "	\
		    "%u, BBLK: 0x%04x\n",				\
		    s->vhd.file, s->queued, s->completed, s->returned,	\
		    VHD_REQS_DATA - s->vreq_free_count,			\
		    s->bat.pbw_blk);					\
	} while(0)

#if (DEBUGGING == 1)
  #define DBG(level, _f, _a...)      DPRINTF(_f, ##_a)
  #define ERR(_s, err, _f, _a...)    DPRINTF("ERROR: %d: " _f, err, ##_a)
  #define TRACE(s)                   ((void)0)
#elif (DEBUGGING == 2)
  #define DBG(level, _f, _a...)      tlog_write(level, _f, ##_a)
  #define ERR(_s, _err, _f, _a...)   tlog_drv_error((_s)->driver, _err, _f, ##_a)
  #define TRACE(s)                   __TRACE(s)
#else
  #define DBG(level, _f, _a...)      ((void)0)
  #define ERR(_s, err, _f, _a...)    ((void)0)
  #define TRACE(s)                   ((void)0)
#endif

/******VHD DEFINES******/
#define VHD_CACHE_SIZE               32

#define VHD_REQS_DATA                TAPDISK_DATA_REQUESTS
#define VHD_REQS_META                (VHD_CACHE_SIZE + 2)
#define VHD_REQS_TOTAL               (VHD_REQS_DATA + VHD_REQS_META)

#define VHD_OP_BAT_WRITE             0
#define VHD_OP_DATA_READ             1
#define VHD_OP_DATA_WRITE            2
#define VHD_OP_BITMAP_READ           3
#define VHD_OP_BITMAP_WRITE          4
#define VHD_OP_ZERO_BM_WRITE         5
#define VHD_OP_REDUNDANT_BM_WRITE    6

#define VHD_BM_BAT_LOCKED            0
#define VHD_BM_BAT_CLEAR             1
#define VHD_BM_BIT_CLEAR             2
#define VHD_BM_BIT_SET               3
#define VHD_BM_NOT_CACHED            4
#define VHD_BM_READ_PENDING          5

#define VHD_FLAG_OPEN_RDONLY         1
#define VHD_FLAG_OPEN_NO_CACHE       2
#define VHD_FLAG_OPEN_QUIET          4
#define VHD_FLAG_OPEN_STRICT         8
#define VHD_FLAG_OPEN_QUERY          16
#define VHD_FLAG_OPEN_PREALLOCATE    32
#define VHD_FLAG_OPEN_NO_O_DIRECT    64
#define VHD_FLAG_OPEN_LOCAL_CACHE    128

#define VHD_FLAG_BAT_LOCKED          1
#define VHD_FLAG_BAT_WRITE_STARTED   2

#define VHD_FLAG_BM_UPDATE_BAT       1
#define VHD_FLAG_BM_WRITE_PENDING    2
#define VHD_FLAG_BM_READ_PENDING     4
#define VHD_FLAG_BM_LOCKED           8

#define VHD_FLAG_REQ_UPDATE_BAT      1
#define VHD_FLAG_REQ_UPDATE_BITMAP   2
#define VHD_FLAG_REQ_QUEUED          4
#define VHD_FLAG_REQ_FINISHED        8

#define VHD_FLAG_TX_LIVE             1
#define VHD_FLAG_TX_UPDATE_BAT       2

typedef uint8_t vhd_flag_t;

struct vhd_state;
struct vhd_request;

struct vhd_req_list {
	struct vhd_request       *head;
	struct vhd_request       *tail;
};

struct vhd_transaction {
	int                       error;
	int                       closed;
	int                       started;
	int                       finished;
	vhd_flag_t                status;
	struct vhd_req_list       requests;
};

struct vhd_request {
	int                       error;
	uint8_t                   op;
	vhd_flag_t                flags;
	td_request_t              treq;
	struct tiocb              tiocb;
	struct vhd_state         *state;
	struct vhd_request       *next;
	struct vhd_transaction   *tx;
};

struct vhd_bat_state {
	vhd_bat_t                 bat;
	vhd_batmap_t              batmap;
	vhd_flag_t                status;
	uint32_t                  pbw_blk;     /* blk num of pending write */
	uint64_t                  pbw_offset;  /* file offset of same */
	struct vhd_request        req;         /* for writing bat table */
	struct vhd_request        zero_req;    /* for initializing bitmaps */
	char                     *bat_buf;
};

struct vhd_bitmap {
	uint32_t                  blk;
	uint64_t                  seqno;       /* lru sequence number */
	vhd_flag_t                status;

	char                     *map;         /* map should only be modified
					        * in finish_bitmap_write */
	char                     *shadow;      /* in-memory bitmap changes are 
					        * made to shadow and copied to
					        * map only after having been
					        * flushed to disk */
	struct vhd_transaction    tx;          /* transaction data structure
						* encapsulating data, bitmap, 
						* and bat writes */
	struct vhd_req_list       queue;       /* data writes waiting for next
						* transaction */
	struct vhd_req_list       waiting;     /* pending requests that cannot
					        * be serviced until this bitmap
					        * is read from disk */
	struct vhd_request        req;
};

struct vhd_state {
	vhd_flag_t                flags;

        /* VHD stuff */
	vhd_context_t             vhd;
	uint32_t                  spp;         /* sectors per page */
	uint32_t                  spb;         /* sectors per block */
	uint64_t                  first_db;    /* pointer to datablock 0 */

	/**
	 * Pointer to the next (unallocated) datablock. If greater than UINT_MAX,
	 * there are no more blocks available.
	 */
	uint64_t                  next_db;

	struct vhd_bat_state      bat;

	uint64_t                  bm_lru;      /* lru sequence number */
	uint32_t                  bm_secs;     /* size of bitmap, in sectors */
	struct vhd_bitmap        *bitmap[VHD_CACHE_SIZE];

	int                       bm_free_count;
	struct vhd_bitmap        *bitmap_free[VHD_CACHE_SIZE];
	struct vhd_bitmap         bitmap_list[VHD_CACHE_SIZE];

	int                       vreq_free_count;
	struct vhd_request       *vreq_free[VHD_REQS_DATA];
	struct vhd_request        vreq_list[VHD_REQS_DATA];

	/* for redundant bitmap writes */
	int                       padbm_size;
	char                     *padbm_buf;
	long int                  debug_skipped_redundant_writes;
	long int                  debug_done_redundant_writes;

	td_driver_t              *driver;

	uint64_t                  queued;
	uint64_t                  completed;
	uint64_t                  returned;
	uint64_t                  reads;
	uint64_t                  read_size;
	uint64_t                  writes;
	uint64_t                  write_size;
};

#define test_vhd_flag(word, flag)  ((word) & (flag))
#define set_vhd_flag(word, flag)   ((word) |= (flag))
#define clear_vhd_flag(word, flag) ((word) &= ~(flag))

#define bat_entry(s, blk)          ((s)->bat.bat.bat[(blk)])

static void vhd_complete(void *, struct tiocb *, int);
static void finish_data_transaction(struct vhd_state *, struct vhd_bitmap *);

static struct vhd_state  *_vhd_master;
static unsigned long      _vhd_zsize;
static char              *_vhd_zeros = NULL;
int                       _dev_zero = -1;

static int
vhd_initialize(struct vhd_state *s)
{
	int err;

	if (_vhd_zeros)
		return 0;

	_vhd_zsize = 2 * getpagesize();
	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_PREALLOCATE))
		_vhd_zsize += VHD_BLOCK_SIZE;

	_dev_zero = open("/dev/zero", O_RDONLY);
	if (unlikely(_dev_zero == -1)) {
		err = errno;
		EPRINTF("failed to open /dev/zero: %s\n", strerror(err));
		return -err;
	}

	_vhd_zeros = mmap(NULL, _vhd_zsize, PROT_READ,
			  MAP_SHARED, _dev_zero, 0);
	if (_vhd_zeros == MAP_FAILED) {
		int _err;
		err = errno;
		EPRINTF("vhd_initialize failed: %s\n", strerror(err));
		_vhd_zeros = NULL;
		_vhd_zsize = 0;
		_err = close(_dev_zero);
		if (unlikely(_err == -1))
			EPRINTF("failed to close /dev/zero: %s (error ignored)\n",
					strerror(errno));
		else
			_dev_zero = -1;

		return -err;
	}

	_vhd_master = s;
	return 0;
}

static void
vhd_free(struct vhd_state *s)
{
	if (_vhd_master != s || !_vhd_zeros)
		return;

	free(s->padbm_buf);
	munmap(_vhd_zeros, _vhd_zsize);
	_vhd_zsize  = 0;
	_vhd_zeros  = NULL;
	_vhd_master = NULL;
	if (_dev_zero != -1) {
		int _err = close(_dev_zero);
		if (unlikely(_err == -1))
			EPRINTF("failed to close /dev/zero: %s (error ignored)\n",
					strerror(errno));
		else
			_dev_zero = -1;
	}
}

static char *
_get_vhd_zeros(const char *func, unsigned long size)
{
	if (!_vhd_zeros || _vhd_zsize < size) {
		EPRINTF("invalid zero request from %s: %lu, %lu, %p\n",
			func, size, _vhd_zsize, _vhd_zeros);
		ASSERT(0);
	}

	return _vhd_zeros;
}

#define vhd_zeros(size)	_get_vhd_zeros(__func__, size)

static inline void
set_batmap(struct vhd_state *s, uint32_t blk)
{
	if (s->bat.batmap.map) {
		vhd_batmap_set(&s->vhd, &s->bat.batmap, blk);
		DBG(TLOG_DBG, "block 0x%x completely full\n", blk);
	}
}

static inline int
test_batmap(struct vhd_state *s, uint32_t blk)
{
	if (!s->bat.batmap.map)
		return 0;
	return vhd_batmap_test(&s->vhd, &s->bat.batmap, blk);
}

static int
vhd_kill_footer(struct vhd_state *s)
{
	int err;
	off64_t end;
	void *zeros;

	if (s->vhd.footer.type == HD_TYPE_FIXED)
		return 0;

	err = posix_memalign(&zeros, 512, 512);
	if (err)
		return -err;

	err = 1;
	memset(zeros, 0xc7c7c7c7, 512);

	if ((end = lseek64(s->vhd.fd, 0, SEEK_END)) == -1)
		goto fail;

	if (lseek64(s->vhd.fd, (end - 512), SEEK_SET) == -1)
		goto fail;

	if (write(s->vhd.fd, zeros, 512) != 512)
		goto fail;

	err = 0;

 fail:
	free(zeros);
	if (err)
		return (errno ? -errno : -EIO);
	return 0;
}

static inline int
find_next_free_block(struct vhd_state *s)
{
	int err;
	off64_t eom;
	uint32_t i, entry;

	err = vhd_end_of_headers(&s->vhd, &eom);
	if (err)
		return err;

	s->next_db = secs_round_up(eom);
	s->first_db = s->next_db;
	if ((s->first_db + s->bm_secs) % s->spp)
		s->first_db += (s->spp - ((s->first_db + s->bm_secs) % s->spp));

	for (i = 0; i < s->bat.bat.entries; i++) {
		entry = bat_entry(s, i);
		if (entry != DD_BLK_UNUSED && entry >= s->next_db)
			s->next_db = (uint64_t)entry + (uint64_t)s->spb
				+ (uint64_t)s->bm_secs;
			if (s->next_db > UINT_MAX)
				break;
	}

	return 0;
}

static void
vhd_free_bat(struct vhd_state *s)
{
	free(s->bat.bat.bat);
	free(s->bat.batmap.map);
	free(s->bat.bat_buf);
	memset(&s->bat, 0, sizeof(struct vhd_bat));
}

static int
vhd_initialize_bat(struct vhd_state *s)
{
	int err, batmap_required, i;
	void *buf;

	memset(&s->bat, 0, sizeof(struct vhd_bat));

	err = vhd_read_bat(&s->vhd, &s->bat.bat);
	if (err) {
		EPRINTF("%s: reading bat: %d\n", s->vhd.file, err);
		return err;
	}

	batmap_required = 1;
	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_RDONLY)) {
		batmap_required = 0;
	} else {
		err = find_next_free_block(s);
		if (err)
			goto fail;
	}

	if (vhd_has_batmap(&s->vhd)) {
		for (i = 0; i < VHD_BATMAP_MAX_RETRIES; i++) {
			err = vhd_read_batmap(&s->vhd, &s->bat.batmap);
			if (err) {
				EPRINTF("%s: reading batmap: %d\n",
						s->vhd.file, err);
				if (batmap_required)
					goto fail;
			} else {
				break;
			}
		}
		if (err)
			EPRINTF("%s: ignoring non-critical batmap error\n",
					s->vhd.file);
	}

	err = posix_memalign(&buf, VHD_SECTOR_SIZE, VHD_SECTOR_SIZE);
	if (err)
		goto fail;

	s->bat.bat_buf = buf;

	return 0;

fail:
	vhd_free_bat(s);
	return err;
}

static void
vhd_free_bitmap_cache(struct vhd_state *s)
{
	int i;
	struct vhd_bitmap *bm;

	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		bm = s->bitmap_list + i;
		free(bm->map);
		free(bm->shadow);
		s->bitmap_free[i] = NULL;
	}

	memset(s->bitmap_list, 0, sizeof(struct vhd_bitmap) * VHD_CACHE_SIZE);
}

static int
vhd_initialize_bitmap_cache(struct vhd_state *s)
{
	int i, err, map_size;
	struct vhd_bitmap *bm;
	void *map, *shadow;

	memset(s->bitmap_list, 0, sizeof(struct vhd_bitmap) * VHD_CACHE_SIZE);

	s->bm_lru        = 0;
	map_size         = vhd_sectors_to_bytes(s->bm_secs);
	s->bm_free_count = VHD_CACHE_SIZE;

	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		bm = s->bitmap_list + i;

		err = posix_memalign(&map, 512, map_size);
		if (err)
			goto fail;

		bm->map = map;

		err = posix_memalign(&shadow, 512, map_size);
		if (err)
			goto fail;

		bm->shadow = shadow;

		memset(bm->map, 0, map_size);
		memset(bm->shadow, 0, map_size);
		s->bitmap_free[i] = bm;
	}

	return 0;

fail:
	vhd_free_bitmap_cache(s);
	return err;
}

static int
vhd_initialize_dynamic_disk(struct vhd_state *s)
{
	uint32_t bm_size;
	void *buf;
	int err;

	err = vhd_get_header(&s->vhd);
	if (err) {
		if (!test_vhd_flag(s->flags, VHD_FLAG_OPEN_QUIET))
			EPRINTF("Error reading VHD DD header.\n");
		return err;
	}

	if (s->vhd.header.hdr_ver != 0x00010000) {
		EPRINTF("unsupported header version! (0x%x)\n",
			s->vhd.header.hdr_ver);
		return -EINVAL;
	}

	s->spp     = getpagesize() >> VHD_SECTOR_SHIFT;
	s->spb     = s->vhd.header.block_size >> VHD_SECTOR_SHIFT;
	s->bm_secs = secs_round_up_no_zero(s->spb >> 3);

	s->padbm_size = (s->bm_secs / getpagesize()) * getpagesize();
	if (s->bm_secs % getpagesize())
		s->padbm_size += getpagesize();

	err = posix_memalign(&buf, 512, s->padbm_size);
	if (err)
		return -err;

	s->padbm_buf = buf;
	bm_size = s->bm_secs << VHD_SECTOR_SHIFT;
	memset(s->padbm_buf, 0, s->padbm_size - bm_size);
	memset(s->padbm_buf + (s->padbm_size - bm_size), ~0, bm_size);
	s->debug_skipped_redundant_writes = 0;
	s->debug_done_redundant_writes = 0;

	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_NO_CACHE))
		return 0;

	err = vhd_initialize_bat(s);
	if (err)
		return err;

	err = vhd_initialize_bitmap_cache(s);
	if (err) {
		vhd_free_bat(s);
		return err;
	}

	return 0;
}

static int
vhd_check_version(struct vhd_state *s)
{
	if (strncmp(s->vhd.footer.crtr_app, "tap", 3))
		return 0;

	if (s->vhd.footer.crtr_ver > VHD_CURRENT_VERSION) {
		if (!test_vhd_flag(s->flags, VHD_FLAG_OPEN_QUIET))
			EPRINTF("WARNING: %s vhd creator version 0x%08x, "
				"but only versions up to 0x%08x are "
				"supported for IO\n", s->vhd.file,
				s->vhd.footer.crtr_ver, VHD_CURRENT_VERSION);

		return -EINVAL;
	}

	return 0;
}

static void
vhd_log_open(struct vhd_state *s)
{
	char buf[5];
	uint32_t i, allocated, full;

	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_QUIET))
		return;

	snprintf(buf, sizeof(buf), "%s", s->vhd.footer.crtr_app);
	if (!vhd_type_dynamic(&s->vhd)) {
		DPRINTF("%s version: %s 0x%08x\n",
			s->vhd.file, buf, s->vhd.footer.crtr_ver);
		return;
	}

	allocated = 0;
	full      = 0;

	for (i = 0; i < s->bat.bat.entries; i++) {
		if (bat_entry(s, i) != DD_BLK_UNUSED)
			allocated++;
		if (test_batmap(s, i))
			full++;
	}

	DPRINTF("%s version: %s 0x%08x, b: %u, a: %u, f: %u, n: %"PRIu64"\n",
		s->vhd.file, buf, s->vhd.footer.crtr_ver, s->bat.bat.entries,
		allocated, full, s->next_db);
}

static int
__vhd_open(td_driver_t *driver, const char *name, vhd_flag_t flags)
{
        int i, o_flags, err;
	struct vhd_state *s;

        DBG(TLOG_INFO, "vhd_open: %s\n", name);
	if (test_vhd_flag(flags, VHD_FLAG_OPEN_STRICT))
		libvhd_set_log_level(1);

	s = (struct vhd_state *)driver->data;
	memset(s, 0, sizeof(struct vhd_state));

	s->flags  = flags;
	s->driver = driver;

	err = vhd_initialize(s);
	if (err)
		return err;

	o_flags = ((test_vhd_flag(flags, VHD_FLAG_OPEN_RDONLY)) ? 
		   VHD_OPEN_RDONLY : VHD_OPEN_RDWR);
	if ((test_vhd_flag(flags, VHD_FLAG_OPEN_RDONLY) ||
                test_vhd_flag(flags, VHD_FLAG_OPEN_LOCAL_CACHE)) &&
	    test_vhd_flag(flags, VHD_FLAG_OPEN_NO_O_DIRECT))
		set_vhd_flag(o_flags, VHD_OPEN_CACHED);

	if (test_vhd_flag(flags, VHD_FLAG_OPEN_STRICT))
		set_vhd_flag(o_flags, VHD_OPEN_STRICT);

	err = vhd_open(&s->vhd, name, o_flags);
	if (err) {
		libvhd_set_log_level(1);
		err = vhd_open(&s->vhd, name, o_flags);
		if (err) {
			EPRINTF("Unable to open [%s] (%d)!\n", name, err);
			return err;
		}
	}

	err = vhd_check_version(s);
	if (err)
		goto fail;

	s->spb = s->spp = 1;

	if (vhd_type_dynamic(&s->vhd)) {
		err = vhd_initialize_dynamic_disk(s);
		if (err)
			goto fail;
	}

	vhd_log_open(s);

	SPB = s->spb;

	s->vreq_free_count = VHD_REQS_DATA;
	for (i = 0; i < VHD_REQS_DATA; i++)
		s->vreq_free[i] = s->vreq_list + i;

	driver->info.size        = s->vhd.footer.curr_size >> VHD_SECTOR_SHIFT;
	driver->info.sector_size = VHD_SECTOR_SIZE;
	driver->info.info        = 0;

        DBG(TLOG_INFO, "vhd_open: done (sz:%"PRIu64", sct:%lu, inf:%u)\n",
	    driver->info.size, driver->info.sector_size, driver->info.info);

	if (test_vhd_flag(flags, VHD_FLAG_OPEN_STRICT) && 
	    !test_vhd_flag(flags, VHD_FLAG_OPEN_RDONLY)) {
		err = vhd_kill_footer(s);
		if (err) {
			DPRINTF("ERROR killing footer: %d\n", err);
			goto fail;
		}
		s->writes++;
	}

        return 0;

 fail:
	vhd_free_bat(s);
	vhd_free_bitmap_cache(s);
	vhd_close(&s->vhd);
	vhd_free(s);
	return err;
}

static int
_vhd_open(td_driver_t *driver, const char *name, td_flag_t flags)
{
	vhd_flag_t vhd_flags = 0;

	if (flags & TD_OPEN_RDONLY)
		vhd_flags |= VHD_FLAG_OPEN_RDONLY;
	if (flags & TD_OPEN_NO_O_DIRECT)
		vhd_flags |= VHD_FLAG_OPEN_NO_O_DIRECT;
	if (flags & TD_OPEN_QUIET)
		vhd_flags |= VHD_FLAG_OPEN_QUIET;
	if (flags & TD_OPEN_STRICT)
		vhd_flags |= VHD_FLAG_OPEN_STRICT;
	if (flags & TD_OPEN_QUERY)
		vhd_flags |= (VHD_FLAG_OPEN_QUERY  |
			      VHD_FLAG_OPEN_QUIET  |
			      VHD_FLAG_OPEN_RDONLY |
			      VHD_FLAG_OPEN_NO_CACHE);
    if (flags & TD_OPEN_LOCAL_CACHE)
        vhd_flags |= VHD_FLAG_OPEN_LOCAL_CACHE;

	/* pre-allocate for all but NFS and LVM storage */
	driver->storage = tapdisk_storage_type(name);

	if (driver->storage != TAPDISK_STORAGE_TYPE_NFS &&
	    driver->storage != TAPDISK_STORAGE_TYPE_LVM)
		vhd_flags |= VHD_FLAG_OPEN_PREALLOCATE;

	return __vhd_open(driver, name, vhd_flags);
}

static void
vhd_log_close(struct vhd_state *s)
{
	uint32_t i, allocated, full;

	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_QUIET))
		return;

	allocated = 0;
	full      = 0;

	for (i = 0; i < s->bat.bat.entries; i++) {
		if (bat_entry(s, i) != DD_BLK_UNUSED)
			allocated++;
		if (test_batmap(s, i))
			full++;
	}

	DPRINTF("%s: b: %u, a: %u, f: %u, n: %"PRIu64"\n",
		s->vhd.file, s->bat.bat.entries, allocated, full, s->next_db);
}

static int
_vhd_close(td_driver_t *driver)
{
	int err;
	struct vhd_state *s;
	
	DBG(TLOG_WARN, "vhd_close\n");
	s = (struct vhd_state *)driver->data;

	DPRINTF("gaps written/skipped: %ld/%ld\n", 
			s->debug_done_redundant_writes,
			s->debug_skipped_redundant_writes);

	/* don't write footer if tapdisk is read-only */
	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_RDONLY))
		goto free;
	
	/* 
	 * write footer if:
	 *   - we killed it on open (opened with strict) 
	 *   - we've written data since opening
	 */
	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_STRICT) || s->writes) {
		memcpy(&s->vhd.bat, &s->bat.bat, sizeof(vhd_bat_t));
		err = vhd_write_footer(&s->vhd, &s->vhd.footer);
		memset(&s->vhd.bat, 0, sizeof(vhd_bat_t));

		if (err)
			EPRINTF("writing %s footer: %d\n", s->vhd.file, err);

		if (!vhd_has_batmap(&s->vhd))
			goto free;

		err = vhd_write_batmap(&s->vhd, &s->bat.batmap);
		if (err)
			EPRINTF("writing %s batmap: %d\n", s->vhd.file, err);
	}

 free:
	vhd_log_close(s);
	vhd_free_bat(s);
	vhd_free_bitmap_cache(s);
	vhd_close(&s->vhd);
	vhd_free(s);

	memset(s, 0, sizeof(struct vhd_state));

	return 0;
}

int
vhd_validate_parent(td_driver_t *child_driver,
		    td_driver_t *parent_driver, td_flag_t flags)
{
	struct vhd_state *child  = (struct vhd_state *)child_driver->data;
	struct vhd_state *parent;

	if (parent_driver->type != DISK_TYPE_VHD) {
		if (child_driver->type != DISK_TYPE_VHD)
			return -EINVAL;
		if (child->vhd.footer.type != HD_TYPE_DIFF)
			return -EINVAL;
		if (!vhd_parent_raw(&child->vhd))
			return -EINVAL;
		return 0;
	}

	parent = (struct vhd_state *)parent_driver->data;

	/* 
	 * This check removed because of cases like:
	 *   - parent VHD marked as 'hidden'
	 *   - parent VHD modified during coalesce
	 */
	/*
	if (stat(parent->vhd.file, &stats)) {
		DPRINTF("ERROR stating parent file %s\n", parent->vhd.file);
		return -errno;
	}

	if (child->hdr.prt_ts != vhd_time(stats.st_mtime)) {
		DPRINTF("ERROR: parent file has been modified since "
			"snapshot.  Child image no longer valid.\n");
		return -EINVAL;
	}
	*/

	if (uuid_compare(child->vhd.header.prt_uuid, parent->vhd.footer.uuid)) {
		DPRINTF("ERROR: %s: %s, %s: parent uuid has changed since "
			"snapshot.  Child image no longer valid.\n",
			__func__, child->vhd.file, parent->vhd.file);
		return -EINVAL;
	}

	/* TODO: compare sizes */
	
	return 0;
}

int
vhd_get_parent_id(td_driver_t *driver, td_disk_id_t *id)
{
	int err;
	char *parent;
	struct vhd_state *s;
	int flags;

	DBG(TLOG_DBG, "\n");
	flags = id->flags;
	memset(id, 0, sizeof(td_disk_id_t));

	s = (struct vhd_state *)driver->data;

	if (s->vhd.footer.type != HD_TYPE_DIFF)
		return TD_NO_PARENT;

	err = vhd_parent_locator_get(&s->vhd, &parent);
	if (err)
		return err;

	id->name   = parent;
	id->type   = vhd_parent_raw(&s->vhd) ? DISK_TYPE_AIO : DISK_TYPE_VHD;
	id->flags  = flags|TD_OPEN_SHAREABLE|TD_OPEN_RDONLY;

	return 0;
}

static inline void
clear_req_list(struct vhd_req_list *list)
{
	list->head = list->tail = NULL;
}

static inline void
add_to_tail(struct vhd_req_list *list, struct vhd_request *e)
{
	if (!list->head) 
		list->head = list->tail = e;
	else 
		list->tail = list->tail->next = e;
}

static inline int
remove_from_req_list(struct vhd_req_list *list, struct vhd_request *e)
{
	struct vhd_request *i = list->head;

	if (list->head == e) {
		if (list->tail == e)
			clear_req_list(list);
		else
			list->head = list->head->next;
		return 0;
	}

	while (i->next) {
		if (i->next == e) {
			if (list->tail == e) {
				i->next = NULL;
				list->tail = i;
			} else
				i->next = i->next->next;
			return 0;
		}
		i = i->next;
	}

	return -EINVAL;
}

static inline void
init_vhd_request(struct vhd_state *s, struct vhd_request *req)
{
	memset(req, 0, sizeof(struct vhd_request));
	req->state = s;
}

static inline void
init_tx(struct vhd_transaction *tx)
{
	memset(tx, 0, sizeof(struct vhd_transaction));
}

static inline void
add_to_transaction(struct vhd_transaction *tx, struct vhd_request *r)
{
	ASSERT(!tx->closed);

	r->tx = tx;
	tx->started++;
	add_to_tail(&tx->requests, r);
	set_vhd_flag(tx->status, VHD_FLAG_TX_LIVE);

	DBG(TLOG_DBG, "blk: 0x%04"PRIx64", lsec: 0x%08"PRIx64", tx: %p, "
	    "started: %d, finished: %d, status: %u\n",
	    r->treq.sec / SPB, r->treq.sec, tx,
	    tx->started, tx->finished, tx->status);
}

static inline int
transaction_completed(struct vhd_transaction *tx)
{
	return (tx->started == tx->finished);
}

static inline void
init_bat(struct vhd_state *s)
{
	s->bat.req.tx     = NULL;
	s->bat.req.next   = NULL;
	s->bat.req.error  = 0;
	s->bat.pbw_blk    = 0;
	s->bat.pbw_offset = 0;
	s->bat.status     = 0;
}

static inline void
lock_bat(struct vhd_state *s)
{
	set_vhd_flag(s->bat.status, VHD_FLAG_BAT_LOCKED);
}

static inline void
unlock_bat(struct vhd_state *s)
{
	clear_vhd_flag(s->bat.status, VHD_FLAG_BAT_LOCKED);
}

static inline int
bat_locked(struct vhd_state *s)
{
	return test_vhd_flag(s->bat.status, VHD_FLAG_BAT_LOCKED);
}

static inline void
init_vhd_bitmap(struct vhd_state *s, struct vhd_bitmap *bm)
{
	bm->blk    = 0;
	bm->seqno  = 0;
	bm->status = 0;
	init_tx(&bm->tx);
	clear_req_list(&bm->queue);
	clear_req_list(&bm->waiting);
	memset(bm->map, 0, vhd_sectors_to_bytes(s->bm_secs));
	memset(bm->shadow, 0, vhd_sectors_to_bytes(s->bm_secs));
	init_vhd_request(s, &bm->req);
}

static inline struct vhd_bitmap *
get_bitmap(struct vhd_state *s, uint32_t block)
{
	int i;
	struct vhd_bitmap *bm;

	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		bm = s->bitmap[i];
		if (bm && bm->blk == block)
			return bm;
	}

	return NULL;
}

static inline void
lock_bitmap(struct vhd_bitmap *bm)
{
	set_vhd_flag(bm->status, VHD_FLAG_BM_LOCKED);
}

static inline void
unlock_bitmap(struct vhd_bitmap *bm)
{
	clear_vhd_flag(bm->status, VHD_FLAG_BM_LOCKED);
}

static inline int
bitmap_locked(struct vhd_bitmap *bm)
{
	return test_vhd_flag(bm->status, VHD_FLAG_BM_LOCKED);
}

static inline int
bitmap_valid(struct vhd_bitmap *bm)
{
	return !test_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING);
}

static inline int
bitmap_in_use(struct vhd_bitmap *bm)
{
	return (test_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING)  ||
		test_vhd_flag(bm->status, VHD_FLAG_BM_WRITE_PENDING) ||
		test_vhd_flag(bm->tx.status, VHD_FLAG_TX_UPDATE_BAT) ||
		bm->waiting.head || bm->tx.requests.head || bm->queue.head);
}

static inline int
bitmap_full(struct vhd_state *s, struct vhd_bitmap *bm)
{
	int i, n;

	n = s->spb >> 3;
	for (i = 0; i < n; i++)
		if (bm->map[i] != (char)0xFF)
			return 0;

	DBG(TLOG_DBG, "bitmap 0x%04x full\n", bm->blk);
	return 1;
}

static struct vhd_bitmap *
remove_lru_bitmap(struct vhd_state *s)
{
	int i, idx = 0;
	uint64_t seq = s->bm_lru;
	struct vhd_bitmap *bm, *lru = NULL;

	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		bm = s->bitmap[i];
		if (bm && bm->seqno < seq && !bitmap_locked(bm)) {
			idx = i;
			lru = bm;
			seq = lru->seqno;
		}
	}

	if (lru) {
		s->bitmap[idx] = NULL;
		ASSERT(!bitmap_in_use(lru));
	}

	return  lru;
}

static int
alloc_vhd_bitmap(struct vhd_state *s, struct vhd_bitmap **bitmap, uint32_t blk)
{
	struct vhd_bitmap *bm;
	
	*bitmap = NULL;

	if (s->bm_free_count > 0) {
		bm = s->bitmap_free[--s->bm_free_count];
	} else {
		bm = remove_lru_bitmap(s);
		if (!bm)
			return -EBUSY;
	}

	init_vhd_bitmap(s, bm);
	bm->blk = blk;
	*bitmap = bm;

	return 0;
}

static inline uint64_t
__bitmap_lru_seqno(struct vhd_state *s)
{
	int i;
	struct vhd_bitmap *bm;

	if (s->bm_lru == 0xffffffff) {
		s->bm_lru = 0;
		for (i = 0; i < VHD_CACHE_SIZE; i++) {
			bm = s->bitmap[i];
			if (bm) {
				bm->seqno >>= 1;
				if (bm->seqno > s->bm_lru)
					s->bm_lru = bm->seqno;
			}
		}
	}

	return ++s->bm_lru;
}

static inline void
touch_bitmap(struct vhd_state *s, struct vhd_bitmap *bm)
{
	bm->seqno = __bitmap_lru_seqno(s);
}

static inline void
install_bitmap(struct vhd_state *s, struct vhd_bitmap *bm)
{
	int i;
	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		if (!s->bitmap[i]) {
			touch_bitmap(s, bm);
			s->bitmap[i] = bm;
			return;
		}
	}

	ASSERT(0);
}

static inline void
free_vhd_bitmap(struct vhd_state *s, struct vhd_bitmap *bm)
{
	int i;

	for (i = 0; i < VHD_CACHE_SIZE; i++)
		if (s->bitmap[i] == bm)
			break;

	ASSERT(!bitmap_locked(bm));
	ASSERT(!bitmap_in_use(bm));
	ASSERT(i < VHD_CACHE_SIZE);

	s->bitmap[i] = NULL;
	s->bitmap_free[s->bm_free_count++] = bm;
}

static int
read_bitmap_cache(struct vhd_state *s, uint64_t sector, uint8_t op)
{
	uint32_t blk, sec;
	struct vhd_bitmap *bm;

	/* in fixed disks, every block is present */
	if (s->vhd.footer.type == HD_TYPE_FIXED) 
		return VHD_BM_BIT_SET;

	/* the extent the logical sector falls in */
	blk = sector / s->spb;

	/* offset within the extent the logical sector is located */
	sec = sector % s->spb;

	if (blk > s->vhd.header.max_bat_size) {
		DPRINTF("ERROR: sec %"PRIu64" out of range, op = %d\n",
			sector, op);
		return -EINVAL;
	}

	if (bat_entry(s, blk) == DD_BLK_UNUSED) {
		if (op == VHD_OP_DATA_WRITE &&
		    s->bat.pbw_blk != blk && bat_locked(s))
			return VHD_BM_BAT_LOCKED;

		return VHD_BM_BAT_CLEAR;
	}

	if (test_batmap(s, blk)) {
		DBG(TLOG_DBG, "batmap set for 0x%04x\n", blk);
		return VHD_BM_BIT_SET;
	}

	bm = get_bitmap(s, blk);
	if (!bm)
		return VHD_BM_NOT_CACHED;

	/* bump lru count */
	touch_bitmap(s, bm);

	if (test_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING))
		return VHD_BM_READ_PENDING;

	return ((vhd_bitmap_test(&s->vhd, bm->map, sec)) ? 
		VHD_BM_BIT_SET : VHD_BM_BIT_CLEAR);
}

static int
read_bitmap_cache_span(struct vhd_state *s, 
		       uint64_t sector, int nr_secs, int value)
{
	int ret;
	uint32_t blk, sec;
	struct vhd_bitmap *bm;

	/* in fixed disks, every block is present */
	if (s->vhd.footer.type == HD_TYPE_FIXED) 
		return nr_secs;

	sec = sector % s->spb;
	blk = sector / s->spb;

	if (test_batmap(s, blk))
		return MIN(nr_secs, s->spb - sec);

	bm  = get_bitmap(s, blk);
	
	ASSERT(bm && bitmap_valid(bm));

	for (ret = 0; sec < s->spb && ret < nr_secs; sec++, ret++)
		if (vhd_bitmap_test(&s->vhd, bm->map, sec) != value)
			break;

	return ret;
}

static inline struct vhd_request *
alloc_vhd_request(struct vhd_state *s)
{
	struct vhd_request *req = NULL;
	
	if (s->vreq_free_count > 0) {
		req = s->vreq_free[--s->vreq_free_count];
		ASSERT(req->treq.secs == 0);
		init_vhd_request(s, req);
		return req;
	}

	return NULL;
}

static inline void
free_vhd_request(struct vhd_state *s, struct vhd_request *req)
{
	memset(req, 0, sizeof(struct vhd_request));
	s->vreq_free[s->vreq_free_count++] = req;
}

static inline void
aio_read(struct vhd_state *s, struct vhd_request *req, uint64_t offset)
{
	struct tiocb *tiocb = &req->tiocb;

	td_prep_read(tiocb, s->vhd.fd, req->treq.buf,
		     vhd_sectors_to_bytes(req->treq.secs),
		     offset, vhd_complete, req);
	td_queue_tiocb(s->driver, tiocb);

	s->queued++;
	s->reads++;
	s->read_size += req->treq.secs;
	TRACE(s);
}

static inline void
aio_write(struct vhd_state *s, struct vhd_request *req, uint64_t offset)
{
	struct tiocb *tiocb = &req->tiocb;

	td_prep_write(tiocb, s->vhd.fd, req->treq.buf,
		      vhd_sectors_to_bytes(req->treq.secs),
		      offset, vhd_complete, req);
	td_queue_tiocb(s->driver, tiocb);

	s->queued++;
	s->writes++;
	s->write_size += req->treq.secs;
	TRACE(s);
}

/**
 * Reserves a new extent.
 *
 * @returns a 64-bit unsigned integer where the error code is stored in the
 * upper 32 bits and the reserved block number is stored in the lower 32 bits.
 * If an error is returned (the upper 32 bits are not zero), the lower 32 bits
 * are undefined.
 */
static inline uint64_t
reserve_new_block(struct vhd_state *s, uint32_t blk)
{
	int gap = 0;

	ASSERT(!test_vhd_flag(s->bat.status, VHD_FLAG_BAT_WRITE_STARTED));

	/* data region of segment should begin on page boundary */
	if ((s->next_db + s->bm_secs) % s->spp)
		gap = (s->spp - ((s->next_db + s->bm_secs) % s->spp));

	if (s->next_db + gap > UINT_MAX)
		return (uint64_t)ENOSPC << 32;

	s->bat.pbw_blk    = blk;
	s->bat.pbw_offset = s->next_db + gap;

	return s->next_db;
}

static int
schedule_bat_write(struct vhd_state *s)
{
	int i;
	uint32_t blk;
	char *buf;
	uint64_t offset;
	struct vhd_request *req;

	ASSERT(bat_locked(s));

	req = &s->bat.req;
	buf = s->bat.bat_buf;
	blk = s->bat.pbw_blk;

	init_vhd_request(s, req);
	memcpy(buf, &bat_entry(s, blk - (blk % 128)), 512);

	((uint32_t *)buf)[blk % 128] = s->bat.pbw_offset;

	for (i = 0; i < 128; i++)
		BE32_OUT(&((uint32_t *)buf)[i]);

	offset         = s->vhd.header.table_offset + (blk - (blk % 128)) * 4;
	req->treq.secs = 1;
	req->treq.buf  = buf;
	req->op        = VHD_OP_BAT_WRITE;
	req->next      = NULL;

	aio_write(s, req, offset);
	set_vhd_flag(s->bat.status, VHD_FLAG_BAT_WRITE_STARTED);

	DBG(TLOG_DBG, "blk: 0x%04x, pbwo: 0x%08"PRIx64", "
	    "table_offset: 0x%08"PRIx64"\n", blk, s->bat.pbw_offset, offset);

	return 0;
}

static void
schedule_zero_bm_write(struct vhd_state *s,
		       struct vhd_bitmap *bm, uint64_t lb_end)
{
	uint64_t offset;
	struct vhd_request *req = &s->bat.zero_req;

	init_vhd_request(s, req);

	offset         = vhd_sectors_to_bytes(lb_end);
	req->op        = VHD_OP_ZERO_BM_WRITE;
	req->treq.sec  = s->bat.pbw_blk * s->spb;
	req->treq.secs = (s->bat.pbw_offset - lb_end) + s->bm_secs;
	req->treq.buf  = vhd_zeros(vhd_sectors_to_bytes(req->treq.secs));
	req->next      = NULL;

	DBG(TLOG_DBG, "blk: 0x%04x, writing zero bitmap at 0x%08"PRIx64"\n",
	    s->bat.pbw_blk, offset);

	lock_bitmap(bm);
	add_to_transaction(&bm->tx, req);
	aio_write(s, req, offset);
}

/* This is a performance optimization. When writing sequentially into full 
 * blocks, skipping (up-to-date) bitmaps causes an approx. 25% reduction in 
 * throughput. To prevent skipping, we issue redundant writes into the (padded) 
 * bitmap area just to make all writes sequential. This will help VHDs on raw 
 * block devices, while the FS-based VHDs shouldn't suffer much.
 *
 * Note that it only makes sense to perform this reduntant bitmap write if the 
 * block is completely full (i.e. the batmap entry is set). If the block is not 
 * completely full then one of the following two things will be true:
 *  1. we'll either be allocating new sectors in this block and writing its
 *     bitmap transactionally, which will be slow anyways; or
 *  2. the IO will be skipping over the unallocated sectors again, so the
 *     pattern will not be sequential anyways
 * In either case a redundant bitmap write becomes pointless. This fact 
 * simplifies the implementation of redundant writes: since we know the bitmap 
 * cannot be updated by anyone else, we don't have to worry about transactions 
 * or potential write conflicts.
 * */
static void
schedule_redundant_bm_write(struct vhd_state *s, uint32_t blk)
{
	uint64_t offset;
	struct vhd_request *req;

	ASSERT(s->vhd.footer.type != HD_TYPE_FIXED);
	ASSERT(test_batmap(s, blk));

	req = alloc_vhd_request(s);
	if (!req) 
		return;

	req->treq.buf = s->padbm_buf;

	offset = bat_entry(s, blk);
	ASSERT(offset != DD_BLK_UNUSED);
	offset <<= VHD_SECTOR_SHIFT;
	offset -= s->padbm_size - (s->bm_secs << VHD_SECTOR_SHIFT);

	req->op        = VHD_OP_REDUNDANT_BM_WRITE;
	req->treq.sec  = blk * s->spb;
	req->treq.secs = s->padbm_size >> VHD_SECTOR_SHIFT;
	req->next      = NULL;

	DBG(TLOG_DBG, "blk: %u, writing redundant bitmap at %" PRIu64 "\n",
	    blk, offset);

	aio_write(s, req, offset);
}

static int
update_bat(struct vhd_state *s, uint32_t blk)
{
	int err;
	uint64_t lb_end;
	struct vhd_bitmap *bm;

	ASSERT(bat_entry(s, blk) == DD_BLK_UNUSED);
	
	if (bat_locked(s)) {
		ASSERT(s->bat.pbw_blk == blk);
		return 0;
	}

	/* empty bitmap could already be in
	 * cache if earlier bat update failed */
	bm = get_bitmap(s, blk);
	if (!bm) {
		/* install empty bitmap in cache */
		err = alloc_vhd_bitmap(s, &bm, blk);
		if (err) 
			return err;

		install_bitmap(s, bm);
	}

	lock_bat(s);
	lb_end = reserve_new_block(s, blk);
	if (lb_end >> 32) {
		unlock_bat(s);
		return -(lb_end >> 32);
	}
	schedule_zero_bm_write(s, bm, lb_end);
	set_vhd_flag(bm->tx.status, VHD_FLAG_TX_UPDATE_BAT);

	return 0;
}

static int
allocate_block(struct vhd_state *s, uint32_t blk)
{
	int err, gap;
	uint64_t offset, size;
	struct vhd_bitmap *bm;
	ssize_t count;
	uint64_t next_db;

	ASSERT(bat_entry(s, blk) == DD_BLK_UNUSED);

	if (bat_locked(s)) {
		ASSERT(s->bat.pbw_blk == blk);
		if (s->bat.req.error)
			return -EBUSY;
		return 0;
	}

	gap     = 0;
	offset  = vhd_sectors_to_bytes(s->next_db);
	next_db = s->next_db;

	/* data region of segment should begin on page boundary */
	if ((next_db + s->bm_secs) % s->spp) {
		gap = (s->spp - ((next_db + s->bm_secs) % s->spp));
		next_db += gap;
	}

	if (next_db > UINT_MAX)
		return -ENOSPC;

	s->next_db = next_db;

	s->bat.pbw_blk = blk;
	s->bat.pbw_offset = s->next_db;

	DBG(TLOG_DBG, "blk: 0x%04x, pbwo: 0x%08"PRIx64"\n",
	    blk, s->bat.pbw_offset);

	if (lseek(s->vhd.fd, offset, SEEK_SET) == (off_t)-1) {
		ERR(s, -errno, "lseek failed\n");
		return -errno;
	}

	size  = vhd_sectors_to_bytes(s->spb + s->bm_secs + gap);
	count = write(s->vhd.fd, vhd_zeros(size), size);
	if (count != size) {
		err = count < 0 ? -errno : -ENOSPC;
		ERR(s, -errno,
		    "write failed (%zd, offset %"PRIu64")\n", count, offset);
		return err;
	}

	/* empty bitmap could already be in
	 * cache if earlier bat update failed */
	bm = get_bitmap(s, blk);
	if (!bm) {
		/* install empty bitmap in cache */
		err = alloc_vhd_bitmap(s, &bm, blk);
		if (err) 
			return err;

		install_bitmap(s, bm);
	}

	lock_bat(s);
	lock_bitmap(bm);
	schedule_bat_write(s);
	add_to_transaction(&bm->tx, &s->bat.req);

	return 0;
}

static int 
schedule_data_read(struct vhd_state *s, td_request_t treq, vhd_flag_t flags)
{
	uint64_t offset;
	uint32_t blk = 0, sec = 0;
	struct vhd_bitmap  *bm;
	struct vhd_request *req;

	if (s->vhd.footer.type == HD_TYPE_FIXED) {
		offset = vhd_sectors_to_bytes(treq.sec);
		goto make_request;
	}

	blk    = treq.sec / s->spb;
	sec    = treq.sec % s->spb;
	bm     = get_bitmap(s, blk);
	offset = bat_entry(s, blk);

	ASSERT(offset != DD_BLK_UNUSED);
	ASSERT(test_batmap(s, blk) || (bm && bitmap_valid(bm)));

	offset += s->bm_secs + sec;
	offset  = vhd_sectors_to_bytes(offset);

 make_request:
	req = alloc_vhd_request(s);
	if (!req) 
		return -EBUSY;

	req->treq  = treq;
	req->flags = flags;
	req->op    = VHD_OP_DATA_READ;
	req->next  = NULL;

	aio_read(s, req, offset);

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", blk: 0x%04x, sec: 0x%04x, "
	    "nr_secs: 0x%04x, offset: 0x%08"PRIx64", flags: 0x%08x, buf: %p\n",
	    s->vhd.file, treq.sec, blk, sec, treq.secs, offset, req->flags,
	    treq.buf);

	return 0;
}

static int
schedule_data_write(struct vhd_state *s, td_request_t treq, vhd_flag_t flags)
{
	int err;
	uint64_t offset;
	uint32_t blk = 0, sec = 0;
	struct vhd_bitmap  *bm = NULL;
	struct vhd_request *req;

	if (s->vhd.footer.type == HD_TYPE_FIXED) {
		offset = vhd_sectors_to_bytes(treq.sec);
		goto make_request;
	}

	blk    = treq.sec / s->spb;
	sec    = treq.sec % s->spb;
	offset = bat_entry(s, blk);

	if (test_vhd_flag(flags, VHD_FLAG_REQ_UPDATE_BAT)) {
		if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_PREALLOCATE))
			err = allocate_block(s, blk);
		else
			err = update_bat(s, blk);

		if (err)
			return err;

		offset = s->bat.pbw_offset;
	}

	offset += s->bm_secs + sec;
	offset  = vhd_sectors_to_bytes(offset);

 make_request:
	req = alloc_vhd_request(s);
	if (!req)
		return -EBUSY;

	req->treq  = treq;
	req->flags = flags;
	req->op    = VHD_OP_DATA_WRITE;
	req->next  = NULL;

	if (test_vhd_flag(flags, VHD_FLAG_REQ_UPDATE_BITMAP)) {
		bm = get_bitmap(s, blk);
		ASSERT(bm && bitmap_valid(bm));
		lock_bitmap(bm);

		if (bm->tx.closed) {
			add_to_tail(&bm->queue, req);
			set_vhd_flag(req->flags, VHD_FLAG_REQ_QUEUED);
		} else
			add_to_transaction(&bm->tx, req);
	} else if (sec == 0 && 	/* first sector inside data block */
		   s->vhd.footer.type != HD_TYPE_FIXED && 
		   bat_entry(s, blk) != s->first_db &&
		   test_batmap(s, blk))
		schedule_redundant_bm_write(s, blk);

	aio_write(s, req, offset);

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", blk: 0x%04x, sec: 0x%04x, "
	    "nr_secs: 0x%04x, offset: 0x%08"PRIx64", flags: 0x%08x\n",
	    s->vhd.file, treq.sec, blk, sec, treq.secs, offset, req->flags);

	return 0;
}

static int 
schedule_bitmap_read(struct vhd_state *s, uint32_t blk)
{
	int err;
	uint64_t offset;
	struct vhd_bitmap  *bm;
	struct vhd_request *req = NULL;

	ASSERT(vhd_type_dynamic(&s->vhd));

	offset = bat_entry(s, blk);

	ASSERT(offset != DD_BLK_UNUSED);
	ASSERT(!get_bitmap(s, blk));

	offset = vhd_sectors_to_bytes(offset);

	err = alloc_vhd_bitmap(s, &bm, blk);
	if (err)
		return err;

	req = &bm->req;
	init_vhd_request(s, req);

	req->treq.sec  = blk * s->spb;
	req->treq.secs = s->bm_secs;
	req->treq.buf  = bm->map;
	req->treq.cb   = NULL;
	req->op        = VHD_OP_BITMAP_READ;
	req->next      = NULL;

	aio_read(s, req, offset);
	lock_bitmap(bm);
	install_bitmap(s, bm);
	set_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING);

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", blk: 0x%04x, nr_secs: 0x%04x, "
	    "offset: 0x%08"PRIx64"\n", s->vhd.file, req->treq.sec, blk,
	    req->treq.secs, offset);

	return 0;
}

static void
schedule_bitmap_write(struct vhd_state *s, uint32_t blk)
{
	uint64_t offset;
	struct vhd_bitmap  *bm;
	struct vhd_request *req;

	bm     = get_bitmap(s, blk);
	offset = bat_entry(s, blk);

	ASSERT(vhd_type_dynamic(&s->vhd));
	ASSERT(bm && bitmap_valid(bm) &&
	       !test_vhd_flag(bm->status, VHD_FLAG_BM_WRITE_PENDING));

	if (offset == DD_BLK_UNUSED) {
		ASSERT(bat_locked(s) && s->bat.pbw_blk == blk);
		offset = s->bat.pbw_offset;
	}
	
	offset = vhd_sectors_to_bytes(offset);

	req = &bm->req;
	init_vhd_request(s, req);

	req->treq.sec  = blk * s->spb;
	req->treq.secs = s->bm_secs;
	req->treq.buf  = bm->shadow;
	req->treq.cb   = NULL;
	req->op        = VHD_OP_BITMAP_WRITE;
	req->next      = NULL;

	aio_write(s, req, offset);
	lock_bitmap(bm);
	touch_bitmap(s, bm);     /* bump lru count */
	set_vhd_flag(bm->status, VHD_FLAG_BM_WRITE_PENDING);

	DBG(TLOG_DBG, "%s: blk: 0x%04x, sec: 0x%08"PRIx64", nr_secs: 0x%04x, "
	    "offset: 0x%"PRIx64"\n", s->vhd.file, blk, req->treq.sec,
	    req->treq.secs, offset);
}

/* 
 * queued requests will be submitted once the bitmap
 * describing them is read and the requests are validated. 
 */
static int
__vhd_queue_request(struct vhd_state *s, uint8_t op, td_request_t treq)
{
	uint32_t blk;
	struct vhd_bitmap  *bm;
	struct vhd_request *req;

	ASSERT(vhd_type_dynamic(&s->vhd));

	blk = treq.sec / s->spb;
	bm  = get_bitmap(s, blk);

	ASSERT(bm && test_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING));

	req = alloc_vhd_request(s);
	if (!req)
		return -EBUSY;

	req->treq = treq;
	req->op   = op;
	req->next = NULL;

	add_to_tail(&bm->waiting, req);
	lock_bitmap(bm);

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", blk: 0x%04x nr_secs: 0x%04x, "
	    "op: %u\n", s->vhd.file, treq.sec, blk, treq.secs, op);

	TRACE(s);
	return 0;
}

static void
vhd_queue_read(td_driver_t *driver, td_request_t treq)
{
	struct vhd_state *s = (struct vhd_state *)driver->data;

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", secs: 0x%04x (seg: %d)\n",
	    s->vhd.file, treq.sec, treq.secs, treq.sidx);

	while (treq.secs) {
		int err;
		td_request_t clone;

		err   = 0;
		clone = treq;

		switch (read_bitmap_cache(s, clone.sec, VHD_OP_DATA_READ)) {
		case -EINVAL:
			err = -EINVAL;
			goto fail;

		case VHD_BM_BAT_CLEAR:
			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			td_forward_request(clone);
			break;

		case VHD_BM_BIT_CLEAR:
			clone.secs = read_bitmap_cache_span(s, clone.sec, clone.secs, 0);
			td_forward_request(clone);
			break;

		case VHD_BM_BIT_SET:
			clone.secs = read_bitmap_cache_span(s, clone.sec, clone.secs, 1);
			err = schedule_data_read(s, clone, 0);
			if (err)
				goto fail;
			break;

		case VHD_BM_NOT_CACHED:
			err = schedule_bitmap_read(s, clone.sec / s->spb);
			if (err)
				goto fail;

			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			err = __vhd_queue_request(s, VHD_OP_DATA_READ, clone);
			if (err)
				goto fail;
			break;

		case VHD_BM_READ_PENDING:
			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			err = __vhd_queue_request(s, VHD_OP_DATA_READ, clone);
			if (err)
				goto fail;
			break;

		case VHD_BM_BAT_LOCKED:
		default:
			ASSERT(0);
			break;
		}

		treq.sec  += clone.secs;
		treq.secs -= clone.secs;
		treq.buf  += vhd_sectors_to_bytes(clone.secs);
		continue;

	fail:
		clone.secs = treq.secs;
		td_complete_request(clone, err);
		break;
	}
}

static void
vhd_queue_write(td_driver_t *driver, td_request_t treq)
{
	struct vhd_state *s = (struct vhd_state *)driver->data;

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", secs: 0x%04x, (seg: %d)\n",
	    s->vhd.file, treq.sec, treq.secs, treq.sidx);

	while (treq.secs) {
		int err;
		uint8_t flags;
		td_request_t clone;

		err   = 0;
		flags = 0;
		clone = treq;

		switch (read_bitmap_cache(s, clone.sec, VHD_OP_DATA_WRITE)) {
		case -EINVAL:
			err = -EINVAL;
			goto fail;

		case VHD_BM_BAT_LOCKED:
			err = -EBUSY;
			goto fail;

		case VHD_BM_BAT_CLEAR:
			flags      = (VHD_FLAG_REQ_UPDATE_BAT |
				      VHD_FLAG_REQ_UPDATE_BITMAP);
			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			err        = schedule_data_write(s, clone, flags);
			if (err)
				goto fail;
			break;

		case VHD_BM_BIT_CLEAR:
			flags      = VHD_FLAG_REQ_UPDATE_BITMAP;
			clone.secs = read_bitmap_cache_span(s, clone.sec, clone.secs, 0);
			err        = schedule_data_write(s, clone, flags);
			if (err)
				goto fail;
			break;

		case VHD_BM_BIT_SET:
			clone.secs = read_bitmap_cache_span(s, clone.sec, clone.secs, 1);
			err = schedule_data_write(s, clone, 0);
			if (err)
				goto fail;
			break;

		case VHD_BM_NOT_CACHED:
			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			err = schedule_bitmap_read(s, clone.sec / s->spb);
			if (err)
				goto fail;

			err = __vhd_queue_request(s, VHD_OP_DATA_WRITE, clone);
			if (err)
				goto fail;
			break;

		case VHD_BM_READ_PENDING:
			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			err = __vhd_queue_request(s, VHD_OP_DATA_WRITE, clone);
			if (err)
				goto fail;
			break;

		default:
			ASSERT(0);
			break;
		}

		treq.sec  += clone.secs;
		treq.secs -= clone.secs;
		treq.buf  += vhd_sectors_to_bytes(clone.secs);
		continue;

	fail:
		clone.secs = treq.secs;
		td_complete_request(clone, err);
		break;
	}
}

static inline void
signal_completion(struct vhd_request *list, int error)
{
	struct vhd_state *s;
	struct vhd_request *r, *next;

	if (!list)
		return;

	r = list;
	s = list->state;

	while (r) {
		int err;

		err  = (error ? error : r->error);
		next = r->next;
		td_complete_request(r->treq, err);
		DBG(TLOG_DBG, "lsec: 0x%08"PRIx64", blk: 0x%04"PRIx64", "
		    "err: %d\n", r->treq.sec, r->treq.sec / s->spb, err);
		free_vhd_request(s, r);
		r    = next;

		s->returned++;
		TRACE(s);
	}
}

static void
start_new_bitmap_transaction(struct vhd_state *s, struct vhd_bitmap *bm)
{
	struct vhd_transaction *tx;
	struct vhd_request *r, *next;
	int i;

	if (!bm->queue.head)
		return;

	DBG(TLOG_DBG, "blk: 0x%04x\n", bm->blk);

	r  = bm->queue.head;
	tx = &bm->tx;
	clear_req_list(&bm->queue);

	if (r && bat_entry(s, bm->blk) == DD_BLK_UNUSED)
		tx->error = -EIO;

	while (r) {
		next    = r->next;
		r->next = NULL;
		clear_vhd_flag(r->flags, VHD_FLAG_REQ_QUEUED);

		add_to_transaction(tx, r);
		if (test_vhd_flag(r->flags, VHD_FLAG_REQ_FINISHED)) {
			tx->finished++;
			if (!r->error) {
				uint32_t sec = r->treq.sec % s->spb;
				for (i = 0; i < r->treq.secs; i++)
					vhd_bitmap_set(&s->vhd,
						       bm->shadow, sec + i);
			}
		}
		r = next;
	}

	/* perhaps all the queued writes already completed? */
	if (tx->started && transaction_completed(tx))
		finish_data_transaction(s, bm);
}

static void
finish_bat_transaction(struct vhd_state *s, struct vhd_bitmap *bm)
{
	struct vhd_transaction *tx = &bm->tx;

	if (!bat_locked(s))
		return;

	if (s->bat.pbw_blk != bm->blk)
		return;

	if (!s->bat.req.error)
		goto release;

	if (!test_vhd_flag(tx->status, VHD_FLAG_TX_LIVE))
		goto release;

	tx->closed = 1;
	return;

 release:
	DBG(TLOG_DBG, "blk: 0x%04x\n", bm->blk);
	unlock_bat(s);
	init_bat(s);
}

static void
finish_bitmap_transaction(struct vhd_state *s,
			  struct vhd_bitmap *bm, int error)
{
	int map_size;
	struct vhd_transaction *tx = &bm->tx;

	DBG(TLOG_DBG, "blk: 0x%04x, err: %d\n", bm->blk, error);
	tx->error = (tx->error ? tx->error : error);
	map_size  = vhd_sectors_to_bytes(s->bm_secs);

	if (!test_vhd_flag(s->flags, VHD_FLAG_OPEN_PREALLOCATE)) {
		if (test_vhd_flag(tx->status, VHD_FLAG_TX_UPDATE_BAT)) {
			/* still waiting for bat write */
			ASSERT(bm->blk == s->bat.pbw_blk);
			ASSERT(test_vhd_flag(s->bat.status, 
					     VHD_FLAG_BAT_WRITE_STARTED));
			s->bat.req.tx = tx;
			return;
		}
	}

	if (tx->error) {
		/* undo changes to shadow */
		memcpy(bm->shadow, bm->map, map_size);
	} else {
		/* complete atomic write */
		memcpy(bm->map, bm->shadow, map_size);
		if (!test_batmap(s, bm->blk) && bitmap_full(s, bm))
			set_batmap(s, bm->blk);
	}

	/* transaction done; signal completions */
	signal_completion(tx->requests.head, tx->error);
	init_tx(tx);
	start_new_bitmap_transaction(s, bm);

	if (!bitmap_in_use(bm))
		unlock_bitmap(bm);

	finish_bat_transaction(s, bm);
}

static void
finish_data_transaction(struct vhd_state *s, struct vhd_bitmap *bm)
{
	struct vhd_transaction *tx = &bm->tx;

	DBG(TLOG_DBG, "blk: 0x%04x\n", bm->blk);

	tx->closed = 1;

	if (!tx->error)
		return schedule_bitmap_write(s, bm->blk);

	return finish_bitmap_transaction(s, bm, 0);
}

static void
finish_bat_write(struct vhd_request *req)
{
	struct vhd_bitmap *bm;
	struct vhd_transaction *tx;
	struct vhd_state *s = req->state;

	s->returned++;
	TRACE(s);

	bm = get_bitmap(s, s->bat.pbw_blk);

	DBG(TLOG_DBG, "blk 0x%04x, pbwo: 0x%08"PRIx64", err %d\n",
	    s->bat.pbw_blk, s->bat.pbw_offset, req->error);
	ASSERT(bm && bitmap_valid(bm));
	ASSERT(bat_locked(s) &&
	       test_vhd_flag(s->bat.status, VHD_FLAG_BAT_WRITE_STARTED));

	tx = &bm->tx;
	ASSERT(test_vhd_flag(tx->status, VHD_FLAG_TX_LIVE));

	if (!req->error) {
		bat_entry(s, s->bat.pbw_blk) = s->bat.pbw_offset;
		s->next_db = s->bat.pbw_offset + s->spb + s->bm_secs;
	} else
		tx->error = req->error;

	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_PREALLOCATE)) {
		tx->finished++;
		remove_from_req_list(&tx->requests, req);
		if (transaction_completed(tx))
			finish_data_transaction(s, bm);
	} else {
		clear_vhd_flag(tx->status, VHD_FLAG_TX_UPDATE_BAT);
		if (s->bat.req.tx)
			finish_bitmap_transaction(s, bm, req->error);
	}

	finish_bat_transaction(s, bm);
}

static void
finish_zero_bm_write(struct vhd_request *req)
{
	uint32_t blk;
	struct vhd_bitmap *bm;
	struct vhd_transaction *tx = req->tx;
	struct vhd_state *s = req->state;

	s->returned++;
	TRACE(s);

	blk = req->treq.sec / s->spb;
	bm  = get_bitmap(s, blk);

	DBG(TLOG_DBG, "blk: 0x%04x\n", blk);
	ASSERT(bat_locked(s));
	ASSERT(s->bat.pbw_blk == blk);
	ASSERT(bm && bitmap_valid(bm) && bitmap_locked(bm));

	tx->finished++;
	remove_from_req_list(&tx->requests, req);

	if (req->error) {
		unlock_bat(s);
		init_bat(s);
		tx->error = req->error;
		clear_vhd_flag(tx->status, VHD_FLAG_TX_UPDATE_BAT);
	} else
		schedule_bat_write(s);

	if (transaction_completed(tx))
		finish_data_transaction(s, bm);
}

static int
finish_redundant_bm_write(struct vhd_request *req)
{
	/* uint32_t blk; */
	struct vhd_state *s = (struct vhd_state *) req->state;

	s->returned++;
	TRACE(s);	
	/* blk = req->treq.sec / s->spb;
	   DBG(TLOG_DBG, "blk: %u\n", blk); */

	if (req->error) {
		ERR(s, req->error, "lsec: 0x%08"PRIx64, req->treq.sec);
	}
	free_vhd_request(s, req);
	s->debug_done_redundant_writes++;
	return 0;
}


static void
finish_bitmap_read(struct vhd_request *req)
{
	uint32_t blk;
	struct vhd_bitmap  *bm;
	struct vhd_request *r, *next;
	struct vhd_state   *s = req->state;

	s->returned++;
	TRACE(s);

	blk = req->treq.sec / s->spb;
	bm  = get_bitmap(s, blk);

	DBG(TLOG_DBG, "blk: 0x%04x\n", blk);
	ASSERT(bm && test_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING));

	r = bm->waiting.head;
	clear_req_list(&bm->waiting);
	clear_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING);

	if (!req->error) {
		memcpy(bm->shadow, bm->map, vhd_sectors_to_bytes(s->bm_secs));

		while (r) {
			struct vhd_request tmp;

			tmp  = *r;
			next =  r->next;
			free_vhd_request(s, r);

			ASSERT(tmp.op == VHD_OP_DATA_READ || 
			       tmp.op == VHD_OP_DATA_WRITE);

			if (tmp.op == VHD_OP_DATA_READ)
				vhd_queue_read(s->driver, tmp.treq);
			else if (tmp.op == VHD_OP_DATA_WRITE)
				vhd_queue_write(s->driver, tmp.treq);

			r = next;
		}
	} else {
		int err = req->error;
		unlock_bitmap(bm);
		free_vhd_bitmap(s, bm);
		return signal_completion(r, err);
	}

	if (!bitmap_in_use(bm))
		unlock_bitmap(bm);
}

static void
finish_bitmap_write(struct vhd_request *req)
{
	uint32_t blk;
	struct vhd_bitmap  *bm;
	struct vhd_transaction *tx;
	struct vhd_state *s = req->state;

	s->returned++;
	TRACE(s);

	blk = req->treq.sec / s->spb;
	bm  = get_bitmap(s, blk);
	tx  = &bm->tx;

	DBG(TLOG_DBG, "blk: 0x%04x, started: %d, finished: %d\n",
	    blk, tx->started, tx->finished);
	ASSERT(tx->closed);
	ASSERT(bm && bitmap_valid(bm));
	ASSERT(test_vhd_flag(bm->status, VHD_FLAG_BM_WRITE_PENDING));

	clear_vhd_flag(bm->status, VHD_FLAG_BM_WRITE_PENDING);

	finish_bitmap_transaction(s, bm, req->error);
}

static void
finish_data_read(struct vhd_request *req)
{
	struct vhd_state *s = req->state;

	DBG(TLOG_DBG, "lsec 0x%08"PRIx64", blk: 0x%04"PRIx64"\n", 
	    req->treq.sec, req->treq.sec / s->spb);
	signal_completion(req, 0);
}

static void
finish_data_write(struct vhd_request *req)
{
	int i;
	struct vhd_transaction *tx = req->tx;
	struct vhd_state *s = (struct vhd_state *)req->state;

	set_vhd_flag(req->flags, VHD_FLAG_REQ_FINISHED);

	if (tx) {
		uint32_t blk, sec;
		struct vhd_bitmap *bm;

		blk = req->treq.sec / s->spb;
		sec = req->treq.sec % s->spb;
		bm  = get_bitmap(s, blk);

		ASSERT(bm && bitmap_valid(bm) && bitmap_locked(bm));

		tx->finished++;

		DBG(TLOG_DBG, "lsec: 0x%08"PRIx64", blk: 0x04%"PRIx64", "
		    "tx->started: %d, tx->finished: %d\n", req->treq.sec,
		    req->treq.sec / s->spb, tx->started, tx->finished);

		if (!req->error)
			for (i = 0; i < req->treq.secs; i++)
				vhd_bitmap_set(&s->vhd, bm->shadow,  sec + i);

		if (transaction_completed(tx))
			finish_data_transaction(s, bm);

	} else if (!test_vhd_flag(req->flags, VHD_FLAG_REQ_QUEUED)) {
		ASSERT(!req->next);
		DBG(TLOG_DBG, "lsec: 0x%08"PRIx64", blk: 0x%04"PRIx64"\n", 
		    req->treq.sec, req->treq.sec / s->spb);
		signal_completion(req, 0);
	}
}

void
vhd_complete(void *arg, struct tiocb *tiocb, int err)
{
	struct vhd_request *req = (struct vhd_request *)arg;
	struct vhd_state *s = req->state;
	struct iocb *io = &tiocb->iocb;

	s->completed++;
	TRACE(s);

	req->error = err;

	if (req->error)
		ERR(s, req->error, "%s: op: %u, lsec: %"PRIu64", secs: %u, "
		    "nbytes: %lu, blk: %"PRIu64", blk_offset: %u",
		    s->vhd.file, req->op, req->treq.sec, req->treq.secs,
		    io->u.c.nbytes, req->treq.sec / s->spb,
		    bat_entry(s, req->treq.sec / s->spb));

	switch (req->op) {
	case VHD_OP_DATA_READ:
		finish_data_read(req);
		break;

	case VHD_OP_DATA_WRITE:
		finish_data_write(req);
		break;

	case VHD_OP_BITMAP_READ:
		finish_bitmap_read(req);
		break;

	case VHD_OP_BITMAP_WRITE:
		finish_bitmap_write(req);
		break;

	case VHD_OP_ZERO_BM_WRITE:
		finish_zero_bm_write(req);
		break;

	case VHD_OP_REDUNDANT_BM_WRITE:
		finish_redundant_bm_write(req);
		break;

	case VHD_OP_BAT_WRITE:
		finish_bat_write(req);
		break;

	default:
		ASSERT(0);
		break;
	}
}

void 
vhd_debug(td_driver_t *driver)
{
	int i;
	struct vhd_state *s = (struct vhd_state *)driver->data;

	DBG(TLOG_WARN, "%s: QUEUED: 0x%08"PRIx64", COMPLETED: 0x%08"PRIx64", "
	    "RETURNED: 0x%08"PRIx64"\n", s->vhd.file, s->queued, s->completed,
	    s->returned);
	DBG(TLOG_WARN, "WRITES: 0x%08"PRIx64", AVG_WRITE_SIZE: %f\n",
	    s->writes, (s->writes ? ((float)s->write_size / s->writes) : 0.0));
	DBG(TLOG_WARN, "READS: 0x%08"PRIx64", AVG_READ_SIZE: %f\n",
	    s->reads, (s->reads ? ((float)s->read_size / s->reads) : 0.0));

	DBG(TLOG_WARN, "ALLOCATED REQUESTS: (%u total)\n", VHD_REQS_DATA);
	for (i = 0; i < VHD_REQS_DATA; i++) {
		struct vhd_request *r = &s->vreq_list[i];
		td_request_t *t       = &r->treq;
		const char *vname     = t->vreq ? t->vreq->name: NULL;
		if (t->secs)
			DBG(TLOG_WARN, "%d: vreq: %s.%d, err: %d, op: %d,"
			    " lsec: 0x%08"PRIx64", flags: %d, this: %p, "
			    "next: %p, tx: %p\n", i, vname, t->sidx, r->error, r->op,
			    t->sec, r->flags, r, r->next, r->tx);
	}

	DBG(TLOG_WARN, "BITMAP CACHE:\n");
	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		int qnum = 0, wnum = 0, rnum = 0;
		struct vhd_bitmap *bm = s->bitmap[i];
		struct vhd_transaction *tx;
		struct vhd_request *r;

		if (!bm)
			continue;

		tx = &bm->tx;
		r = bm->queue.head;
		while (r) {
			qnum++;
			r = r->next;
		}

		r = bm->waiting.head;
		while (r) {
			wnum++;
			r = r->next;
		}

		r = tx->requests.head;
		while (r) {
			rnum++;
			r = r->next;
		}

		DBG(TLOG_WARN, "%d: blk: 0x%04x, status: 0x%08x, q: %p, qnum: %d, w: %p, "
		    "wnum: %d, locked: %d, in use: %d, tx: %p, tx_error: %d, "
		    "started: %d, finished: %d, status: %u, reqs: %p, nreqs: %d\n",
		    i, bm->blk, bm->status, bm->queue.head, qnum, bm->waiting.head,
		    wnum, bitmap_locked(bm), bitmap_in_use(bm), tx, tx->error,
		    tx->started, tx->finished, tx->status, tx->requests.head, rnum);
	}

	DBG(TLOG_WARN, "BAT: status: 0x%08x, pbw_blk: 0x%04x, "
	    "pbw_off: 0x%08"PRIx64", tx: %p\n", s->bat.status, s->bat.pbw_blk,
	    s->bat.pbw_offset, s->bat.req.tx);

/*
	for (i = 0; i < s->hdr.max_bat_size; i++)
		DPRINTF("%d: %u\n", i, s->bat.bat[i]);
*/
}

struct tap_disk tapdisk_vhd = {
	.disk_type          = "tapdisk_vhd",
	.flags              = 0,
	.private_data_size  = sizeof(struct vhd_state),
	.td_open            = _vhd_open,
	.td_close           = _vhd_close,
	.td_queue_read      = vhd_queue_read,
	.td_queue_write     = vhd_queue_write,
	.td_get_parent_id   = vhd_get_parent_id,
	.td_validate_parent = vhd_validate_parent,
	.td_debug           = vhd_debug,
};

[-- Attachment #4: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2015-07-03  8:45 Akash Talole
  0 siblings, 0 replies; 278+ messages in thread
From: Akash Talole @ 2015-07-03  8:45 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 580 bytes --]

Hello,
      I want to know about Blktap asynchronous i/o read write operations on
VHD. I want to know detail flow of program  block-VHD.c . How the read
write operations are performed on VHD . And any improvement in code would
be done for better read   write operations. Description about dynamic disk
structure. I wand modify code of fast clone copy for copy on read.
Currently data is copy into vhd  after write.
So tell me about how step by step which functions are calling from
block-vhd so fast copy is done.

I have attached the code of block-vhd.c.


Thanks,
Akash Talole

[-- Attachment #1.2: Type: text/html, Size: 1371 bytes --]

[-- Attachment #2: block-vhd.c --]
[-- Type: text/x-csrc, Size: 58428 bytes --]

/* 
 * Copyright (C) Citrix Systems Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; version 2.1 only
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

/*
 * block-vhd.c: asynchronous vhd implementation.
 *
 * A note on write transactions:
 * Writes that require updating the BAT or bitmaps cannot be signaled
 * as complete until all updates have reached disk.  Transactions are
 * used to ensure proper ordering in these cases.  The two types of
 * transactions are as follows:
 *   - Bitmap updates only: data writes that require updates to the same
 *     bitmap are grouped in a transaction.  Only after all data writes
 *     in a transaction complete does the bitmap write commence.  Only
 *     after the bitmap write finishes are the data writes signalled as
 *     complete.
 *   - BAT and bitmap updates: data writes are grouped in transactions
 *     as above, but a special extra write is included in the transaction,
 *     which zeros out the newly allocated bitmap on disk.  When the data
 *     writes and the zero-bitmap write complete, the BAT and bitmap writes
 *     are started in parallel.  The transaction is completed only after both
 *     the BAT and bitmap writes successfully return.
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <uuid/uuid.h> /* For whatever reason, Linux packages this in */
                       /* e2fsprogs-devel.                            */
#include <string.h>    /* for memset.                                 */
#include <libaio.h>
#include <sys/mman.h>
#include <limits.h>

#include "debug.h"
#include "libvhd.h"
#include "tapdisk.h"
#include "tapdisk-driver.h"
#include "tapdisk-interface.h"
#include "tapdisk-disktype.h"
#include "tapdisk-storage.h"

unsigned int SPB;

#define DEBUGGING   2
#define MICROSOFT_COMPAT

#define VHD_BATMAP_MAX_RETRIES 10

#define __TRACE(s)							\
	do {								\
		DBG(TLOG_DBG, "%s: QUEUED: %" PRIu64 ", COMPLETED: %"	\
		    PRIu64", RETURNED: %" PRIu64 ", DATA_ALLOCATED: "	\
		    "%u, BBLK: 0x%04x\n",				\
		    s->vhd.file, s->queued, s->completed, s->returned,	\
		    VHD_REQS_DATA - s->vreq_free_count,			\
		    s->bat.pbw_blk);					\
	} while(0)

#if (DEBUGGING == 1)
  #define DBG(level, _f, _a...)      DPRINTF(_f, ##_a)
  #define ERR(_s, err, _f, _a...)    DPRINTF("ERROR: %d: " _f, err, ##_a)
  #define TRACE(s)                   ((void)0)
#elif (DEBUGGING == 2)
  #define DBG(level, _f, _a...)      tlog_write(level, _f, ##_a)
  #define ERR(_s, _err, _f, _a...)   tlog_drv_error((_s)->driver, _err, _f, ##_a)
  #define TRACE(s)                   __TRACE(s)
#else
  #define DBG(level, _f, _a...)      ((void)0)
  #define ERR(_s, err, _f, _a...)    ((void)0)
  #define TRACE(s)                   ((void)0)
#endif

/******VHD DEFINES******/
#define VHD_CACHE_SIZE               32

#define VHD_REQS_DATA                TAPDISK_DATA_REQUESTS
#define VHD_REQS_META                (VHD_CACHE_SIZE + 2)
#define VHD_REQS_TOTAL               (VHD_REQS_DATA + VHD_REQS_META)

#define VHD_OP_BAT_WRITE             0
#define VHD_OP_DATA_READ             1
#define VHD_OP_DATA_WRITE            2
#define VHD_OP_BITMAP_READ           3
#define VHD_OP_BITMAP_WRITE          4
#define VHD_OP_ZERO_BM_WRITE         5
#define VHD_OP_REDUNDANT_BM_WRITE    6

#define VHD_BM_BAT_LOCKED            0
#define VHD_BM_BAT_CLEAR             1
#define VHD_BM_BIT_CLEAR             2
#define VHD_BM_BIT_SET               3
#define VHD_BM_NOT_CACHED            4
#define VHD_BM_READ_PENDING          5

#define VHD_FLAG_OPEN_RDONLY         1
#define VHD_FLAG_OPEN_NO_CACHE       2
#define VHD_FLAG_OPEN_QUIET          4
#define VHD_FLAG_OPEN_STRICT         8
#define VHD_FLAG_OPEN_QUERY          16
#define VHD_FLAG_OPEN_PREALLOCATE    32
#define VHD_FLAG_OPEN_NO_O_DIRECT    64
#define VHD_FLAG_OPEN_LOCAL_CACHE    128

#define VHD_FLAG_BAT_LOCKED          1
#define VHD_FLAG_BAT_WRITE_STARTED   2

#define VHD_FLAG_BM_UPDATE_BAT       1
#define VHD_FLAG_BM_WRITE_PENDING    2
#define VHD_FLAG_BM_READ_PENDING     4
#define VHD_FLAG_BM_LOCKED           8

#define VHD_FLAG_REQ_UPDATE_BAT      1
#define VHD_FLAG_REQ_UPDATE_BITMAP   2
#define VHD_FLAG_REQ_QUEUED          4
#define VHD_FLAG_REQ_FINISHED        8

#define VHD_FLAG_TX_LIVE             1
#define VHD_FLAG_TX_UPDATE_BAT       2

typedef uint8_t vhd_flag_t;

struct vhd_state;
struct vhd_request;

struct vhd_req_list {
	struct vhd_request       *head;
	struct vhd_request       *tail;
};

struct vhd_transaction {
	int                       error;
	int                       closed;
	int                       started;
	int                       finished;
	vhd_flag_t                status;
	struct vhd_req_list       requests;
};

struct vhd_request {
	int                       error;
	uint8_t                   op;
	vhd_flag_t                flags;
	td_request_t              treq;
	struct tiocb              tiocb;
	struct vhd_state         *state;
	struct vhd_request       *next;
	struct vhd_transaction   *tx;
};

struct vhd_bat_state {
	vhd_bat_t                 bat;
	vhd_batmap_t              batmap;
	vhd_flag_t                status;
	uint32_t                  pbw_blk;     /* blk num of pending write */
	uint64_t                  pbw_offset;  /* file offset of same */
	struct vhd_request        req;         /* for writing bat table */
	struct vhd_request        zero_req;    /* for initializing bitmaps */
	char                     *bat_buf;
};

struct vhd_bitmap {
	uint32_t                  blk;
	uint64_t                  seqno;       /* lru sequence number */
	vhd_flag_t                status;

	char                     *map;         /* map should only be modified
					        * in finish_bitmap_write */
	char                     *shadow;      /* in-memory bitmap changes are 
					        * made to shadow and copied to
					        * map only after having been
					        * flushed to disk */
	struct vhd_transaction    tx;          /* transaction data structure
						* encapsulating data, bitmap, 
						* and bat writes */
	struct vhd_req_list       queue;       /* data writes waiting for next
						* transaction */
	struct vhd_req_list       waiting;     /* pending requests that cannot
					        * be serviced until this bitmap
					        * is read from disk */
	struct vhd_request        req;
};

struct vhd_state {
	vhd_flag_t                flags;

        /* VHD stuff */
	vhd_context_t             vhd;
	uint32_t                  spp;         /* sectors per page */
	uint32_t                  spb;         /* sectors per block */
	uint64_t                  first_db;    /* pointer to datablock 0 */

	/**
	 * Pointer to the next (unallocated) datablock. If greater than UINT_MAX,
	 * there are no more blocks available.
	 */
	uint64_t                  next_db;

	struct vhd_bat_state      bat;

	uint64_t                  bm_lru;      /* lru sequence number */
	uint32_t                  bm_secs;     /* size of bitmap, in sectors */
	struct vhd_bitmap        *bitmap[VHD_CACHE_SIZE];

	int                       bm_free_count;
	struct vhd_bitmap        *bitmap_free[VHD_CACHE_SIZE];
	struct vhd_bitmap         bitmap_list[VHD_CACHE_SIZE];

	int                       vreq_free_count;
	struct vhd_request       *vreq_free[VHD_REQS_DATA];
	struct vhd_request        vreq_list[VHD_REQS_DATA];

	/* for redundant bitmap writes */
	int                       padbm_size;
	char                     *padbm_buf;
	long int                  debug_skipped_redundant_writes;
	long int                  debug_done_redundant_writes;

	td_driver_t              *driver;

	uint64_t                  queued;
	uint64_t                  completed;
	uint64_t                  returned;
	uint64_t                  reads;
	uint64_t                  read_size;
	uint64_t                  writes;
	uint64_t                  write_size;
};

#define test_vhd_flag(word, flag)  ((word) & (flag))
#define set_vhd_flag(word, flag)   ((word) |= (flag))
#define clear_vhd_flag(word, flag) ((word) &= ~(flag))

#define bat_entry(s, blk)          ((s)->bat.bat.bat[(blk)])

static void vhd_complete(void *, struct tiocb *, int);
static void finish_data_transaction(struct vhd_state *, struct vhd_bitmap *);

static struct vhd_state  *_vhd_master;
static unsigned long      _vhd_zsize;
static char              *_vhd_zeros = NULL;
int                       _dev_zero = -1;

static int
vhd_initialize(struct vhd_state *s)
{
	int err;

	if (_vhd_zeros)
		return 0;

	_vhd_zsize = 2 * getpagesize();
	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_PREALLOCATE))
		_vhd_zsize += VHD_BLOCK_SIZE;

	_dev_zero = open("/dev/zero", O_RDONLY);
	if (unlikely(_dev_zero == -1)) {
		err = errno;
		EPRINTF("failed to open /dev/zero: %s\n", strerror(err));
		return -err;
	}

	_vhd_zeros = mmap(NULL, _vhd_zsize, PROT_READ,
			  MAP_SHARED, _dev_zero, 0);
	if (_vhd_zeros == MAP_FAILED) {
		int _err;
		err = errno;
		EPRINTF("vhd_initialize failed: %s\n", strerror(err));
		_vhd_zeros = NULL;
		_vhd_zsize = 0;
		_err = close(_dev_zero);
		if (unlikely(_err == -1))
			EPRINTF("failed to close /dev/zero: %s (error ignored)\n",
					strerror(errno));
		else
			_dev_zero = -1;

		return -err;
	}

	_vhd_master = s;
	return 0;
}

static void
vhd_free(struct vhd_state *s)
{
	if (_vhd_master != s || !_vhd_zeros)
		return;

	free(s->padbm_buf);
	munmap(_vhd_zeros, _vhd_zsize);
	_vhd_zsize  = 0;
	_vhd_zeros  = NULL;
	_vhd_master = NULL;
	if (_dev_zero != -1) {
		int _err = close(_dev_zero);
		if (unlikely(_err == -1))
			EPRINTF("failed to close /dev/zero: %s (error ignored)\n",
					strerror(errno));
		else
			_dev_zero = -1;
	}
}

static char *
_get_vhd_zeros(const char *func, unsigned long size)
{
	if (!_vhd_zeros || _vhd_zsize < size) {
		EPRINTF("invalid zero request from %s: %lu, %lu, %p\n",
			func, size, _vhd_zsize, _vhd_zeros);
		ASSERT(0);
	}

	return _vhd_zeros;
}

#define vhd_zeros(size)	_get_vhd_zeros(__func__, size)

static inline void
set_batmap(struct vhd_state *s, uint32_t blk)
{
	if (s->bat.batmap.map) {
		vhd_batmap_set(&s->vhd, &s->bat.batmap, blk);
		DBG(TLOG_DBG, "block 0x%x completely full\n", blk);
	}
}

static inline int
test_batmap(struct vhd_state *s, uint32_t blk)
{
	if (!s->bat.batmap.map)
		return 0;
	return vhd_batmap_test(&s->vhd, &s->bat.batmap, blk);
}

static int
vhd_kill_footer(struct vhd_state *s)
{
	int err;
	off64_t end;
	void *zeros;

	if (s->vhd.footer.type == HD_TYPE_FIXED)
		return 0;

	err = posix_memalign(&zeros, 512, 512);
	if (err)
		return -err;

	err = 1;
	memset(zeros, 0xc7c7c7c7, 512);

	if ((end = lseek64(s->vhd.fd, 0, SEEK_END)) == -1)
		goto fail;

	if (lseek64(s->vhd.fd, (end - 512), SEEK_SET) == -1)
		goto fail;

	if (write(s->vhd.fd, zeros, 512) != 512)
		goto fail;

	err = 0;

 fail:
	free(zeros);
	if (err)
		return (errno ? -errno : -EIO);
	return 0;
}

static inline int
find_next_free_block(struct vhd_state *s)
{
	int err;
	off64_t eom;
	uint32_t i, entry;

	err = vhd_end_of_headers(&s->vhd, &eom);
	if (err)
		return err;

	s->next_db = secs_round_up(eom);
	s->first_db = s->next_db;
	if ((s->first_db + s->bm_secs) % s->spp)
		s->first_db += (s->spp - ((s->first_db + s->bm_secs) % s->spp));

	for (i = 0; i < s->bat.bat.entries; i++) {
		entry = bat_entry(s, i);
		if (entry != DD_BLK_UNUSED && entry >= s->next_db)
			s->next_db = (uint64_t)entry + (uint64_t)s->spb
				+ (uint64_t)s->bm_secs;
			if (s->next_db > UINT_MAX)
				break;
	}

	return 0;
}

static void
vhd_free_bat(struct vhd_state *s)
{
	free(s->bat.bat.bat);
	free(s->bat.batmap.map);
	free(s->bat.bat_buf);
	memset(&s->bat, 0, sizeof(struct vhd_bat));
}

static int
vhd_initialize_bat(struct vhd_state *s)
{
	int err, batmap_required, i;
	void *buf;

	memset(&s->bat, 0, sizeof(struct vhd_bat));

	err = vhd_read_bat(&s->vhd, &s->bat.bat);
	if (err) {
		EPRINTF("%s: reading bat: %d\n", s->vhd.file, err);
		return err;
	}

	batmap_required = 1;
	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_RDONLY)) {
		batmap_required = 0;
	} else {
		err = find_next_free_block(s);
		if (err)
			goto fail;
	}

	if (vhd_has_batmap(&s->vhd)) {
		for (i = 0; i < VHD_BATMAP_MAX_RETRIES; i++) {
			err = vhd_read_batmap(&s->vhd, &s->bat.batmap);
			if (err) {
				EPRINTF("%s: reading batmap: %d\n",
						s->vhd.file, err);
				if (batmap_required)
					goto fail;
			} else {
				break;
			}
		}
		if (err)
			EPRINTF("%s: ignoring non-critical batmap error\n",
					s->vhd.file);
	}

	err = posix_memalign(&buf, VHD_SECTOR_SIZE, VHD_SECTOR_SIZE);
	if (err)
		goto fail;

	s->bat.bat_buf = buf;

	return 0;

fail:
	vhd_free_bat(s);
	return err;
}

static void
vhd_free_bitmap_cache(struct vhd_state *s)
{
	int i;
	struct vhd_bitmap *bm;

	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		bm = s->bitmap_list + i;
		free(bm->map);
		free(bm->shadow);
		s->bitmap_free[i] = NULL;
	}

	memset(s->bitmap_list, 0, sizeof(struct vhd_bitmap) * VHD_CACHE_SIZE);
}

static int
vhd_initialize_bitmap_cache(struct vhd_state *s)
{
	int i, err, map_size;
	struct vhd_bitmap *bm;
	void *map, *shadow;

	memset(s->bitmap_list, 0, sizeof(struct vhd_bitmap) * VHD_CACHE_SIZE);

	s->bm_lru        = 0;
	map_size         = vhd_sectors_to_bytes(s->bm_secs);
	s->bm_free_count = VHD_CACHE_SIZE;

	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		bm = s->bitmap_list + i;

		err = posix_memalign(&map, 512, map_size);
		if (err)
			goto fail;

		bm->map = map;

		err = posix_memalign(&shadow, 512, map_size);
		if (err)
			goto fail;

		bm->shadow = shadow;

		memset(bm->map, 0, map_size);
		memset(bm->shadow, 0, map_size);
		s->bitmap_free[i] = bm;
	}

	return 0;

fail:
	vhd_free_bitmap_cache(s);
	return err;
}

static int
vhd_initialize_dynamic_disk(struct vhd_state *s)
{
	uint32_t bm_size;
	void *buf;
	int err;

	err = vhd_get_header(&s->vhd);
	if (err) {
		if (!test_vhd_flag(s->flags, VHD_FLAG_OPEN_QUIET))
			EPRINTF("Error reading VHD DD header.\n");
		return err;
	}

	if (s->vhd.header.hdr_ver != 0x00010000) {
		EPRINTF("unsupported header version! (0x%x)\n",
			s->vhd.header.hdr_ver);
		return -EINVAL;
	}

	s->spp     = getpagesize() >> VHD_SECTOR_SHIFT;
	s->spb     = s->vhd.header.block_size >> VHD_SECTOR_SHIFT;
	s->bm_secs = secs_round_up_no_zero(s->spb >> 3);

	s->padbm_size = (s->bm_secs / getpagesize()) * getpagesize();
	if (s->bm_secs % getpagesize())
		s->padbm_size += getpagesize();

	err = posix_memalign(&buf, 512, s->padbm_size);
	if (err)
		return -err;

	s->padbm_buf = buf;
	bm_size = s->bm_secs << VHD_SECTOR_SHIFT;
	memset(s->padbm_buf, 0, s->padbm_size - bm_size);
	memset(s->padbm_buf + (s->padbm_size - bm_size), ~0, bm_size);
	s->debug_skipped_redundant_writes = 0;
	s->debug_done_redundant_writes = 0;

	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_NO_CACHE))
		return 0;

	err = vhd_initialize_bat(s);
	if (err)
		return err;

	err = vhd_initialize_bitmap_cache(s);
	if (err) {
		vhd_free_bat(s);
		return err;
	}

	return 0;
}

static int
vhd_check_version(struct vhd_state *s)
{
	if (strncmp(s->vhd.footer.crtr_app, "tap", 3))
		return 0;

	if (s->vhd.footer.crtr_ver > VHD_CURRENT_VERSION) {
		if (!test_vhd_flag(s->flags, VHD_FLAG_OPEN_QUIET))
			EPRINTF("WARNING: %s vhd creator version 0x%08x, "
				"but only versions up to 0x%08x are "
				"supported for IO\n", s->vhd.file,
				s->vhd.footer.crtr_ver, VHD_CURRENT_VERSION);

		return -EINVAL;
	}

	return 0;
}

static void
vhd_log_open(struct vhd_state *s)
{
	char buf[5];
	uint32_t i, allocated, full;

	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_QUIET))
		return;

	snprintf(buf, sizeof(buf), "%s", s->vhd.footer.crtr_app);
	if (!vhd_type_dynamic(&s->vhd)) {
		DPRINTF("%s version: %s 0x%08x\n",
			s->vhd.file, buf, s->vhd.footer.crtr_ver);
		return;
	}

	allocated = 0;
	full      = 0;

	for (i = 0; i < s->bat.bat.entries; i++) {
		if (bat_entry(s, i) != DD_BLK_UNUSED)
			allocated++;
		if (test_batmap(s, i))
			full++;
	}

	DPRINTF("%s version: %s 0x%08x, b: %u, a: %u, f: %u, n: %"PRIu64"\n",
		s->vhd.file, buf, s->vhd.footer.crtr_ver, s->bat.bat.entries,
		allocated, full, s->next_db);
}

static int
__vhd_open(td_driver_t *driver, const char *name, vhd_flag_t flags)
{
        int i, o_flags, err;
	struct vhd_state *s;

        DBG(TLOG_INFO, "vhd_open: %s\n", name);
	if (test_vhd_flag(flags, VHD_FLAG_OPEN_STRICT))
		libvhd_set_log_level(1);

	s = (struct vhd_state *)driver->data;
	memset(s, 0, sizeof(struct vhd_state));

	s->flags  = flags;
	s->driver = driver;

	err = vhd_initialize(s);
	if (err)
		return err;

	o_flags = ((test_vhd_flag(flags, VHD_FLAG_OPEN_RDONLY)) ? 
		   VHD_OPEN_RDONLY : VHD_OPEN_RDWR);
	if ((test_vhd_flag(flags, VHD_FLAG_OPEN_RDONLY) ||
                test_vhd_flag(flags, VHD_FLAG_OPEN_LOCAL_CACHE)) &&
	    test_vhd_flag(flags, VHD_FLAG_OPEN_NO_O_DIRECT))
		set_vhd_flag(o_flags, VHD_OPEN_CACHED);

	if (test_vhd_flag(flags, VHD_FLAG_OPEN_STRICT))
		set_vhd_flag(o_flags, VHD_OPEN_STRICT);

	err = vhd_open(&s->vhd, name, o_flags);
	if (err) {
		libvhd_set_log_level(1);
		err = vhd_open(&s->vhd, name, o_flags);
		if (err) {
			EPRINTF("Unable to open [%s] (%d)!\n", name, err);
			return err;
		}
	}

	err = vhd_check_version(s);
	if (err)
		goto fail;

	s->spb = s->spp = 1;

	if (vhd_type_dynamic(&s->vhd)) {
		err = vhd_initialize_dynamic_disk(s);
		if (err)
			goto fail;
	}

	vhd_log_open(s);

	SPB = s->spb;

	s->vreq_free_count = VHD_REQS_DATA;
	for (i = 0; i < VHD_REQS_DATA; i++)
		s->vreq_free[i] = s->vreq_list + i;

	driver->info.size        = s->vhd.footer.curr_size >> VHD_SECTOR_SHIFT;
	driver->info.sector_size = VHD_SECTOR_SIZE;
	driver->info.info        = 0;

        DBG(TLOG_INFO, "vhd_open: done (sz:%"PRIu64", sct:%lu, inf:%u)\n",
	    driver->info.size, driver->info.sector_size, driver->info.info);

	if (test_vhd_flag(flags, VHD_FLAG_OPEN_STRICT) && 
	    !test_vhd_flag(flags, VHD_FLAG_OPEN_RDONLY)) {
		err = vhd_kill_footer(s);
		if (err) {
			DPRINTF("ERROR killing footer: %d\n", err);
			goto fail;
		}
		s->writes++;
	}

        return 0;

 fail:
	vhd_free_bat(s);
	vhd_free_bitmap_cache(s);
	vhd_close(&s->vhd);
	vhd_free(s);
	return err;
}

static int
_vhd_open(td_driver_t *driver, const char *name, td_flag_t flags)
{
	vhd_flag_t vhd_flags = 0;

	if (flags & TD_OPEN_RDONLY)
		vhd_flags |= VHD_FLAG_OPEN_RDONLY;
	if (flags & TD_OPEN_NO_O_DIRECT)
		vhd_flags |= VHD_FLAG_OPEN_NO_O_DIRECT;
	if (flags & TD_OPEN_QUIET)
		vhd_flags |= VHD_FLAG_OPEN_QUIET;
	if (flags & TD_OPEN_STRICT)
		vhd_flags |= VHD_FLAG_OPEN_STRICT;
	if (flags & TD_OPEN_QUERY)
		vhd_flags |= (VHD_FLAG_OPEN_QUERY  |
			      VHD_FLAG_OPEN_QUIET  |
			      VHD_FLAG_OPEN_RDONLY |
			      VHD_FLAG_OPEN_NO_CACHE);
    if (flags & TD_OPEN_LOCAL_CACHE)
        vhd_flags |= VHD_FLAG_OPEN_LOCAL_CACHE;

	/* pre-allocate for all but NFS and LVM storage */
	driver->storage = tapdisk_storage_type(name);

	if (driver->storage != TAPDISK_STORAGE_TYPE_NFS &&
	    driver->storage != TAPDISK_STORAGE_TYPE_LVM)
		vhd_flags |= VHD_FLAG_OPEN_PREALLOCATE;

	return __vhd_open(driver, name, vhd_flags);
}

static void
vhd_log_close(struct vhd_state *s)
{
	uint32_t i, allocated, full;

	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_QUIET))
		return;

	allocated = 0;
	full      = 0;

	for (i = 0; i < s->bat.bat.entries; i++) {
		if (bat_entry(s, i) != DD_BLK_UNUSED)
			allocated++;
		if (test_batmap(s, i))
			full++;
	}

	DPRINTF("%s: b: %u, a: %u, f: %u, n: %"PRIu64"\n",
		s->vhd.file, s->bat.bat.entries, allocated, full, s->next_db);
}

static int
_vhd_close(td_driver_t *driver)
{
	int err;
	struct vhd_state *s;
	
	DBG(TLOG_WARN, "vhd_close\n");
	s = (struct vhd_state *)driver->data;

	DPRINTF("gaps written/skipped: %ld/%ld\n", 
			s->debug_done_redundant_writes,
			s->debug_skipped_redundant_writes);

	/* don't write footer if tapdisk is read-only */
	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_RDONLY))
		goto free;
	
	/* 
	 * write footer if:
	 *   - we killed it on open (opened with strict) 
	 *   - we've written data since opening
	 */
	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_STRICT) || s->writes) {
		memcpy(&s->vhd.bat, &s->bat.bat, sizeof(vhd_bat_t));
		err = vhd_write_footer(&s->vhd, &s->vhd.footer);
		memset(&s->vhd.bat, 0, sizeof(vhd_bat_t));

		if (err)
			EPRINTF("writing %s footer: %d\n", s->vhd.file, err);

		if (!vhd_has_batmap(&s->vhd))
			goto free;

		err = vhd_write_batmap(&s->vhd, &s->bat.batmap);
		if (err)
			EPRINTF("writing %s batmap: %d\n", s->vhd.file, err);
	}

 free:
	vhd_log_close(s);
	vhd_free_bat(s);
	vhd_free_bitmap_cache(s);
	vhd_close(&s->vhd);
	vhd_free(s);

	memset(s, 0, sizeof(struct vhd_state));

	return 0;
}

int
vhd_validate_parent(td_driver_t *child_driver,
		    td_driver_t *parent_driver, td_flag_t flags)
{
	struct vhd_state *child  = (struct vhd_state *)child_driver->data;
	struct vhd_state *parent;

	if (parent_driver->type != DISK_TYPE_VHD) {
		if (child_driver->type != DISK_TYPE_VHD)
			return -EINVAL;
		if (child->vhd.footer.type != HD_TYPE_DIFF)
			return -EINVAL;
		if (!vhd_parent_raw(&child->vhd))
			return -EINVAL;
		return 0;
	}

	parent = (struct vhd_state *)parent_driver->data;

	/* 
	 * This check removed because of cases like:
	 *   - parent VHD marked as 'hidden'
	 *   - parent VHD modified during coalesce
	 */
	/*
	if (stat(parent->vhd.file, &stats)) {
		DPRINTF("ERROR stating parent file %s\n", parent->vhd.file);
		return -errno;
	}

	if (child->hdr.prt_ts != vhd_time(stats.st_mtime)) {
		DPRINTF("ERROR: parent file has been modified since "
			"snapshot.  Child image no longer valid.\n");
		return -EINVAL;
	}
	*/

	if (uuid_compare(child->vhd.header.prt_uuid, parent->vhd.footer.uuid)) {
		DPRINTF("ERROR: %s: %s, %s: parent uuid has changed since "
			"snapshot.  Child image no longer valid.\n",
			__func__, child->vhd.file, parent->vhd.file);
		return -EINVAL;
	}

	/* TODO: compare sizes */
	
	return 0;
}

int
vhd_get_parent_id(td_driver_t *driver, td_disk_id_t *id)
{
	int err;
	char *parent;
	struct vhd_state *s;
	int flags;

	DBG(TLOG_DBG, "\n");
	flags = id->flags;
	memset(id, 0, sizeof(td_disk_id_t));

	s = (struct vhd_state *)driver->data;

	if (s->vhd.footer.type != HD_TYPE_DIFF)
		return TD_NO_PARENT;

	err = vhd_parent_locator_get(&s->vhd, &parent);
	if (err)
		return err;

	id->name   = parent;
	id->type   = vhd_parent_raw(&s->vhd) ? DISK_TYPE_AIO : DISK_TYPE_VHD;
	id->flags  = flags|TD_OPEN_SHAREABLE|TD_OPEN_RDONLY;

	return 0;
}

static inline void
clear_req_list(struct vhd_req_list *list)
{
	list->head = list->tail = NULL;
}

static inline void
add_to_tail(struct vhd_req_list *list, struct vhd_request *e)
{
	if (!list->head) 
		list->head = list->tail = e;
	else 
		list->tail = list->tail->next = e;
}

static inline int
remove_from_req_list(struct vhd_req_list *list, struct vhd_request *e)
{
	struct vhd_request *i = list->head;

	if (list->head == e) {
		if (list->tail == e)
			clear_req_list(list);
		else
			list->head = list->head->next;
		return 0;
	}

	while (i->next) {
		if (i->next == e) {
			if (list->tail == e) {
				i->next = NULL;
				list->tail = i;
			} else
				i->next = i->next->next;
			return 0;
		}
		i = i->next;
	}

	return -EINVAL;
}

static inline void
init_vhd_request(struct vhd_state *s, struct vhd_request *req)
{
	memset(req, 0, sizeof(struct vhd_request));
	req->state = s;
}

static inline void
init_tx(struct vhd_transaction *tx)
{
	memset(tx, 0, sizeof(struct vhd_transaction));
}

static inline void
add_to_transaction(struct vhd_transaction *tx, struct vhd_request *r)
{
	ASSERT(!tx->closed);

	r->tx = tx;
	tx->started++;
	add_to_tail(&tx->requests, r);
	set_vhd_flag(tx->status, VHD_FLAG_TX_LIVE);

	DBG(TLOG_DBG, "blk: 0x%04"PRIx64", lsec: 0x%08"PRIx64", tx: %p, "
	    "started: %d, finished: %d, status: %u\n",
	    r->treq.sec / SPB, r->treq.sec, tx,
	    tx->started, tx->finished, tx->status);
}

static inline int
transaction_completed(struct vhd_transaction *tx)
{
	return (tx->started == tx->finished);
}

static inline void
init_bat(struct vhd_state *s)
{
	s->bat.req.tx     = NULL;
	s->bat.req.next   = NULL;
	s->bat.req.error  = 0;
	s->bat.pbw_blk    = 0;
	s->bat.pbw_offset = 0;
	s->bat.status     = 0;
}

static inline void
lock_bat(struct vhd_state *s)
{
	set_vhd_flag(s->bat.status, VHD_FLAG_BAT_LOCKED);
}

static inline void
unlock_bat(struct vhd_state *s)
{
	clear_vhd_flag(s->bat.status, VHD_FLAG_BAT_LOCKED);
}

static inline int
bat_locked(struct vhd_state *s)
{
	return test_vhd_flag(s->bat.status, VHD_FLAG_BAT_LOCKED);
}

static inline void
init_vhd_bitmap(struct vhd_state *s, struct vhd_bitmap *bm)
{
	bm->blk    = 0;
	bm->seqno  = 0;
	bm->status = 0;
	init_tx(&bm->tx);
	clear_req_list(&bm->queue);
	clear_req_list(&bm->waiting);
	memset(bm->map, 0, vhd_sectors_to_bytes(s->bm_secs));
	memset(bm->shadow, 0, vhd_sectors_to_bytes(s->bm_secs));
	init_vhd_request(s, &bm->req);
}

static inline struct vhd_bitmap *
get_bitmap(struct vhd_state *s, uint32_t block)
{
	int i;
	struct vhd_bitmap *bm;

	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		bm = s->bitmap[i];
		if (bm && bm->blk == block)
			return bm;
	}

	return NULL;
}

static inline void
lock_bitmap(struct vhd_bitmap *bm)
{
	set_vhd_flag(bm->status, VHD_FLAG_BM_LOCKED);
}

static inline void
unlock_bitmap(struct vhd_bitmap *bm)
{
	clear_vhd_flag(bm->status, VHD_FLAG_BM_LOCKED);
}

static inline int
bitmap_locked(struct vhd_bitmap *bm)
{
	return test_vhd_flag(bm->status, VHD_FLAG_BM_LOCKED);
}

static inline int
bitmap_valid(struct vhd_bitmap *bm)
{
	return !test_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING);
}

static inline int
bitmap_in_use(struct vhd_bitmap *bm)
{
	return (test_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING)  ||
		test_vhd_flag(bm->status, VHD_FLAG_BM_WRITE_PENDING) ||
		test_vhd_flag(bm->tx.status, VHD_FLAG_TX_UPDATE_BAT) ||
		bm->waiting.head || bm->tx.requests.head || bm->queue.head);
}

static inline int
bitmap_full(struct vhd_state *s, struct vhd_bitmap *bm)
{
	int i, n;

	n = s->spb >> 3;
	for (i = 0; i < n; i++)
		if (bm->map[i] != (char)0xFF)
			return 0;

	DBG(TLOG_DBG, "bitmap 0x%04x full\n", bm->blk);
	return 1;
}

static struct vhd_bitmap *
remove_lru_bitmap(struct vhd_state *s)
{
	int i, idx = 0;
	uint64_t seq = s->bm_lru;
	struct vhd_bitmap *bm, *lru = NULL;

	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		bm = s->bitmap[i];
		if (bm && bm->seqno < seq && !bitmap_locked(bm)) {
			idx = i;
			lru = bm;
			seq = lru->seqno;
		}
	}

	if (lru) {
		s->bitmap[idx] = NULL;
		ASSERT(!bitmap_in_use(lru));
	}

	return  lru;
}

static int
alloc_vhd_bitmap(struct vhd_state *s, struct vhd_bitmap **bitmap, uint32_t blk)
{
	struct vhd_bitmap *bm;
	
	*bitmap = NULL;

	if (s->bm_free_count > 0) {
		bm = s->bitmap_free[--s->bm_free_count];
	} else {
		bm = remove_lru_bitmap(s);
		if (!bm)
			return -EBUSY;
	}

	init_vhd_bitmap(s, bm);
	bm->blk = blk;
	*bitmap = bm;

	return 0;
}

static inline uint64_t
__bitmap_lru_seqno(struct vhd_state *s)
{
	int i;
	struct vhd_bitmap *bm;

	if (s->bm_lru == 0xffffffff) {
		s->bm_lru = 0;
		for (i = 0; i < VHD_CACHE_SIZE; i++) {
			bm = s->bitmap[i];
			if (bm) {
				bm->seqno >>= 1;
				if (bm->seqno > s->bm_lru)
					s->bm_lru = bm->seqno;
			}
		}
	}

	return ++s->bm_lru;
}

static inline void
touch_bitmap(struct vhd_state *s, struct vhd_bitmap *bm)
{
	bm->seqno = __bitmap_lru_seqno(s);
}

static inline void
install_bitmap(struct vhd_state *s, struct vhd_bitmap *bm)
{
	int i;
	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		if (!s->bitmap[i]) {
			touch_bitmap(s, bm);
			s->bitmap[i] = bm;
			return;
		}
	}

	ASSERT(0);
}

static inline void
free_vhd_bitmap(struct vhd_state *s, struct vhd_bitmap *bm)
{
	int i;

	for (i = 0; i < VHD_CACHE_SIZE; i++)
		if (s->bitmap[i] == bm)
			break;

	ASSERT(!bitmap_locked(bm));
	ASSERT(!bitmap_in_use(bm));
	ASSERT(i < VHD_CACHE_SIZE);

	s->bitmap[i] = NULL;
	s->bitmap_free[s->bm_free_count++] = bm;
}

static int
read_bitmap_cache(struct vhd_state *s, uint64_t sector, uint8_t op)
{
	uint32_t blk, sec;
	struct vhd_bitmap *bm;

	/* in fixed disks, every block is present */
	if (s->vhd.footer.type == HD_TYPE_FIXED) 
		return VHD_BM_BIT_SET;

	/* the extent the logical sector falls in */
	blk = sector / s->spb;

	/* offset within the extent the logical sector is located */
	sec = sector % s->spb;

	if (blk > s->vhd.header.max_bat_size) {
		DPRINTF("ERROR: sec %"PRIu64" out of range, op = %d\n",
			sector, op);
		return -EINVAL;
	}

	if (bat_entry(s, blk) == DD_BLK_UNUSED) {
		if (op == VHD_OP_DATA_WRITE &&
		    s->bat.pbw_blk != blk && bat_locked(s))
			return VHD_BM_BAT_LOCKED;

		return VHD_BM_BAT_CLEAR;
	}

	if (test_batmap(s, blk)) {
		DBG(TLOG_DBG, "batmap set for 0x%04x\n", blk);
		return VHD_BM_BIT_SET;
	}

	bm = get_bitmap(s, blk);
	if (!bm)
		return VHD_BM_NOT_CACHED;

	/* bump lru count */
	touch_bitmap(s, bm);

	if (test_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING))
		return VHD_BM_READ_PENDING;

	return ((vhd_bitmap_test(&s->vhd, bm->map, sec)) ? 
		VHD_BM_BIT_SET : VHD_BM_BIT_CLEAR);
}

static int
read_bitmap_cache_span(struct vhd_state *s, 
		       uint64_t sector, int nr_secs, int value)
{
	int ret;
	uint32_t blk, sec;
	struct vhd_bitmap *bm;

	/* in fixed disks, every block is present */
	if (s->vhd.footer.type == HD_TYPE_FIXED) 
		return nr_secs;

	sec = sector % s->spb;
	blk = sector / s->spb;

	if (test_batmap(s, blk))
		return MIN(nr_secs, s->spb - sec);

	bm  = get_bitmap(s, blk);
	
	ASSERT(bm && bitmap_valid(bm));

	for (ret = 0; sec < s->spb && ret < nr_secs; sec++, ret++)
		if (vhd_bitmap_test(&s->vhd, bm->map, sec) != value)
			break;

	return ret;
}

static inline struct vhd_request *
alloc_vhd_request(struct vhd_state *s)
{
	struct vhd_request *req = NULL;
	
	if (s->vreq_free_count > 0) {
		req = s->vreq_free[--s->vreq_free_count];
		ASSERT(req->treq.secs == 0);
		init_vhd_request(s, req);
		return req;
	}

	return NULL;
}

static inline void
free_vhd_request(struct vhd_state *s, struct vhd_request *req)
{
	memset(req, 0, sizeof(struct vhd_request));
	s->vreq_free[s->vreq_free_count++] = req;
}

static inline void
aio_read(struct vhd_state *s, struct vhd_request *req, uint64_t offset)
{
	struct tiocb *tiocb = &req->tiocb;

	td_prep_read(tiocb, s->vhd.fd, req->treq.buf,
		     vhd_sectors_to_bytes(req->treq.secs),
		     offset, vhd_complete, req);
	td_queue_tiocb(s->driver, tiocb);

	s->queued++;
	s->reads++;
	s->read_size += req->treq.secs;
	TRACE(s);
}

static inline void
aio_write(struct vhd_state *s, struct vhd_request *req, uint64_t offset)
{
	struct tiocb *tiocb = &req->tiocb;

	td_prep_write(tiocb, s->vhd.fd, req->treq.buf,
		      vhd_sectors_to_bytes(req->treq.secs),
		      offset, vhd_complete, req);
	td_queue_tiocb(s->driver, tiocb);

	s->queued++;
	s->writes++;
	s->write_size += req->treq.secs;
	TRACE(s);
}

/**
 * Reserves a new extent.
 *
 * @returns a 64-bit unsigned integer where the error code is stored in the
 * upper 32 bits and the reserved block number is stored in the lower 32 bits.
 * If an error is returned (the upper 32 bits are not zero), the lower 32 bits
 * are undefined.
 */
static inline uint64_t
reserve_new_block(struct vhd_state *s, uint32_t blk)
{
	int gap = 0;

	ASSERT(!test_vhd_flag(s->bat.status, VHD_FLAG_BAT_WRITE_STARTED));

	/* data region of segment should begin on page boundary */
	if ((s->next_db + s->bm_secs) % s->spp)
		gap = (s->spp - ((s->next_db + s->bm_secs) % s->spp));

	if (s->next_db + gap > UINT_MAX)
		return (uint64_t)ENOSPC << 32;

	s->bat.pbw_blk    = blk;
	s->bat.pbw_offset = s->next_db + gap;

	return s->next_db;
}

static int
schedule_bat_write(struct vhd_state *s)
{
	int i;
	uint32_t blk;
	char *buf;
	uint64_t offset;
	struct vhd_request *req;

	ASSERT(bat_locked(s));

	req = &s->bat.req;
	buf = s->bat.bat_buf;
	blk = s->bat.pbw_blk;

	init_vhd_request(s, req);
	memcpy(buf, &bat_entry(s, blk - (blk % 128)), 512);

	((uint32_t *)buf)[blk % 128] = s->bat.pbw_offset;

	for (i = 0; i < 128; i++)
		BE32_OUT(&((uint32_t *)buf)[i]);

	offset         = s->vhd.header.table_offset + (blk - (blk % 128)) * 4;
	req->treq.secs = 1;
	req->treq.buf  = buf;
	req->op        = VHD_OP_BAT_WRITE;
	req->next      = NULL;

	aio_write(s, req, offset);
	set_vhd_flag(s->bat.status, VHD_FLAG_BAT_WRITE_STARTED);

	DBG(TLOG_DBG, "blk: 0x%04x, pbwo: 0x%08"PRIx64", "
	    "table_offset: 0x%08"PRIx64"\n", blk, s->bat.pbw_offset, offset);

	return 0;
}

static void
schedule_zero_bm_write(struct vhd_state *s,
		       struct vhd_bitmap *bm, uint64_t lb_end)
{
	uint64_t offset;
	struct vhd_request *req = &s->bat.zero_req;

	init_vhd_request(s, req);

	offset         = vhd_sectors_to_bytes(lb_end);
	req->op        = VHD_OP_ZERO_BM_WRITE;
	req->treq.sec  = s->bat.pbw_blk * s->spb;
	req->treq.secs = (s->bat.pbw_offset - lb_end) + s->bm_secs;
	req->treq.buf  = vhd_zeros(vhd_sectors_to_bytes(req->treq.secs));
	req->next      = NULL;

	DBG(TLOG_DBG, "blk: 0x%04x, writing zero bitmap at 0x%08"PRIx64"\n",
	    s->bat.pbw_blk, offset);

	lock_bitmap(bm);
	add_to_transaction(&bm->tx, req);
	aio_write(s, req, offset);
}

/* This is a performance optimization. When writing sequentially into full 
 * blocks, skipping (up-to-date) bitmaps causes an approx. 25% reduction in 
 * throughput. To prevent skipping, we issue redundant writes into the (padded) 
 * bitmap area just to make all writes sequential. This will help VHDs on raw 
 * block devices, while the FS-based VHDs shouldn't suffer much.
 *
 * Note that it only makes sense to perform this reduntant bitmap write if the 
 * block is completely full (i.e. the batmap entry is set). If the block is not 
 * completely full then one of the following two things will be true:
 *  1. we'll either be allocating new sectors in this block and writing its
 *     bitmap transactionally, which will be slow anyways; or
 *  2. the IO will be skipping over the unallocated sectors again, so the
 *     pattern will not be sequential anyways
 * In either case a redundant bitmap write becomes pointless. This fact 
 * simplifies the implementation of redundant writes: since we know the bitmap 
 * cannot be updated by anyone else, we don't have to worry about transactions 
 * or potential write conflicts.
 * */
static void
schedule_redundant_bm_write(struct vhd_state *s, uint32_t blk)
{
	uint64_t offset;
	struct vhd_request *req;

	ASSERT(s->vhd.footer.type != HD_TYPE_FIXED);
	ASSERT(test_batmap(s, blk));

	req = alloc_vhd_request(s);
	if (!req) 
		return;

	req->treq.buf = s->padbm_buf;

	offset = bat_entry(s, blk);
	ASSERT(offset != DD_BLK_UNUSED);
	offset <<= VHD_SECTOR_SHIFT;
	offset -= s->padbm_size - (s->bm_secs << VHD_SECTOR_SHIFT);

	req->op        = VHD_OP_REDUNDANT_BM_WRITE;
	req->treq.sec  = blk * s->spb;
	req->treq.secs = s->padbm_size >> VHD_SECTOR_SHIFT;
	req->next      = NULL;

	DBG(TLOG_DBG, "blk: %u, writing redundant bitmap at %" PRIu64 "\n",
	    blk, offset);

	aio_write(s, req, offset);
}

static int
update_bat(struct vhd_state *s, uint32_t blk)
{
	int err;
	uint64_t lb_end;
	struct vhd_bitmap *bm;

	ASSERT(bat_entry(s, blk) == DD_BLK_UNUSED);
	
	if (bat_locked(s)) {
		ASSERT(s->bat.pbw_blk == blk);
		return 0;
	}

	/* empty bitmap could already be in
	 * cache if earlier bat update failed */
	bm = get_bitmap(s, blk);
	if (!bm) {
		/* install empty bitmap in cache */
		err = alloc_vhd_bitmap(s, &bm, blk);
		if (err) 
			return err;

		install_bitmap(s, bm);
	}

	lock_bat(s);
	lb_end = reserve_new_block(s, blk);
	if (lb_end >> 32) {
		unlock_bat(s);
		return -(lb_end >> 32);
	}
	schedule_zero_bm_write(s, bm, lb_end);
	set_vhd_flag(bm->tx.status, VHD_FLAG_TX_UPDATE_BAT);

	return 0;
}

static int
allocate_block(struct vhd_state *s, uint32_t blk)
{
	int err, gap;
	uint64_t offset, size;
	struct vhd_bitmap *bm;
	ssize_t count;
	uint64_t next_db;

	ASSERT(bat_entry(s, blk) == DD_BLK_UNUSED);

	if (bat_locked(s)) {
		ASSERT(s->bat.pbw_blk == blk);
		if (s->bat.req.error)
			return -EBUSY;
		return 0;
	}

	gap     = 0;
	offset  = vhd_sectors_to_bytes(s->next_db);
	next_db = s->next_db;

	/* data region of segment should begin on page boundary */
	if ((next_db + s->bm_secs) % s->spp) {
		gap = (s->spp - ((next_db + s->bm_secs) % s->spp));
		next_db += gap;
	}

	if (next_db > UINT_MAX)
		return -ENOSPC;

	s->next_db = next_db;

	s->bat.pbw_blk = blk;
	s->bat.pbw_offset = s->next_db;

	DBG(TLOG_DBG, "blk: 0x%04x, pbwo: 0x%08"PRIx64"\n",
	    blk, s->bat.pbw_offset);

	if (lseek(s->vhd.fd, offset, SEEK_SET) == (off_t)-1) {
		ERR(s, -errno, "lseek failed\n");
		return -errno;
	}

	size  = vhd_sectors_to_bytes(s->spb + s->bm_secs + gap);
	count = write(s->vhd.fd, vhd_zeros(size), size);
	if (count != size) {
		err = count < 0 ? -errno : -ENOSPC;
		ERR(s, -errno,
		    "write failed (%zd, offset %"PRIu64")\n", count, offset);
		return err;
	}

	/* empty bitmap could already be in
	 * cache if earlier bat update failed */
	bm = get_bitmap(s, blk);
	if (!bm) {
		/* install empty bitmap in cache */
		err = alloc_vhd_bitmap(s, &bm, blk);
		if (err) 
			return err;

		install_bitmap(s, bm);
	}

	lock_bat(s);
	lock_bitmap(bm);
	schedule_bat_write(s);
	add_to_transaction(&bm->tx, &s->bat.req);

	return 0;
}

static int 
schedule_data_read(struct vhd_state *s, td_request_t treq, vhd_flag_t flags)
{
	uint64_t offset;
	uint32_t blk = 0, sec = 0;
	struct vhd_bitmap  *bm;
	struct vhd_request *req;

	if (s->vhd.footer.type == HD_TYPE_FIXED) {
		offset = vhd_sectors_to_bytes(treq.sec);
		goto make_request;
	}

	blk    = treq.sec / s->spb;
	sec    = treq.sec % s->spb;
	bm     = get_bitmap(s, blk);
	offset = bat_entry(s, blk);

	ASSERT(offset != DD_BLK_UNUSED);
	ASSERT(test_batmap(s, blk) || (bm && bitmap_valid(bm)));

	offset += s->bm_secs + sec;
	offset  = vhd_sectors_to_bytes(offset);

 make_request:
	req = alloc_vhd_request(s);
	if (!req) 
		return -EBUSY;

	req->treq  = treq;
	req->flags = flags;
	req->op    = VHD_OP_DATA_READ;
	req->next  = NULL;

	aio_read(s, req, offset);

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", blk: 0x%04x, sec: 0x%04x, "
	    "nr_secs: 0x%04x, offset: 0x%08"PRIx64", flags: 0x%08x, buf: %p\n",
	    s->vhd.file, treq.sec, blk, sec, treq.secs, offset, req->flags,
	    treq.buf);

	return 0;
}

static int
schedule_data_write(struct vhd_state *s, td_request_t treq, vhd_flag_t flags)
{
	int err;
	uint64_t offset;
	uint32_t blk = 0, sec = 0;
	struct vhd_bitmap  *bm = NULL;
	struct vhd_request *req;

	if (s->vhd.footer.type == HD_TYPE_FIXED) {
		offset = vhd_sectors_to_bytes(treq.sec);
		goto make_request;
	}

	blk    = treq.sec / s->spb;
	sec    = treq.sec % s->spb;
	offset = bat_entry(s, blk);

	if (test_vhd_flag(flags, VHD_FLAG_REQ_UPDATE_BAT)) {
		if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_PREALLOCATE))
			err = allocate_block(s, blk);
		else
			err = update_bat(s, blk);

		if (err)
			return err;

		offset = s->bat.pbw_offset;
	}

	offset += s->bm_secs + sec;
	offset  = vhd_sectors_to_bytes(offset);

 make_request:
	req = alloc_vhd_request(s);
	if (!req)
		return -EBUSY;

	req->treq  = treq;
	req->flags = flags;
	req->op    = VHD_OP_DATA_WRITE;
	req->next  = NULL;

	if (test_vhd_flag(flags, VHD_FLAG_REQ_UPDATE_BITMAP)) {
		bm = get_bitmap(s, blk);
		ASSERT(bm && bitmap_valid(bm));
		lock_bitmap(bm);

		if (bm->tx.closed) {
			add_to_tail(&bm->queue, req);
			set_vhd_flag(req->flags, VHD_FLAG_REQ_QUEUED);
		} else
			add_to_transaction(&bm->tx, req);
	} else if (sec == 0 && 	/* first sector inside data block */
		   s->vhd.footer.type != HD_TYPE_FIXED && 
		   bat_entry(s, blk) != s->first_db &&
		   test_batmap(s, blk))
		schedule_redundant_bm_write(s, blk);

	aio_write(s, req, offset);

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", blk: 0x%04x, sec: 0x%04x, "
	    "nr_secs: 0x%04x, offset: 0x%08"PRIx64", flags: 0x%08x\n",
	    s->vhd.file, treq.sec, blk, sec, treq.secs, offset, req->flags);

	return 0;
}

static int 
schedule_bitmap_read(struct vhd_state *s, uint32_t blk)
{
	int err;
	uint64_t offset;
	struct vhd_bitmap  *bm;
	struct vhd_request *req = NULL;

	ASSERT(vhd_type_dynamic(&s->vhd));

	offset = bat_entry(s, blk);

	ASSERT(offset != DD_BLK_UNUSED);
	ASSERT(!get_bitmap(s, blk));

	offset = vhd_sectors_to_bytes(offset);

	err = alloc_vhd_bitmap(s, &bm, blk);
	if (err)
		return err;

	req = &bm->req;
	init_vhd_request(s, req);

	req->treq.sec  = blk * s->spb;
	req->treq.secs = s->bm_secs;
	req->treq.buf  = bm->map;
	req->treq.cb   = NULL;
	req->op        = VHD_OP_BITMAP_READ;
	req->next      = NULL;

	aio_read(s, req, offset);
	lock_bitmap(bm);
	install_bitmap(s, bm);
	set_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING);

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", blk: 0x%04x, nr_secs: 0x%04x, "
	    "offset: 0x%08"PRIx64"\n", s->vhd.file, req->treq.sec, blk,
	    req->treq.secs, offset);

	return 0;
}

static void
schedule_bitmap_write(struct vhd_state *s, uint32_t blk)
{
	uint64_t offset;
	struct vhd_bitmap  *bm;
	struct vhd_request *req;

	bm     = get_bitmap(s, blk);
	offset = bat_entry(s, blk);

	ASSERT(vhd_type_dynamic(&s->vhd));
	ASSERT(bm && bitmap_valid(bm) &&
	       !test_vhd_flag(bm->status, VHD_FLAG_BM_WRITE_PENDING));

	if (offset == DD_BLK_UNUSED) {
		ASSERT(bat_locked(s) && s->bat.pbw_blk == blk);
		offset = s->bat.pbw_offset;
	}
	
	offset = vhd_sectors_to_bytes(offset);

	req = &bm->req;
	init_vhd_request(s, req);

	req->treq.sec  = blk * s->spb;
	req->treq.secs = s->bm_secs;
	req->treq.buf  = bm->shadow;
	req->treq.cb   = NULL;
	req->op        = VHD_OP_BITMAP_WRITE;
	req->next      = NULL;

	aio_write(s, req, offset);
	lock_bitmap(bm);
	touch_bitmap(s, bm);     /* bump lru count */
	set_vhd_flag(bm->status, VHD_FLAG_BM_WRITE_PENDING);

	DBG(TLOG_DBG, "%s: blk: 0x%04x, sec: 0x%08"PRIx64", nr_secs: 0x%04x, "
	    "offset: 0x%"PRIx64"\n", s->vhd.file, blk, req->treq.sec,
	    req->treq.secs, offset);
}

/* 
 * queued requests will be submitted once the bitmap
 * describing them is read and the requests are validated. 
 */
static int
__vhd_queue_request(struct vhd_state *s, uint8_t op, td_request_t treq)
{
	uint32_t blk;
	struct vhd_bitmap  *bm;
	struct vhd_request *req;

	ASSERT(vhd_type_dynamic(&s->vhd));

	blk = treq.sec / s->spb;
	bm  = get_bitmap(s, blk);

	ASSERT(bm && test_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING));

	req = alloc_vhd_request(s);
	if (!req)
		return -EBUSY;

	req->treq = treq;
	req->op   = op;
	req->next = NULL;

	add_to_tail(&bm->waiting, req);
	lock_bitmap(bm);

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", blk: 0x%04x nr_secs: 0x%04x, "
	    "op: %u\n", s->vhd.file, treq.sec, blk, treq.secs, op);

	TRACE(s);
	return 0;
}

static void
vhd_queue_read(td_driver_t *driver, td_request_t treq)
{
	struct vhd_state *s = (struct vhd_state *)driver->data;

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", secs: 0x%04x (seg: %d)\n",
	    s->vhd.file, treq.sec, treq.secs, treq.sidx);

	while (treq.secs) {
		int err;
		td_request_t clone;

		err   = 0;
		clone = treq;

		switch (read_bitmap_cache(s, clone.sec, VHD_OP_DATA_READ)) {
		case -EINVAL:
			err = -EINVAL;
			goto fail;

		case VHD_BM_BAT_CLEAR:
			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			td_forward_request(clone);
			break;

		case VHD_BM_BIT_CLEAR:
			clone.secs = read_bitmap_cache_span(s, clone.sec, clone.secs, 0);
			td_forward_request(clone);
			break;

		case VHD_BM_BIT_SET:
			clone.secs = read_bitmap_cache_span(s, clone.sec, clone.secs, 1);
			err = schedule_data_read(s, clone, 0);
			if (err)
				goto fail;
			break;

		case VHD_BM_NOT_CACHED:
			err = schedule_bitmap_read(s, clone.sec / s->spb);
			if (err)
				goto fail;

			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			err = __vhd_queue_request(s, VHD_OP_DATA_READ, clone);
			if (err)
				goto fail;
			break;

		case VHD_BM_READ_PENDING:
			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			err = __vhd_queue_request(s, VHD_OP_DATA_READ, clone);
			if (err)
				goto fail;
			break;

		case VHD_BM_BAT_LOCKED:
		default:
			ASSERT(0);
			break;
		}

		treq.sec  += clone.secs;
		treq.secs -= clone.secs;
		treq.buf  += vhd_sectors_to_bytes(clone.secs);
		continue;

	fail:
		clone.secs = treq.secs;
		td_complete_request(clone, err);
		break;
	}
}

static void
vhd_queue_write(td_driver_t *driver, td_request_t treq)
{
	struct vhd_state *s = (struct vhd_state *)driver->data;

	DBG(TLOG_DBG, "%s: lsec: 0x%08"PRIx64", secs: 0x%04x, (seg: %d)\n",
	    s->vhd.file, treq.sec, treq.secs, treq.sidx);

	while (treq.secs) {
		int err;
		uint8_t flags;
		td_request_t clone;

		err   = 0;
		flags = 0;
		clone = treq;

		switch (read_bitmap_cache(s, clone.sec, VHD_OP_DATA_WRITE)) {
		case -EINVAL:
			err = -EINVAL;
			goto fail;

		case VHD_BM_BAT_LOCKED:
			err = -EBUSY;
			goto fail;

		case VHD_BM_BAT_CLEAR:
			flags      = (VHD_FLAG_REQ_UPDATE_BAT |
				      VHD_FLAG_REQ_UPDATE_BITMAP);
			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			err        = schedule_data_write(s, clone, flags);
			if (err)
				goto fail;
			break;

		case VHD_BM_BIT_CLEAR:
			flags      = VHD_FLAG_REQ_UPDATE_BITMAP;
			clone.secs = read_bitmap_cache_span(s, clone.sec, clone.secs, 0);
			err        = schedule_data_write(s, clone, flags);
			if (err)
				goto fail;
			break;

		case VHD_BM_BIT_SET:
			clone.secs = read_bitmap_cache_span(s, clone.sec, clone.secs, 1);
			err = schedule_data_write(s, clone, 0);
			if (err)
				goto fail;
			break;

		case VHD_BM_NOT_CACHED:
			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			err = schedule_bitmap_read(s, clone.sec / s->spb);
			if (err)
				goto fail;

			err = __vhd_queue_request(s, VHD_OP_DATA_WRITE, clone);
			if (err)
				goto fail;
			break;

		case VHD_BM_READ_PENDING:
			clone.secs = MIN(clone.secs, s->spb - (clone.sec % s->spb));
			err = __vhd_queue_request(s, VHD_OP_DATA_WRITE, clone);
			if (err)
				goto fail;
			break;

		default:
			ASSERT(0);
			break;
		}

		treq.sec  += clone.secs;
		treq.secs -= clone.secs;
		treq.buf  += vhd_sectors_to_bytes(clone.secs);
		continue;

	fail:
		clone.secs = treq.secs;
		td_complete_request(clone, err);
		break;
	}
}

static inline void
signal_completion(struct vhd_request *list, int error)
{
	struct vhd_state *s;
	struct vhd_request *r, *next;

	if (!list)
		return;

	r = list;
	s = list->state;

	while (r) {
		int err;

		err  = (error ? error : r->error);
		next = r->next;
		td_complete_request(r->treq, err);
		DBG(TLOG_DBG, "lsec: 0x%08"PRIx64", blk: 0x%04"PRIx64", "
		    "err: %d\n", r->treq.sec, r->treq.sec / s->spb, err);
		free_vhd_request(s, r);
		r    = next;

		s->returned++;
		TRACE(s);
	}
}

static void
start_new_bitmap_transaction(struct vhd_state *s, struct vhd_bitmap *bm)
{
	struct vhd_transaction *tx;
	struct vhd_request *r, *next;
	int i;

	if (!bm->queue.head)
		return;

	DBG(TLOG_DBG, "blk: 0x%04x\n", bm->blk);

	r  = bm->queue.head;
	tx = &bm->tx;
	clear_req_list(&bm->queue);

	if (r && bat_entry(s, bm->blk) == DD_BLK_UNUSED)
		tx->error = -EIO;

	while (r) {
		next    = r->next;
		r->next = NULL;
		clear_vhd_flag(r->flags, VHD_FLAG_REQ_QUEUED);

		add_to_transaction(tx, r);
		if (test_vhd_flag(r->flags, VHD_FLAG_REQ_FINISHED)) {
			tx->finished++;
			if (!r->error) {
				uint32_t sec = r->treq.sec % s->spb;
				for (i = 0; i < r->treq.secs; i++)
					vhd_bitmap_set(&s->vhd,
						       bm->shadow, sec + i);
			}
		}
		r = next;
	}

	/* perhaps all the queued writes already completed? */
	if (tx->started && transaction_completed(tx))
		finish_data_transaction(s, bm);
}

static void
finish_bat_transaction(struct vhd_state *s, struct vhd_bitmap *bm)
{
	struct vhd_transaction *tx = &bm->tx;

	if (!bat_locked(s))
		return;

	if (s->bat.pbw_blk != bm->blk)
		return;

	if (!s->bat.req.error)
		goto release;

	if (!test_vhd_flag(tx->status, VHD_FLAG_TX_LIVE))
		goto release;

	tx->closed = 1;
	return;

 release:
	DBG(TLOG_DBG, "blk: 0x%04x\n", bm->blk);
	unlock_bat(s);
	init_bat(s);
}

static void
finish_bitmap_transaction(struct vhd_state *s,
			  struct vhd_bitmap *bm, int error)
{
	int map_size;
	struct vhd_transaction *tx = &bm->tx;

	DBG(TLOG_DBG, "blk: 0x%04x, err: %d\n", bm->blk, error);
	tx->error = (tx->error ? tx->error : error);
	map_size  = vhd_sectors_to_bytes(s->bm_secs);

	if (!test_vhd_flag(s->flags, VHD_FLAG_OPEN_PREALLOCATE)) {
		if (test_vhd_flag(tx->status, VHD_FLAG_TX_UPDATE_BAT)) {
			/* still waiting for bat write */
			ASSERT(bm->blk == s->bat.pbw_blk);
			ASSERT(test_vhd_flag(s->bat.status, 
					     VHD_FLAG_BAT_WRITE_STARTED));
			s->bat.req.tx = tx;
			return;
		}
	}

	if (tx->error) {
		/* undo changes to shadow */
		memcpy(bm->shadow, bm->map, map_size);
	} else {
		/* complete atomic write */
		memcpy(bm->map, bm->shadow, map_size);
		if (!test_batmap(s, bm->blk) && bitmap_full(s, bm))
			set_batmap(s, bm->blk);
	}

	/* transaction done; signal completions */
	signal_completion(tx->requests.head, tx->error);
	init_tx(tx);
	start_new_bitmap_transaction(s, bm);

	if (!bitmap_in_use(bm))
		unlock_bitmap(bm);

	finish_bat_transaction(s, bm);
}

static void
finish_data_transaction(struct vhd_state *s, struct vhd_bitmap *bm)
{
	struct vhd_transaction *tx = &bm->tx;

	DBG(TLOG_DBG, "blk: 0x%04x\n", bm->blk);

	tx->closed = 1;

	if (!tx->error)
		return schedule_bitmap_write(s, bm->blk);

	return finish_bitmap_transaction(s, bm, 0);
}

static void
finish_bat_write(struct vhd_request *req)
{
	struct vhd_bitmap *bm;
	struct vhd_transaction *tx;
	struct vhd_state *s = req->state;

	s->returned++;
	TRACE(s);

	bm = get_bitmap(s, s->bat.pbw_blk);

	DBG(TLOG_DBG, "blk 0x%04x, pbwo: 0x%08"PRIx64", err %d\n",
	    s->bat.pbw_blk, s->bat.pbw_offset, req->error);
	ASSERT(bm && bitmap_valid(bm));
	ASSERT(bat_locked(s) &&
	       test_vhd_flag(s->bat.status, VHD_FLAG_BAT_WRITE_STARTED));

	tx = &bm->tx;
	ASSERT(test_vhd_flag(tx->status, VHD_FLAG_TX_LIVE));

	if (!req->error) {
		bat_entry(s, s->bat.pbw_blk) = s->bat.pbw_offset;
		s->next_db = s->bat.pbw_offset + s->spb + s->bm_secs;
	} else
		tx->error = req->error;

	if (test_vhd_flag(s->flags, VHD_FLAG_OPEN_PREALLOCATE)) {
		tx->finished++;
		remove_from_req_list(&tx->requests, req);
		if (transaction_completed(tx))
			finish_data_transaction(s, bm);
	} else {
		clear_vhd_flag(tx->status, VHD_FLAG_TX_UPDATE_BAT);
		if (s->bat.req.tx)
			finish_bitmap_transaction(s, bm, req->error);
	}

	finish_bat_transaction(s, bm);
}

static void
finish_zero_bm_write(struct vhd_request *req)
{
	uint32_t blk;
	struct vhd_bitmap *bm;
	struct vhd_transaction *tx = req->tx;
	struct vhd_state *s = req->state;

	s->returned++;
	TRACE(s);

	blk = req->treq.sec / s->spb;
	bm  = get_bitmap(s, blk);

	DBG(TLOG_DBG, "blk: 0x%04x\n", blk);
	ASSERT(bat_locked(s));
	ASSERT(s->bat.pbw_blk == blk);
	ASSERT(bm && bitmap_valid(bm) && bitmap_locked(bm));

	tx->finished++;
	remove_from_req_list(&tx->requests, req);

	if (req->error) {
		unlock_bat(s);
		init_bat(s);
		tx->error = req->error;
		clear_vhd_flag(tx->status, VHD_FLAG_TX_UPDATE_BAT);
	} else
		schedule_bat_write(s);

	if (transaction_completed(tx))
		finish_data_transaction(s, bm);
}

static int
finish_redundant_bm_write(struct vhd_request *req)
{
	/* uint32_t blk; */
	struct vhd_state *s = (struct vhd_state *) req->state;

	s->returned++;
	TRACE(s);	
	/* blk = req->treq.sec / s->spb;
	   DBG(TLOG_DBG, "blk: %u\n", blk); */

	if (req->error) {
		ERR(s, req->error, "lsec: 0x%08"PRIx64, req->treq.sec);
	}
	free_vhd_request(s, req);
	s->debug_done_redundant_writes++;
	return 0;
}


static void
finish_bitmap_read(struct vhd_request *req)
{
	uint32_t blk;
	struct vhd_bitmap  *bm;
	struct vhd_request *r, *next;
	struct vhd_state   *s = req->state;

	s->returned++;
	TRACE(s);

	blk = req->treq.sec / s->spb;
	bm  = get_bitmap(s, blk);

	DBG(TLOG_DBG, "blk: 0x%04x\n", blk);
	ASSERT(bm && test_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING));

	r = bm->waiting.head;
	clear_req_list(&bm->waiting);
	clear_vhd_flag(bm->status, VHD_FLAG_BM_READ_PENDING);

	if (!req->error) {
		memcpy(bm->shadow, bm->map, vhd_sectors_to_bytes(s->bm_secs));

		while (r) {
			struct vhd_request tmp;

			tmp  = *r;
			next =  r->next;
			free_vhd_request(s, r);

			ASSERT(tmp.op == VHD_OP_DATA_READ || 
			       tmp.op == VHD_OP_DATA_WRITE);

			if (tmp.op == VHD_OP_DATA_READ)
				vhd_queue_read(s->driver, tmp.treq);
			else if (tmp.op == VHD_OP_DATA_WRITE)
				vhd_queue_write(s->driver, tmp.treq);

			r = next;
		}
	} else {
		int err = req->error;
		unlock_bitmap(bm);
		free_vhd_bitmap(s, bm);
		return signal_completion(r, err);
	}

	if (!bitmap_in_use(bm))
		unlock_bitmap(bm);
}

static void
finish_bitmap_write(struct vhd_request *req)
{
	uint32_t blk;
	struct vhd_bitmap  *bm;
	struct vhd_transaction *tx;
	struct vhd_state *s = req->state;

	s->returned++;
	TRACE(s);

	blk = req->treq.sec / s->spb;
	bm  = get_bitmap(s, blk);
	tx  = &bm->tx;

	DBG(TLOG_DBG, "blk: 0x%04x, started: %d, finished: %d\n",
	    blk, tx->started, tx->finished);
	ASSERT(tx->closed);
	ASSERT(bm && bitmap_valid(bm));
	ASSERT(test_vhd_flag(bm->status, VHD_FLAG_BM_WRITE_PENDING));

	clear_vhd_flag(bm->status, VHD_FLAG_BM_WRITE_PENDING);

	finish_bitmap_transaction(s, bm, req->error);
}

static void
finish_data_read(struct vhd_request *req)
{
	struct vhd_state *s = req->state;

	DBG(TLOG_DBG, "lsec 0x%08"PRIx64", blk: 0x%04"PRIx64"\n", 
	    req->treq.sec, req->treq.sec / s->spb);
	signal_completion(req, 0);
}

static void
finish_data_write(struct vhd_request *req)
{
	int i;
	struct vhd_transaction *tx = req->tx;
	struct vhd_state *s = (struct vhd_state *)req->state;

	set_vhd_flag(req->flags, VHD_FLAG_REQ_FINISHED);

	if (tx) {
		uint32_t blk, sec;
		struct vhd_bitmap *bm;

		blk = req->treq.sec / s->spb;
		sec = req->treq.sec % s->spb;
		bm  = get_bitmap(s, blk);

		ASSERT(bm && bitmap_valid(bm) && bitmap_locked(bm));

		tx->finished++;

		DBG(TLOG_DBG, "lsec: 0x%08"PRIx64", blk: 0x04%"PRIx64", "
		    "tx->started: %d, tx->finished: %d\n", req->treq.sec,
		    req->treq.sec / s->spb, tx->started, tx->finished);

		if (!req->error)
			for (i = 0; i < req->treq.secs; i++)
				vhd_bitmap_set(&s->vhd, bm->shadow,  sec + i);

		if (transaction_completed(tx))
			finish_data_transaction(s, bm);

	} else if (!test_vhd_flag(req->flags, VHD_FLAG_REQ_QUEUED)) {
		ASSERT(!req->next);
		DBG(TLOG_DBG, "lsec: 0x%08"PRIx64", blk: 0x%04"PRIx64"\n", 
		    req->treq.sec, req->treq.sec / s->spb);
		signal_completion(req, 0);
	}
}

void
vhd_complete(void *arg, struct tiocb *tiocb, int err)
{
	struct vhd_request *req = (struct vhd_request *)arg;
	struct vhd_state *s = req->state;
	struct iocb *io = &tiocb->iocb;

	s->completed++;
	TRACE(s);

	req->error = err;

	if (req->error)
		ERR(s, req->error, "%s: op: %u, lsec: %"PRIu64", secs: %u, "
		    "nbytes: %lu, blk: %"PRIu64", blk_offset: %u",
		    s->vhd.file, req->op, req->treq.sec, req->treq.secs,
		    io->u.c.nbytes, req->treq.sec / s->spb,
		    bat_entry(s, req->treq.sec / s->spb));

	switch (req->op) {
	case VHD_OP_DATA_READ:
		finish_data_read(req);
		break;

	case VHD_OP_DATA_WRITE:
		finish_data_write(req);
		break;

	case VHD_OP_BITMAP_READ:
		finish_bitmap_read(req);
		break;

	case VHD_OP_BITMAP_WRITE:
		finish_bitmap_write(req);
		break;

	case VHD_OP_ZERO_BM_WRITE:
		finish_zero_bm_write(req);
		break;

	case VHD_OP_REDUNDANT_BM_WRITE:
		finish_redundant_bm_write(req);
		break;

	case VHD_OP_BAT_WRITE:
		finish_bat_write(req);
		break;

	default:
		ASSERT(0);
		break;
	}
}

void 
vhd_debug(td_driver_t *driver)
{
	int i;
	struct vhd_state *s = (struct vhd_state *)driver->data;

	DBG(TLOG_WARN, "%s: QUEUED: 0x%08"PRIx64", COMPLETED: 0x%08"PRIx64", "
	    "RETURNED: 0x%08"PRIx64"\n", s->vhd.file, s->queued, s->completed,
	    s->returned);
	DBG(TLOG_WARN, "WRITES: 0x%08"PRIx64", AVG_WRITE_SIZE: %f\n",
	    s->writes, (s->writes ? ((float)s->write_size / s->writes) : 0.0));
	DBG(TLOG_WARN, "READS: 0x%08"PRIx64", AVG_READ_SIZE: %f\n",
	    s->reads, (s->reads ? ((float)s->read_size / s->reads) : 0.0));

	DBG(TLOG_WARN, "ALLOCATED REQUESTS: (%u total)\n", VHD_REQS_DATA);
	for (i = 0; i < VHD_REQS_DATA; i++) {
		struct vhd_request *r = &s->vreq_list[i];
		td_request_t *t       = &r->treq;
		const char *vname     = t->vreq ? t->vreq->name: NULL;
		if (t->secs)
			DBG(TLOG_WARN, "%d: vreq: %s.%d, err: %d, op: %d,"
			    " lsec: 0x%08"PRIx64", flags: %d, this: %p, "
			    "next: %p, tx: %p\n", i, vname, t->sidx, r->error, r->op,
			    t->sec, r->flags, r, r->next, r->tx);
	}

	DBG(TLOG_WARN, "BITMAP CACHE:\n");
	for (i = 0; i < VHD_CACHE_SIZE; i++) {
		int qnum = 0, wnum = 0, rnum = 0;
		struct vhd_bitmap *bm = s->bitmap[i];
		struct vhd_transaction *tx;
		struct vhd_request *r;

		if (!bm)
			continue;

		tx = &bm->tx;
		r = bm->queue.head;
		while (r) {
			qnum++;
			r = r->next;
		}

		r = bm->waiting.head;
		while (r) {
			wnum++;
			r = r->next;
		}

		r = tx->requests.head;
		while (r) {
			rnum++;
			r = r->next;
		}

		DBG(TLOG_WARN, "%d: blk: 0x%04x, status: 0x%08x, q: %p, qnum: %d, w: %p, "
		    "wnum: %d, locked: %d, in use: %d, tx: %p, tx_error: %d, "
		    "started: %d, finished: %d, status: %u, reqs: %p, nreqs: %d\n",
		    i, bm->blk, bm->status, bm->queue.head, qnum, bm->waiting.head,
		    wnum, bitmap_locked(bm), bitmap_in_use(bm), tx, tx->error,
		    tx->started, tx->finished, tx->status, tx->requests.head, rnum);
	}

	DBG(TLOG_WARN, "BAT: status: 0x%08x, pbw_blk: 0x%04x, "
	    "pbw_off: 0x%08"PRIx64", tx: %p\n", s->bat.status, s->bat.pbw_blk,
	    s->bat.pbw_offset, s->bat.req.tx);

/*
	for (i = 0; i < s->hdr.max_bat_size; i++)
		DPRINTF("%d: %u\n", i, s->bat.bat[i]);
*/
}

struct tap_disk tapdisk_vhd = {
	.disk_type          = "tapdisk_vhd",
	.flags              = 0,
	.private_data_size  = sizeof(struct vhd_state),
	.td_open            = _vhd_open,
	.td_close           = _vhd_close,
	.td_queue_read      = vhd_queue_read,
	.td_queue_write     = vhd_queue_write,
	.td_get_parent_id   = vhd_get_parent_id,
	.td_validate_parent = vhd_validate_parent,
	.td_debug           = vhd_debug,
};

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <557FA708.7020101@yahoo.fr>]
* Help
@ 2015-01-21 20:38 Natesh Relhan
  0 siblings, 0 replies; 278+ messages in thread
From: Natesh Relhan @ 2015-01-21 20:38 UTC (permalink / raw)
  To: kernel-janitors

I am a kernel newbie. How to begin task type "Audit return codes". I
mean where to look and start.

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2015-01-14  9:16 SAJID HOSSAIN
  2015-01-14 10:19 ` Help Anuz Pratap Singh Tomar
  0 siblings, 1 reply; 278+ messages in thread
From: SAJID HOSSAIN @ 2015-01-14  9:16 UTC (permalink / raw)
  To: kernelnewbies

Hi everyone,I am new to open source and really interested in contributing to Linux kernel, can someone please help me how to get started.P.S : I have good knowledge in computer architecture, operating systems and C/C++
-Sajid Hossain IRC : sajid5786 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150114/c33851bf/attachment.html 

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2014-12-04 19:01 m_del_buon
  2014-12-04 19:19 ` help Arend van Spriel
  0 siblings, 1 reply; 278+ messages in thread
From: m_del_buon @ 2014-12-04 19:01 UTC (permalink / raw)
  To: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 4160 bytes --]

can you help me with this problems? thx

Sent from Libero Mobile
________________________________

Il 04/12/2014, m_del_buon@libero.it ha scritto:

hi I am an italian user of one realtek based device Bus 001 Device 005: ID 0df6:004b Sitecom Europe B.V. WL-349v3 Wireless Micro Adapter 150N X1 [Realtek RTL8192SU] on an ubuntu 14.04 64bit 3.13.0-40-generic kernel and I received following error
make
make -C /lib/modules/3.13.0-40-generic/build M=/home/hp/rtl8192su-master/rtlwifi CONFIG_RTL_CARDS=y CONFIG_RTLWIFI=m CONFIG_RTLWIFI_DEBUG=y CONFIG_RTLWIFI_DEBUGFS=y CONFIG_RTLWIFI_USB=m CONFIG_RTLWIFI_PCI=m CONFIG_RTL8192SU=m CONFIG_RTL8192SE=m CONFIG_RTL8192S_COMMON=m CONFIG_RTL8192CU=n CONFIG_RTL8192DE=n CONFIG_RTL8192CE=n CONFIG_RTL8192C_COMMON=n CONFIG_RTL8723AE=n CONFIG_RTL8188EE=n  EXTRA_CFLAGS="-DDEBUG -DCONFIG_RTLWIFI_DEBUGFS=m -w"
make[1]: ingresso nella directory "/usr/src/linux-headers-3.13.0-40-generic"
  CC [M]  /home/hp/rtl8192su-master/rtlwifi/regd.o
In file included from include/net/cfg80211.h:23:0,
                 from include/net/mac80211.h:21,
                 from /home/hp/rtl8192su-master/rtlwifi/wifi.h:41,
                 from /home/hp/rtl8192su-master/rtlwifi/regd.c:30:
/home/hp/rtl8192su-master/rtlwifi/regd.c:62:4: error: ‘NL80211_RRF_NO_IR’ undeclared here (not in a function)
    NL80211_RRF_NO_IR)
    ^
include/net/regulatory.h:128:11: note: in definition of macro ‘REG_RULE’
  .flags = reg_flags,    \
           ^
/home/hp/rtl8192su-master/rtlwifi/regd.c:99:6: note: in expansion of macro ‘RTL819x_2GHZ_CH12_13’
      RTL819x_2GHZ_CH12_13,
      ^
/home/hp/rtl8192su-master/rtlwifi/regd.c: In function ‘_rtl_reg_apply_beaconing_flags’:
/home/hp/rtl8192su-master/rtlwifi/regd.c:186:20: error: ‘IEEE80211_CHAN_NO_IR’ undeclared (first use in this function)
      ch->flags &= ~IEEE80211_CHAN_NO_IR;
                    ^
/home/hp/rtl8192su-master/rtlwifi/regd.c:186:20: note: each undeclared identifier is reported only once for each function it appears in
/home/hp/rtl8192su-master/rtlwifi/regd.c: In function ‘_rtl_reg_apply_active_scan_flags’:
/home/hp/rtl8192su-master/rtlwifi/regd.c:214:19: error: ‘IEEE80211_CHAN_NO_IR’ undeclared (first use in this function)
   if (ch->flags & IEEE80211_CHAN_NO_IR)
                   ^
/home/hp/rtl8192su-master/rtlwifi/regd.c: In function ‘_rtl_reg_apply_radar_flags’:
/home/hp/rtl8192su-master/rtlwifi/regd.c:279:10: error: ‘IEEE80211_CHAN_NO_IR’ undeclared (first use in this function)
          IEEE80211_CHAN_NO_IR;
          ^
/home/hp/rtl8192su-master/rtlwifi/regd.c: In function ‘_rtl_regd_init_wiphy’:
/home/hp/rtl8192su-master/rtlwifi/regd.c:348:7: error: ‘struct wiphy’ has no member named ‘regulatory_flags’
  wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
       ^
/home/hp/rtl8192su-master/rtlwifi/regd.c:348:29: error: ‘REGULATORY_CUSTOM_REG’ undeclared (first use in this function)
  wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG;
                             ^
/home/hp/rtl8192su-master/rtlwifi/regd.c:349:7: error: ‘struct wiphy’ has no member named ‘regulatory_flags’
  wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG;
       ^
/home/hp/rtl8192su-master/rtlwifi/regd.c:349:30: error: ‘REGULATORY_STRICT_REG’ undeclared (first use in this function)
  wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG;
                              ^
/home/hp/rtl8192su-master/rtlwifi/regd.c:350:7: error: ‘struct wiphy’ has no member named ‘regulatory_flags’
  wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
       ^
/home/hp/rtl8192su-master/rtlwifi/regd.c:350:30: error: ‘REGULATORY_DISABLE_BEACON_HINTS’ undeclared (first use in this function)
  wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS;
                              ^
make[2]: *** [/home/hp/rtl8192su-master/rtlwifi/regd.o] Errore 1
make[1]: *** [_module_/home/hp/rtl8192su-master/rtlwifi] Errore 2
make[1]: uscita dalla directory "/usr/src/linux-headers-3.13.0-40-generic"
make: *** [all] Errore 2
can you help me?

Sent from Libero Mobile

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2014-10-09 12:43 Manuel Piroz
  2014-10-09 13:14 ` help Burton, Ross
  0 siblings, 1 reply; 278+ messages in thread
From: Manuel Piroz @ 2014-10-09 12:43 UTC (permalink / raw)
  To: bitbake-devel


[-- Attachment #1.1: Type: text/plain, Size: 1381 bytes --]

Hello All
I’m new to the community and i just started building
i have a bit of a problem trying to build an image i have searched the WWW for answers and no luck. I’m running the command 
“bitbake core-image-minimal” 

Loading cache: 100% |#######################################################################################################################| ETA:  00:00:00
Loaded 1222 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION        = "1.22.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "Fedora-20"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.6.1"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "daisy:7a12eda78555a78ad33c6e38c1ed2b29982b165f"

NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
Currently 15 running tasks (624 of 1791):

// This is The beginning of the build






// this is the END
Summary: 1 task failed:
  virtual:native:/home/Yocto/Mano/poky/meta/recipes-core/ncurses/ncurses_5.9.bb, do_install
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
[UNITdaMERCENARY@YoctoBuild 4]$ 



[-- Attachment #1.2: Type: text/html, Size: 6814 bytes --]

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 507 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2013-03-23  7:51 Arun Kv
  2013-03-25 10:54 ` Help George Dunlap
  0 siblings, 1 reply; 278+ messages in thread
From: Arun Kv @ 2013-03-23  7:51 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 162 bytes --]

Hi,

My question is how can i disable direct io in XCP, in XEN i can do it by
editing "driver name" value to "file"
How can i do this in XCP, please help.


Arun

[-- Attachment #1.2: Type: text/html, Size: 204 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2013-01-23  9:59 Narendra Pal Singh
  0 siblings, 0 replies; 278+ messages in thread
From: Narendra Pal Singh @ 2013-01-23  9:59 UTC (permalink / raw)
  To: linux-perf-users

I want to check time taken  and  number of system calls made by each
function in my code  .My code is part of user as well as kernel space.
So i need time taken in both space. I am interested to know
performance in terms of CPU time and Disk IO .How should i go ? is
perf is right tool for same ?

-- 
Regards,
Narendra Pal

^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <mailman.3.1347822001.6317.yocto@yoctoproject.org>]
* help
@ 2012-08-21  1:26 du81692468
  2012-08-23 19:18 ` help Dexter Filmore
  0 siblings, 1 reply; 278+ messages in thread
From: du81692468 @ 2012-08-21  1:26 UTC (permalink / raw)
  To: Intel-gfx-request


[-- Attachment #1.1: Type: text/plain, Size: 481 bytes --]






Hello, I have a question:
System Environment: fedora 14
Graphics card: intel integrated graphics + NVIDIA
When I installed the xf86-video-intel-2.17.0 driver, I can not set the screen resolution of 800 * 600, when I downgraded to xf86-video-intel-2.13.0 when you can set the screen resolution but can not set the host screen to the main screen, start when the attachment: xf86-video-intel-2.13.0 driver the xwindows error screenshot. Can you help me?



du81692468

[-- Attachment #1.2: Type: text/html, Size: 2937 bytes --]

[-- Attachment #2: uname.jpg --]
[-- Type: application/octet-stream, Size: 58934 bytes --]

[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2012-06-14 16:30 chen.chenchacha
  0 siblings, 0 replies; 278+ messages in thread
From: chen.chenchacha @ 2012-06-14 16:30 UTC (permalink / raw)
  To: linux-kernel

help

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2011-11-18  5:12 shepherd Lazy
  0 siblings, 0 replies; 278+ messages in thread
From: shepherd Lazy @ 2011-11-18  5:12 UTC (permalink / raw)
  To: linux-kernel

help

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2011-10-29 20:37 Kai Moonbourn
  0 siblings, 0 replies; 278+ messages in thread
From: Kai Moonbourn @ 2011-10-29 20:37 UTC (permalink / raw)
  To: linux-btrfs



^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2011-10-28  4:15 Pankaj Kumar Biswas
  2011-10-28  8:47 ` Help Ian Campbell
  0 siblings, 1 reply; 278+ messages in thread
From: Pankaj Kumar Biswas @ 2011-10-28  4:15 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 256 bytes --]

Hi team,

I want to know how the paging works in xen and what the shadow paging is?

Thanks & Regards,
PANKAJ KUMAR BISWAS

Software Maintenance Engineer | XenServer India | Citrix Systems Inc.
Ext. 41225 | Email:  pankaj.kumarbiswas@citrix.com


[-- Attachment #1.2: Type: text/html, Size: 2470 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2011-10-17 23:50 Mario Torres
  0 siblings, 0 replies; 278+ messages in thread
From: Mario Torres @ 2011-10-17 23:50 UTC (permalink / raw)
  To: linux-media, majordomo

Can I say a word to you guys?

Cool

I got one AVerMedia M792 PCIe Combo (OEM) on Ubuntu 11.10 and i wonder 
if we can work it out, it is a pci-e and yes it is on the unsupported 
list. but if we can work it out lets do it.

when i do a lspci -vv
it gives me this


03:00.0 Multimedia video controller: Conexant Systems, Inc. CX23887/8 
PCIe Broadcast Audio and Video Decoder with 3D Comb (rev 0f)
     Subsystem: Avermedia Technologies Inc Device df39
     Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-
     Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- 
<TAbort- <MAbort- >SERR- <PERR- INTx-
     Latency: 0, Cache Line Size: 32 bytes
     Interrupt: pin A routed to IRQ 17
     Region 0: Memory at f9e00000 (64-bit, non-prefetchable) [size=2M]
     Capabilities: <access denied>
     Kernel driver in use: cx23885
     Kernel modules: cx23885

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2011-10-14 16:22 Mario Torres
  0 siblings, 0 replies; 278+ messages in thread
From: Mario Torres @ 2011-10-14 16:22 UTC (permalink / raw)
  To: linux-media

help

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2011-10-14 16:21 Mario Torres
  0 siblings, 0 replies; 278+ messages in thread
From: Mario Torres @ 2011-10-14 16:21 UTC (permalink / raw)
  To: linux-media



^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2011-07-28 23:33 Martin Partridge
  2011-07-28 23:47 ` help Christian Lamparter
  2011-07-29  3:12 ` help Pavel Roskin
  0 siblings, 2 replies; 278+ messages in thread
From: Martin Partridge @ 2011-07-28 23:33 UTC (permalink / raw)
  To: linux-wireless

Hello,

I don't understand the last 2 steps, i'm running fedora (ok i lie its  
Fuduntu, but to all intents and purposes its fedora) Kernel version:  
2.6.39.3-1.fc14.i686
i'm using a WG511v2 PCMCIA card, i've downloaded the correct firmware,  
renamed it and modprobed everything as instructed, the bit i'm having  
trouble with is this bit:

Enabling p54

To enable p54, you must first enable mac80211:

Networking Support --->
   Wireless  --->
     <M> cfg80211 - wireless configuration API
     <M> Generic IEEE 802.11 Networking Stack (mac80211)

You can then enable p54 in the kernel configuration under

Device Drivers  --->
   [*] Network device support  --->
         Wireless LAN --->
           [*] Wireless LAN (IEEE 802.11)
           <M>   Softmac Prism54 support
           <M>     Prism54 USB support
           <M>     Prism54 PCI support
           <M>     Prism54 SPI (stlc45xx) support

where do i type this, or what does it mean? I i don't have a 'networking  
support' menu and it's not a program, where do i find this? is it a conf  
file? I'm no stranger to linux but this is perplexing, the card works fine  
on windows, but i can't get it work now. I have a kernel config file in  
/etc/sysconfig but its a bit bare, as shown below:

# UPDATEDEFAULT specifies if new-kernel-pkg should make
# new kernels the default
UPDATEDEFAULT=yes

# DEFAULTKERNEL specifies the default kernel package type
DEFAULTKERNEL=kernel

That's the whole thing.

How do i enable p54 and mac80211, i'm not sure and its bloody annoying.

regards

Martin Partridge

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2011-04-22  8:49 wolfu
  0 siblings, 0 replies; 278+ messages in thread
From: wolfu @ 2011-04-22  8:49 UTC (permalink / raw)
  To: linux-omap



^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2010-12-21  7:58 andy xu
  0 siblings, 0 replies; 278+ messages in thread
From: andy xu @ 2010-12-21  7:58 UTC (permalink / raw)
  To: linux-kernel




      


^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2010-09-20 12:06 Marcos
  2010-09-20 12:16 ` help Oskar Berggren
  0 siblings, 1 reply; 278+ messages in thread
From: Marcos @ 2010-09-20 12:06 UTC (permalink / raw)
  To: netfilter

help



      

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2010-09-20 12:06 Marcos
  0 siblings, 0 replies; 278+ messages in thread
From: Marcos @ 2010-09-20 12:06 UTC (permalink / raw)
  To: netfilter-devel

help



      

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2010-05-29  2:48 code.perfect
  0 siblings, 0 replies; 278+ messages in thread
From: code.perfect @ 2010-05-29  2:48 UTC (permalink / raw)
  To: linux-kernel

Hi linux-kernel@vger.kernel.org, 

  

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2010-05-28  9:06 code.perfect
  0 siblings, 0 replies; 278+ messages in thread
From: code.perfect @ 2010-05-28  9:06 UTC (permalink / raw)
  To: linux-kernel



^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2010-05-17 17:00 ` Sgt. Ken Holland
  0 siblings, 0 replies; 278+ messages in thread
From: Sgt. Ken Holland @ 2010-05-17 17:00 UTC (permalink / raw)


Permit me to approach you in this manner.I am Sgt. Ken Holland of the US Marine in Ba'qubah,Iraq. We got the sum of $15,500,000.00 we made from some Crude Oil Money deal that i will want you to help us receive. Since we are working here on Official capacity we cannot keep this funds hence my contacting you. If you are interested, do get back to me so that i can give you further details.

Sgt. Ken Holland

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2010-05-17 17:00 Sgt. Ken Holland
  0 siblings, 0 replies; 278+ messages in thread
From: Sgt. Ken Holland @ 2010-05-17 17:00 UTC (permalink / raw)


Permit me to approach you in this manner.I am Sgt. Ken Holland of the US Marine in Ba'qubah,Iraq. We got the sum of $15,500,000.00 we made from some Crude Oil Money deal that i will want you to help us receive. Since we are working here on Official capacity we cannot keep this funds hence my contacting you. If you are interested, do get back to me so that i can give you further details.

Sgt. Ken Holland

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2009-10-24  5:15 Ingo Krabbe
  0 siblings, 0 replies; 278+ messages in thread
From: Ingo Krabbe @ 2009-10-24  5:15 UTC (permalink / raw)
  To: git

help
-- 
i don't do signatures

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2009-10-19 16:07 Jens-U. Mozdzen
  0 siblings, 0 replies; 278+ messages in thread
From: Jens-U. Mozdzen @ 2009-10-19 16:07 UTC (permalink / raw)
  To: linux-nfs


-- 
Jens-U. Mozdzen				voice	: +49-40-559 51 75
NDE Netzdesign und -entwicklung	AG	fax	: +49-40-559 51 77
Postfach 61 03 15			mobile	: +49-179-4 98 21 98
D-22423 Hamburg				e-mail	: jmozdzen-9fbXLY7Yocc@public.gmane.org

        Vorsitzende des Aufsichtsrates: Angelika Mozdzen
          Sitz und Registergericht: Hamburg, HRB 90934
                  Vorstand: Jens-U. Mozdzen
                   USt-IdNr. DE 814 013 983


^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2009-10-01 13:22 Jie Cai
  0 siblings, 0 replies; 278+ messages in thread
From: Jie Cai @ 2009-10-01 13:22 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA

help
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2009-10-01 13:16 Jie Cai
  0 siblings, 0 replies; 278+ messages in thread
From: Jie Cai @ 2009-10-01 13:16 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <E1McOLX-0003Lq-BN@665xhf1.ch3.sourceforge.com>]
* Help
@ 2009-09-18 11:19 Lorenzo Brito Morales
  2009-09-18 13:18 ` Help Iain Hibbert
  0 siblings, 1 reply; 278+ messages in thread
From: Lorenzo Brito Morales @ 2009-09-18 11:19 UTC (permalink / raw)
  To: linux-bluetooth

Hi, im a beggineer in bluez and also in programming stuff, i have read
a coupble of things about bluez and programming,  what i want to do is
a progran that send files to the phone is near by,,im trying to get
work these code, its compile, and conect to the phone , but in the
phone ask for a number security, ahta later i have to type in the
computer...... how can i send a file whitout asking a number? just
asking in the phone about aceptting the file
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/rfcomm.h>

int main(int argc, char **argv)
{
    struct sockaddr_rc addr = { 0 };
    int s, status;
    char dest[18] = "00:23:F1:CC:BF:10";

    // allocate a socket
    s = socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);

    // set the connection parameters (who to connect to)
    addr.rc_family = AF_BLUETOOTH;
    addr.rc_channel = 1;
    str2ba( dest, &addr.rc_bdaddr );

    // connect to server
    status = connect(s, (struct sockaddr *)&addr, sizeof(addr));

    // send a message
    if( 0 == status ) {
        status = send(s, "hello!", 6, 0);
    }

    if( status < 0 ) perror("uh oh");

    close(s);
    return 0;
}

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Re: help
@ 2009-09-10 13:57 Dante Durham
  0 siblings, 0 replies; 278+ messages in thread
From: Dante Durham @ 2009-09-10 13:57 UTC (permalink / raw)
  To: clusters_sig-qjLDD68F18O7TbgM5vRIOg
  Cc: containers-qjLDD68F18O7TbgM5vRIOg,
	bugme-janitors-qjLDD68F18O7TbgM5vRIOg,
	fastboot-qjLDD68F18O7TbgM5vRIOg,
	virtualization-qjLDD68F18O7TbgM5vRIOg

High-End Luxury Watches online with great 78% OFF in September!
Your S0urce F0r Designer & Luxury Watches.
http://buildglass.com/

^ permalink raw reply	[flat|nested] 278+ messages in thread
* RAID10 Layouts
@ 2009-08-21 13:27 Info
  2009-08-21 16:43 ` Goswin von Brederlow
  0 siblings, 1 reply; 278+ messages in thread
From: Info @ 2009-08-21 13:27 UTC (permalink / raw)
  To: linux-raid


Hello list,

Researching RAID10, trying to learn the most advanced system for a 2 SATA drive system.  Have two WD 2TB drives for a media computer, and the most important requirement is data redundancy.  I realize that RAID is no substitute for backups, but this is a backup for the backups and the purpose here is data safety.  The secondary goal is speed enhancement.  It appears that RAID10 can give both.

First question is on layout of RAID10.  In studying the man pages it seems that Far mode gives 95% of the speed of RAID0, but with increased seek for writes.  And that Offset retains much of this benefit while increasing efficiency of writes.  What should be the preference, Far or Offset?  Are they equally as robust?

How safe is the data in Far or Offset mode?  If a drive fails, will a complete, usable, bootable system exist on the other drive?  (These two are the only drives in the system, which is Debian Testing, Debian kernel 2.6.30-5)  Need I make any special Grub settings?

What about this Intel firmware 'RAID'?  Would this assist in any way?  How does it relate (if it does) to the linux md system?  Should I set in BIOS to RAID, or leave it at ACPI?

How does this look:
# mdadm --create /dev/md0 --level=raid10 --layout=o2 --metadata=1.2 --chunk=64 --raid-disks=2 missing /dev/sdb1


^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2009-04-24 11:31 Sudeept Prusti
  2009-04-24 11:39 ` Help Jaroslav Kysela
  0 siblings, 1 reply; 278+ messages in thread
From: Sudeept Prusti @ 2009-04-24 11:31 UTC (permalink / raw)
  To: alsa-devel

Hi all,
 
As i am working on alsa for minimal PCM playback (8khz,mono,16 bit pcm file).
 
When i tried to allocate 1k buffer and send through snd_pcm_writei() call it doesn't play perfect and skips are there in between. If we keep on increasing in allocating the buffer for 31 kb then it could play the buffers randomly.
 
Code is attached for ur reference below.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <alsa/asoundlib.h>
#include <stdio.h>
#include <stdlib.h>

#define  k	(31*1024)

static void playback(FILE *fd);

int main(int argc, char *argv[]) 
{
  FILE *fd;
  fd = fopen(argv[1],"r");
  playback(fd);
  return 0;
}

static void playback(FILE *fd)
{
  int rc,err;
  snd_pcm_t *handle;
  snd_pcm_hw_params_t *params;
  unsigned int val;
  snd_pcm_uframes_t frames;
  unsigned char *buffer;
  int seek_size=0;
  int nonblock = 0;

  printf("Entered Playback Module \n");
	
  /* Open PCM device for playback. */
  rc = snd_pcm_open(&handle, "default",SND_PCM_STREAM_PLAYBACK, 0);
  if(rc >= 0)
  {
  	printf("Open PCM Success:  %d \n",rc);
  }
  if (rc < 0) {
    	fprintf(stderr,"unable to open pcm device: %s\n",snd_strerror(rc));
	exit(1);
  }
  
  /* PCM Hardware Parameters Allocation.  */
  err = snd_pcm_hw_params_malloc (&params);

  if(err>=0)
  {
	printf("Hardware Params Allocation Success:  %d \n",err);
  }

  if (err < 0)
  {
  	fprintf (stderr, "cannot allocate hardware parameter structure (%s)\n", snd_strerror (err));
      	exit (1);
  }
  /* Intialize PCM Hardware Parameters */	
  err = snd_pcm_hw_params_any(handle, params);
  if(err >=0)
  {
  	printf("PCM HW params Initialization Success : %d \n",err);
  }
  if (err < 0)
  {
	printf("Cannot initialize hardware parameter structure \n");
	exit(EXIT_FAILURE);
  }

  /* Set the PCM Hardware parameters. */

  /* Interleaved mode */
  err = snd_pcm_hw_params_set_access(handle, params,SND_PCM_ACCESS_RW_INTERLEAVED);
  if (err >= 0)
  {
	printf("Access Type Available: %d \n",err);
  }
  if (err < 0)
  {
	printf("Access Type Not-available: %d \n",err);
	exit(EXIT_FAILURE);
   }

  /* Signed 16-bit little-endian format */
  err = snd_pcm_hw_params_set_format(handle, params,SND_PCM_FORMAT_S16_LE);
  if (err >= 0)
  {
	printf("Sample format Available: %d \n",err);
  }
  if (err < 0)
  {
	printf("Sample format Non-Available \n");
	exit(EXIT_FAILURE);
  }

  /* One Channel (Mono) */
  err = snd_pcm_hw_params_set_channels(handle, params, 1);
  if (err >= 0)
  {
	printf("Channels Available: %d \n",err);
  }
  if (err < 0)
  {
	printf("Channels Non-Available \n");
	exit(EXIT_FAILURE);
  }

  /* 8khz sampling rate */
  err = snd_pcm_hw_params_set_rate (handle, params, 8000, 0);
  if (err >= 0)
  {
      	printf ("Sample Rate Set Success: %d \n",err);
  }
  if (err < 0)
  {
      	fprintf (stderr, "cannot set sample rate (%s)\n", snd_strerror (err));
      	exit (EXIT_FAILURE);
  }
  
  /* Write the parameters to the alsa-driver */
  rc = snd_pcm_hw_params(handle, params);
  if(rc >=0)
  {
  	printf("Set HW Parameters Success: %d \n",rc);
  }
  if (rc < 0)
  {
   	fprintf(stderr,"Unable to Set HW Parameters: %s\n",snd_strerror(rc));
	exit(1);
  }
  /* Allocate buffer*/
  buffer = (unsigned char *) malloc(k);

  if (buffer == NULL)
  {
	printf("Not Enough Memory: %c \n",buffer);
	exit(1);
  }

  while (!feof(fd))
  {
    if(fd != NULL)
    {
 	printf("File pointer is not NULL \n");
    }
    printf("Current Position of File Pointer is: %d\n",ftell(fd));

    rc = fread(buffer,k,1,fd);
    printf("Data Read from File is: %d \n",rc);
    
    if(rc > 0)
    {
    	printf("File Read Success \n");
    }
    
    seek_size = seek_size + k;    
    fseek(fd,seek_size,SEEK_SET);

    if (rc == 0)
    {
      	printf("End of File Reached: %d \n",rc);
      	break;
    } 
    rc = snd_pcm_writei(handle, buffer, k);
    printf("Write: %d  bytes \n",rc);
    
    if (rc == -EPIPE)
    {
      printf("underrun occurred \n");
      snd_pcm_prepare(handle);
    }
    else if (rc < 0)
    {
    	fprintf(stderr,"Error From Writei Call: %s\n",snd_strerror(rc));
       exit(1);
    }  
   }//End of While
   
   fclose(fd);
   snd_pcm_drain(handle);
   snd_pcm_close(handle);
   free(buffer);
}//End of Playback
--------------------------------------------------------------------------------------------------------------
Can anyone help me out where i am doing wrong.Ur's valuable suggestions are welcomed.
 
Best Regards,
Sudeept

^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <20081205170026.821496198E3@hormel.redhat.com>]
* help
@ 2008-09-28  5:06 Reg Clemens
  0 siblings, 0 replies; 278+ messages in thread
From: Reg Clemens @ 2008-09-28  5:06 UTC (permalink / raw)
  To: linux-kernel

help

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2008-08-13  9:26 Boris Shteinbock
  2008-08-13 12:02 ` Help Arnd Bergmann
  0 siblings, 1 reply; 278+ messages in thread
From: Boris Shteinbock @ 2008-08-13  9:26 UTC (permalink / raw)
  To: linuxppc-dev

Help



      

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2008-08-13  8:22 Artem Bityutskiy
  2008-08-13  8:29 ` help Artem Bityutskiy
  0 siblings, 1 reply; 278+ messages in thread
From: Artem Bityutskiy @ 2008-08-13  8:22 UTC (permalink / raw)
  To: linux-fsdevel

help

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2008-07-24  7:18 Sudeept Prusti
  2008-07-24 16:53 ` Help stan
  0 siblings, 1 reply; 278+ messages in thread
From: Sudeept Prusti @ 2008-07-24  7:18 UTC (permalink / raw)
  To: alsa-devel

Hi all,
 
As i am working on ALSA for last few weeks.Can anyone guide where can i get
moe informative things on ALSA internals (Internally how alsa works).
 
Could anyone suggest what are validation scenario on alsa driver flow.
 
Thanks a lot.
 
Awaiting for response soon.
 
Regards,
Sudeept

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments contained in it.

Contact your Administrator for further information.

^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <20080220170012.C9E168E0292@hormel.redhat.com>]
[parent not found: <mailman.230.1199775553.6908.linuxppc-dev@ozlabs.org>]
* Help
@ 2007-12-26  1:15 xiaodan
  0 siblings, 0 replies; 278+ messages in thread
From: xiaodan @ 2007-12-26  1:15 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 196 bytes --]


Is there anyone working on the ATI Opensurce driver - RV 630 ?
_________________________________________________________________
MSN 中文网,最新时尚生活资讯,白领聚集门户。
http://cn.msn.com

[-- Attachment #1.2: Type: text/html, Size: 380 bytes --]

[-- Attachment #2: Type: text/plain, Size: 181 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2007-12-10 11:48 Thanos Chatziathanassiou
  2007-12-11  1:02 ` help David Newall
  0 siblings, 1 reply; 278+ messages in thread
From: Thanos Chatziathanassiou @ 2007-12-10 11:48 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 5 bytes --]

help

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3229 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2007-12-02  4:24 YanBob
  2007-12-02 17:09 ` help Tobin Davis
  0 siblings, 1 reply; 278+ messages in thread
From: YanBob @ 2007-12-02  4:24 UTC (permalink / raw)
  To: alsa-devel

hello, my  linux is ubuntu with Linux bob-laptop 2.6.22-14-generic #1
SMP Sun Oct 14 23:05:12 GMT 2007 i686 GNU/Linux.
        now the problem is that,no sound comes out when i use ubuntu.
        i have google some pages, and followed the steps as they said. But i
turns out that my sound card is still not working. At the end of this
email,
i send you  some inf. about my sound card. And my laptop model is Lenovo
F41.
 Could you please help me?   thanks a million!!

bob@bob-laptop:~$ aplay -l
**** PLAYBACK硬件设备列表 ****
卡 0: Intel [HDA Intel], 设备 0: ALC262 Analog [ALC262 Analog]
  子设备: 1/1
  子设备:#0: subdevice #0
卡 0: Intel [HDA Intel], 设备 1: ALC262 Digital [ALC262 Digital]
  子设备: 1/1
  子设备:#0: subdevice #0
卡 0: Intel [HDA Intel], 设备 6: Si3054 Modem [Si3054 Modem]
  子设备: 1/1
  子设备:#0: subdevice #0

bob@bob-laptop:~$ lspci -vv|grep Audio
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio
Controller (rev 03)

bob@bob-laptop:~$ cat /proc/asound/cards 
 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xf8300000 irq 22

bob@bob-laptop:~$ lsmod|grep snd
snd_hda_intel         263712  1 
snd_pcm_oss            44672  0 
snd_mixer_oss          17664  1 snd_pcm_oss
snd_pcm                80388  2 snd_hda_intel,snd_pcm_oss
snd_seq_dummy           4740  0 
snd_seq_oss            33152  0 
snd_seq_midi            9600  0 
snd_rawmidi            25728  1 snd_seq_midi
snd_seq_midi_event      8448  2 snd_seq_oss,snd_seq_midi
snd_seq                53232  6
snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_seq_midi_event
snd_timer              24324  2 snd_pcm,snd_seq
snd_seq_device          9228  5
snd_seq_dummy,snd_seq_oss,snd_seq_midi,snd_rawmidi,snd_seq
snd                    54660  11
snd_hda_intel,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_seq_oss,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
soundcore               8800  1 snd
snd_page_alloc         11400  2 snd_hda_intel,snd_pcm


bob@bob-laptop:~$ cat /proc/asound/version 
Advanced Linux Sound Architecture Driver Version 1.0.14 (Thu May 31
09:03:25 2007 UTC).
























































      ___________________________________________________________ 
进入雅虎游戏嘉年华,赢取液晶显示器! 
http://cn.mail.yahoo.com/promo/carnival07/
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2007-11-26 14:53 liujiusheng
  0 siblings, 0 replies; 278+ messages in thread
From: liujiusheng @ 2007-11-26 14:53 UTC (permalink / raw)
  To: kernel-janitors


help

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2007-11-18 18:48 mattias
  2007-11-18 19:06 ` help Morten K. Poulsen
  0 siblings, 1 reply; 278+ messages in thread
From: mattias @ 2007-11-18 18:48 UTC (permalink / raw)
  To: mlmmj

I try to use mlmmj-php-web-admin
But php says
mlmmj config

Warning: fopen(../conf/tunables.pl) [
function.fopen]:
failed to open stream: No such file or directory in
/var/www/mlmmj-php-web-admin/edit.php on line 117

Warning: filesize() [
function.filesize]:
Stat failed for ../conf/tunables.pl (errno=2 - No such file or directory) in
/var/www/mlmmj-php-web-admin/edit.php on line 118

Warning: fread(): supplied argument is not a valid stream resource in
/var/www/mlmmj-php-web-admin/edit.php on line 118

Warning: fclose(): supplied argument is not a valid stream resource in
/var/www/mlmmj-php-web-admin/edit.php on line 119

mlmmj config

{ROWS}

What are wrong?



^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <46D25A05.4070606@davidnewall.com>]
[parent not found: <mailman.274497.1187370904.21973.nfs@lists.sourceforge.net>]
* help
@ 2007-05-16  0:25 Mao Wei
  0 siblings, 0 replies; 278+ messages in thread
From: Mao Wei @ 2007-05-16  0:25 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi,
Anybody can give me some information about CFS

Thanks!


^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2006-08-29  8:12 Limeng [李萌]
  2006-08-29  8:48 ` help Jan Engelhardt
  0 siblings, 1 reply; 278+ messages in thread
From: Limeng [李萌] @ 2006-08-29  8:12 UTC (permalink / raw)
  To: linux-kernel

Hi,
    How can I get one thread’s  LWP id on linux? 
    The thread is not the main thread, so that getpid() does not work. And the LWP id is not the same as the result by pthread_self().

    Any suggestion?

Xixi
2006-8-29



^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2006-08-23 19:21 Archie Cotton
  0 siblings, 0 replies; 278+ messages in thread
From: Archie Cotton @ 2006-08-23 19:21 UTC (permalink / raw)
  To: linux-net

Do you want a w-atch?

In our online store you can buy r e p l i c a s of R o l e x watches and
other brands. They look and feel exactly like the real thing.

- We have 100+ different brands in our selection
- Best prices on the market Just For You
- Great Discount Live Support Extended Warranty
- Free shipping if you order 2 or more
- Save up to 85% compared to the cost of other r e p l i c a s
- Standard Features:
- Screw-in crown
- Unidirectional turning bezel where appropriate
- All the appropriate r o l e x logos, on crown and dial
- Heavy weight

Clisk here: http://superty.info













"It's yours.
That was the only way he could account for this bizarre behavior — she had seen the marks after all, and this was the beginning of some new and spectacular punishment.
As a result, hadn't his "serious fiction»become steadily more self-conscious, a sort of scream?
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2006-08-23 19:21 Archie Cotton
  0 siblings, 0 replies; 278+ messages in thread
From: Archie Cotton @ 2006-08-23 19:21 UTC (permalink / raw)
  To: linux-net

Do you want a w-atch?

In our online store you can buy r e p l i c a s of R o l e x watches and
other brands. They look and feel exactly like the real thing.

- We have 100+ different brands in our selection
- Best prices on the market Just For You
- Great Discount Live Support Extended Warranty
- Free shipping if you order 2 or more
- Save up to 85% compared to the cost of other r e p l i c a s
- Standard Features:
- Screw-in crown
- Unidirectional turning bezel where appropriate
- All the appropriate r o l e x logos, on crown and dial
- Heavy weight

Clisk here: http://superty.info













"It's yours.
That was the only way he could account for this bizarre behavior — she had seen the marks after all, and this was the beginning of some new and spectacular punishment.
As a result, hadn't his "serious fiction»become steadily more self-conscious, a sort of scream?
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2006-08-16 12:46 Hemanth KumarBS
  0 siblings, 0 replies; 278+ messages in thread
From: Hemanth KumarBS @ 2006-08-16 12:46 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 101 bytes --]

Hi,

I am working on PPC-8248. Is montavista has driver for DMA based SPI 
driver ? 

Regards
Hemanth

[-- Attachment #2: Type: text/html, Size: 277 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2006-08-15  2:35 derrywang
  0 siblings, 0 replies; 278+ messages in thread
From: derrywang @ 2006-08-15  2:35 UTC (permalink / raw)
  To: linux-ide

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]

Dear Uwe Koziolek,

Hi, Can you help me?
I am a engineer of a linux company. I want to install a linux 
distribution on one notebook.
But I failed because of SATA HDD driver problem.
The hardware of this notebook is : SISM662MXZ+966LZ. I download the new 
driver source from SIS website.
Unfortunnly I failed again.
The detail dmesg and lspci information are touched by attachment. please 
check it.
The main problem is ( I guess)
driver can not get the correct SCR_STATUS register value. So Sata link down.

In the last, please forgive me for the poor english. :-)
Thank you!

Best Regards,
Derry


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: dmesg.log --]
[-- Type: text/x-log; name="dmesg.log", Size: 15346 bytes --]

Linux version 2.6.16 (root@localhost.localdomain) (gcc 版本 3.4.6) #1 Mon Aug 14 14:34:39 CST 2006
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009dc00 (usable)
 BIOS-e820: 000000000009dc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e4000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000000dd90000 (usable)
 BIOS-e820: 000000000dd90000 - 000000000dd9f000 (ACPI data)
 BIOS-e820: 000000000dd9f000 - 000000000de00000 (ACPI NVS)
 BIOS-e820: 000000000de00000 - 000000000e000000 (reserved)
 BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved)
 BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
 BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
0MB HIGHMEM available.
221MB LOWMEM available.
On node 0 totalpages: 56720
  DMA zone: 4096 pages, LIFO batch:0
  DMA32 zone: 0 pages, LIFO batch:0
  Normal zone: 52624 pages, LIFO batch:15
  HighMem zone: 0 pages, LIFO batch:0
DMI present.
ACPI: RSDP (v000 PTLTD                                 ) @ 0x000f93b0
ACPI: RSDT (v001 PTLTD    RSDT   0x06040000  LTP 0x00000000) @ 0x0dd9a278
ACPI: FADT (v001 SiS    662MX    0x06040000 PTL  0x000f4240) @ 0x0dd9eef2
ACPI: MADT (v001 PTLTD  	 APIC   0x06040000  LTP 0x00000000) @ 0x0dd9ef66
ACPI: MCFG (v001 PTLTD    MCFG   0x06040000  LTP 0x00000000) @ 0x0dd9efc4
ACPI: SSDT (v001  PmRef    CpuPm 0x00003000 INTL 0x20050228) @ 0x0dd9a2ac
ACPI: DSDT (v001 PTLTD       662 0x06040000 MSFT 0x0100000e) @ 0x00000000
ACPI: PM-Timer IO Port: 0x8008
Allocating PCI resources starting at 10000000 (gap: 0e000000:f0c00000)
Built 1 zonelists
Kernel command line: vga=769 max_loop=255 initrd=boot/initrd.gz init=linuxrc load_ramdisk=1 prompt_ramdisk=0 ramdisk_size=4444 root=/dev/ram0 rw BOOT_IMAGE=boot/vmlinuz 
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
PID hash table entries: 1024 (order: 10, 16384 bytes)
Detected 1600.284 MHz processor.
Using pmtmr for high-res timesource
Console: colour dummy device 80x25
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 216716k/226880k available (4164k kernel code, 9568k reserved, 1284k data, 496k init, 0k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay using timer specific routine.. 3207.47 BogoMIPS (lpj=6414944)
Security Framework v1.0.0 initialized
Mount-cache hash table entries: 512
CPU: After generic identify, caps: bfe9fbff 00100000 00000000 00000000 0000c189 00000000 00000000
CPU: After vendor identify, caps: bfe9fbff 00100000 00000000 00000000 0000c189 00000000 00000000
monitor/mwait feature present.
using mwait in idle threads.
CPU: L1 I cache: 32K, L1 D cache: 32K
CPU: L2 cache: 2048K
CPU: After all inits, caps: bfe9fbff 00100000 00000000 00000140 0000c189 00000000 00000000
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
CPU: Intel Genuine Intel(R) CPU            1050  @ 1.60GHz stepping 08
Checking 'hlt' instruction... OK.
ACPI: setting ELCR to 0800 (from 0eb8)
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd
Freeing initrd memory: 1320k freed
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: BIOS BUG #81[000fdda0] found
PCI: Using MMCONFIG
ACPI: Subsystem revision 20060127
ACPI: Interpreter enabled
ACPI: Using PIC for interrupt routing
ACPI Error (nsxfeval-0242): Handle is NULL and Pathname is relative [20060127]
ACPI Error (nsxfeval-0242): Handle is NULL and Pathname is relative [20060127]
ACPI Error (nsxfeval-0242): Handle is NULL and Pathname is relative [20060127]
ACPI Error (nsxfeval-0242): Handle is NULL and Pathname is relative [20060127]
ACPI: PCI Root Bridge [PCI0] (0000:00)
PCI: Probing PCI hardware (bus 00)
PCI: Ignoring BAR0-3 of IDE controller 0000:00:02.5
Boot video device is 0000:01:00.0
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 *9 10 11)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 *5 7 9 10 11)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 *4 5 7 9 10 11)
ACPI: PCI Interrupt Link [LNKD] (IRQs *3 4 5 7 9 10 11)
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 7 9 10 *11)
ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 7 9 *10 11)
ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 7 9 10 11) *0, disabled.
ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 *7 9 10 11)
ACPI: Embedded Controller [EC0] (gpe 31) interrupt mode.
Linux Plug and Play Support v0.97 (c) Adam Belay
SCSI subsystem initialized
usbcore: registered new driver usbfs
usbcore: registered new driver hub
PCI: Using ACPI for IRQ routing
PCI: If a device doesn't work, try "pci=routeirq".  If it helps, post a report
PCI: Ignore bogus resource 6 [0:0] of 0000:01:00.0
PCI: Bridge: 0000:00:01.0
  IO window: 9000-9fff
  MEM window: d4000000-d40fffff
  PREFETCH window: c8000000-cfffffff
PCI: Bridge: 0000:00:06.0
  IO window: disabled.
  MEM window: d4100000-d41fffff
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:07.0
  IO window: disabled.
  MEM window: dc000000-dfffffff
  PREFETCH window: disabled.
PCI: Bridge: 0000:00:1f.0
  IO window: disabled.
  MEM window: disabled.
  PREFETCH window: disabled.
PCI: Setting latency timer of device 0000:00:01.0 to 64
PCI: Setting latency timer of device 0000:00:06.0 to 64
PCI: Setting latency timer of device 0000:00:07.0 to 64
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 9
PCI: setting IRQ 9 as level-triggered
ACPI: PCI Interrupt 0000:00:1f.0[A] -> Link [LNKA] -> GSI 9 (level, low) -> IRQ 9
PCI: Setting latency timer of device 0000:00:1f.0 to 64
apm: BIOS version 1.2 Flags 0x03 (Driver version 1.16ac)
apm: overridden by ACPI.
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
NTFS driver 2.1.26 [Flags: R/O].
JFS: nTxBlock = 1705, nTxLock = 13640
SGI XFS with ACLs, security attributes, large block numbers, no debug enabled
SGI XFS Quota Management subsystem
Initializing Cryptographic API
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
PCI: Setting latency timer of device 0000:00:06.0 to 64
pcie_portdrv_probe->Dev[000a:1039] has invalid IRQ. Check vendor BIOS
assign_interrupt_mode Found MSI capability
Allocate Port Service[0000:00:06.0:pcie00]
Allocate Port Service[0000:00:06.0:pcie01]
Allocate Port Service[0000:00:06.0:pcie02]
Allocate Port Service[0000:00:06.0:pcie03]
PCI: Setting latency timer of device 0000:00:07.0 to 64
pcie_portdrv_probe->Dev[000a:1039] has invalid IRQ. Check vendor BIOS
assign_interrupt_mode Found MSI capability
Allocate Port Service[0000:00:07.0:pcie00]
Allocate Port Service[0000:00:07.0:pcie01]
Allocate Port Service[0000:00:07.0:pcie02]
Allocate Port Service[0000:00:07.0:pcie03]
ACPI: PCI Interrupt 0000:00:1f.0[A] -> Link [LNKA] -> GSI 9 (level, low) -> IRQ 9
PCI: Setting latency timer of device 0000:00:1f.0 to 64
assign_interrupt_mode Found MSI capability
Allocate Port Service[0000:00:1f.0:pcie00]
pci_hotplug: PCI Hot Plug PCI Core version: 0.5
vesafb: framebuffer at 0xc8000000, mapped to 0xce980000, using 600k, total 32768k
vesafb: mode is 640x480x8, linelength=640, pages=24
vesafb: protected mode interface info at cc82:0004
vesafb: scrolling: redraw
vesafb: Pseudocolor: size=6:6:6:6, shift=0:0:0:0
Console: switching to colour frame buffer device 80x30
fb0: VESA VGA frame buffer device
ACPI: AC Adapter [ACAD] (off-line)
ACPI: Battery Slot [BAT1] (battery present)
ACPI: Power Button (FF) [PWRF]
ACPI: Power Button (CM) [PWRB]
ACPI: Sleep Button (CM) [SLPB]
ACPI: Lid Switch [LID]
ACPI: Video Device [VGA0] (multi-head: yes  rom: no  post: no)
ACPI: CPU0 (power states: C1[C1] C2[C2])
ACPI: Processor [CPU0] (supports 8 throttling states)
ACPI: Thermal Zone [TZ00] (33 C)
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Real Time Clock Driver v1.12ac
PNP: No PS/2 controller found. Probing ports directly.
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
floppy0: no floppy controllers found
RAMDISK driver initialized: 16 RAM disks of 4444K size 1024 blocksize
loop: loaded (max 255 devices)
Compaq SMART2 Driver (v 2.6.0)
HP CISS Driver (v 2.6.10)
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
SIS5513: IDE controller at PCI slot 0000:00:02.5
ACPI: PCI Interrupt 0000:00:02.5[A] -> Link [LNKA] -> GSI 9 (level, low) -> IRQ 9
SIS5513: chipset revision 1
SIS5513: not 100% native mode: will probe irqs later
SIS5513: IDE controller at PCI slot 0000:00:02.5
ACPI: PCI Interrupt 0000:00:02.5[A] -> Link [LNKA] -> GSI 9 (level, low) -> IRQ 9
SIS5513: chipset revision 1
SIS5513: not 100% native mode: will probe irqs later
SIS_IDE: probe of 0000:00:02.5 failed with error -1
Probing IDE interface ide0...
hda: PHILIPS CD-RW/DVD-ROM SCB5265, ATAPI CD/DVD-ROM drive
Probing IDE interface ide1...
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
hda: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache
Uniform CD-ROM driver Revision: 3.20
ide-floppy driver 0.99.newide
Loading Adaptec I2O RAID: Version 2.4 Build 5go
Detecting Adaptec I2O RAID controllers...
Adaptec aacraid driver (1.1-4 Aug 14 2006 14:29:02)
scsi: <fdomain> Detection failed (no card)
sym53c416.c: Version 1.0.0-ac
qlogicfas: no cards were found, please specify I/O address and IRQ using iobase= and irq= optionsEmulex LightPulse Fibre Channel SCSI driver 8.1.1
Copyright(c) 2004-2005 Emulex.  All rights reserved.
Failed initialization of WD-7000 SCSI card!
megaraid cmm: 2.20.2.6 (Release Date: Mon Mar 7 00:01:03 EST 2005)
megaraid: 2.20.4.7 (Release Date: Mon Nov 14 12:27:22 EST 2005)
megasas: 00.00.02.04 Fri Feb 03 14:31:44 PST 2006
GDT-HA: Storage RAID Controller Driver. Version: 3.04 
GDT-HA: Found 0 PCI Storage RAID Controllers
3ware Storage Controller device driver for Linux v1.26.02.001.
3ware 9000 Storage Controller device driver for Linux v2.26.02.007.
nsp32: loading...
ipr: IBM Power RAID SCSI Device Driver version: 2.1.2 (February 8, 2006)
libata version 1.20 loaded.
I2O subsystem v1.325
i2o: max drivers = 8
I2O Configuration OSM v1.323
I2O Bus Adapter OSM v1.317
I2O Block Device OSM v1.325
I2O SCSI Peripheral OSM v1.316
I2O ProcFS OSM v1.316
Fusion MPT base driver 3.03.07
Copyright (c) 1999-2005 LSI Logic Corporation
Fusion MPT SPI Host driver 3.03.07
Fusion MPT FC Host driver 3.03.07
Fusion MPT SAS Host driver 3.03.07
usbmon: debugfs is not available
usbcore: registered new driver hiddev
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.6:USB HID core driver
mice: PS/2 mouse device common for all mice
NET: Registered protocol family 2
input: AT Translated Set 2 keyboard as /class/input/input0
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
TCP bic registered
Initializing IPsec netlink socket
NET: Registered protocol family 1
NET: Registered protocol family 17
Using IPI Shortcut mode
ACPI wakeup devices: 
PCI0  KBC USB0 USB1 USB2  LAN HDEF CBUS 
ACPI: (supports S0 S3 S4 S5)
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem).
Freeing unused kernel memory: 496k freed
ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 5
PCI: setting IRQ 5 as level-triggered
ACPI: PCI Interrupt 0000:00:05.0[A] -> Link [LNKB] -> GSI 5 (level, low) -> IRQ 5
sata_sis 0000:00:05.0: Detected SiS 182/1182/1183 SATA controller
ata1: SATA max UDMA/133 cmd 0x1448 ctl 0x143E bmdma 0x1410 irq 5
ata2: SATA max UDMA/133 cmd 0x1440 ctl 0x143A bmdma 0x1418 irq 5
ata1: SATA link down (SStatus 117)
scsi2 : sata_sis
ata2: SATA link down (SStatus 5)
scsi3 : sata_sis
squashfs: version 3.0 (2006/03/15) Phillip Lougher
Registering unionfs 20060423-1600
ISO 9660 Extensions: Microsoft Joliet Level 3
ISO 9660 Extensions: RRIP_1991A
Linux agpgart interface v0.101 (c) Dave Jones
fuse init (API version 7.6)
input: ImPS/2 Synaptics TouchPad as /class/input/input1
Intel ISA PCIC probe: not found.
Databook TCIC-2 PCMCIA probe: not found.
ath_hal: module license 'Proprietary' taints kernel.
ath_hal: 0.9.16.16 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
wlan: 0.8.4.2 (svn 1531)
ath_rate_sample: 1.2 (svn 1531)
ath_pci: 0.9.4.5 (svn 1531)
ACPI: PCI Interrupt 0000:02:00.0[A] -> Link [LNKA] -> GSI 9 (level, low) -> IRQ 9
PCI: Setting latency timer of device 0000:02:00.0 to 64
wifi%d: unable to attach hardware: 'Hardware revision not supported' (HAL status 13)
ACPI: PCI interrupt for device 0000:02:00.0 disabled
shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 4
PCI: setting IRQ 4 as level-triggered
ACPI: PCI Interrupt 0000:00:0f.0[A] -> Link [LNKC] -> GSI 4 (level, low) -> IRQ 4
PCI: Setting latency timer of device 0000:00:0f.0 to 64
hda_codec: Unknown model for ALC262, trying auto-probe from BIOS...
sis190 Gigabit Ethernet driver 1.2 loaded.
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 3
PCI: setting IRQ 3 as level-triggered
ACPI: PCI Interrupt 0000:00:04.0[A] -> Link [LNKD] -> GSI 3 (level, low) -> IRQ 3
PCI: Setting latency timer of device 0000:00:04.0 to 64
0000:00:04.0: Read MAC address from EEPROM
0000:00:04.0: Realtek PHY RTL8201 transceiver at address 31.
0000:00:04.0: Using transceiver at address 31 as default.
0000:00:04.0: SiS 190 PCI Fast Ethernet adapter at cea34000 (IRQ: 3), 00:17:00:00:00:00
eth0: GMII mode.
eth0: Enabling Auto-negotiation.
ACPI: PCI Interrupt Link [LNKH] enabled at IRQ 7
PCI: setting IRQ 7 as level-triggered
ACPI: PCI Interrupt 0000:00:03.3[D] -> Link [LNKH] -> GSI 7 (level, low) -> IRQ 7
ehci_hcd 0000:00:03.3: EHCI Host Controller
ehci_hcd 0000:00:03.3: new USB bus registered, assigned bus number 1
ehci_hcd 0000:00:03.3: irq 7, io mem 0xd4206000
ehci_hcd 0000:00:03.3: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 8 ports detected
ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)
ACPI: PCI Interrupt Link [LNKE] enabled at IRQ 11
PCI: setting IRQ 11 as level-triggered
ACPI: PCI Interrupt 0000:00:03.0[A] -> Link [LNKE] -> GSI 11 (level, low) -> IRQ 11
ohci_hcd 0000:00:03.0: OHCI Host Controller
ohci_hcd 0000:00:03.0: new USB bus registered, assigned bus number 2
ohci_hcd 0000:00:03.0: irq 11, io mem 0xd4204000
usb usb2: configuration #1 chosen from 1 choice
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 4 ports detected
ACPI: PCI Interrupt Link [LNKF] enabled at IRQ 10
PCI: setting IRQ 10 as level-triggered
ACPI: PCI Interrupt 0000:00:03.1[B] -> Link [LNKF] -> GSI 10 (level, low) -> IRQ 10
ohci_hcd 0000:00:03.1: OHCI Host Controller
ohci_hcd 0000:00:03.1: new USB bus registered, assigned bus number 3
ohci_hcd 0000:00:03.1: irq 10, io mem 0xd4205000
usb usb3: configuration #1 chosen from 1 choice
hub 3-0:1.0: USB hub found
hub 3-0:1.0: 4 ports detected
agpgart: Unsupported SiS chipset (device id: 0662)
USB Universal Host Controller Interface driver v2.3

[-- Attachment #3: lspci.log --]
[-- Type: text/x-log, Size: 5172 bytes --]

00:00.0 Host bridge: Silicon Integrated Systems [SiS]: Unknown device 0662 (rev 01)
	Flags: bus master, medium devsel, latency 32
	Memory at d0000000 (32-bit, non-prefetchable) [size=64M]
	Capabilities: [c0] AGP version 3.5

00:01.0 PCI bridge: Silicon Integrated Systems [SiS] SiS AGP Port (virtual PCI-to-PCI bridge) (prog-if 00 [Normal decode])
	Flags: bus master, 66Mhz, fast devsel, latency 0
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
	I/O behind bridge: 00009000-00009fff
	Memory behind bridge: d4000000-d40fffff
	Prefetchable memory behind bridge: c8000000-cfffffff

00:02.0 ISA bridge: Silicon Integrated Systems [SiS]: Unknown device 0966 (rev 59)
	Flags: bus master, medium devsel, latency 0

00:02.5 IDE interface: Silicon Integrated Systems [SiS] 5513 [IDE] (rev 01) (prog-if 8a [Master SecP PriP])
	Subsystem: Silicon Integrated Systems [SiS] SiS5513 EIDE Controller (A,B step)
	Flags: bus master, medium devsel, latency 128, IRQ 9
	I/O ports at <ignored>
	I/O ports at <ignored>
	I/O ports at <ignored>
	I/O ports at <ignored>
	I/O ports at 1400 [size=16]
	Capabilities: [58] Power Management version 2

00:03.0 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f) (prog-if 10 [OHCI])
	Subsystem: QUANTA Computer Inc: Unknown device 0759
	Flags: bus master, medium devsel, latency 32, IRQ 11
	Memory at d4204000 (32-bit, non-prefetchable) [size=4K]

00:03.1 USB Controller: Silicon Integrated Systems [SiS] USB 1.0 Controller (rev 0f) (prog-if 10 [OHCI])
	Subsystem: QUANTA Computer Inc: Unknown device 0759
	Flags: bus master, medium devsel, latency 32, IRQ 10
	Memory at d4205000 (32-bit, non-prefetchable) [size=4K]

00:03.3 USB Controller: Silicon Integrated Systems [SiS] USB 2.0 Controller (prog-if 20 [EHCI])
	Subsystem: Silicon Integrated Systems [SiS] USB 2.0 Controller
	Flags: bus master, medium devsel, latency 32, IRQ 7
	Memory at d4206000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [50] Power Management version 2

00:04.0 Ethernet controller: Silicon Integrated Systems [SiS]: Unknown device 0190 (rev 01)
	Subsystem: QUANTA Computer Inc: Unknown device 0759
	Flags: bus master, medium devsel, latency 0, IRQ 3
	Memory at d4407000 (32-bit, non-prefetchable) [size=128]
	I/O ports at 1000 [size=128]
	Capabilities: [40] Power Management version 2

00:05.0 IDE interface: Silicon Integrated Systems [SiS]: Unknown device 1183 (rev 02) (prog-if 8f [Master SecP SecO PriP PriO])
	Subsystem: Silicon Integrated Systems [SiS]: Unknown device 1183
	Flags: bus master, medium devsel, latency 32, IRQ 5
	I/O ports at 1448 [size=8]
	I/O ports at 143c [size=4]
	I/O ports at 1440 [size=8]
	I/O ports at 1438 [size=4]
	I/O ports at 1410 [size=16]
	I/O ports at 1080 [size=128]
	Capabilities: [58] Power Management version 2

00:06.0 PCI bridge: Silicon Integrated Systems [SiS] PCI-to-PCI bridge (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0
	Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
	Memory behind bridge: d4100000-d41fffff
	Capabilities: [b0] #0d [0000]
	Capabilities: [c0] Message Signalled Interrupts: 64bit- Queue=0/0 Enable-
	Capabilities: [d0] #10 [0141]
	Capabilities: [f4] Power Management version 2

00:07.0 PCI bridge: Silicon Integrated Systems [SiS] PCI-to-PCI bridge (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0
	Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
	Memory behind bridge: dc000000-dfffffff
	Capabilities: [b0] #0d [0000]
	Capabilities: [c0] Message Signalled Interrupts: 64bit- Queue=0/0 Enable-
	Capabilities: [d0] #10 [0141]
	Capabilities: [f4] Power Management version 2

00:0f.0 Class 0403: Silicon Integrated Systems [SiS]: Unknown device 7502
	Subsystem: Silicon Integrated Systems [SiS]: Unknown device 1234
	Flags: bus master, medium devsel, latency 0, IRQ 4
	Memory at d4200000 (32-bit, non-prefetchable) [size=16K]
	Capabilities: [50] Power Management version 2

00:1f.0 PCI bridge: Silicon Integrated Systems [SiS] PCI-to-PCI bridge (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0
	Bus: primary=00, secondary=04, subordinate=04, sec-latency=0
	Capabilities: [d0] #10 [0141]
	Capabilities: [a0] Message Signalled Interrupts: 64bit- Queue=0/0 Enable-
	Capabilities: [f4] Power Management version 2

01:00.0 VGA compatible controller: Silicon Integrated Systems [SiS] 661/741/760/761 PCI/AGP VGA Display Adapter (rev 04) (prog-if 00 [VGA])
	Flags: 66Mhz, medium devsel, IRQ 9
	BIST result: 00
	Memory at c8000000 (32-bit, prefetchable) [size=128M]
	Memory at d4000000 (32-bit, non-prefetchable) [size=128K]
	I/O ports at 9000 [size=128]
	Expansion ROM at <unassigned> [disabled]
	Capabilities: [40] Power Management version 2
	Capabilities: [50] AGP version 3.0

02:00.0 Ethernet controller: Atheros Communications, Inc.: Unknown device 001c (rev 01)
	Subsystem: Unknown device 1a32:0100
	Flags: fast devsel, IRQ 9
	Memory at d4100000 (64-bit, non-prefetchable) [size=64K]
	Capabilities: [40] Power Management version 2
	Capabilities: [50] Message Signalled Interrupts: 64bit- Queue=0/0 Enable-
	Capabilities: [60] #10 [0011]
	Capabilities: [90] #11 [0000]


^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2006-04-09 20:47 amirhosein jahanbekam
  0 siblings, 0 replies; 278+ messages in thread
From: amirhosein jahanbekam @ 2006-04-09 20:47 UTC (permalink / raw)
  To: linux-mtd

Hi all
I have an 'at91rm9200 development kit'.
Recently, I `ve attached an 'AT45DB642' serial data
flash
to the board and installed uboot via XModem
successfully.
But somethings seemed to go wrong:

Firstly, uboot is not able to erase or unprotect the  
    flash as I tested  several versions of uboot and
also compiled 'u-boot-1.1.2' to be certain that
dataflash options are correctly enabled.
It pretend to work,but really does nothing.

Secondly, after booting via network,linux also is not
able to deal with flash operations, for instance:

--[root@AT91RM9200DK /root]$flash_erase
/dev/mtdblock/1
--Erase Total 1 Units
 but in fact nothing happens.


My linux version is '2.4.27-vrs1-ATMEL' and my mtd
configs are as follow.

 Tanks in advanced.
 
 Amir.H.J


#
# Memory Technology Devices (MTD)
#
CONFIG_MTD=y
CONFIG_MTD_DEBUG=y
CONFIG_MTD_DEBUG_VERBOSE=0
CONFIG_MTD_PARTITIONS=y
CONFIG_MTD_CONCAT=y
CONFIG_MTD_REDBOOT_PARTS=y
CONFIG_MTD_CMDLINE_PARTS=y
CONFIG_MTD_AFS_PARTS=y
CONFIG_MTD_CHAR=y
CONFIG_MTD_BLOCK=y
# CONFIG_FTL is not set
# CONFIG_NFTL is not set

#
# RAM/ROM/Flash chip drivers
#
CONFIG_MTD_CFI=y
# CONFIG_MTD_JEDECPROBE is not set
CONFIG_MTD_GEN_PROBE=y
# CONFIG_MTD_CFI_ADV_OPTIONS is not set
CONFIG_MTD_CFI_INTELEXT=y
# CONFIG_MTD_CFI_AMDSTD is not set
# CONFIG_MTD_CFI_STAA is not set
# CONFIG_MTD_RAM is not set
# CONFIG_MTD_ROM is not set
# CONFIG_MTD_ABSENT is not set
# CONFIG_MTD_OBSOLETE_CHIPS is not set
# CONFIG_MTD_AMDSTD is not set
# CONFIG_MTD_SHARP is not set
# CONFIG_MTD_JEDEC is not set

#
# Mapping drivers for chip access
#
# CONFIG_MTD_PHYSMAP is not set
# CONFIG_MTD_NORA is not set
# CONFIG_MTD_ARM_INTEGRATOR is not set
# CONFIG_MTD_CDB89712 is not set
# CONFIG_MTD_SA1100 is not set
# CONFIG_MTD_DC21285 is not set
# CONFIG_MTD_IQ80310 is not set
# CONFIG_MTD_FORTUNET is not set
# CONFIG_MTD_EPXA is not set
# CONFIG_MTD_AUTCPU12 is not set
# CONFIG_MTD_EDB7312 is not set
# CONFIG_MTD_IMPA7 is not set
# CONFIG_MTD_CEIVA is not set
# CONFIG_MTD_PCI is not set
# CONFIG_MTD_PCMCIA is not set

#
# Self-contained MTD device drivers
#
# CONFIG_MTD_PMC551 is not set
# CONFIG_MTD_SLRAM is not set
CONFIG_MTD_AT91_DATAFLASH=y
CONFIG_MTD_AT91_DATAFLASH_CARD=y
CONFIG_MTD_MTDRAM=y
CONFIG_MTDRAM_TOTAL_SIZE=4096
CONFIG_MTDRAM_ERASE_SIZE=128
CONFIG_MTDRAM_ABS_POS=0
CONFIG_MTD_BLKMTD=y
# CONFIG_MTD_DOC1000 is not set
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOCPROBE is not set

#
# NAND Flash Device Drivers
#
# CONFIG_MTD_NAND is not set
# CONFIG_MTD_AT91_SMARTMEDIA is not set

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2006-03-09  2:57 zhaoyw
  2006-03-09  9:51 ` help Matej Kupljen
  0 siblings, 1 reply; 278+ messages in thread
From: zhaoyw @ 2006-03-09  2:57 UTC (permalink / raw)
  To: linux-mips

I seem to get cross-compile using Buildroot . And tinyx included .
But when I nfs program to my target board. It can not run.
Prompt is : /usr/X11R6/bin/Xfbdev:1: syntax error : " ( " unexpected.
PS: my target board is mips arch.
Any suggestion.
Thanks in advance.

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2006-02-04  2:21 Oren Ben-Menachem
  0 siblings, 0 replies; 278+ messages in thread
From: Oren Ben-Menachem @ 2006-02-04  2:21 UTC (permalink / raw)
  To: linux-raid




^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-12-28 10:53 wayne.chen
  0 siblings, 0 replies; 278+ messages in thread
From: wayne.chen @ 2005-12-28 10:53 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #2: Type: text/html, Size: 0 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <430C62420003CAE8@mail14.jumpyint.it>]
* help
@ 2005-11-27 20:30 Matt Darcy
  0 siblings, 0 replies; 278+ messages in thread
From: Matt Darcy @ 2005-11-27 20:30 UTC (permalink / raw)
  To: linux-ide

subscribe

^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <1122236195.3173.68.camel@localhost>]
* help
@ 2005-11-17  6:02 prabha.j
  2005-11-17 14:04 ` help Wolfgang Denk
  0 siblings, 1 reply; 278+ messages in thread
From: prabha.j @ 2005-11-17  6:02 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 2059 bytes --]


Hi all,
I am trying to build kernel image for my custom borad which is similar to 
mpc8260ads board. But i am getting the error.

I am using denx enldk and also the kernel source.

The error is
 make[1]: Entering directory 
`/home/cdot/eldk/ppc_6xx/usr/src/linux-2.4.25/arch/ppc/lib'
make all_targets
make[2]: Entering directory 
`/home/cdot/eldk/ppc_6xx/usr/src/linux-2.4.25/arch/ppc/lib'
make[2]: Nothing to be done for `all_targets'.
make[2]: Leaving directory 
`/home/cdot/eldk/ppc_6xx/usr/src/linux-2.4.25/arch/ppc/lib'
make[1]: Leaving directory 
`/home/cdot/eldk/ppc_6xx/usr/src/linux-2.4.25/arch/ppc/lib'
ppc_6xx-ld -T arch/ppc/vmlinux.lds -Ttext 0xc0000000 -Bstatic 
arch/ppc/kernel/head.o arch/ppc/kernel/idle_6xx.o init/main.o 
init/version.o init/do_mounts.o \
        --start-group \
        arch/ppc/kernel/kernel.o arch/ppc/platforms/platform.o 
arch/ppc/mm/mm.o arch/ppc/lib/lib.o kernel/kernel.o mm/mm.o fs/fs.o 
ipc/ipc.o \
         drivers/char/char.o drivers/block/block.o drivers/misc/misc.o 
drivers/net/net.o drivers/pci/driver.o drivers/mtd/mtdlink.o 
drivers/macintosh/macintosh.o drivers/media/media.o \
        net/network.o \
        /home/cdot/eldk/ppc_6xx/usr/src/linux-2.4.25/lib/lib.a \
        --end-group \
        -o vmlinux
arch/ppc/kernel/kernel.o(__ksymtab+0x480): In function `sys_call_table':
arch/ppc/kernel/entry.S: undefined reference to `__res'
make: *** [vmlinux] Error 1

Thanks in advance

Prabha J.
Tata Consultancy Services Limited
Mailto: prabha.j@tcs.com
Website: http://www.tcs.com

Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information.   If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited.   If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments.  Thank you

[-- Attachment #2: Type: text/html, Size: 3272 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-11-16  8:26 Hua Feijun
  2005-11-16  8:40 ` help Ian McDonald
  0 siblings, 1 reply; 278+ messages in thread
From: Hua Feijun @ 2005-11-16  8:26 UTC (permalink / raw)
  To: linux-kernel

Hi everybody!
Could anybody tell me the differentia between linux/em64t and linux/ia64?
Should i notice anything during migrating a project form linux/ia64 to
linux/em64t?
Thanks!!!

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-08-29  4:01 raja
  2005-08-29  4:41 ` help Randy.Dunlap
  0 siblings, 1 reply; 278+ messages in thread
From: raja @ 2005-08-29  4:01 UTC (permalink / raw)
  To: Linux Kernel Mailing List

I have subscribed in kernel newbie group.can anyone  you please tell me 
how can i post a question please.

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-08-27  7:01 raja
  2005-08-27  7:32 ` help Pekka Enberg
  0 siblings, 1 reply; 278+ messages in thread
From: raja @ 2005-08-27  7:01 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi,
     I am new to linux kernel programming.Will you please give me the 
useful mailing lists and how to subscribe please.
raja.

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-08-09 17:24 androsov
       [not found] ` <000001c59d07$3a9ee170$a14a3d0a-8fM5sft8TcWs1BDpvl8NfQ@public.gmane.org>
  0 siblings, 1 reply; 278+ messages in thread
From: androsov @ 2005-08-09 17:24 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 6 bytes --]

help


[-- Attachment #2: Type: text/html, Size: 919 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-07-26  9:21 戴红刚
  0 siblings, 0 replies; 278+ messages in thread
From: 戴红刚 @ 2005-07-26  9:21 UTC (permalink / raw)
  To: linuxppc-embedded

thanks for your answer, my kernel is vxworks 5.5, can you give any help 
or advice?

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-07-25  7:50 support
  0 siblings, 0 replies; 278+ messages in thread
From: support @ 2005-07-25  7:50 UTC (permalink / raw)
  To: linux-scsi

help


^ permalink raw reply	[flat|nested] 278+ messages in thread
* RE: help
@ 2005-07-21 11:39 Jordan, Kyle
  0 siblings, 0 replies; 278+ messages in thread
From: Jordan, Kyle @ 2005-07-21 11:39 UTC (permalink / raw)
  To: ???; +Cc: linuxppc-embedded

>=20
>=20
> can you give me the driver of isp1362, thanks a lot.
>=20


I have a driver for the isp1362 in host controller mode for a 2.4.x
kernel.  However, isochronous endpoints are not working with it.  I
think there is another driver for the 2.6.x kernel out there.  Which
kernel are you using?

- Kyle

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-07-21  5:59 戴红刚
  0 siblings, 0 replies; 278+ messages in thread
From: 戴红刚 @ 2005-07-21  5:59 UTC (permalink / raw)
  To: linuxppc-embedded

can you give me the driver of isp1362, thanks a lot.

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-05-28 14:15 John W. M. Stevens
  0 siblings, 0 replies; 278+ messages in thread
From: John W. M. Stevens @ 2005-05-28 14:15 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-05-19  6:23 NEC
  2005-05-19  6:23 ` help Jean Delvare
                   ` (6 more replies)
  0 siblings, 7 replies; 278+ messages in thread
From: NEC @ 2005-05-19  6:23 UTC (permalink / raw)
  To: lm-sensors

 hi,

i have soltek drv4 mainboard and i don't know what sensor chip it has..
should it be supported or not? i've tried modprobe and after that it still said that no sensor chips were found.


NEC

^ permalink raw reply	[flat|nested] 278+ messages in thread
* [PATCH 2.6] vr41xx: remove old TB0219 driver
@ 2005-05-13 13:25 Yoichi Yuasa
  2005-05-17  6:20 ` help Steve Alexander
  0 siblings, 1 reply; 278+ messages in thread
From: Yoichi Yuasa @ 2005-05-13 13:25 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: yuasa, linux-mips

Hi,

This patch had removed old TB0219 driver.
Please apply.

Yoichi

Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

diff -urN -X dontdiff b-orig/arch/mips/vr41xx/tanbac-tb0229/Makefile b/arch/mips/vr41xx/tanbac-tb0229/Makefile
--- b-orig/arch/mips/vr41xx/tanbac-tb0229/Makefile	Thu Apr 29 10:42:49 2004
+++ b/arch/mips/vr41xx/tanbac-tb0229/Makefile	Sun Apr 24 00:18:11 2005
@@ -3,5 +3,3 @@
 #
 
 obj-y				:= setup.o
-
-obj-$(CONFIG_TANBAC_TB0219)	+= tb0219.o
diff -urN -X dontdiff b-orig/arch/mips/vr41xx/tanbac-tb0229/tb0219.c b/arch/mips/vr41xx/tanbac-tb0229/tb0219.c
--- b-orig/arch/mips/vr41xx/tanbac-tb0229/tb0219.c	Thu May 27 08:14:29 2004
+++ b/arch/mips/vr41xx/tanbac-tb0229/tb0219.c	Thu Jan  1 09:00:00 1970
@@ -1,44 +0,0 @@
-/*
- *  tb0219.c, Setup for the TANBAC TB0219
- *
- *  Copyright (C) 2003  Megasolution Inc. <matsu@megasolution.jp>
- *  Copyright (C) 2004  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#include <linux/init.h>
-
-#include <asm/io.h>
-#include <asm/reboot.h>
-
-#define TB0219_RESET_REGS	KSEG1ADDR(0x0a00000e)
-
-#define tb0219_hard_reset()	writew(0, TB0219_RESET_REGS)
-
-static void tanbac_tb0219_restart(char *command)
-{
-	local_irq_disable();
-	tb0219_hard_reset();
-	while (1);
-}
-
-static int __init tanbac_tb0219_setup(void)
-{
-	_machine_restart = tanbac_tb0219_restart;
-
-	return 0;
-}
-
-early_initcall(tanbac_tb0219_setup);

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-05-10  8:01 andyliu
  0 siblings, 0 replies; 278+ messages in thread
From: andyliu @ 2005-05-10  8:01 UTC (permalink / raw)
  To: linux-fsdevel

how to join?
-- 
Yours andyliu

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-05-07 13:46 sen lin
  0 siblings, 0 replies; 278+ messages in thread
From: sen lin @ 2005-05-07 13:46 UTC (permalink / raw)
  To: linuxppc-embedded

only test how to use maillist

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Re: Help
@ 2005-04-07 16:29 James Carlson
  2005-04-07 16:32 ` Help Kumar
  2005-04-07 16:42 ` Help Bill Unruh
  0 siblings, 2 replies; 278+ messages in thread
From: James Carlson @ 2005-04-07 16:29 UTC (permalink / raw)
  To: linux-ppp

Kumar writes:
> I have to run linux pppd as a server and need to support many ppp
> clients. I'm currently using linux pppd-2.4.2.
> 
> Would you please tell me if the linux ppp has support for multi
> channels? If so, by default how many links it supports?

Each pppd process supports one link, but you may have as many pppd
processes and links as your system may accomodate.

-- 
James Carlson                                 <carlsonj@workingcode.com>

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-01-24  4:33 wayne.chen
  0 siblings, 0 replies; 278+ messages in thread
From: wayne.chen @ 2005-01-24  4:33 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 4 bytes --]

help

[-- Attachment #2: Type: text/html, Size: 47 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2005-01-22 10:12 Pankaj Agarwal
  2005-01-22 11:16 ` Help Graeme T Ford
  0 siblings, 1 reply; 278+ messages in thread
From: Pankaj Agarwal @ 2005-01-22 10:12 UTC (permalink / raw)
  To: linux-kernel

Hi,

Kindly help/update me on how to set these parameters in the used kernel...

CONFIG_IP_ADVANCED_ROUTER

CONFIG_IP_MULTIPLE_TABLES

CONFIG_IP_ROUTE_MULTIPATH

Thanks and Regards,

Pankaj



^ permalink raw reply	[flat|nested] 278+ messages in thread
* RE: help
@ 2005-01-11 15:36 Bhupesh Kumar Pandey, Noida
  2005-01-11 15:51 ` help Greg KH
  2005-01-11 16:07 ` help Erik Mouw
  0 siblings, 2 replies; 278+ messages in thread
From: Bhupesh Kumar Pandey, Noida @ 2005-01-11 15:36 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

 
Actually My problem is to report the current problems in hotplugging of
FC-HBA on PCI Express for kernel 2.6.8 and don't have the hardware, I have
studied the code, searched and studied the documents available in the
internet, but I am not able to conclude. That is why I thought of taking
help from you experienced people.
I think now the problem is clear to you.
Please help me.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks and Best Regards
Bhupesh Kumar Pandey


-----Original Message-----
From: Greg KH [mailto:greg@kroah.com] 
Sent: Tuesday, January 11, 2005 8:47 PM
To: Bhupesh Kumar Pandey, Noida
Cc: linux-kernel@vger.kernel.org
Subject: Re: help

On Tue, Jan 11, 2005 at 07:58:26PM +0530, Bhupesh Kumar Pandey, Noida wrote:
>  
> Hi
> can any one list current problems in hotplug of FC-HBA on PCI Express 
> under kernel 2.6.8?

I don't wish to be annoying, but you have been asking this same question for
a while now.  You were told that this should work, and for you to report any
issues that you found.  So, I'm guessing that you have not yet actually
tried this out?  Why not?

greg k-h

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2005-01-11 14:28 Bhupesh Kumar Pandey, Noida
  2005-01-11 15:16 ` help Greg KH
  0 siblings, 1 reply; 278+ messages in thread
From: Bhupesh Kumar Pandey, Noida @ 2005-01-11 14:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg KH

 
Hi
can any one list current problems in hotplug of FC-HBA on PCI Express under
kernel 2.6.8?
 
 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thanks and Best Regards

Bhupesh Kumar Pandey

Member Technical Staff

	   __   _

  / /  (_)__  __ ____  __  

 / /__/ / _ \/ // /\ \/ / 

/____/_/_//_/\___/ /_/\_\

	
System Software <outbind://10/main_files/image001.jpg> 

G: A-11, Sec-16, Noida ': 9891968828, 2510701:3124

	

 


^ permalink raw reply	[flat|nested] 278+ messages in thread
* HELP
@ 2004-12-11 11:25 Bartosz Hetmanski
  0 siblings, 0 replies; 278+ messages in thread
From: Bartosz Hetmanski @ 2004-12-11 11:25 UTC (permalink / raw)
  To: linux-scsi

HELP


^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2004-11-25  9:55 Bakki Srinivas
  2004-11-27  9:57 ` help Jan-Benedict Glaw
  0 siblings, 1 reply; 278+ messages in thread
From: Bakki Srinivas @ 2004-11-25  9:55 UTC (permalink / raw)
  To: Linux C Programming

[-- Attachment #1: Type: text/plain, Size: 101 bytes --]

hi,
    whats the equivalent of sprintf in the kernel mode?

Thanks with Regards
Srinivas Bakki

[-- Attachment #2: disclaimer.txt --]
[-- Type: text/plain, Size: 1091 bytes --]

-----------------------------------------------------------------------------------------------------------------------------
Disclaimer
-----------------------------------------------------------------------------------------------------------------------------

"This message(including attachment if any)is confidential and may be privileged.Before opening attachments please check them
for viruses and defects.MindTree Consulting Private Limited (MindTree)will not be responsible for any viruses or defects or
any forwarded attachments emanating either from within MindTree or outside.If you have received this message by mistake please notify the sender by return  e-mail and delete this message from your system. Any unauthorized use or dissemination of this message in whole or in part is strictly prohibited.  Please note that e-mails are susceptible to change and MindTree shall not be liable for any improper, untimely or incomplete transmission."

-----------------------------------------------------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2004-11-09  9:57 sebastian.ionita
  0 siblings, 0 replies; 278+ messages in thread
From: sebastian.ionita @ 2004-11-09  9:57 UTC (permalink / raw)
  To: netdev


____________________________________________________________
SC. FO Comunicatii SRL.
Sebastian Ionita
Administrator Sistem
mobil: 0724 212408
tel fix: 0264 450456 

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2004-10-20  5:05 Srinivasa S
  2004-10-20  5:50 ` help Guy
  2004-10-21  1:47 ` help Jon Lewis
  0 siblings, 2 replies; 278+ messages in thread
From: Srinivasa S @ 2004-10-20  5:05 UTC (permalink / raw)
  To: linux-raid

i've a raid 5 setup with 3 disks each of 1 GB. i'm using it for some
experimentation purpose. resync is n progress and is not ending at
all. its almost 15 hrs since the resync started and the "cat
/proc/mdstat" always shows something like this.

Personalities : [raid5] 
md0 : active raid5 sdj1[2] sdi1[1] sdh1[0]
      2002688 blocks level 5, 8k chunk, algorithm 2 [3/3] [UUU]
      [>....................]  resync =  0.0% (0/1001344)
finish=442287.5min speed=0K/sec

is there anything wrong - can i possibly stop the resync. the problem
i'm having is that whichever process tries to do IO with the array is
hanging. please help. thanks.

srinivasa s

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2004-08-18 12:24 Manik Raina
  0 siblings, 0 replies; 278+ messages in thread
From: Manik Raina @ 2004-08-18 12:24 UTC (permalink / raw)
  To: linux-kernel

help

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help.
@ 2004-04-01 16:56 Jason C. Leach
  2004-04-01 17:00 ` Help Måns Rullgård
  0 siblings, 1 reply; 278+ messages in thread
From: Jason C. Leach @ 2004-04-01 16:56 UTC (permalink / raw)
  To: linux-raid

Help.

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2004-04-01  0:50 g lh
  0 siblings, 0 replies; 278+ messages in thread
From: g lh @ 2004-04-01  0:50 UTC (permalink / raw)
  To: netfilter-devel

I want to know iptables testing results about its 
thruput(bandwidth),dalay,lost packets rate.where can I find out?
Thanks!

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2004-03-06 17:00 Billy Rose
  2004-03-06 19:22 ` help Francois Romieu
  0 siblings, 1 reply; 278+ messages in thread
From: Billy Rose @ 2004-03-06 17:00 UTC (permalink / raw)
  To: Linux Kernel

the kernel mode console seems like a dead issue due to duplicate effort, what 
can i help on?

-- 
. ~billyrose/make

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2004-02-01 13:13 Rami Addady
  0 siblings, 0 replies; 278+ messages in thread
From: Rami Addady @ 2004-02-01 13:13 UTC (permalink / raw)
  To: linux-raid




^ permalink raw reply	[flat|nested] 278+ messages in thread
* help...
@ 2003-12-14 22:30 Cristiano Soares
  2003-12-17 18:09 ` help Ian Hunter
  0 siblings, 1 reply; 278+ messages in thread
From: Cristiano Soares @ 2003-12-14 22:30 UTC (permalink / raw)
  To: netfilter

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

Hi, i would like to know if u guys could help me with a simple problem that im having trying to set up a network server. I have DSL conection and im sharing it with a network. I had set up the DHCPD server, all the DHCP clients in my network can receive an IP from the server, but they cant browse. I know that there as some lines that i have to set up to make de server allow the clients to browser normaly. and i also know that it has something to do with iptables, and maskarading. Please, i need help doing this. I have MSN and ICQ if anyone would like to help me. I have SSH server running also. please, please, i need help. Thanks a lot.

MSN: stillnick@hotmail.com
ICQ #: 3794264

Ass.: Cristian Soares

[-- Attachment #2: Type: text/html, Size: 1310 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2003-10-30 10:04 stefan.eletzhofer
  0 siblings, 0 replies; 278+ messages in thread
From: stefan.eletzhofer @ 2003-10-30 10:04 UTC (permalink / raw)
  To: linux-kernel

help

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2003-10-28  3:04 Kenneth H. Braun
  0 siblings, 0 replies; 278+ messages in thread
From: Kenneth H. Braun @ 2003-10-28  3:04 UTC (permalink / raw)
  To: linux-scsi

help

^ permalink raw reply	[flat|nested] 278+ messages in thread
* RE: help
@ 2003-08-29 13:58 Adeel Malik
  0 siblings, 0 replies; 278+ messages in thread
From: Adeel Malik @ 2003-08-29 13:58 UTC (permalink / raw)
  To: Steffen Malmgaard Mortensen; +Cc: linux-mips

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]


Hi Steffen,
               I couldn't understand your point. I want to disable module
versioning and for this I start make menuconfig in the linux folder. From
this I disable module versioning and then I launck make dep, make clean and
then make from the toplevel directory.
I havn't checked the top-level makefile. Can you tell me what fields need to
be added to CFLAGS to disable the MODVERSIONING.



Regards,
Adeel

 -----Original Message-----
From: Steffen Malmgaard Mortensen [mailto:smm@futarque.com]
Sent: Friday, August 29, 2003 6:21 PM
To: Adeel Malik
Subject: Re: help


Have you tried with the CFLAGS from the kernel makefile?? 
/Steffen

Adeel Malik wrote:


 



[-- Attachment #2: Type: text/html, Size: 3134 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2003-08-29 12:57 Adeel Malik
  0 siblings, 0 replies; 278+ messages in thread
From: Adeel Malik @ 2003-08-29 12:57 UTC (permalink / raw)
  To: linux-mips

[-- Attachment #1: Type: text/plain, Size: 2 bytes --]

 

[-- Attachment #2: Type: text/html, Size: 311 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <20030725061502.30342.8650.Mailman@kashyyyk>]
* help
@ 2003-07-23  6:53 ` Adeel Malik
  0 siblings, 0 replies; 278+ messages in thread
From: Adeel Malik @ 2003-07-23  6:53 UTC (permalink / raw)
  To: linux-mips

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: Type: text/html, Size: 299 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2003-07-07 18:20 Justin Rush
  0 siblings, 0 replies; 278+ messages in thread
From: Justin Rush @ 2003-07-07 18:20 UTC (permalink / raw)
  To: linux-kernel



^ permalink raw reply	[flat|nested] 278+ messages in thread
* RE: help
@ 2003-06-10 22:15 George Vieira
  0 siblings, 0 replies; 278+ messages in thread
From: George Vieira @ 2003-06-10 22:15 UTC (permalink / raw)
  To: dawn lin, netfilter

You have not mentioned anything about IPs so I assume they are on the same subnet. In that case, use a bridge which proxies the ARP requests and MAC addresses on each side of the firewall. Otherwise this won't work without routing.

A and C will see each other via B when B is setup as a bridge. You may need some patching on the kernel for iptables to work on a bridge.. not sure, brain dead this morning.. ;)

Thanks,
____________________________________________
George Vieira
Systems Manager
georgev@citadelcomputer.com.au

Citadel Computer Systems Pty Ltd
http://www.citadelcomputer.com.au

Phone   : +61 2 9955 2644
HelpDesk: +61 2 9955 2698
 

-----Original Message-----
From: dawn lin [mailto:alantisjun@hotmail.com]
Sent: Thursday, June 05, 2003 7:19 PM
To: netfilter@lists.netfilter.org
Subject: help


hi,

i have 3 computers A, B and C.
i need A to talk to C through B(not a router)

I was hoping iptables will help me do mac filtering.

is it possible?

What i need is A is able to talk B only and B is to resend A's message to B.
Which is in a way where A wants to talk to C but it can only go through B to 
talk to C.
Can anyone advice me how i can use iptables for that?

one senerio:
A send packets to C-> packet info shows MAC source=A, MAC dest=B,IP 
source=A,IP dest=C
When packet reaches B-> packet info shows MAC source=B,MAC dest=C,IP 
source=A,IP dest=C

is that possible?

_________________________________________________________________
Download Norah Jones, Eminem and more! http://www.msn.com.sg/ringtones/




^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2003-06-05  9:19 dawn lin
  0 siblings, 0 replies; 278+ messages in thread
From: dawn lin @ 2003-06-05  9:19 UTC (permalink / raw)
  To: netfilter

hi,

i have 3 computers A, B and C.
i need A to talk to C through B(not a router)

I was hoping iptables will help me do mac filtering.

is it possible?

What i need is A is able to talk B only and B is to resend A's message to B.
Which is in a way where A wants to talk to C but it can only go through B to 
talk to C.
Can anyone advice me how i can use iptables for that?

one senerio:
A send packets to C-> packet info shows MAC source=A, MAC dest=B,IP 
source=A,IP dest=C
When packet reaches B-> packet info shows MAC source=B,MAC dest=C,IP 
source=A,IP dest=C

is that possible?

_________________________________________________________________
Download Norah Jones, Eminem and more! http://www.msn.com.sg/ringtones/



^ permalink raw reply	[flat|nested] 278+ messages in thread
* supermount for 2.5 test version available
@ 2003-06-02  7:47 Andrey Borzenkov
  2003-06-02  8:02 ` help Pedro Requejo
  0 siblings, 1 reply; 278+ messages in thread
From: Andrey Borzenkov @ 2003-06-02  7:47 UTC (permalink / raw)
  To: linux-kernel

Test version of supermount for kernel 2.5.70 is available on
http://supermount-ng.sf.net/

Many things are still missing and mediactl interface needs redesign.
It is possiblly completely broken for disks anyway. Still it appears
to work for CD-ROMs and floppies to the same extent as in 2.4 (i.e.
I can easily change media and FAM even gets notified about it :).
More details are in release notes on sourceforge.

It is likely the patch won't apply to previous versions; at least
there were some incompatibilities between 2.5.69 and 2.5.70 already.

Please report bugs on sourceforge tracker.

cheers

-andrey

^ permalink raw reply	[flat|nested] 278+ messages in thread
* RE: help
@ 2003-06-02  0:54 김용철
  0 siblings, 0 replies; 278+ messages in thread
From: 김용철 @ 2003-06-02  0:54 UTC (permalink / raw)
  To: chandrashekhar dethe, nfs

You can check client's  ipchains or iptables.
Sometimes, this  is cause failure.
With regards,

Yongchul Kim.

-----Original Message-----
From: chandrashekhar dethe [mailto:cgdethe@yahoo.com]=20
Sent: Saturday, May 31, 2003 11:26 AM
To: nfs@lists.sourceforge.net
Subject: [NFS] help

Dear All,
I have been trying to mount server fs on the client
using nfs, but could not be successful in mounting fs.
Herewith I am attaching three files which can be
helpful to suggest the remedy.
1) test.txt  file - is a error message
2) rpcinfo_localhost.txt
3) rpcinfo_server.txt
Pl. suggest the appropriate remedy.

=20

=3D=3D=3D=3D=3D
with regards,

- C.G.DETHE.

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com


-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2003-05-31  2:25 chandrashekhar dethe
  0 siblings, 0 replies; 278+ messages in thread
From: chandrashekhar dethe @ 2003-05-31  2:25 UTC (permalink / raw)
  To: nfs

[-- Attachment #1: Type: text/plain, Size: 498 bytes --]

Dear All,
I have been trying to mount server fs on the client
using nfs, but could not be successful in mounting fs.
Herewith I am attaching three files which can be
helpful to suggest the remedy.
1) test.txt  file - is a error message
2) rpcinfo_localhost.txt
3) rpcinfo_server.txt
Pl. suggest the appropriate remedy.

 

=====
with regards,

- C.G.DETHE.

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

[-- Attachment #2: rpcinfo_localhost.txt --]
[-- Type: text/plain, Size: 909 bytes --]

[root@durga cgdethe]# /usr/sbin/rpcinfo -p 192.168.254.76
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp   1024  status
    100024    1   tcp   1024  status
    391002    2   tcp   1025  sgi_fam
    100011    1   udp   1008  rquotad
    100011    2   udp   1008  rquotad
    100011    1   tcp   1011  rquotad
    100011    2   tcp   1011  rquotad
    100005    1   udp   1025  mountd
    100005    1   tcp   1026  mountd
    100005    2   udp   1025  mountd
    100005    2   tcp   1026  mountd
    100005    3   udp   1025  mountd
    100005    3   tcp   1026  mountd
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100021    1   udp   1026  nlockmgr
    100021    3   udp   1026  nlockmgr
    100021    4   udp   1026  nlockmgr
    300019    1   tcp    622  amd
    300019    1   udp    623  amd


[-- Attachment #3: rpcinfo_server.txt --]
[-- Type: text/plain, Size: 841 bytes --]

[root@etc hpc_course]# /usr/sbin/rpcinfo -p 192.168.254.75
   program vers proto   port
    100000    2   tcp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp   1024  status
    100024    1   tcp   1024  status
    391002    2   tcp   1025  sgi_fam
    100011    1   udp   1015  rquotad
    100011    2   udp   1015  rquotad
    100011    1   tcp   1018  rquotad
    100011    2   tcp   1018  rquotad
    100005    1   udp   1026  mountd
    100005    1   tcp   1026  mountd
    100005    2   udp   1026  mountd
    100005    2   tcp   1026  mountd
    100005    3   udp   1026  mountd
    100005    3   tcp   1026  mountd
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100021    1   udp   1027  nlockmgr
    100021    3   udp   1027  nlockmgr
    100021    4   udp   1027  nlockmgr

[-- Attachment #4: test.txt --]
[-- Type: text/plain, Size: 238 bytes --]

[root@durga cgdethe]#  mount 192.168.254.75:/home /shrikant
mount: RPC: Port mapper failure - RPC: Unable to receive
[root@durga cgdethe]# mount 192.168.254.75:/home /home/cgdethe
mount: RPC: Port mapper failure - RPC: Unable to receive


^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2003-04-09  9:40 prem nath
  0 siblings, 0 replies; 278+ messages in thread
From: prem nath @ 2003-04-09  9:40 UTC (permalink / raw)
  To: netfilter



Hi ,
I have problem in configuring firewall using Iptables .I h...
8.0. I am using webmin to configure the firewall.
The existing IP is


2 static Ips are there from ISp eg:61.11.56.42,61.11.56.115
Webserver and DNS server is hosted on 61.11.56.42
I have an Internal network 192.168.1.x
The linux box has 2 Interfaces ETH0 61.11.56.115
eth1 is 192.168.1.19
ETH0 is connected to external and internal to switch is connected to
192.168.1.19.
They have a mail server where smtp and pop3 has to be forwarded .
Please let me know how to NAT 192.168.1.19 with 61.11.56.115.
At the same time squid proxy should work .
I need to allow ports 80,8080,22,21,23,25,110,1494,1328.
All the queries should reach the DNS server & Webserver(61.11.56.42)
eg:80,80801494,1328
Please do give me a plan so that I can forward all these to both servers
.(mail server * Webserver )
I have an idea of putting DNS server in linux firewall box but cant  forward
the queries to webserver.


Please do help me out with natting and forwarding .Getting really confused.
Awaiting reply .
Advance thanks
Regards
Prem




_________________________________________________________________
Vrroooom…… Fasten your seatbelts. 
http://server1.msn.co.in/msnSpecials/formula2003/index.asp Get set for F1 
2003



^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2003-03-08  6:10 kalpesh
  2003-03-08  8:28 ` help Patrick Schaaf
  0 siblings, 1 reply; 278+ messages in thread
From: kalpesh @ 2003-03-08  6:10 UTC (permalink / raw)
  To: netfilter-devel

help

Slow respose after using IPTABLES

Hi all,
My mail server is runnig on Redhat 7.2 with Sendmail.
Now I want to use IPTABLES for the Security Point of view. For this I made
test server and implemented IPTABLES on it. But after using IPTABLES
respose from the server is SLOW  when i use POP3 clients but it works.

I am using following script.

# Deny All

/sbin/iptables -P INPUT DROP
/sbin/iptables -P FORWARD DROP
/sbin/iptables -P OUTPUT DROP

# Local host

/sbin/iptables -A INPUT -s localhost -d localhost -j ACCEPT
/sbin/iptables -A OUTPUT -s localhost -d localhost -j ACCEPT

# ICMP

/sbin/iptables -A INPUT -s $INTRANET  -d $MYHOST -p icmp -j ACCEPT
/sbin/iptables -A OUTPUT -s $MYHOST -d $INTRANET  -p icmp -j ACCEPT


# SMTP

/sbin/iptables -A INPUT -s $INTRANET -d $MYHOST -p tcp --dport smtp    -j
ACCEPT
/sbin/iptables -A OUTPUT -s $MYHOST -d $INTRANET -p tcp --sport smtp   -j
ACCEPT

# POP3

/sbin/iptables -A INPUT -s $INTRANET -d $MYHOST -p tcp --dport pop3    -j
ACCEPT
/sbin/iptables -A OUTPUT -s $MYHOST -d $INTRANET -p tcp --sport  pop3   -j
  ACCEPT

Any suggestions ? help ? Please

with warm regards

kalpesh

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Re: YAMON.
@ 2003-02-22  8:55 Harald Koerfgen
  2001-08-14  5:54 ` help Sathish Vasudevaiah
  0 siblings, 1 reply; 278+ messages in thread
From: Harald Koerfgen @ 2003-02-22  8:55 UTC (permalink / raw)
  To: Nicu Popovici; +Cc: linux-mips, Brady Brown


On 14-Dec-00 Nicu Popovici wrote:
> Thanks . Now I have a much bigger problem. I have to try to start this ATLAS
> board without a HDD and without ethernet. At reset it should give me a login
> prompt which I have to see throught the console. Can anyone help me ?

The linux-vr tree has a nice feature called XIP (eXecute In Place). This allows
to prepare a kernel to run directly out of ROM.

http://linuxvr-org

if that's what you're looking for.

-- 
Regards,
Harald

^ permalink raw reply	[flat|nested] 278+ messages in thread
* RE: help
@ 2003-02-17 15:04 Khanh Tran
  0 siblings, 0 replies; 278+ messages in thread
From: Khanh Tran @ 2003-02-17 15:04 UTC (permalink / raw)
  To: Laxman Gummadavally; +Cc: netfilter

Try:

/sbin/chkconfig --level=2345 ipchains off
/sbin/rmmod ipchains

Hope that helps.

Khanh Tran 
Network Operations 
Sarah Lawrence College 


-----Original Message-----
From: Laxman Gummadavally [mailto:laxman@oxynetworks.com]
Sent: Monday, February 17, 2003 5:11 AM
To: netfilter@lists.netfilter.org
Subject: help


Hi,

How to disable Ipchains in Linux???

I need to enable iptables ...........


Thanks
Laxman



^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2003-02-17 10:11 Laxman Gummadavally
  0 siblings, 0 replies; 278+ messages in thread
From: Laxman Gummadavally @ 2003-02-17 10:11 UTC (permalink / raw)
  To: netfilter

[-- Attachment #1: Type: text/plain, Size: 105 bytes --]

Hi,

How to disable Ipchains in Linux???

I need to enable iptables ...........


Thanks
Laxman

[-- Attachment #2: Type: text/html, Size: 652 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2003-01-02 21:01 lmonroy
  2003-01-03  7:17 ` Help Reinhard Karcher
  0 siblings, 1 reply; 278+ messages in thread
From: lmonroy @ 2003-01-02 21:01 UTC (permalink / raw)
  To: linux-msdos

Hi,

I have been make test with dosemu and samba to migrate workstations from
windows to linux, i have a little problem, i want to run a foxpro 2,6
application but in some cases appear a message  INSUFFICIENT DISK SPACE
but i have 3GB free disk space  on the server and my computer has 2gb
free too.

In other cases appear a message INSUFFICIENT MEMORY but i edit the
dosemu.conf and i was changed  the memory parameters, and the config.sys
to add more buffers, files.

Thank you so much for your help

Regards


Luis Alberto Monroy


_______________________________________________________________________
Te recomendamos:
Aventuras para los más pequeños en: http://www.terra.com.co/ninos/
Vive la pasión del fútbol en: http://www.terra.com.co/deportes/futbol/


-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2002-12-25  7:31 Mailhebuau Christophe
  0 siblings, 0 replies; 278+ messages in thread
From: Mailhebuau Christophe @ 2002-12-25  7:31 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

Hi,

I need help to patch my kernel 2.4.19 on my mandrake 9.0.

I've compiled my kernel with acpi support it's ok, but i don't have
directory :

/proc/acpi

my laptops is an inspiron 2650

can you help me to apply patch iasl ?
-- 
Cordialement,
Christophe Mailhebuau    http://www.justlinux.org
                           http://www.abul.org
GPG: 1024D/75B07F8D: BD18 2D01 D954 A339 E35B 9EA1 4240 0410 75B0 7F8D

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help...
@ 2002-12-18 15:23 manish
  2002-12-18 16:00 ` Help Maciej Soltysiak
  0 siblings, 1 reply; 278+ messages in thread
From: manish @ 2002-12-18 15:23 UTC (permalink / raw)
  To: netfilter

Hello 
Can any one look up to my problem. The problem is:
I have set up a small lan with both wired and wireless
clients, here i am describing only wired lan.

I am giving you the details, which will help you to
understand my problem.

    A----------B----------C
               |
               |
               |
               D

Here A is my windows client with IP address
        192.168.101.1 Mask 255.255.0.0
Here B is my Linux7.3 Server with IP address
        192.168.0.1 Mask 255.255.0.0
      B is also connected to Internet with Generic
        Serial Modem (ppp0).
Here C is my windows client with IP address
        192.168.101.3 Mask 255.255.0.0
Here D is my Linux client with IP address
        192.168.80.1 Mask 255.255.0.0.
I am sharing internet to all my client i.e A, C and D.
using this command.
>iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Turn on the IP forwarding
>echo 1 > /proc/sys/net/ipv4/ip_forward

Upto this everything works fine all clients (A, C, D)
share internets.
Now if i wanted to start any chat services i.e Yahoo
Messenger or vat tool the person who has logged on
from A not able to talk to person logged on from C or
D. or even a person who is also online from out of
this network (Somewhere from internet)also not able
to call or do voice chat.
# I had use this command after that
>iptables -t nat -A PREROUTING -i ppp0 -j DNAT
 --to-destination 192.168.101.3

This time i am able to call people from outside from
machine C (192.168.101.3)and also able to do voice
conversation in vat. But another side A and D are not
able to talk to that person outside the network. Also
the above command will not work for other hosts A and
D. At a time only one machine is able to make a vat
connection from B.

1) What should i do so A, C, and D all together can
  use to call outside and able to do voice
conversation
  in vat or vive-versa?
2) what should i do so A can talk to B in yahoo or vat
 voice chat?

please let me know that is there any solution for my
problem? Mostly i wanted to run vat?
Thanks
Manish.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help...
@ 2002-12-18 15:00 manish
  0 siblings, 0 replies; 278+ messages in thread
From: manish @ 2002-12-18 15:00 UTC (permalink / raw)
  To: netfilter

Hello 
Can any one look up to my problem. The problem is:
I have set up a small lan with both wired and wireless
clients, here i am describing only wired lan.

I am giving you the details, which will help you to
understand my problem.

    A----------B----------C
               |
               |
               |
               D

Here A is my windows client with IP address
        192.168.101.1 Mask 255.255.0.0
Here B is my Linux7.3 Server with IP address
        192.168.0.1 Mask 255.255.0.0
      B is also connected to Internet with Generic
        Serial Modem (ppp0).
Here C is my windows client with IP address
        192.168.101.3 Mask 255.255.0.0
Here D is my Linux client with IP address
        192.168.80.1 Mask 255.255.0.0.
I am sharing internet to all my client i.e A, C and D.
using this command.
>iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Turn on the IP forwarding
>echo 1 > /proc/sys/net/ipv4/ip_forward

Upto this everything works fine all clients (A, C, D)
share internets.
Now if i wanted to start any chat services i.e Yahoo
Messenger or vat tool the person who has logged on
from A not able to talk to person logged on from C or
D. or even a person who is also online from out of
this network (Somewhere from internet)also not able
to call or do voice chat.
# I had use this command after that
>iptables -t nat -A PREROUTING -i ppp0 -j DNAT
 --to-destination 192.168.101.3

This time i am able to call people from outside from
machine C (192.168.101.3)and also able to do voice
conversation in vat. But another side A and D are not
able to talk to that person outside the network. Also
the above command will not work for other hosts A and
D. At a time only one machine is able to make a vat
connection from B.

1) What should i do so A, C, and D all together can
  use to call outside and able to do voice
conversation
  in vat or vive-versa?
2) what should i do so A can talk to B in yahoo or vat
 voice chat?

please let me know that is there any solution for my
problem? Mostly i wanted to run vat?
Thanks
Manish.


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help...
@ 2002-12-11 17:45 manish
  0 siblings, 0 replies; 278+ messages in thread
From: manish @ 2002-12-11 17:45 UTC (permalink / raw)
  To: netfilter

Hello 
Its really nice to see a detail information about NAT
in Linux 2.4 NAT HOWTO.It works well but i have a
small problem, i m not able to connect to voice from
my internal LAN to the internet. I am giving you the
details, which will help you to understand my problem.

   A----------B----------C
   	      |
	      |
	      |
	      D
  
Here A is my windows client with IP address
192.168.101.1 Mask 255.255.0.0
Here B is my Linux7.3 Server with IP address
192.168.0.1 Mask 255.255.0.0
B is also connected to Internet with Generic Serial
Modem (ppp0).
Here C is my windows client with IP address
192.168.101.3 Mask 255.255.0.0
Here D is my Linux client with IP address 192.168.80.1
Mask 255.255.0.0.
I am sharing internet to all my client i.e A, C and D.
using this command.

> iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
# Turn on the IP forwarding
  echo 1 > /proc/sys/net/ipv4/ip_forward

Upto this everything works fine all clients (A, C, D)
share internets.
Now if i wanted to start any chat services i.e Yahoo
Messenger or vat tool the person who has logged on
from A not able to use audio chat to person
logged on from C or D.
or even a person who is also online from out of this
network also not able to call or do voice chat.
# I had use this command after that
> iptables -t nat -A PREROUTING -i ppp0 -j DNAT
--to-destination 192.168.101.3
This time i am able to call people from outside from
machine C (192.168.101.3) and also able to do voice
conversation in vat. But another side A and D are not
able to talk to that person outside the network. Also
the above command will not for other hosts A and D. At
a time only one machine is able to make a vat
connection from B.

1) What should i do so A, C, and D all together can
use to call outside and able to do voice conversation
in vat?
2) what should i do so A can talk to B in yahoo or vat
voice chat?

please let me know that is there any solution for my
problem?
Thanks
Regards.

Manish.

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2002-12-05 16:14 Dmitry V. Zhulanov
  0 siblings, 0 replies; 278+ messages in thread
From: Dmitry V. Zhulanov @ 2002-12-05 16:14 UTC (permalink / raw)
  To: linux-kernel

help


^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2002-12-05 15:17 Dmitry V. Zhulanov
  0 siblings, 0 replies; 278+ messages in thread
From: Dmitry V. Zhulanov @ 2002-12-05 15:17 UTC (permalink / raw)
  To: linux-sound

help



^ permalink raw reply	[flat|nested] 278+ messages in thread
* help
@ 2002-11-18 13:24 Hyunjung Park
  0 siblings, 0 replies; 278+ messages in thread
From: Hyunjung Park @ 2002-11-18 13:24 UTC (permalink / raw)
  To: netdev



^ permalink raw reply	[flat|nested] 278+ messages in thread
[parent not found: <E18D9IZ-0006nI-00@sc8-sf-list2.sourceforge.net>]
[parent not found: <F392BE64738A7143B00E86A5634FBF142C85@akun2900.intra.savi.ch>]
* help
@ 2002-10-11 10:38 Nataraj
  2002-10-14  4:02 ` help ashutosh.varshney
  0 siblings, 1 reply; 278+ messages in thread
From: Nataraj @ 2002-10-11 10:38 UTC (permalink / raw)
  To: nfs

[-- Attachment #1: Type: text/plain, Size: 4383 bytes --]

Hi,

I have Redhat linux 7.2 and NFS V3 working on it. it puts too much load on network which slows down all network operations.
Also I am running NFS on Solaris 7. I just want to know the who is cause the problem.

both side NFS working on UDP.

  a.. the version of nfs-utils Iam  are using (nfs-utils-0.3.1-13.7.2.1)

  b.. the version of the kernel and any non-stock applied kernels. is (2.4.7-10)

  c.. the distribution of linux you are using (REDHAT )

  d.. the version(s) of other operating systems involved. ( Linux 7.2)

It is also useful to know the networking configuration connecting the hosts ( cat 5 with 10/100 switch network).

Linux NFS server.


  a.. the output of rpcinfo -p localhost run on the server out put is 

program vers proto   port
100000    2   tcp    111  portmapper
100000    2   udp    111  portmapper
100024    1   udp  32768  status
100024    1   tcp  32768  status
100004    2   udp    624  ypserv
100004    1   udp    624  ypserv
100004    2   tcp    627  ypserv
100004    1   tcp    627  ypserv
100007    2   udp    644  ypbind
100007    1   udp    644  ypbind
100007    2   tcp    647  ypbind
100007    1   tcp    647  ypbind
100003    2   udp   2049  nfs
100003    3   udp   2049  nfs
100021    1   udp  32771  nlockmgr
100021    3   udp  32771  nlockmgr
100021    4   udp  32771  nlockmgr
100009    1   udp    830  yppasswdd
100011    1   udp    685  rquotad
100011    2   udp    685  rquotad
100011    1   tcp    688  rquotad
100011    2   tcp    688  rquotad
100005    1   udp  32774  mountd
100005    1   tcp  32770  mountd
100005    2   udp  32774  mountd
100005    2   tcp  32770  mountd
100005    3   udp  32774  mountd
100005    3   tcp  32770  mountd



for Solaris is

  a.. the output of rpcinfo -p localhost out put is

program vers proto   port
100000    4   tcp    111  portmapper
100000    3   tcp    111  portmapper
100000    2   tcp    111  portmapper
100000    4   udp    111  portmapper
100000    3   udp    111  portmapper
100000    2   udp    111  portmapper
100004    2   udp    728  ypserv
100004    1   udp    728  ypserv
100004    1   tcp    729  ypserv
100004    2   tcp  32771  ypserv
1073741824    2   udp  32772
100007    3   udp  32778  ypbind
100007    2   udp  32778  ypbind
100007    1   udp  32778  ypbind
100007    3   tcp  32772  ypbind
100007    2   tcp  32772  ypbind
100007    1   tcp  32772  ypbind
100024    1   udp  32783  status
100024    1   tcp  32773  status
100133    1   udp  32783
100133    1   tcp  32773
100021    1   udp   4045  nlockmgr
100021    2   udp   4045  nlockmgr
100021    3   udp   4045  nlockmgr
100021    4   udp   4045  nlockmgr
100232   10   udp  32785  sadmind
100011    1   udp  32786  rquotad
100002    2   udp  32787  rusersd
100002    3   udp  32787  rusersd
100002    2   tcp  32774  rusersd
100002    3   tcp  32774  rusersd
100012    1   udp  32788  sprayd
100008    1   udp  32789  walld
100001    2   udp  32790  rstatd
100001    3   udp  32790  rstatd
100001    4   udp  32790  rstatd
100083    1   tcp  32775
100221    1   tcp  32776
100235    1   tcp  32777
100068    2   udp  32791
100068    3   udp  32791
100068    4   udp  32791
100068    5   udp  32791
300326    4   tcp  32778
100021    1   tcp   4045  nlockmgr
100021    2   tcp   4045  nlockmgr
100021    3   tcp   4045  nlockmgr
100021    4   tcp   4045  nlockmgr
100005    1   udp  32803  mountd
100005    2   udp  32803  mountd
100005    3   udp  32803  mountd
100005    1   tcp  32779  mountd
100005    2   tcp  32779  mountd
100005    3   tcp  32779  mountd
100003    2   udp   2049  nfs
100003    3   udp   2049  nfs
100227    2   udp   2049  nfs_acl
100227    3   udp   2049  nfs_acl
100003    2   tcp   2049  nfs
100003    3   tcp   2049  nfs
100227    2   tcp   2049  nfs_acl
100227    3   tcp   2049  nfs_acl
300598    1   udp  32805
300598    1   tcp  32781
805306368    1   udp  32805
805306368    1   tcp  32781
100249    1   udp  32807
100249    1   tcp  32782
1289637087    4   tcp  32859
1289637087    1   tcp  32859
1289637087    3   tcp  32859
1289637087    2   tcp  32859
1289637086    4   tcp  35213
1289637086    1   tcp  35213
1289637086    3   tcp  35213
1289637086    2   tcp  35213

Help on this will be greatful

Thanks 

Yukthi




[-- Attachment #2: Type: text/html, Size: 9923 bytes --]

^ permalink raw reply	[flat|nested] 278+ messages in thread
* Help
@ 2001-11-19 20:48 dave
  2001-11-20 13:19 ` Help David Woodhouse
  0 siblings, 1 reply; 278+ messages in thread
From: dave @ 2001-11-19 20:48 UTC (permalink / raw)
  To: linux-mtd

Does the following error message mean anything to anyone?
(I don't belong to this mailing list as yet so please reply direct)

flashcard: erase failed, status 0xffff
and then I have to reboot

I have a DOC1000 with all the right patches to 2.4.9.
And the erase ioctl returns this.

I can read from it using dd.
But writes fail with similar results.

^ permalink raw reply	[flat|nested] 278+ messages in thread
* HELP
@ 2001-06-07  9:04 Abraham vd Merwe
  2001-06-07  9:35 ` HELP David Woodhouse
  0 siblings, 1 reply; 278+ messages in thread
From: Abraham vd Merwe @ 2001-06-07  9:04 UTC (permalink / raw)
  To: MTD for Linux

[-- Attachment #1: Type: text/plain, Size: 7661 bytes --]

Hi!

I'm busy debugging my chip driver for 28Fxx... chips in LART and I got this
problem with one of my tests:

------------< snip <------< snip <------< snip <------------
root@tinystor:~# ./mtd_debug write 2 6 /dev/zero
MTD_open
MTD_write
flash_write(to = 0x00000002, len = 6)
write_dword(): 0x00000000 <- 0x0000ffff
mtd_debug: Unaligned memory access at pc=0xca005644, lr=0xc001dc08 (bad
address=0xc0135d82, cod)
Internal error: alignment exception: 0
CPU: 0
pc : [<ca005644>]    lr : [<c001dc08>]
sp : c9635f10  ip : c9635f54  fp : c9635f44
r10: c0135d82  r9 : 00000000  r8 : 00000004
r7 : c0135d82  r6 : 00000002  r5 : 00000004  r4 : 00000000
r3 : 00000002  r2 : 00000004  r1 : ca005adc  r0 : ca005ac0
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  Segment user
Control: C075117F  Table: C075117F  DAC: 00000015
Process mtd_debug (pid: 273, stackpage=c9635000)
Code: e59f10c0 e1a02008 (e49a3004) e2455004 eb00020f
Stack:
c9635f00: c001dc08 ca005644 20000013 ffffffff  00000002 00000000 0000ffff
00000006
c9635f20: c0135d80 00000000 00000006 c00116e0  c011bec0 0200d800 c9635f80
c9635f48
c9635f40: ca002648 ca0054b0 c9635f54 c0135d80  00000000 00000002 c00116c0
ffffffea
c9635f60: 00000000 00000006 0200d800 00000004  bfffff30 c9635fac c9635f84
c003f48c
c9635f80: ca0024e4 c00180bc c003ee5c 0200d800  0200d810 20000010 00000002
c0012804
c9635fa0: 00000000 c9635fb0 c0012680 c003f3bc  0200d800 c0018690 00000003
0200d800
c9635fc0: 00000006 ffffffff 0200d800 0200d810  00000006 00000002 00000003
400fe248
c9635fe0: bfffff30 bffffdcc 400abaa0 bffffda8  02000b48 400abaa4 20000010
00000003
Backtrace:
Function entered at [<ca0054a4>] from [<ca002648>]
Function entered at [<ca0024d8>] from [<c003f48c>]
Function entered at [<c003f3b0>] from [<c0012680>]
 r8 = C0012804  r7 = 00000002  r6 = 20000010  r5 = 0200D810
 r4 = 0200D800
Segmentation fault
root@tinystor:~#
------------< snip <------< snip <------< snip <------------

All that the test program in this case is doing is writing 6 bytes starting
at offset 2 in /dev/mtd0 to /dev/mtd0 (damn, this sounds confusing). Here is
the test procedure:

------------< snip <------< snip <------< snip <------------
void file_to_flash (int fd,u_int32_t offset,u_int32_t len,const char
*filename)
{
   u_int8_t *buf;
   FILE *fp;
   int err;
   if (offset != lseek (fd,offset,SEEK_SET))
     {
        perror ("lseek()");
        return;
     }
   if ((buf = (u_int8_t *) malloc (len * sizeof (u_int8_t))) == NULL)
     {
        perror ("malloc()");
        return;
     }
   if ((fp = fopen (filename,"r")) == NULL)
     {
        perror ("fopen()");
        free (buf);
        return;
     }
   if (fread (buf,len,1,fp) != 1 || ferror (fp))
     {
        perror ("fread()");
        free (buf);
        fclose (fp);
        return;
     }
   err = write (fd,buf,len);
   if (err < 0)
     {
        perror ("write()");
        free (buf);
        fclose (fp);
        return;
     }
   free (buf);
   fclose (fp);
   printf ("Copied %d bytes from %s to address 0x%.8x in
flash\n",len,filename,offset);
}
------------< snip <------< snip <------< snip <------------

Above function is called with an open file descriptor to /dev/mtd0, offset =
2, len = 6, and the source file is /dev/zero

As you can see from the fault that occurred, above function obviously
reached the write(), so I doubt there's anything wrong with the function
above (after I can't see anything that might be unaligned in there)

Now the chip driver which is used by /dev/mtd0 is a dummy driver which fakes
the write and just shows you what it would do (hence the write_dword():
0x00000000 <- 0x0000ffff)

Below is the relevant module code:

------------< snip <------< snip <------< snip <------------
static int flash_write (struct mtd_info *mtd,loff_t to,size_t len,size_t
*retlen,const u_char *buf)
{
   __u8 tmp[4];
   int i,n;

#ifdef LART_DEBUG
   printk (KERN_DEBUG "%s(to = 0x%.8x, len = %d)\n",__FUNCTION__,(__u32)
to,len);
#endif

   *retlen = 0;

   /* sanity checks */
   if (!len) return (0);
   if (to + len > mtd->size) return (-EINVAL);

   /* first, we write a 0xFF.... padded byte until we reach a dword boundary
*/
   if (to & (BUSWIDTH - 1))
     {
        __u32 aligned = to & ~(BUSWIDTH - 1);
        int gap = to - aligned;

        i = n = 0;

        while (gap--) tmp[i++] = 0xFF;
        while (len && i < BUSWIDTH) tmp[i++] = buf[n++], len--;
        while (i < BUSWIDTH) tmp[i++] = 0xFF;

        if (!write_dword (aligned,*((__u32 *) tmp))) return (-EIO);

        to += n;
        buf += n;
        *retlen += n;
     }

   /* now we write dwords until we reach a non-dword boundary */
   while (len >= BUSWIDTH)
     {
        if (!write_dword (to,*((__u32 *) buf))) return (-EIO);

        to += BUSWIDTH;
        buf += BUSWIDTH;
        *retlen += BUSWIDTH;
        len -= BUSWIDTH;
     }

   /* top up the last unaligned bytes, padded with 0xFF.... */
   if (len & (BUSWIDTH - 1))
     {
        i = n = 0;

        while (len--) tmp[i++] = buf[n++];
        while (i < BUSWIDTH) tmp[i++] = 0xFF;

        if (!write_dword (to,*((__u32 *) tmp))) return (-EIO);

        *retlen += n;
     }

   return (0);
}

static inline int write_dword (__u32 offset,__u32 x)
{
#ifndef LART_DEBUG
   __u32 status;

   /* setup writing */
   write32 (data_to_flash (PGM_SETUP),offset);

   /* write the data */
   write32 (x,offset);

   /* wait for the write to finish */
   do
     {
        write32 (data_to_flash (STATUS_READ),offset);
        status = flash_to_data (read32 (offset));
     }
   while ((~status & STATUS_BUSY) != 0);

   /* put the flash back into command mode */
   write32 (data_to_flash (READ_ARRAY),offset);

   /* was the write successfull? */
   if ((status & STATUS_PGM_ERR) || read32 (x) != x)
     {
        printk (KERN_WARNING "%s: write error at address
0x%.8x.\n",module_name,offset);
        return (0);
     }
#else
   printk (KERN_DEBUG "%s(): 0x%.8x <- 0x%.8x\n",__FUNCTION__,offset,x);
#endif

   return (1);
}
------------< snip <------< snip <------< snip <------------

LART_DEBUG is of course defined. As you can see from the output, the first
if() was executed successfully and then it crashed in the while loop (at
offset 2, there's a padded word and a dword that needs to be written. The
dword get's caught be the while loop).

What I don't get is why I get an "Unaligned memory access" since all the
data I'm using should be aligned correctly by the compiler. Also a similar
test that tests the dword while loop works perfectly:

------------< snip <------< snip <------< snip <------------
root@tinystor:~# ./mtd_debug write 4 6 /dev/zero
MTD_open
MTD_write
flash_write(to = 0x00000004, len = 6)
write_dword(): 0x00000004 <- 0x00000000
write_dword(): 0x00000008 <- 0xffff0000
Copied 6 MTD_close
bytes from /dev/zero to address 0x00000004 in flash
root@tinystor:~#
------------< snip <------< snip <------< snip <------------

Any help would really be appreciated.

-- 

Regards
 Abraham

Love is never asking why?

__________________________________________________________
 Abraham vd Merwe - 2d3D, Inc.

 Device Driver Development, Outsourcing, Embedded Systems

  Cell: +27 82 565 4451         Snailmail:
   Tel: +27 21 761 7549            Block C, Antree Park
   Fax: +27 21 761 7648            Doncaster Road
 Email: abraham@2d3d.co.za         Kenilworth, 7700
  Http: http://www.2d3d.com        South Africa


[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

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

end of thread, other threads:[~2023-06-12  9:53 UTC | newest]

Thread overview: 278+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-06  5:55 Help madalin mihailescu
2003-06-11  1:14 ` Help Lucas Correia Villa Real
  -- strict thread matches above, loose matches on Subject: below --
2023-06-12  9:33 help stanzgy
2023-06-12  9:36 ` help stanzgy
2022-11-29 21:01 help hinxx
2022-11-15  4:35 Help jovial umwari
2022-11-15 13:59 ` Help Julia Lawall
2022-06-16  5:26 help Andreas Radke
2022-06-03 23:04 help Thomas Green
2022-02-25  0:04 Help 张健
2020-11-28 14:32 help Rroach
2020-09-16 16:33 help Dan Jakubiec
2020-04-07  5:06 help number201724
2020-03-24 10:13 Help Chained Up
2020-03-25 15:34 ` Help Philippe Mathieu-Daudé
2020-03-21 19:26 help don fisher
2020-02-07  5:26 help Frank Esposito
2020-01-17 19:31 help Fairouz Fakhfakh
     [not found] <20191121140040.GB9271.ref@pc1lin.fred.org>
2019-11-21 14:00 ` help Fred
2019-03-14  6:39 help Yubin
2019-02-06  5:26 help John Klug
2018-11-21 13:32 help _
2018-10-17  8:33 help Lorenzo Chelini
2018-10-17  9:28 ` help Madhavan Srinivasan
2018-08-07 13:01 help Marcel J.E. Mol
2018-05-06 19:28 help Richard Lee
2018-01-06 16:44 Help Farouk Maâboudallah
2018-01-06 22:40 ` Help Ozgur
2018-01-07  0:56 ` Help Tobin C. Harding
2018-01-07  1:39 ` Help valdis.kletnieks at vt.edu
2017-09-28  1:21 Help Nityananda
2017-09-28  3:06 ` Help Christian Couder
2017-05-17 14:26 help James Okken
     [not found] <mailman.63189.1489153806.15860.yocto@yoctoproject.org>
2017-03-10 14:25 ` help Suneetha Lakshmi G
2017-03-10 14:28   ` help Robert P. J. Day
2017-03-10 14:39   ` help Schmitt, Richard
2017-03-10 18:15   ` help Khem Raj
2017-03-13  4:28     ` help Suneetha Lakshmi G
2017-01-28 16:59 help Micah Crochet
2017-01-17 17:35 help Jay Miller
2016-08-19 13:11 help jayachandran.subramanian
2016-08-19 18:09 ` help Stephen Hemminger
2016-08-19 18:36   ` help Wiles, Keith
2016-08-20  0:26 ` help harshavardhan Reddy
2016-05-13  7:25 help Chandrakanth Sherkhane (IC Nexus)
2016-05-13  7:34 ` help Chris Z.
2016-05-13  9:26 ` help Burton, Ross
2016-05-13  9:30   ` help Herman van Hazendonk
2016-03-23 10:23 help Marwa Hamza
2016-03-10 20:04 help Safa Hamza
2016-03-11 14:49 ` help Konrad Rzeszutek Wilk
     [not found]   ` <CAFwQ9hH6_7v57sw9c96GG=B9FdqFGn4WnDYO3RU5sLxEKQX7gg@mail.gmail.com>
     [not found]     ` <20160311152001.GJ5133@char.us.oracle.com>
2016-03-11 15:20       ` help Konrad Rzeszutek Wilk
     [not found]         ` <CAFwQ9hE_erNA4uCCpdKwWRdZXRF39YJ=mqo6dbOpeWkNdipyTA@mail.gmail.com>
2016-03-11 16:02           ` help Konrad Rzeszutek Wilk
2016-03-11 16:08             ` help Safa Hamza
2016-03-11 16:09             ` help Wei Liu
     [not found]               ` <CAFwQ9hFx_ctRJdPzuE03asqYwcdxAGPFii_Ns0WFk3dmrVSfBQ@mail.gmail.com>
2016-03-11 17:16                 ` help Wei Liu
2016-03-15 17:56                   ` help Julien Grall
2016-03-15 18:09                     ` help Konrad Rzeszutek Wilk
2016-03-15 18:16                       ` help Julien Grall
2016-03-15 18:21                         ` help Konrad Rzeszutek Wilk
2016-03-15 18:22                           ` help Julien Grall
2016-03-15 21:01                   ` help Safa Hamza
2016-03-15 23:47                     ` help Doug Goldstein
2015-11-24 14:40 Help Almeida, Gabriel
2015-11-23 18:31 help Carlos Palminha
2015-11-02  8:22 Help Almeida, Gabriel
2015-11-02 17:38 ` Help Michael Wood
2015-11-30  7:31 ` Help Almeida, Gabriel
     [not found] <CAD-PXq+fMXjH3r==9wDBRn0U37HLmkfWPT7JPh+82OWQEqph-w@mail.gmail.com>
2015-09-30  9:41 ` Help Mulyadi Santosa
2015-10-05 18:00   ` Help Prem Kumar
2015-07-23 15:05 Help Akash Talole
2015-07-24  7:46 ` Help Wei Liu
2015-07-03  8:45 Help Akash Talole
     [not found] <557FA708.7020101@yahoo.fr>
2015-06-25  4:51 ` Help Luc Pierard de Maujouy
2015-06-25  8:51   ` Help Ian Campbell
2015-01-21 20:38 Help Natesh Relhan
2015-01-14  9:16 Help SAJID HOSSAIN
2015-01-14 10:19 ` Help Anuz Pratap Singh Tomar
2015-01-14 10:24   ` Help Anuz Pratap Singh Tomar
2014-12-04 19:01 help m_del_buon
2014-12-04 19:19 ` help Arend van Spriel
2014-10-09 12:43 help Manuel Piroz
2014-10-09 13:14 ` help Burton, Ross
2013-03-23  7:51 Help Arun Kv
2013-03-25 10:54 ` Help George Dunlap
2013-01-23  9:59 help Narendra Pal Singh
     [not found] <mailman.3.1347822001.6317.yocto@yoctoproject.org>
2012-09-16 19:10 ` help Jam1e Harr1s
2012-08-21  1:26 help du81692468
2012-08-23 19:18 ` help Dexter Filmore
2012-06-14 16:30 help chen.chenchacha
2011-11-18  5:12 help shepherd Lazy
2011-10-29 20:37 help Kai Moonbourn
2011-10-28  4:15 Help Pankaj Kumar Biswas
2011-10-28  8:47 ` Help Ian Campbell
2011-10-17 23:50 help Mario Torres
2011-10-14 16:22 help Mario Torres
2011-10-14 16:21 help Mario Torres
2011-07-28 23:33 help Martin Partridge
2011-07-28 23:47 ` help Christian Lamparter
2011-07-29  3:12 ` help Pavel Roskin
2011-07-29 16:32   ` help Pavel Roskin
2011-04-22  8:49 help wolfu
2010-12-21  7:58 help andy xu
2010-09-20 12:06 help Marcos
2010-09-20 12:16 ` help Oskar Berggren
2010-09-20 12:06 help Marcos
2010-05-29  2:48 help code.perfect
2010-05-28  9:06 help code.perfect
2010-05-17 17:00 Help Sgt. Ken Holland
2010-05-17 17:00 ` Help Sgt. Ken Holland
2010-05-17 17:00 Help Sgt. Ken Holland
2009-10-24  5:15 help Ingo Krabbe
2009-10-19 16:07 help Jens-U. Mozdzen
2009-10-01 13:22 help Jie Cai
2009-10-01 13:16 help Jie Cai
     [not found] <E1McOLX-0003Lq-BN@665xhf1.ch3.sourceforge.com>
     [not found] ` <200908152239.15915.rjw@sisk.pl>
     [not found]   ` <20090822073516.GD2108@elf.ucw.cz>
2009-09-22 23:33     ` Help Rafael J. Wysocki
     [not found]     ` <200909230133.28689.rjw@sisk.pl>
2009-09-23 16:43       ` Help Pavel Machek
2009-09-18 11:19 Help Lorenzo Brito Morales
2009-09-18 13:18 ` Help Iain Hibbert
2009-09-10 13:57 help Dante Durham
2009-08-21 13:27 RAID10 Layouts Info
2009-08-21 16:43 ` Goswin von Brederlow
2009-08-21 18:02   ` Info
2009-08-21 19:20     ` Help Info
2009-08-21 19:38       ` Help John Robinson
2009-08-21 20:51         ` Help Info
2009-08-22  6:14       ` Help Info
2009-08-22  9:34         ` Help NeilBrown
2009-08-22 12:56           ` Help Info
2009-08-22 16:47             ` Help John Robinson
2009-08-22 18:12               ` Help Info
2009-08-22 20:45                 ` Help Info
2009-08-22 20:59                   ` Help Guy Watkins
     [not found]                     ` <200908230631.46865.Info@quantum-sci.net>
2009-08-24 23:08                       ` Help Info
2009-08-24 23:38                         ` Help NeilBrown
2009-08-25 13:18                           ` Help Info
2009-08-27 12:47                             ` Help Info
2009-08-23 20:28                 ` Help John Robinson
2009-04-24 11:31 Help Sudeept Prusti
2009-04-24 11:39 ` Help Jaroslav Kysela
2009-04-24 11:53   ` Help Sudeept Prusti
2009-04-24 16:05     ` Help Alan Horstmann
     [not found] <20081205170026.821496198E3@hormel.redhat.com>
2008-12-05 17:24 ` help Brian Rosenberger
2008-09-28  5:06 help Reg Clemens
2008-08-13  9:26 Help Boris Shteinbock
2008-08-13 12:02 ` Help Arnd Bergmann
2008-08-13  8:22 help Artem Bityutskiy
2008-08-13  8:29 ` help Artem Bityutskiy
2008-07-24  7:18 Help Sudeept Prusti
2008-07-24 16:53 ` Help stan
     [not found] <20080220170012.C9E168E0292@hormel.redhat.com>
2008-02-21  8:25 ` help Lothar Brendel
     [not found] <mailman.230.1199775553.6908.linuxppc-dev@ozlabs.org>
2008-01-08  7:04 ` help 张自强
2007-12-26  1:15 Help xiaodan
2007-12-10 11:48 help Thanos Chatziathanassiou
2007-12-11  1:02 ` help David Newall
2007-12-02  4:24 help YanBob
2007-12-02 17:09 ` help Tobin Davis
2007-11-26 14:53 help liujiusheng
2007-11-18 18:48 help mattias
2007-11-18 19:06 ` help Morten K. Poulsen
     [not found] <46D25A05.4070606@davidnewall.com>
2007-08-27 17:18 ` help David Newall
2007-08-27 17:31   ` help Michal Piotrowski
     [not found] <mailman.274497.1187370904.21973.nfs@lists.sourceforge.net>
2007-08-18  5:35 ` help Kapil Maheshwari
2007-05-16  0:25 help Mao Wei
2006-08-29  8:12 help Limeng [李萌]
2006-08-29  8:48 ` help Jan Engelhardt
2006-08-23 19:21 help Archie Cotton
2006-08-23 19:21 help Archie Cotton
2006-08-16 12:46 help Hemanth KumarBS
2006-08-15  2:35 help derrywang
2006-04-09 20:47 help amirhosein jahanbekam
2006-03-09  2:57 help zhaoyw
2006-03-09  9:51 ` help Matej Kupljen
2006-02-04  2:21 Help Oren Ben-Menachem
2005-12-28 10:53 help wayne.chen
     [not found] <430C62420003CAE8@mail14.jumpyint.it>
2005-12-08 17:18 ` Help helant2005
2005-11-27 20:30 help Matt Darcy
     [not found] <1122236195.3173.68.camel@localhost>
2005-11-19 12:40 ` help Yu Luming
2005-11-17  6:02 help prabha.j
2005-11-17 14:04 ` help Wolfgang Denk
2005-11-16  8:26 help Hua Feijun
2005-11-16  8:40 ` help Ian McDonald
2005-08-29  4:01 help raja
2005-08-29  4:41 ` help Randy.Dunlap
2005-08-27  7:01 help raja
2005-08-27  7:32 ` help Pekka Enberg
2005-08-09 17:24 help androsov
     [not found] ` <000001c59d07$3a9ee170$a14a3d0a-8fM5sft8TcWs1BDpvl8NfQ@public.gmane.org>
2005-08-09 17:59   ` help Andrew Haninger
     [not found]     ` <105c793f05080910595ceb4199-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2005-08-10  7:28       ` help Bruno Ducrot
2005-07-26  9:21 help 戴红刚
2005-07-25  7:50 help support
2005-07-21 11:39 help Jordan, Kyle
2005-07-21  5:59 help 戴红刚
2005-05-28 14:15 help John W. M. Stevens
2005-05-19  6:23 help NEC
2005-05-19  6:23 ` help Jean Delvare
2005-05-19  6:23 ` Help Ville Jutvik
2005-05-19  6:23 ` Help phil
2005-05-19  6:23 ` Help Mark Studebaker
2005-05-19  6:23 ` help Kyösti Mälkki
2005-05-19  6:23 ` help Stealth
2005-05-19  6:25 ` HELP Lev A. Melnikovsky
2005-05-13 13:25 [PATCH 2.6] vr41xx: remove old TB0219 driver Yoichi Yuasa
2005-05-17  6:20 ` help Steve Alexander
2005-05-10  8:01 help andyliu
2005-05-07 13:46 help sen lin
2005-04-07 16:29 Help James Carlson
2005-04-07 16:32 ` Help Kumar
2005-04-07 16:42 ` Help Bill Unruh
2005-01-24  4:33 help wayne.chen
2005-01-22 10:12 Help Pankaj Agarwal
2005-01-22 11:16 ` Help Graeme T Ford
2005-01-11 15:36 help Bhupesh Kumar Pandey, Noida
2005-01-11 15:51 ` help Greg KH
2005-01-11 17:00   ` help Theodore Ts'o
2005-01-11 16:07 ` help Erik Mouw
2005-01-11 14:28 help Bhupesh Kumar Pandey, Noida
2005-01-11 15:16 ` help Greg KH
2004-12-11 11:25 HELP Bartosz Hetmanski
2004-11-25  9:55 help Bakki Srinivas
2004-11-27  9:57 ` help Jan-Benedict Glaw
2004-11-09  9:57 help sebastian.ionita
2004-10-20  5:05 help Srinivasa S
2004-10-20  5:50 ` help Guy
2004-10-21  1:47 ` help Jon Lewis
2004-08-18 12:24 help Manik Raina
2004-04-01 16:56 Help Jason C. Leach
2004-04-01 17:00 ` Help Måns Rullgård
2004-04-01  0:50 help g lh
2004-03-06 17:00 help Billy Rose
2004-03-06 19:22 ` help Francois Romieu
2004-02-01 13:13 help Rami Addady
2003-12-14 22:30 help Cristiano Soares
2003-12-17 18:09 ` help Ian Hunter
2003-12-17 18:22   ` help Antony Stone
2003-10-30 10:04 help stefan.eletzhofer
2003-10-28  3:04 help Kenneth H. Braun
2003-08-29 13:58 help Adeel Malik
2003-08-29 12:57 help Adeel Malik
     [not found] <20030725061502.30342.8650.Mailman@kashyyyk>
2003-07-25 14:33 ` help durga prasad
2003-07-23  6:53 help Adeel Malik
2003-07-23  6:53 ` help Adeel Malik
2003-07-07 18:20 help Justin Rush
2003-06-10 22:15 help George Vieira
2003-06-05  9:19 help dawn lin
2003-06-02  7:47 supermount for 2.5 test version available Andrey Borzenkov
2003-06-02  8:02 ` help Pedro Requejo
2003-06-02  0:54 help 김용철
2003-05-31  2:25 help chandrashekhar dethe
2003-04-09  9:40 help prem nath
2003-03-08  6:10 help kalpesh
2003-03-08  8:28 ` help Patrick Schaaf
2003-02-22  8:55 YAMON Harald Koerfgen
2001-08-14  5:54 ` help Sathish Vasudevaiah
2003-02-17 15:04 help Khanh Tran
2003-02-17 10:11 help Laxman Gummadavally
2003-01-02 21:01 Help lmonroy
2003-01-03  7:17 ` Help Reinhard Karcher
2002-12-25  7:31 help Mailhebuau Christophe
2002-12-18 15:23 Help manish
2002-12-18 16:00 ` Help Maciej Soltysiak
2002-12-18 15:00 Help manish
2002-12-11 17:45 Help manish
2002-12-05 16:14 help Dmitry V. Zhulanov
2002-12-05 15:17 help Dmitry V. Zhulanov
2002-11-18 13:24 help Hyunjung Park
     [not found] <E18D9IZ-0006nI-00@sc8-sf-list2.sourceforge.net>
     [not found] ` <E18D9IZ-0006nI-00-ek0oC1U1TqqnvZpeIfgr/KQD96bmaF075NbjCUgZEJk@public.gmane.org>
2002-11-16 20:22   ` help deepak singh
     [not found] <F392BE64738A7143B00E86A5634FBF142C85@akun2900.intra.savi.ch>
2002-10-31  8:50 ` Help Antony Stone
2002-10-11 10:38 help Nataraj
2002-10-14  4:02 ` help ashutosh.varshney
2001-11-19 20:48 Help dave
2001-11-20 13:19 ` Help David Woodhouse
2001-06-07  9:04 HELP Abraham vd Merwe
2001-06-07  9:35 ` HELP David Woodhouse
2001-06-07  9:43   ` HELP Abraham vd Merwe
2001-06-07 14:30     ` HELP Nicolas Pitre
2001-06-07  9:44   ` HELP David Woodhouse
2001-06-07  9:47     ` HELP Abraham vd Merwe
2001-06-07 17:21     ` HELP Russ Dill
2001-06-07 20:01     ` HELP David Woodhouse
2001-06-07  9:48   ` HELP David Woodhouse
2001-06-07  9:51     ` HELP Abraham vd Merwe
2001-06-07 10:16     ` HELP David Woodhouse
2001-06-07 14:23   ` HELP Nicolas Pitre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.