Monday, December 3, 2018

QEMU memory

http://blog.vmsplice.net/2016/01/qemu-internals-how-guest-physical-ram.html


QEMU migration

RAM migration is basically sending all pages in RAMblock structure's'.

http://blog.vmsplice.net/2016/01/qemu-internals-how-guest-physical-ram.html

ram_list global variable has all the RAMblocks.

Therefore, RAM migration is
1) iterating all RAMblocks
2) iterating all pages in a RAM block

ram_save_page() is the function that sends a page to the destination.
It only cares the source block and the offset within the block (i.e. nth page in the block) recorded in PageSearchStatus structure.

```
/* used by the search for pages to send */
struct PageSearchStatus {
    /* Current block being searched */
    RAMBlock    *block;
    /* Current page to search from */
    unsigned long page; /* The nth page in the block */
    /* Set once we wrap around */
    bool         complete_round;
};
```


Friday, July 27, 2018

Use regex for pexpect()

I was writing a pexpect script to wait for (qemu).

child.pexpect('(qemu)')

didn't work.

ree = re.compile('\(qemu\)')
child.pexpect(ree)

worked.

In fact,

child.expect('\(qemu\)')

this just worked.

Strings will be compiled to re types
https://pexpect.readthedocs.io/en/stable/api/pexpect.html

expect_exact() would not compile strings to re types.

Friday, May 25, 2018

Navigating big project source code


Linux/QEMU 코드를 봐야할 일이 많다보니, 나름대로 약간의 팁이 생겨서 일단 적어둠.

나의 경우는 대부분 hardware에서 지원하는 functionality를 QEMU에서 emulation 하거나 KVM에서 이용하는 경우가 많음.

1. 몇개의 keyword로 해당 patch를 찾는다 (e.g. posted interrupt kvm nested)

2. 그럼 대략 관련 patch의 cover letter 또는 patch가 나온다

3. 최종 버젼을 찾는다. (google을 하거나, mailing list에서 찾음). Git repo에서 날짜/시간으로 찾은게 최종 버젼이 맞는지 확인할 수 있음.

4. 편한 방법대로 (web이나 e-mail client나 git 이나) patch를 읽는다.

5. latest source code를 읽는다. 처음에 patch들이 merge된 이후에 변경된 것을 발견할 수 있다.

끝.


Thursday, April 24, 2014

D-26

블로그를 시작함.
여기서 영감을 받아서.
http://think.golbin.net/page/6

HMC의 문제는 refresh로 대략 밝혀짐.
refresh를 사용하지 말자는 Manju의 의견.

CGAL은 DB가 아닌 library임.
이걸 쓰려면 내가 programming을 해서 spatial query를 구현해야 함. 배꼽이 너무 큼.
일단 mongoDB에 집중하면서,
R-tree를 사용할 수 있는 DB를 찾아보기로 함.

날짜 관념을 갖기 위해서 D- 형식으로 제목을 붙이기로 함.
유타를 떠날때 까지만 유지하는 것이 목표