search for: is_block

Displaying 20 results from an estimated 27 matches for "is_block".

Did you mean: ms_block
2011 Jan 26
1
[PATCH] Don't use libvirt for volume information when converting with libvirtxml
...me my $self = shift; my ($path) = @_; - # Use a libvirt session connection to inspect local volumes - my $vmm = Sys::Virt->new(uri => 'qemu:///session'); - my $vol = $vmm->get_storage_volume_by_path($path); - - my ($name, $format, $size, $usage, $is_sparse, $is_block) = - parse_libvirt_volinfo($vol, $path); + # Use the output of qemu-img to inspect the path + open(my $qemuimg, '-|', 'env', 'LANG=C', 'qemu-img', 'info', $path) + or die("Unable to execute qemu-img: $!"); + + # qemu-img outpu...
2020 Sep 01
3
Re: [nbdkit PATCH 2/2] ocaml: Implement .list_exports and friends
...9; as the second member of the export record. https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#s%3Ac-ocaml-datatype-repr didn't directly answer my question, but my understanding is that since 'string option' is the same as: type 'a t = a' option = | None (* Is_block is false, value is Val_int(0) *) | Some of 'a (* Is_block is true, value is block with tag 0 *) then checking Is_block tells me whether I have None or Some string, at which point another Field() deref gets me to the string contained in that block. diff --git i/plugins/ocaml/NBDKit.mli...
2013 Feb 07
2
[PATCH 1/2] Fix bogus partition number passed to guestfs___check_for_filesystem_on
...ct_fs *guestfs___search_for_root (guestfs_h *g, const char *r /* inspect-fs.c */ extern int guestfs___is_file_nocase (guestfs_h *g, const char *); extern int guestfs___is_dir_nocase (guestfs_h *g, const char *); -extern int guestfs___check_for_filesystem_on (guestfs_h *g, const char *device, int is_block, int is_partnum); +extern int guestfs___check_for_filesystem_on (guestfs_h *g, const char *device); extern int guestfs___parse_unsigned_int (guestfs_h *g, const char *str); extern int guestfs___parse_unsigned_int_ignore_trailing (guestfs_h *g, const char *str); extern int guestfs___parse_major_m...
2020 Sep 01
0
Re: [nbdkit PATCH 2/2] ocaml: Implement .list_exports and friends
...ber of the export record. https://caml.inria.fr/pub/docs/manual-ocaml/intfc.html#s%3Ac-ocaml-datatype-repr > didn't directly answer my question, but my understanding is that > since 'string option' is the same as: > > type 'a t = a' option = > | None (* Is_block is false, value is Val_int(0) *) > | Some of 'a (* Is_block is true, value is block with tag 0 *) > > then checking Is_block tells me whether I have None or Some string, > at which point another Field() deref gets me to the string contained > in that block. All ‘value’ thin...
2006 Mar 01
6
How to retrieve attributes from HABTM?
We have tables Users and Communities linked by has_an_belongs_to_many. The join table Communities_Users has additional fields [ is_active, is_blocked, join_date] etc. These are populated using @user.push_with_attributes(:is_active => true,...). Later on how do we update or retrieve the attributes in the link table for a given user or a community with doing it explicitly using SQL? Thanks, Yash -- Posted via http://www.ruby-forum.com/.
2010 Sep 21
1
[PREVIEW ONLY] Refactor data transfer code
...+ +=item get_volume(path) + +Return a volume object for I<path>, where I<path> is the path of a volume on the +connected hypervisor. + +=cut + +sub get_volume +{ + my $self = shift; + my ($path) = @_; + + my $uri = $self->{uri}; + + my ($name, $format, $size, $is_sparse, $is_block); + + # The libvirt storage APIs aren't yet reliably implemented for ESX, so we + # need to get volume metadata some other way + my $transfer; + if ($uri->scheme eq "esx") { + $transfer = $self->_get_transfer($path, 0); + + $name = $transfer->esx_get...
2006 Feb 16
1
Interaction between R and Perl
...ave some questions for a multi-users utilisation: - Can I change the directory where R is running in order to have a directory per user? Then no problem of erasing R data of an other user. - If it's not possible, can I limite the number of users at the same time? I see "lock", "is_blocked" and "is_started" options in Statistics-R module. How can I use them? Thanks! B??line
2013 May 30
0
Re: ATTN: Denial of service attack possible on libguestfs 1.21.x, libguestfs.1.22.0
...f7b8b65e in parse_suse_release (filename=<optimized out>, fs=<optimized out>, g=<optimized out>) at inspect-fs-unix.c:343 #4 guestfs___check_linux_root (g=0x65da50, fs=0x6665b0) at inspect-fs-unix.c:560 #5 0x00007ffff7b88522 in check_filesystem (is_partnum=<optimized out>, is_block=<optimized out>, device=<optimized out>, g=<optimized out>) at inspect-fs.c:238 #6 guestfs___check_for_filesystem_on (g=0x65da50, device=0x617930 "/dev/sda2", is_block=0, is_partnum=2) at inspect-fs.c:152 #7 0x00007ffff7b86980 in guestfs__inspect_os (g=0x65da50) at ins...
2011 Jan 26
1
[PATCH] Display verbose error message when guest storage isn't found
..._x("Failed to retrieve storage volume {path}:". + "{error}", + path => $path, + error => $@->stringify())); + } ($name, $format, $size, $usage, $is_sparse, $is_block) = parse_libvirt_volinfo($vol); -- 1.7.3.5
2010 Apr 07
1
[PATCH] Connection: Handle case of cdrom with no <source> element
...;qemu'); - $driver->setAttribute('type', $vol->get_format()); - - # Remove the @file or @dev attribute before adding a new one - $source_e->removeAttributeNode($source); - - # Set @file or @dev as appropriate - if ($vol->is_block()) - { - $disk->setAttribute('type', 'block'); - $source_e->setAttribute('dev', $path); - } else { - $disk->setAttribute('type', 'file'); - $source_e->setAttribute(&...
2020 Sep 01
1
Re: [nbdkit PATCH 2/2] ocaml: Implement .list_exports and friends
...while (rv != Val_int (0)) { >> - const char *name, *desc; >> + const char *name, *desc = NULL; >> >> v = Field (rv, 0); /* export struct */ >> name = String_val (Field (v, 0)); >> - desc = String_val (Field (v, 1)); >> + if (Is_block (Field (v, 1))) >> + desc = String_val (Field (Field (v, 1), 0)); >> if (nbdkit_add_export (exports, name, desc) == -1) { >> caml_enter_blocking_section (); >> CAMLreturnT (int, -1); > > Seems OK. I'm guessing this crashes? Nope, it wo...
2013 May 28
6
ATTN: Denial of service attack possible on libguestfs 1.21.x, libguestfs.1.22.0
There's a denial of service attack possible from guests on any program that does inspection (eg. virt-inspector, many other virt-* tools, virt-v2v, OpenStack). The attack causes the host process to crash because of a double free. It's probably not exploitable (definitely not on Fedora because of the default memory hardening settings). This patch contains the fix and a reproducer:
2011 Mar 11
2
[PATCH 1/2] Allow reading more data than the reported size of a volume
If a volume is not an exact multiple of 512 bytes, qemu-img will report its size rounded down to a 512 byte boundary. However, when copying, the file is still read until EOF, which will return more data than was expected. This change prevents that causing a failure in itself. The situation is still not resolved, however, as there are still situations where this will cause a failure. For example,
2020 Sep 01
4
[nbdkit PATCH 0/2] More language bindings for .list_exports
This picks up python and ocaml. Some of our languages are lacking a number of bindings (for example, lua and perl lack .extents, so I didn't have anything to copy from), and I felt less comfortable with golang and rust. But for python and ocaml, I was able to test a working implementation. Eric Blake (2): python: Implement .list_exports and friends ocaml: Implement .list_exports and
2010 Mar 31
1
[PATCH] Add LocalCopy transfer method to transfer local files to a target
...$driver->setAttribute('type', $vol->get_format()); - - # Remove the @file or @dev attribute before adding a new one - $source_e->removeAttributeNode($source); - - # Set @file or @dev as appropriate - if ($vol->is_block()) - { - $disk->setAttribute('type', 'block'); - $source_e->setAttribute('dev', $path); - } else { - $disk->setAttribute('type', 'file'); - $sou...
2020 Sep 21
0
[nbdkit PATCH v3 14/14] ocaml: Implement .list_exports and friends
...l_enter_blocking_section (); + CAMLreturnT (int, -1); + } + + /* Convert exports list into calls to nbdkit_add_export. */ + while (rv != Val_emptylist) { + const char *name, *desc = NULL; + + v = Field (rv, 0); /* export struct */ + name = String_val (Field (v, 0)); + if (Is_block (Field (v, 1))) + desc = String_val (Field (Field (v, 1), 0)); + if (nbdkit_add_export (exports, name, desc) == -1) { + caml_enter_blocking_section (); + CAMLreturnT (int, -1); + } + + rv = Field (rv, 1); + } + + caml_enter_blocking_section (); + CAMLreturnT (int, 0); +}...
2013 Jan 24
2
[PATCH 1/2] lib: Add CLEANUP_FREE macro which automatically calls 'free' when leaving scope.
From: "Richard W.M. Jones" <rjones@redhat.com> Use the macro like this to create temporary variables which are automatically cleaned up when the scope is exited: { CLEANUP_FREE (char *, foo, strdup (bar)); /* char *foo = strdup (bar) */ ... // no need to call free (foo)! } On GCC and LLVM, this is implemented using __attribute__((cleanup(...))). On other
2010 Mar 30
3
[PATCH 1/2] Refactor guest and volume creation into Sys::VirtV2V::Target::LibVirt
...$source_e->removeAttributeNode($source); - $path = $vol->get_path(); - # Set @file or @dev as appropriate - if ($vol->get_info()->{type} == - Sys::Virt::StorageVol::TYPE_FILE) + if ($vol->is_block()) { - $disk->setAttribute('type', 'file'); - $source_e->setAttribute('file', $path); - } else { $disk->setAttribute('type', 'block'); $so...
2013 May 10
4
remotely mounting client disks in p2v server
Just spent a little time poking around w/ p2v and am attaching the following pseudo-code for consideration. Note the patches aren't commit ready yet, just looking for thoughts - The first is a fix to get client image building process working on F17. It seems the version of ksflatten there didn't expand the nested %includes which was causing errors (also --interpreter image-minimizer
2013 May 16
1
support remotely mounting disk images in p2v
Figure I'd share the latest revision to p2v I had regarding $subject. The patch now applies against HEAD and compiles fine. I was able to update the package on the client and run virt-p2v, though have yet to do a full end-to-end verification Most likely a little more work is needed to tidy up some edge cases and fully flush things out, but the majority of the work should be in place. On the