Il 14/11/2013 22:43, Vladimir 'φ-coder/phcoder' Serbinenko ha scritto:
On 14.11.2013 22:11, M A Young wrote:
On Thu, 14 Nov 2013, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
On 14.11.2013 19:57, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
On 14.11.2013 19:48, M A Young wrote:
On Thu, 14 Nov 2013, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
On 14.11.2013 18:03, M A Young wrote:
On Thu, 14 Nov 2013, M A Young wrote:
On Wed, 13 Nov 2013, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
On 13.11.2013 20:06, M A Young wrote:
It doesn't seem to understand sub-partitions. I can get it to
work if
the boot files are in /dev/xvda but not in /dev/xvda1 .
insmod part_msdos
insmod part_gpt
Right, if I add those to the embedded grub.cfg file I get to the
standard grub menu and the boot starts. However the boot doesn't get
very far - it loads the kernel and the initrd file and starts the
kernel but the kernel doesn't see the virtual disks so it doesn't
get
very far.
Using xenstore-ls from the dom0 on the guest when the boot stops the
local/domain/2/device/vbd/51712 section looks like
backend = "/local/domain/0/backend/vbd/2/51712"
backend-id = "0"
state = "6\000"
virtual-device = "51712"
device-type = "disk"
ring-ref = "\000"
event-channel = "\000"
protocol = "x86_64-abi\000"
As nothing else has null character endings I suspend that is wrong.
Good catch. Could you test following:
diff --git a/grub-core/kern/xen/init.c b/grub-core/kern/xen/init.c
index 3bfd99f..ab74543 100644
--- a/grub-core/kern/xen/init.c
+++ b/grub-core/kern/xen/init.c
@@ -256,11 +256,10 @@ grub_xenstore_write_file (const char *dir, const
void *buf, grub_size_t len)
grub_memset (&msg, 0, sizeof (msg));
msg.type = XS_WRITE;
- msg.len = dirlen + len + 1;
+ msg.len = dirlen + len;
grub_xen_store_send (&msg, sizeof (msg));
grub_xen_store_send (dir, dirlen);
grub_xen_store_send (buf, len);
- grub_xen_store_send ("", 1);
grub_xen_store_recv (&msg, sizeof (msg));
resp = grub_malloc (msg.len + 1);
if (!resp)
The section is tidied up, ie.
backend = "/local/domain/0/backend/vbd/4/51712"
backend-id = "0"
state = "6"
virtual-device = "51712"
device-type = "disk"
ring-ref = ""
event-channel = ""
protocol = "x86_64-abi"
but unfortunately it doesn't help as the boot process sticks at the
same
point. I notice this section is in state 6 which apparently is
"closed".
I wonder if the kernel expecting something else.
Possible. I'd try this (on top of previous patch):
Sorry, too tired. I meant:
diff --git a/grub-core/disk/xen/xendisk.c b/grub-core/disk/xen/xendisk.c
index c449848..9b71d3a 100644
--- a/grub-core/disk/xen/xendisk.c
+++ b/grub-core/disk/xen/xendisk.c
@@ -449,5 +449,10 @@ grub_xendisk_fini (void)
grub_xen_free_shared_page (virtdisks[i].shared_page);
grub_xen_event_channel_op (EVTCHNOP_close, &close_op);
+
+ /* Prepare for handoff. */
+ grub_snprintf (fdir, sizeof (fdir), "%s/state",
+ virtdisks[i].frontend_dir);
+ grub_xenstore_write_file (fdir, "0", 1);
}
}
That doesn't work. However, according to the documentation state 0 is
unknown, and the vif interface (while grub is running) is in state 1
(initializing) so I thought I would try it, and if you replace "0" with
"1" in the above patch then the kernel does boot.
Thanks.
http://git.savannah.gnu.org/cgit/grub.git/commit/?id=c7995256e410c5272e2be2f94faf62d3c9d57b61
and
http://git.savannah.gnu.org/cgit/grub.git/commit/?id=e1aa5b662088cea329fc968af7c819784b6da068
Michael Young
Thanks for all that have worked for xen support on upstream grub2.
I did a test following informations on one of post before:
git clone git://git.sv.gnu.org/grub.git # commit
61e1b9a49d48035bde52784abb54c3212b647fc8
./autogen.sh
./configure --target=x86_64 --with-platform=xen
mkdir -p boot/grub/
cat > boot/grub/grub.cfg <<EOF
search -s root -f /boot/grub/grub.cfg
configfile /boot/grub/grub.cfg
EOF
./grub-mkstandalone --grub-mkimage=./grub-mkimage -o pvgrub2.xen -O
x86_64-xen -d grub-core/ boot/grub/grub.cfg
Latest command give me this warning:
./grub-mkstandalone: warning: cannot open directory
`/usr/local/share/locale': File o directory non esistente.
I tried to use it on Sid domU adding this line on domU's xl cfg:
kernel = "/mnt/vm/pvgrub2/grub/pvgrub2.xen"
But vnc show black screen and xl console white screen with only this
line on start before refresh:
Welcome to GRUB!
I also tried to add this line:
extra = "(hd0,msdos1)/grub/grub.cfg"
but the result on vnc and xl console is the same.
I did something wrong?
Output of xl -vvv create on attachment.
If you need more tests and/or details tell me and I'll post them.
Thanks for any reply and sorry for my bad english.
_______________________________________________
Xen-devel mailing list
xen-de...@lists.xen.org
http://lists.xen.org/xen-devel
xl -vvv create /etc/xen/sid.cfg
Parsing config from /etc/xen/sid.cfg
libxl: debug: libxl_create.c:1341:do_domain_create: ao 0x126e260: create:
how=(nil) callback=(nil) poller=0x126e070
libxl: debug: libxl_device.c:251:libxl__device_disk_set_backend: Disk vdev=xvda
spec.backend=unknown
libxl: debug: libxl_device.c:197:disk_try_backend: Disk vdev=xvda, backend phy
unsuitable as phys path not a block device
libxl: debug: libxl_device.c:286:libxl__device_disk_set_backend: Disk
vdev=xvda, using backend qdisk
libxl: debug: libxl_create.c:785:initiate_domain_create: running bootloader
libxl: debug: libxl_bootloader.c:327:libxl__bootloader_run: no bootloader
configured, using user supplied kernel
libxl: debug: libxl_event.c:607:libxl__ev_xswatch_deregister: watch
w=0x126e608: deregister unregistered
libxl: debug: libxl_numa.c:475:libxl__get_numa_candidate: New best NUMA
placement candidate found: nr_nodes=1, nr_cpus=8, nr_vcpus=10, free_memkb=10066
libxl: detail: libxl_dom.c:195:numa_place_domain: NUMA placement candidate with
1 nodes, 8 cpus and 10066 KB free selected
domainbuilder: detail: xc_dom_allocate: cmdline="(hd0,msdos1)/grub/grub.cfg",
features="(null)"
libxl: debug: libxl_dom.c:353:libxl__build_pv: pv kernel mapped 0 path
/mnt/vm/pvgrub2/grub/pvgrub2.xen
domainbuilder: detail: xc_dom_kernel_file:
filename="/mnt/vm/pvgrub2/grub/pvgrub2.xen"
domainbuilder: detail: xc_dom_malloc_filemap : 2088 kB
domainbuilder: detail: xc_dom_boot_xen_init: ver 4.4, caps xen-3.0-x86_64
xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
domainbuilder: detail: xc_dom_parse_image: called
domainbuilder: detail: xc_dom_find_loader: trying multiboot-binary loader ...
domainbuilder: detail: loader probe failed
domainbuilder: detail: xc_dom_find_loader: trying Linux bzImage loader ...
domainbuilder: detail: xc_dom_probe_bzimage_kernel: kernel is not a bzImage
domainbuilder: detail: loader probe failed
domainbuilder: detail: xc_dom_find_loader: trying ELF-generic loader ...
domainbuilder: detail: loader probe OK
xc: detail: elf_parse_binary: phdr: paddr=0x0 memsz=0x41d148
xc: detail: elf_parse_binary: phdr: paddr=0x41d148 memsz=0x1fb500
xc: detail: elf_parse_binary: memory: 0x0 -> 0x618648
xc: detail: elf_xen_parse_note: GUEST_OS = "GRUB"
xc: detail: elf_xen_parse_note: LOADER = "generic"
xc: detail: elf_xen_parse_note: XEN_VERSION = "xen-3.0"
xc: detail: elf_xen_parse_note: ENTRY = 0x0
xc: detail: elf_xen_parse_note: VIRT_BASE = 0x0
xc: detail: elf_xen_addr_calc_check: ELF_PADDR_OFFSET unset, using 0x0
xc: detail: elf_xen_addr_calc_check: addresses:
xc: detail: virt_base = 0x0
xc: detail: elf_paddr_offset = 0x0
xc: detail: virt_offset = 0x0
xc: detail: virt_kstart = 0x0
xc: detail: virt_kend = 0x618648
xc: detail: virt_entry = 0x0
xc: detail: p2m_base = 0xffffffffffffffff
domainbuilder: detail: xc_dom_parse_elf_kernel: xen-3.0-x86_64: 0x0 -> 0x618648
domainbuilder: detail: xc_dom_mem_init: mem 1024 MB, pages 0x40000 pages, 4k
each
domainbuilder: detail: xc_dom_mem_init: 0x40000 pages
domainbuilder: detail: xc_dom_boot_mem_init: called
domainbuilder: detail: x86_compat: guest xen-3.0-x86_64, address size 64
domainbuilder: detail: xc_dom_malloc : 2048 kB
domainbuilder: detail: xc_dom_build_image: called
domainbuilder: detail: xc_dom_alloc_segment: kernel : 0x0 -> 0x619000
(pfn 0x0 + 0x619 pages)
domainbuilder: detail: xc_dom_pfn_to_ptr_retcount: domU mapping: pfn 0x0+0x619
at 0x7ff4b9a5f000
xc: detail: elf_load_binary: phdr 0 at 0x7ff4b9a5f000 -> 0x7ff4b9a6cd07
xc: detail: elf_load_binary: phdr 2 at 0x7ff4b9e7c148 -> 0x7ff4ba077648
domainbuilder: detail: xc_dom_alloc_segment: phys2mach : 0x619000 ->
0x819000 (pfn 0x619 + 0x200 pages)
domainbuilder: detail: xc_dom_pfn_to_ptr_retcount: domU mapping: pfn
0x619+0x200 at 0x7ff4b985f000
domainbuilder: detail: xc_dom_alloc_page : start info : 0x819000 (pfn
0x819)
domainbuilder: detail: xc_dom_alloc_page : xenstore : 0x81a000 (pfn
0x81a)
domainbuilder: detail: xc_dom_alloc_page : console : 0x81b000 (pfn
0x81b)
domainbuilder: detail: nr_page_tables: 0x0000ffffffffffff/48:
0x0000000000000000 -> 0x0000ffffffffffff, 1 table(s)
domainbuilder: detail: nr_page_tables: 0x0000007fffffffff/39:
0x0000000000000000 -> 0x0000007fffffffff, 1 table(s)
domainbuilder: detail: nr_page_tables: 0x000000003fffffff/30:
0x0000000000000000 -> 0x000000003fffffff, 1 table(s)
domainbuilder: detail: nr_page_tables: 0x00000000001fffff/21:
0x0000000000000000 -> 0x0000000000bfffff, 6 table(s)
domainbuilder: detail: xc_dom_alloc_segment: page tables : 0x81c000 ->
0x825000 (pfn 0x81c + 0x9 pages)
domainbuilder: detail: xc_dom_pfn_to_ptr_retcount: domU mapping: pfn 0x81c+0x9
at 0x7ff4b9856000
domainbuilder: detail: xc_dom_alloc_page : boot stack : 0x825000 (pfn
0x825)
domainbuilder: detail: xc_dom_build_image : virt_alloc_end : 0x826000
domainbuilder: detail: xc_dom_build_image : virt_pgtab_end : 0xc00000
domainbuilder: detail: xc_dom_boot_image: called
domainbuilder: detail: arch_setup_bootearly: doing nothing
domainbuilder: detail: xc_dom_compat_check: supported guest type:
xen-3.0-x86_64 <= matches
domainbuilder: detail: xc_dom_compat_check: supported guest type:
xen-3.0-x86_32p
domainbuilder: detail: xc_dom_compat_check: supported guest type: hvm-3.0-x86_32
domainbuilder: detail: xc_dom_compat_check: supported guest type:
hvm-3.0-x86_32p
domainbuilder: detail: xc_dom_compat_check: supported guest type: hvm-3.0-x86_64
domainbuilder: detail: xc_dom_update_guest_p2m: dst 64bit, pages 0x40000
domainbuilder: detail: clear_page: pfn 0x81b, mfn 0x326d4c
domainbuilder: detail: clear_page: pfn 0x81a, mfn 0x326d4d
domainbuilder: detail: xc_dom_pfn_to_ptr_retcount: domU mapping: pfn 0x819+0x1
at 0x7ff4bc775000
domainbuilder: detail: start_info_x86_64: called
domainbuilder: detail: domain builder memory footprint
domainbuilder: detail: allocated
domainbuilder: detail: malloc : 2099 kB
domainbuilder: detail: anon mmap : 0 bytes
domainbuilder: detail: mapped
domainbuilder: detail: file mmap : 2088 kB
domainbuilder: detail: domU mmap : 8332 kB
domainbuilder: detail: arch_setup_bootlate: shared_info: pfn 0x0, mfn 0xbed44
domainbuilder: detail: shared_info_x86_64: called
domainbuilder: detail: vcpu_x86_64: called
domainbuilder: detail: vcpu_x86_64: cr3: pfn 0x81c mfn 0x326d4b
domainbuilder: detail: launch_vm: called, ctxt=0x7ff4b9854004
domainbuilder: detail: xc_dom_release: called
libxl: debug: libxl_device.c:251:libxl__device_disk_set_backend: Disk vdev=xvda
spec.backend=qdisk
libxl: debug: libxl_event.c:607:libxl__ev_xswatch_deregister: watch
w=0x1279260: deregister unregistered
libxl: debug: libxl_dm.c:1327:libxl__spawn_local_dm: Spawning device-model
/usr/lib/xen/bin/qemu-system-i386 with arguments:
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm:
/usr/lib/xen/bin/qemu-system-i386
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -xen-domid
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: 4
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -chardev
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm:
socket,id=libxl-cmd,path=/var/run/xen/qmp-libxl-4,server,nowait
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -mon
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm:
chardev=libxl-cmd,mode=control
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -nodefaults
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -xen-attach
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -name
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: sid
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -vnc
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: 0.0.0.0:0,to=99
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -k
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: it
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -machine
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: xenpv
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: -m
libxl: debug: libxl_dm.c:1329:libxl__spawn_local_dm: 1025
libxl: debug: libxl_event.c:559:libxl__ev_xswatch_register: watch w=0x126e840
wpath=/local/domain/0/device-model/4/state token=3/0: register slotnum=3
libxl: debug: libxl_create.c:1355:do_domain_create: ao 0x126e260: inprogress:
poller=0x126e070, flags=i
libxl: debug: libxl_event.c:503:watchfd_callback: watch w=0x126e840
wpath=/local/domain/0/device-model/4/state token=3/0: event
epath=/local/domain/0/device-model/4/state
libxl: debug: libxl_event.c:503:watchfd_callback: watch w=0x126e840
wpath=/local/domain/0/device-model/4/state token=3/0: event
epath=/local/domain/0/device-model/4/state
libxl: debug: libxl_event.c:595:libxl__ev_xswatch_deregister: watch w=0x126e840
wpath=/local/domain/0/device-model/4/state token=3/0: deregister slotnum=3
libxl: debug: libxl_event.c:607:libxl__ev_xswatch_deregister: watch
w=0x126e840: deregister unregistered
libxl: debug: libxl_qmp.c:703:libxl__qmp_initialize: connected to
/var/run/xen/qmp-libxl-4
libxl: debug: libxl_qmp.c:299:qmp_handle_response: message type: qmp
libxl: debug: libxl_qmp.c:551:qmp_send_prepare: next qmp command: '{
"execute": "qmp_capabilities",
"id": 1
}
'
libxl: debug: libxl_qmp.c:299:qmp_handle_response: message type: return
libxl: debug: libxl_qmp.c:551:qmp_send_prepare: next qmp command: '{
"execute": "query-chardev",
"id": 2
}
'
libxl: debug: libxl_qmp.c:299:qmp_handle_response: message type: return
libxl: debug: libxl_qmp.c:551:qmp_send_prepare: next qmp command: '{
"execute": "query-vnc",
"id": 3
}
'
libxl: debug: libxl_qmp.c:299:qmp_handle_response: message type: return
libxl: debug: libxl_event.c:559:libxl__ev_xswatch_register: watch w=0x12716b8
wpath=/local/domain/0/backend/vif/4/0/state token=3/1: register slotnum=3
libxl: debug: libxl_event.c:503:watchfd_callback: watch w=0x12716b8
wpath=/local/domain/0/backend/vif/4/0/state token=3/1: event
epath=/local/domain/0/backend/vif/4/0/state
libxl: debug: libxl_event.c:646:devstate_watch_callback: backend
/local/domain/0/backend/vif/4/0/state wanted state 2 still waiting state 1
libxl: debug: libxl_event.c:503:watchfd_callback: watch w=0x12716b8
wpath=/local/domain/0/backend/vif/4/0/state token=3/1: event
epath=/local/domain/0/backend/vif/4/0/state
libxl: debug: libxl_event.c:642:devstate_watch_callback: backend
/local/domain/0/backend/vif/4/0/state wanted state 2 ok
libxl: debug: libxl_event.c:595:libxl__ev_xswatch_deregister: watch w=0x12716b8
wpath=/local/domain/0/backend/vif/4/0/state token=3/1: deregister slotnum=3
libxl: debug: libxl_event.c:607:libxl__ev_xswatch_deregister: watch
w=0x12716b8: deregister unregistered
libxl: debug: libxl_device.c:1022:device_hotplug: calling hotplug script:
/etc/xen/scripts/vif-bridge online
libxl: debug: libxl_event.c:607:libxl__ev_xswatch_deregister: watch
w=0x1271740: deregister unregistered
libxl: debug: libxl_event.c:607:libxl__ev_xswatch_deregister: watch
w=0x1271740: deregister unregistered
libxl: debug: libxl_event.c:1742:libxl__ao_progress_report: ao 0x126e260:
progress report: ignored
libxl: debug: libxl_event.c:1572:libxl__ao_complete: ao 0x126e260: complete,
rc=0
libxl: debug: libxl_event.c:1544:libxl__ao__destroy: ao 0x126e260: destroy
xc: debug: hypercall buffer: total allocations:237 total releases:237
xc: debug: hypercall buffer: current allocations:0 maximum allocations:4
xc: debug: hypercall buffer: cache current size:4
xc: debug: hypercall buffer: cache hits:226 misses:4 toobig:7
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel