iSCSI initiator iqn
by Raghu
Hi,
I could not find any option to set iSCSI initiator iqn while using
guestfish, although the underlying qemu command has this option.
It appears that each time guestfish tries to connect to iSCSI LUN, a
randomly generated initiator iqn is being used. This is preventing
guestfish to connect to the iSCSI target in our environment as the target
allows incoming connection based on the preconfigured initiator iqn.
Is there way to set iSCSI initiator iqn with guestfish command?
Regards
Raghu
10 years, 5 months
cannot start domain with channel device
by fangtuo90
Here is what I get.root@ubuntu:/home/john# virsh start ubuntu2error: Failed to start domain ubuntu2error: internal error Process exited while reading console log output: char device redirected to /dev/pts/1bind(unix:/var/lib/libvirt/qemu/ubuntu2.libguestfs): Permission deniedchardev: opening backend "socket" failed: Permission denied
root@ubuntu:/home/john# ll /var/lib/libvirt/qemu/total 20drwxr-x--- 5 libvirt-qemu kvm 4096 Jul 5 14:44 ./drwxr-xr-x 8 root root 4096 May 20 04:18 ../drwxr-xr-x 2 libvirt-qemu kvm 4096 May 20 04:18 dump/drwxr-xr-x 2 libvirt-qemu kvm 4096 May 20 04:18 save/drwxr-xr-x 2 libvirt-qemu kvm 4096 May 20 04:18 snapshot/
root@ubuntu:/home/john# cat /etc/libvirt/qemu/ubuntu2.xml<!--WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BEOVERWRITTEN AND LOST. Changes to this xml configuration should be made using: virsh edit ubuntu2or other application using the libvirt API.--><domain type='kvm' xmlns:qemu='/schemas/domain/qemu/1.0'><qemu:commandline> <qemu:arg value='-s'/></qemu:commandline> <name>ubuntu2</name> <uuid>03f4c36d-9509-05dd-167d-d2613d1dd883</uuid> <memory>1024000</memory> <currentMemory>1024000</currentMemory> <vcpu>1</vcpu> <os> <type arch='x86_64' machine='pc-1.0'>hvm</type> <boot dev='hd'/> </os>
<features> <acpi/> <apic/> <pae/> </features> <clock offset='utc'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/kvm</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/home/john/ubuntu-1204-vm.img'/> <target dev='hda' bus='ide'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <interface type='bridge'> <mac address='52:54:00:d4:7d:07'/> <source bridge='br0'/> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target type='serial' port='0'/> </console>
<input type='mouse' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <sound model='ich6'> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> <model type='cirrus' vram='9216' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </memballoon><channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/ubuntu2.libguestfs' /> <target type='virtio' name='org.libguestfs.channel.0' /></channel> </devices></domain>
When I deleted the <channel>...</channel> part, it will start normally. But I need it to use guestfish with --live option.
10 years, 5 months
Re: [Libguestfs] libguestfs on proxmox
by Richard W.M. Jones
[Let's keep everything on the mailing list]
On Tue, Jul 01, 2014 at 08:37:39PM +0300, Keresztes Péter-Zoltán wrote:
> Hi, I have run the command with virt-rescue and after getting lots of error I get a prompt where I enter the ntfsresize —check /dev/sda1 and I get the following:
>
> I have no name!@(none):/# ntfsresize --check /dev/sda1
> ntfsresize v2012.1.15AR.5 (libntfs-3g)
> I have no name!@(none):/#
For comparison, here is the output using ntfs-3g-2014.2.15-1.fc20.x86_64:
$ guestfish -N fs:ntfs exit
$ virt-rescue --ro -a test1.img
[...]
><rescue> ntfsresize --check /dev/sda1
ntfsresize v2014.2.15 (libntfs-3g)
><rescue>
So that's basically the same as your output, and indicates that
the ntfsresize command itself is working.
Now you should try actually resizing the partition in virt-rescue.
Since it is inside ``virt-rescue --ro'' it won't actually alter the
disk image -- the ``--ro'' flag means that libguestfs puts a
protective overlay between the commands in the rescue shell and the
underlying disk image.
Here is what happens for me:
><rescue> ntfsresize /dev/sda1
ntfsresize v2014.2.15 (libntfs-3g)
Device name : /dev/sda1
NTFS volume version: 3.1
Cluster size : 4096 bytes
Current volume size: 104727040 bytes (105 MB)
Current device size: 104727040 bytes (105 MB)
New volume size : 104727040 bytes (105 MB)
Nothing to do: NTFS volume size is already OK.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
10 years, 5 months
libguestfs on proxmox
by Keresztes Péter-Zoltán
Hello,
I have an issue with virt-resize on the newest version of proxmox which is running on debian wheezy.
when I run the virt-resize on a windows 2008 qemu image I got an error. Here is the last part of the debug message:
Copying /dev/sda1 ...
libguestfs: trace: copy_device_to_device "/dev/sda1" "/dev/sdb1" "size:32210026496"
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
libguestfs: trace: copy_device_to_device = 0
libguestfs: trace: part_set_bootable "/dev/sdb" 1 true
libguestfs: trace: part_set_bootable = 0
libguestfs: trace: part_set_mbr_id "/dev/sdb" 1 7
libguestfs: trace: part_set_mbr_id = 0
libguestfs: trace: shutdown
libguestfs: trace: internal_autosync
libguestfs: trace: internal_autosync = 0
libguestfs: trace: shutdown = 0
libguestfs: trace: close
libguestfs: trace: add_drive "vm-2000-disk-1.qcow2.out" "readonly:false"
libguestfs: trace: add_drive = 0
libguestfs: trace: launch
libguestfs: trace: get_tmpdir
libguestfs: trace: get_tmpdir = "/tmp"
libguestfs: trace: get_cachedir
libguestfs: trace: get_cachedir = "/var/tmp"
100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00
libguestfs: trace: launch = 0
Expanding /dev/sda1 using the 'ntfsresize' method ...
libguestfs: trace: ntfsresize "/dev/sda1" "force:false"
libguestfs: trace: ntfsresize = -1 (error)
Fatal error: exception Guestfs.Error("ntfsresize: /dev/sda1: ")
libguestfs: trace: close
libguestfs: trace: internal_autosync
libguestfs: trace: internal_autosync = 0
10 years, 5 months
[PATCH] generator: Sort the structs.
by Richard W.M. Jones
Sort the structs when generating code. Since the structs are
logically indepedent of each other, this should have no effect except
to make generated files list the structs in a different order.
However this also fixes the following build problem:
File "convert_linux.ml", line 322, characters 43-50:
Error: This expression has type G.stat = Guestfs.stat
but an expression was expected of type G.dirent = Guestfs.dirent
It turns out the OCaml bindings don't like the fact that we have
two structs with a common field name (dirent.ino and stat.ino).
In OCaml < 4.01, this means that any attempt to reference stat.ino
would fail because dirent.ino appears second in the file, overriding
stat.ino.
In OCaml >= 4.01 the compiler now uses some disambiguation rules based
on the known types to resolve this problem.
See:
http://ocaml.org/releases/4.01.0.html
http://www.lexifi.com/blog/type-based-selection-label-and-constructors
http://www.lexifi.com/blog/ocaml-extensions-lexifi-overidding-record-labe...
---
generator/structs.ml | 8 ++++++--
gobject/Makefile.inc | 48 ++++++++++++++++++++++++------------------------
2 files changed, 30 insertions(+), 26 deletions(-)
diff --git a/generator/structs.ml b/generator/structs.ml
index 1bc6e08..65c78b2 100644
--- a/generator/structs.ml
+++ b/generator/structs.ml
@@ -382,6 +382,10 @@ let camel_name_of_struct name = (lookup_struct name).s_camel_name
let cols_of_struct name = (lookup_struct name).s_cols
-let external_structs = List.filter (fun x -> not x.s_internal) structs
+let compare_structs { s_name = n1 } { s_name = n2 } = compare n1 n2
-let internal_structs = List.filter (fun x -> x.s_internal) structs
+let external_structs =
+ List.sort compare_structs (List.filter (fun x -> not x.s_internal) structs)
+
+let internal_structs =
+ List.sort compare_structs (List.filter (fun x -> x.s_internal) structs)
diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc
index 3b567a2..ed1ff3b 100644
--- a/gobject/Makefile.inc
+++ b/gobject/Makefile.inc
@@ -23,26 +23,26 @@ guestfs_gobject_headers= \
include/guestfs-gobject.h \
include/guestfs-gobject/session.h \
include/guestfs-gobject/tristate.h \
+ include/guestfs-gobject/struct-application.h \
+ include/guestfs-gobject/struct-application2.h \
+ include/guestfs-gobject/struct-btrfssubvolume.h \
+ include/guestfs-gobject/struct-dirent.h \
+ include/guestfs-gobject/struct-hivex_node.h \
+ include/guestfs-gobject/struct-hivex_value.h \
+ include/guestfs-gobject/struct-inotify_event.h \
include/guestfs-gobject/struct-int_bool.h \
+ include/guestfs-gobject/struct-isoinfo.h \
+ include/guestfs-gobject/struct-lvm_lv.h \
include/guestfs-gobject/struct-lvm_pv.h \
include/guestfs-gobject/struct-lvm_vg.h \
- include/guestfs-gobject/struct-lvm_lv.h \
+ include/guestfs-gobject/struct-mdstat.h \
+ include/guestfs-gobject/struct-partition.h \
include/guestfs-gobject/struct-stat.h \
include/guestfs-gobject/struct-statvfs.h \
- include/guestfs-gobject/struct-dirent.h \
+ include/guestfs-gobject/struct-utsname.h \
include/guestfs-gobject/struct-version.h \
include/guestfs-gobject/struct-xattr.h \
- include/guestfs-gobject/struct-inotify_event.h \
- include/guestfs-gobject/struct-partition.h \
- include/guestfs-gobject/struct-application.h \
- include/guestfs-gobject/struct-application2.h \
- include/guestfs-gobject/struct-isoinfo.h \
- include/guestfs-gobject/struct-mdstat.h \
- include/guestfs-gobject/struct-btrfssubvolume.h \
include/guestfs-gobject/struct-xfsinfo.h \
- include/guestfs-gobject/struct-utsname.h \
- include/guestfs-gobject/struct-hivex_node.h \
- include/guestfs-gobject/struct-hivex_value.h \
include/guestfs-gobject/optargs-add_domain.h \
include/guestfs-gobject/optargs-add_drive.h \
include/guestfs-gobject/optargs-add_drive_scratch.h \
@@ -100,26 +100,26 @@ guestfs_gobject_headers= \
guestfs_gobject_sources= \
src/session.c \
src/tristate.c \
+ src/struct-application.c \
+ src/struct-application2.c \
+ src/struct-btrfssubvolume.c \
+ src/struct-dirent.c \
+ src/struct-hivex_node.c \
+ src/struct-hivex_value.c \
+ src/struct-inotify_event.c \
src/struct-int_bool.c \
+ src/struct-isoinfo.c \
+ src/struct-lvm_lv.c \
src/struct-lvm_pv.c \
src/struct-lvm_vg.c \
- src/struct-lvm_lv.c \
+ src/struct-mdstat.c \
+ src/struct-partition.c \
src/struct-stat.c \
src/struct-statvfs.c \
- src/struct-dirent.c \
+ src/struct-utsname.c \
src/struct-version.c \
src/struct-xattr.c \
- src/struct-inotify_event.c \
- src/struct-partition.c \
- src/struct-application.c \
- src/struct-application2.c \
- src/struct-isoinfo.c \
- src/struct-mdstat.c \
- src/struct-btrfssubvolume.c \
src/struct-xfsinfo.c \
- src/struct-utsname.c \
- src/struct-hivex_node.c \
- src/struct-hivex_value.c \
src/optargs-add_domain.c \
src/optargs-add_drive.c \
src/optargs-add_drive_scratch.c \
--
1.9.0
10 years, 5 months