search for: guestfs_int_drive_name

Displaying 20 results from an estimated 22 matches for "guestfs_int_drive_name".

2015 Jul 01
1
[PATCH 1/2] utils: Add a test of the guestfs_int_drive_name function.
...* 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 @@ -162,6 +162,32 @@ test_validate_guid (void) assert (guestfs_int_validate_guid ("21EC2020-3AEA-1069-A2DD-08002B30309D") == 1); } +/* Test guestfs_int_drive_name. */ +static void +test_drive_name (void) +{ + char s[10]; + + guestfs_int_drive_name (0, s); + assert (STREQ (s, "a")); + guestfs_int_drive_name (25, s); + assert (STREQ (s, "z")); + guestfs_int_drive_name (26, s); + assert (STREQ (s, "aa")); + guestfs_int_driv...
2015 Jul 01
2
[PATCH v2 0/2] utils: Add guestfs_int_drive_index and unit test.
Since v1: - Test error cases in the unit test of guestfs_int_drive_index. Rich.
2019 Dec 19
1
[PATCH] daemon: reorder internal static libs to fix linking
...This currently does not cause failures, however it "just works" because of the tricky situation set up. The situation is the following: 1) common/utils contains few utility sources: one of them is utils.c, which contains various functions -- for example guestfs_int_free_string_list and guestfs_int_drive_name --, it is built as utils.o, and bundled in the static library libutils.a 2) common/mlutils builds a OCaml library with bindings for some utility functions in libutils.a, in particular guestfs_int_drive_name (but not guestfs_int_free_string_list); there are two versions of this library, one OCaml l...
2015 Jul 01
12
[PATCH 1/9] v2v: Stable bus and slot numbers for removable drives (RHBZ#1238053).
This patch series adds stable bus and slot numbers for removable drives (CDs and floppies) when the guest is converted using virt-v2v or virt-p2v. Previously we were a bit random about this. After this patch series, the bus and slot numbers and preserved if at all possible. BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1238053 Rich.
2017 Apr 28
2
[PATCH] common/options: Change drv struct to store drive index instead of device name.
...guestfish (when using the -N option to prepare drives). We constructed the device name very naively, basically ‘sprintf ("/dev/sd%c", next_drive)’. This stores the device index instead, and only constructs the device name in guestfish. Also the device name is constructed properly using guestfs_int_drive_name so it can cope with #drives > 26. --- align/scan.c | 2 +- cat/cat.c | 2 +- cat/filesystems.c | 2 +- cat/log.c | 2 +- cat/ls.c | 2 +- cat/tail.c | 2 +- common/options/options.c | 30 +++++++++--------------...
2017 Apr 19
1
[PATCH] appliance: Pass root=UUID=... to supermin.
By passing root=UUID=... to supermin, we make the appliance boot process less sensitive to the non-deterministic process of scanning SCSI disks (of which much more to come). This patch should be tested alongside the supermin patch posted here: https://www.redhat.com/archives/libguestfs/2017-April/msg00174.html which in turn requires this supermin patch series:
2017 May 03
0
Re: [PATCH] common/options: Change drv struct to store drive index instead of device name.
...ption to > prepare drives). We constructed the device name very naively, > basically ‘sprintf ("/dev/sd%c", next_drive)’. > > This stores the device index instead, and only constructs the device > name in guestfish. Also the device name is constructed properly using > guestfs_int_drive_name so it can cope with #drives > 26. > --- Looks nice, a couple of notes below. > index 7ae8adf..26f77fd 100644 > --- a/align/scan.c > +++ b/align/scan.c > @@ -236,7 +236,7 @@ main (int argc, char *argv[]) > error (EXIT_FAILURE, 0, _("--uuid option cannot be used wit...
2019 May 24
0
[PATCH 2/2] launch: libvirt: fix custom hypervisor check
...id ignore_errors (void *ignore, virErrorPtr ignore2); static void set_socket_create_context (guestfs_h *g); @@ -606,7 +606,7 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri) params.appliance_index = g->nr_drives; strcpy (params.appliance_dev, "/dev/sd"); guestfs_int_drive_name (params.appliance_index, &params.appliance_dev[7]); - params.enable_svirt = ! is_custom_hv (g); + params.enable_svirt = ! is_custom_hv (g, data); xml = construct_libvirt_xml (g, &params); if (!xml) @@ -873,13 +873,15 @@ parse_domcapabilities (guestfs_h *g, const char *domcapabilit...
2016 Feb 04
0
[PATCH] aarch64: Use a common table of AAVMF paths.
...de = *vars = NULL; diff --git a/src/guestfs-internal-frontend.h b/src/guestfs-internal-frontend.h index 2fbf875..6f54a73 100644 --- a/src/guestfs-internal-frontend.h +++ b/src/guestfs-internal-frontend.h @@ -107,6 +107,7 @@ extern int guestfs_int_random_string (char *ret, size_t len); extern char *guestfs_int_drive_name (size_t index, char *ret); extern ssize_t guestfs_int_drive_index (const char *); extern int guestfs_int_is_true (const char *str); +extern const char *guestfs_int_aavmf_firmware[]; /* These functions are used internally by the CLEANUP_* macros. * Don't call them directly. diff --git a/s...
2019 May 24
3
[PATCH 0/2] libvirt: fix check of custom QEMU
In case you configure libguestfs with a custom QEMU, e.g.: $ ./configure [...] QEMU=/path/to/qemu then the libvirt backend did not use to override it, launching the appliance with the default QEMU for libvirt. This does not change the manual emulator overriding using set-hv. Pino Toscano (2): launch: libvirt: get default QEMU from domcapabilities launch: libvirt: fix custom hypervisor
2020 Mar 05
5
[PATCH v2 0/4] daemon: Translate device names if Linux device is unstable (RHBZ#1804207).
v1 was here: https://www.redhat.com/archives/libguestfs/2020-February/msg00220.html This patch series is a little bit better. It's still a bit of a hack. The _real_ fix for this is outlined in the TODO file (see patch 1) but that requires a lot more work than we could do before 1.42 is released, unless we delay 1.42 for a lot longer. I'm hoping with this to have something which works
2016 Dec 24
0
[PATCH] lib: Use a common function to validate strings.
...+32,8 @@ #ifndef GUESTFS_INTERNAL_FRONTEND_H_ #define GUESTFS_INTERNAL_FRONTEND_H_ +#include <stdbool.h> + #include "guestfs-internal-all.h" #define _(str) dgettext(PACKAGE, (str)) @@ -89,6 +91,7 @@ extern int guestfs_int_random_string (char *ret, size_t len); extern char *guestfs_int_drive_name (size_t index, char *ret); extern ssize_t guestfs_int_drive_index (const char *); extern int guestfs_int_is_true (const char *str); +extern bool guestfs_int_string_is_valid (const char *str, size_t min_length, size_t max_length, bool alpha, bool digit, const char *extra); //extern void guestfs_i...
2017 Apr 20
1
[PATCH] tests: Replace test-max-disks with several tests.
...exit (EXIT_FAILURE); + } + + /* If the --just-add option was given, we're done. */ + if (just_add) + return; + + /* Check each device has the expected drive name, eg. /dev/sda, + * /dev/sdb, ..., /dev/sdaa, ... + */ + for (i = 0; i < ndisks; ++i) { + char expected[64]; + + guestfs_int_drive_name (i, expected); + if (!STRSUFFIX (devices[i], expected)) { + fprintf (stderr, + "%s: incorrect device name at index %zu: " + "%s (expected suffix %s)\n", + getprogname (), i, devices[i], expected); + exit (EXIT_FAILURE); +...
2017 Apr 19
2
[PATCH] lib: direct: Remove support for virtio-blk as the default.
...ex++; - } - else /* virtio-blk */ { - if (drv->iface == NULL || STRNEQ (drv->iface, "virtio")) - index++; - } + if (drv->iface == NULL || STREQ (drv->iface, "ide")) + index++; } - dev[5] = virtio_scsi ? 's' : 'v'; guestfs_int_drive_name (index, &dev[7]); return safe_strdup (g, dev); /* Caller frees. */ @@ -1012,20 +986,7 @@ get_pid_direct (guestfs_h *g, void *datav) static int max_disks_direct (guestfs_h *g, void *datav) { - struct backend_direct_data *data = datav; - - /* Get qemu help text and version. */ - if (d...
2016 Dec 24
2
[PATCH] lib: Use a common function to validate strings.
As discussed in the thread on validating $TERM, it would be good to have a common function to do this. This is such a function. The main advantage is it includes unit tests which the previous functions did not. Rich.
2018 Oct 04
0
[PATCH v2 2/4] common/utils: Move libxml2 writer macros to a common header file.
..., if (drv->disk_label) { start_element ("serial") { - string (drv->disk_label); + string ("%s", drv->disk_label); } end_element (); } @@ -1597,7 +1534,7 @@ construct_libvirt_xml_disk_target (guestfs_h *g, xmlTextWriterPtr xo, guestfs_int_drive_name (drv_index, &drive_name[2]); start_element ("target") { - attribute ("dev", drive_name); + attribute ("dev", "%s", drive_name); attribute ("bus", "scsi"); } end_element (); @@ -1642,8 +1579,8 @@ construct_libvirt_x...
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers. These aren't valid for global names in C++. (http://stackoverflow.com/a/228797) These large but completely mechanical patches change the illegal identifiers to legal ones. Rich.
2023 Jan 30
11
[p2v PATCH 00/11] Expose virt-v2v's "-oo"; re-enable openstack
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1792141 Let the user pass "-oo" options from the kernel cmdline and from the GUI to virt-v2v. This is primarily useful with the OpenStack output mode, so reenable that mode. Cc: Alban Lecorps <alban.lecorps at ubisoft.com> Laszlo Alban Lecorps (1): Introduce "p2v.output.misc" for passing "-oo" options
2019 Jul 09
7
[PATCH 0/5] Split virt-p2v in own repository
Hi, as it was already discussed on this list, here it is my attempt in splitting virt-p2v in an own repository. Sadly there are things that must be copied from libguestfs, as it cannot be avoided. The approach taken was to run a script (will send separately) to just get the "p2v" subdirectory with its history as own repository, and then add in few followup commits all the bits needed
2018 Oct 04
2
[PATCH 0/2] Use common macros to help with libxml2 writer.
Consolidate and extend the use of funky start_element() etc macros. Rich.